build

A build assistant that prepares software for one or more platforms, checks the resulting files, and starts a local preview. A local preview lets you inspect the built app on your own computer.

In plain words
What is it for?
Use it to build web or mobile targets, build for a named environment such as staging, perform a clean rebuild, validate artifacts, and optionally skip the local preview.
Why use it?
It separates building and validation from deployment, helping catch missing dependencies, types, or environment settings before anything is uploaded.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/caspian-sun/claude-code-workflow/build
Clone the repo
git clone --depth 1 https://github.com/Caspian-Sun/claude-code-workflow

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,812 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01812
Opus 5 $0.00000 $0.00906
Sonnet 5 $0.00000 $0.00362
Haiku 4.5 $0.00000 $0.00181

Measured 2d ago against content hash 33d900eb4662, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/build.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are now acting as a Build Engineer. Responsible for multi-platform builds, artifact validation, and local preview.

Core Scope

/build does exactly three things: Build → Validate → Local-ready. No uploading, deploying, or notifications. Once artifacts are confirmed good, use /deploy to push them to a server or platform.

Input

Input Example Behavior
No arguments /build Interactive platform selection
Platform /build web Build Web
Multiple platforms /build web,android Multi-platform build
All platforms /build all Build all platforms
Specific env /build web --env staging Build with staging config (different env vars / API URLs)
Skip preview /build web --no-preview Build only, do not start local preview
Clean rebuild /build web --clean Clean previous artifacts, then rebuild

Execution Flow

Step 1: Pre-checks

  1. Dependency checknode_modules exists and is non-empty; otherwise prompt pnpm install
  2. Type check (Web) — workspace/src/types/api.ts exists; otherwise prompt pnpm gen:api
  3. Environment config — read --env argument to determine build env vars (default: dev)

Step 2: Build

Execute per platform:

Platform Build Command Artifact Path Artifact Type
Web pnpm build workspace/dist/ Static files (HTML/JS/CSS)
Android cd android && ./gradlew assembleDebug (dev) / assembleRelease (staging/prod) android/app/build/outputs/apk/ .apk
iOS cd ios && xcodebuild build (simulator) / archive (device) ios/build/ .app (simulator) / .ipa (device)
HarmonyOS cd harmony && hvigorw assembleHap harmony/build/ .hap

Stream build logs in real time; on failure, output complete error info and stop.

Step 3: Artifact Validation

Automatically validate after build completes:

Web:

  • dist/index.html exists
  • At least 1 .js and 1 .css file present
  • Total artifact size is reasonable (not 0, not above warning threshold)
  • Output file count and total size

Read the full file on GitHub · 205 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 205 lines · 0 tokens per session scan A 33d900eb4662

Subscribe to this mod's changes

build is a command published in the GitHub repository Caspian-Sun/claude-code-workflow (10 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,812 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.