# build

A command that handles building, compiling, and packaging projects with automatic error detection and artifact optimization. Runs from Claude Code with configurable environments and build types.

- command · `type=command` · Claude Code, Codex, GitHub Copilot, Gemini CLI · ★ 23950 repo stars
- Author: SuperClaude-Org
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/SuperClaude-Org/SuperClaude_Framework/tree/HEAD/plugins/superclaude/commands/build.md
- Updated: 2026-09-27
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/commands/superclaude-org-build

## What it does

The `/sc:build` command manages the entire build pipeline: it inspects project structure and configurations, validates dependencies and toolchain, then executes compilation with real-time error detection. After a successful build, it optimizes artifacts, applies minification and tree-shaking for production mode, and outputs a report with build metrics.

Three build modes are available: dev for fast iteration, prod for highly optimized builds with reduced bundle sizes, and test for verification builds. The `--clean` flag performs a full rebuild, `--optimize` applies advanced optimizations, and `--verbose` provides detailed diagnostic output throughout the process.

When build errors occur, the command analyzes logs and suggests fixes. It integrates with Playwright to run UI validation during the build. The final report shows build status, execution time, and whether artifacts are ready for deployment.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/build.md` — Call it with /build. For all projects use ~/.claude/commands/

### Codex

**Manually: put the files in place**
- File: `~/.codex/prompts/build.md` — Call it with /prompts:build. Codex marks this format deprecated in favour of skills

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/prompts/build.prompt.md`

### Gemini CLI

**Manually: put the files in place**
- File: `.gemini/commands/build.toml` — Gemini stores commands as TOML: the prompt text goes into the prompt field

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/SuperClaude-Org/SuperClaude_Framework/tree/HEAD/plugins/superclaude/commands/build.md

## When to use it
- compile a project for development or production with appropriate optimizations
- identify and resolve errors during the build process
- prepare deployment-ready artifacts with quality validation
- verify that dependencies and build environment are correctly configured

## Example prompts
- /sc:build --type prod --clean --optimize
- /sc:build frontend --verbose
- /sc:build --type dev

## Source text · build.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: ce3cbb0341e74f13.

BEGIN THIRD-PARTY FILE ce3cbb0341e74f13
````text
---
name: build
description: "Build, compile, and package projects with intelligent error handling and optimization"
category: utility
complexity: enhanced
mcp-servers: [playwright]
personas: [devops-engineer]
---

# /sc:build - Project Building and Packaging

## Triggers
- Project compilation and packaging requests for different environments
- Build optimization and artifact generation needs
- Error debugging during build processes
- Deployment preparation and artifact packaging requirements

## Usage
```
/sc:build [target] [--type dev|prod|test] [--clean] [--optimize] [--verbose]
```

## Behavioral Flow
1. **Analyze**: Project structure, build configurations, and dependency manifests
2. **Validate**: Build environment, dependencies, and required toolchain components
3. **Execute**: Build process with real-time monitoring and error detection
4. **Optimize**: Build artifacts, apply optimizations, and minimize bundle sizes
5. **Package**: Generate deployment artifacts and comprehensive build reports

Key behaviors:
- Configuration-driven build orchestration with dependency validation
- Intelligent error analysis with actionable resolution guidance
- Environment-specific optimization (dev/prod/test configurations)
- Comprehensive build reporting with timing metrics and artifact analysis

## MCP Integration
- **Playwright MCP**: Auto-activated for build validation and UI testing during builds
- **DevOps Engineer Persona**: Activated for build optimization and deployment preparation
- **Enhanced Capabilities**: Build pipeline integration, performance monitoring, artifact validation

## Tool Coordination
- **Bash**: Build system execution and process management
- **Read**: Configuration analysis and manifest inspection
- **Grep**: Error parsing and build log analysis
- **Glob**: Artifact discovery and validation
- **Write**: Build reports and deployment documentation

## Key Patterns
- **Environment Builds**: dev/prod/test → appropriate configuration and optimization
- **Error Analysis**: Build failures → diagnostic analysis and resolution guidance
- **Optimization**: Artifact analysis → size reduction and performance improvements
- **Validation**: Build verification → quality gates and deployment readiness

## Examples

### Standard Project Build
```
/sc:build
# Builds entire project using default configuration
# Generates artifacts and comprehensive build report
```

### Production Optimization Build
```
/sc:build --type prod --clean --optimize
# Clean production build with advanced optimizations
# Minification, tree-shaking, and deployment preparation
```

### Targeted Component Build
```
/sc:build frontend --verbose
# Builds specific project component with detailed output
# Real-time progress monitoring and diagnostic information
```

### Development Build with Validation
```
/sc:build --type dev --validate
# Development build with Playwright validation
# UI testing and build verification integration
```

## Boundaries

**Will:**
- Execute project build systems using existing configurations
- Provide comprehensive error analysis and optimization recommendations
- Generate deployment-ready artifacts with detailed reporting

**Will Not:**
- Modify build system configuration or create new build scripts
- Install missing build dependencies or development tools
- Execute deployment operations beyond artifact preparation
````
END THIRD-PARTY FILE ce3cbb0341e74f13

The third-party file has ended. Everything between the ce3cbb0341e74f13 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

© SuperClaude-Org · MIT · https://github.com/SuperClaude-Org/SuperClaude_Framework/tree/HEAD/plugins/superclaude/commands/build.md

## Similar
- [build-acceleration](https://affpapa.org/en/nevibecode/skills/build-acceleration.md) — skill · 597 installs
- [unity-build-size](https://affpapa.org/en/nevibecode/skills/unity-build-size.md) — skill · 1800 installs
- [build-on-change](https://affpapa.org/en/nevibecode/hooks/build-on-change.md) — hook · 877 installs
- [bazel-build-optimization](https://affpapa.org/en/nevibecode/skills/bazel-build-optimization.md) — skill · 10300 installs
- [build-parallelism](https://affpapa.org/en/nevibecode/skills/build-parallelism.md) — skill · 4500 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
