$npx -y skills add softspark/ai-toolkit --skill buildBuilds project with auto-detected toolchain (npm, poetry, cargo, go, flutter, Docker). Triggers: build, compile, bundle, produce artifacts.
| 1 | # Build Project |
| 2 | |
| 3 | $ARGUMENTS |
| 4 | |
| 5 | Build the current project. |
| 6 | |
| 7 | ## Project context |
| 8 | |
| 9 | - Project config: !`cat package.json 2>/dev/null || cat pyproject.toml 2>/dev/null || echo "unknown"` |
| 10 | |
| 11 | ## Auto-Detection |
| 12 | |
| 13 | Run the bundled script to detect build system: |
| 14 | |
| 15 | ```bash |
| 16 | python3 ${CLAUDE_SKILL_DIR}/scripts/detect-build.py [dev|prod|docker] |
| 17 | ``` |
| 18 | |
| 19 | ## Usage |
| 20 | |
| 21 | ``` |
| 22 | /build [target] |
| 23 | ``` |
| 24 | |
| 25 | ## What This Command Does |
| 26 | |
| 27 | 1. **Detects** project type |
| 28 | 2. **Runs** appropriate build command |
| 29 | 3. **Reports** build status |
| 30 | |
| 31 | ## Build Commands by Project Type |
| 32 | |
| 33 | | Project Type | Build Command | |
| 34 | |--------------|---------------| |
| 35 | | Node.js | `npm run build` or `pnpm build` | |
| 36 | | Python | `poetry build` or `pip install -e .` | |
| 37 | | Flutter | `flutter build` | |
| 38 | | Go | `go build ./...` | |
| 39 | | Rust | `cargo build --release` | |
| 40 | | Docker | `docker compose build` | |
| 41 | |
| 42 | ## Output Format |
| 43 | |
| 44 | ```markdown |
| 45 | ## Build Report |
| 46 | |
| 47 | ### Status: Success / Failed |
| 48 | |
| 49 | ### Build Details |
| 50 | - **Project**: [name] |
| 51 | - **Type**: [type] |
| 52 | - **Command**: [command used] |
| 53 | - **Duration**: [time] |
| 54 | |
| 55 | ### Artifacts |
| 56 | - [artifact 1] |
| 57 | - [artifact 2] |
| 58 | |
| 59 | ### Warnings |
| 60 | - [warning if any] |
| 61 | |
| 62 | ### Errors |
| 63 | - [error if any] |
| 64 | ``` |
| 65 | |
| 66 | ## Targets |
| 67 | |
| 68 | | Target | Description | |
| 69 | |--------|-------------| |
| 70 | | `dev` | Development build | |
| 71 | | `prod` | Production build | |
| 72 | | `docker` | Docker image build | |
| 73 | | `all` | Build all targets | |
| 74 | |
| 75 | ## MANDATORY: Documentation Update |
| 76 | |
| 77 | After build configuration changes, update documentation: |
| 78 | |
| 79 | ### When to Update |
| 80 | - Build config changes -> Update build docs |
| 81 | - New dependencies -> Update requirements docs |
| 82 | - Docker changes -> Update Docker docs |
| 83 | - CI changes -> Update CI/CD docs |
| 84 | |
| 85 | ### Post-Build Changes Checklist |
| 86 | - [ ] Build successful |
| 87 | - [ ] **README build instructions updated** (if changed) |
| 88 | - [ ] **CI/CD config documented** |
| 89 | |
| 90 | ## Rules |
| 91 | |
| 92 | - **MUST** detect the build system automatically (`detect-build.py`) before invoking any command |
| 93 | - **NEVER** run a `clean` build when incremental works — clean only on explicit user request |
| 94 | - **CRITICAL**: surface the first build error literally, including the stack trace and file:line. Paraphrasing loses the diagnostic. |
| 95 | - **MANDATORY**: on success, report the artifact paths (compiled binaries, bundled output, built images) — callers downstream need them |
| 96 | |
| 97 | ## Gotchas |
| 98 | |
| 99 | - `npm run build` does not refresh `node_modules`. If `package-lock.json` is out of sync, the build runs against stale dependencies and "succeeds" with wrong versions. In CI always precede with `npm ci`. |
| 100 | - `cargo build --release` takes 5-10× longer than debug. Never use `--release` in a dev loop; reserve it for CI artifacts and benchmarks. |
| 101 | - `docker compose build` keys layer cache per service. A change to a shared context file (e.g., root `COPY . .`) invalidates every service's cache. Structure Dockerfiles to copy dependency manifests first, source last. |
| 102 | - `flutter build apk` without `--split-per-abi` produces a fat APK ~3× larger than needed. Production builds should always split unless explicitly bundling. |
| 103 | - `go build ./...` succeeds with a warning when a package has no Go files (e.g., pure-doc subdir). Downstream tools that expect every listed package to compile a binary fail silently — check `go build -v` for the list of built packages. |
| 104 | |
| 105 | ## When NOT to Use |
| 106 | |
| 107 | - For running tests — use `/test` |
| 108 | - For deployment or artifact push — use `/deploy` |
| 109 | - For scaffolding a new build system — use `/app-builder` or `/ci` |
| 110 | - For CI pipeline generation — use `/ci` |
| 111 | - When the project has no build step (interpreted code, pure docs) — this skill has nothing to do |