Skip to content
Back to skills

Build

ASecurity

Implements an approved plan or a batch of similar items; inline, in waves or as one Workflow, by size. Use to execute a plan.

  • 16 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentsgobashgitsecurity

Works with

  • claude code

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 6, 2026

npx -y skills add Alexander-Tyagunov/magician --skill build --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Build?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Build
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/alexander-tyagunov-build/badge)](https://www.skillsdirectory.com/skills/alexander-tyagunov-build)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: build
description: Implements an approved plan or a batch of similar items; inline, in waves or as one Workflow, by size. Use to execute a plan.
allowed-tools: Workflow, Agent, Read, Grep, Glob, Bash(ugrep *), Bash(rg *), Bash(grep *), AskUserQuestion, Bash(kg check), Bash(kg refresh), Bash(kg query *), Bash(kg blast *), Bash(kg neighbors *), Bash(ctx learn line), Edit(./.workspace/local/session-state.md)
argument-hint: "[plan file or folder · \"implement these N tickets\" · \"migrate X across the repo\"]"
---

# /build — Implement a plan or a batch

> **Bundled command:** if `ctx` is not found, run it as `${CLAUDE_PLUGIN_ROOT}/tools/ctx`. If that is missing too (Claude chat ships no plugin tools), skip the `ctx` step.

> **Bundled command:** if `kg` is not found, run it as `${CLAUDE_PLUGIN_ROOT}/tools/kg` and give subagents that full path. If that is missing too (Claude chat ships no plugin tools), skip the `kg` steps and search the code directly.

Execute an approved plan, or deliver a batch of similar items (N tickets, a set of endpoints, a codebase-wide migration, a sweep). One skill, three engines. The size of the work picks the engine. Not for one task (`/tdd`).

## Read the plan

Read the plan `$ARGUMENTS` names, else the plan this session approved, else the most recent approved plan in `.workspace/shared/plans/`. Say which. The plan and spec are read from `.workspace/shared/` here; a worktree holds only committed files, so `/worktree` commits them on its branch first. When the build runs in a worktree, run every command with the worktree as the working directory (`cd <worktree> && …`) and give workers paths under it; run state and evidence stay with the main checkout and the tools find them from the worktree. Documents that git ignores are not in the worktree: read them from the main checkout by the absolute path `/worktree` gave. Only when several approved plans that have not run match equally, ask which one with **AskUserQuestion** (one option per plan, most recent first) and end your turn at the call.

- **An approved plan is not approved again.** `plan.json` with `status: approved` (or a legacy `plan.md` the user asked you to run) starts at once: no summary to confirm, no "shall I start?". A plan with `status: in_review` or `rejected` does not run: say so in one line and point to `/breakdown review <dir>`, where its approval lives.
- **Plan folder** (`plan.json` next to `plan.md`): `plan.json` is the source. Task N is `steps[N-1]`. A step with `review.status` of `deferred` does not run. Check the last line of `plan.md`, `<!-- magician.plan/1 v<n> … -->` or `magician.plan/2`: when `v<n>` differs from `plan.json.version` the plan is stale. Say so and ask for `plan-render all <dir>/plan.json` or `/breakdown review <dir>`; do not run it.
- **Single `plan.md`** (legacy): parse `### Task N`, `Parallel:`, Files, the five TDD lines.
- **Requirements.** A task's `Covers:` line (`covers` in `plan.json`) names the spec requirement ids it must prove. Pass them to whoever implements the task. The task's report cites each id with the test that proves it.
- **No plan, a batch of items:** the items are the units. [references/engine-workflow.md](references/engine-workflow.md) Phase 0 enumerates and grounds them, and holds the one go for work nobody approved.

## Pick the right engine first

Measure, do not ask. Count the tasks or units, and the files the plan's Files lists name.

- **Inline with [`/tdd`](../tdd/SKILL.md):** the whole change is 3 files or fewer and about 300 changed lines or fewer. Run the tasks in order in the main loop, one `/tdd` cycle each, with no `Agent` call ([lore/fold-first.md](../../lore/fold-first.md)).
- **Waves of agents:** above that size, up to 8 tasks. You dispatch each wave from the plan's parallelism map and check for conflicts between waves. Follow [references/engine-waves.md](references/engine-waves.md).
- **One native Workflow:** more than 8 tasks, or a batch or sweep of similar items at any count above the inline size. An approved plan with many similar units runs here. Follow [references/engine-workflow.md](references/engine-workflow.md); a plan folder's `plan.workflow.js` is the script, and with no plan folder the script to copy and adapt is [references/template.md](references/template.md).

State the choice in one clause: "Waves: 6 tasks, 14 files." A request that names an engine ("wave by wave", "as a workflow") wins. Fall back from the Workflow to waves when workflows are disabled (`disableWorkflows`, Pro without the `/config` toggle), when a plan folder has no `plan.workflow.js`, or when a Workflow run reports `nothing to resume` after an interruption. Workers that must talk to each other and share a task list need an agent team, not one-way subagents: say so.

**Whichever engine you pick, inline included, write `.workspace/local/session-state.md` before the first task runs** (goal · plan path · wave graph · decisions · blockers). The plan file's `- [ ]` boxes plus that file are the checklist that survives a compaction. Rewrite it after each wave or phase. Tick a box only after the task's quality loop passes.

**Cap the fan-out.** The plan's parallelism map is the ceiling, not a floor. Above the inline threshold, a wave with two or more independent `Parallel: YES` tasks always fans out: one agent per task, dispatched together in one message, even when each task looks small. A one-task wave, or a sequential task you finish in a handful of tool calls, runs inline; that exception never applies to a parallel wave. One agent per task or unit is the default. Never spawn an agent purely to re-check work an agent just did: the per-task quality loop below is the check. See [lore/fold-first.md](../../lore/fold-first.md) and [lore/model-behavior.md](../../lore/model-behavior.md).

**Effort and model.** `medium` for implementation turns, `high` for check, review and security turns (`xhigh` for very large plans or the hardest units; `max` only as an opt-in). On Bedrock, Vertex and gateways hold one level: an effort change drops the cache there. Suggest a model upgrade; never switch silently ([lore/models.md](../../lore/models.md)).

## Rules every engine obeys

1. **TDD per task.** A failing test first, then green, then refactor (`/tdd`).
2. **kg grounding.** Locate code with `kg query`/`kg blast`. Workers get `file:line` pointers and artifact paths, never pasted files.
3. **No context loss.** A spawned agent sees none of this conversation. Every prompt is self-contained (Goal, Scope, Inputs, Constraints, Return) and tells the agent to read `.workspace/local/session-state.md` first. The return is bounded: STATUS, a summary of 1200 characters or fewer, `files_changed`, the commit, `obstacles` ([lore/subagent-context.md](../../lore/subagent-context.md)).
4. **Check before done.** After the last wave or phase, run /check once; it reuses each kind `evidence check` shows fresh. If it fails, fix and re-check (bounded loop). Never report done on a red check. A worker's evidence row in its own worktree does not carry to the merged tree.
5. **Write gates.** Implement on the branch or worktree and commit there. Never push, open or merge a PR, or do anything destructive without the user's explicit confirmation.
6. **Report progress as [lore/progression.md](../../lore/progression.md) says.** Before a wave or phase print one line per agent (`→ implementer: task 3, 4 files`). Fold the returns into one table: agent, status, findings, time. Never ask whether to continue. Under `/deliver` the parent records the stage; return the fact for its status line, such as `6 tasks in 3 waves, check green`.

**Autonomy.** Gates: which plan (only when several match), one batched call for worker questions per wave or phase, a merge conflict, the go for an unapproved batch. Everything else runs without asking. See [lore/autonomy.md](../../lore/autonomy.md).

## Handle results

- **DONE** is a claim, not proof. Run the per-task quality loop and confirm the change from the VCS diff before you record it.
- **NEEDS_CONTEXT** is a gap in your spawn prompt. Add the missing input and re-dispatch. Do not guess for the agent.
- **BLOCKED:** assess the blocker, re-dispatch with more context, or escalate.
- **A question for the human:** a worker puts it in its Obstacles `NEXT` field and does not wait. Collect the questions of the whole wave or phase, merge duplicates, and ask them in ONE `AskUserQuestion` after it returns. Never ask once per worker ([lore/obstacles.md](../../lore/obstacles.md)).

## Per-task quality loop — review before "done"

A subagent reporting `STATUS: DONE` is a claim, not evidence. Before you mark any task complete, confirm it from the VCS diff and put it through a two-stage review ([lore/verification.md](../../lore/verification.md)).

1. **Confirm from the diff, not the report.** Run `git show` or `git diff` for the task's commits and read the change. If the diff is empty or does not match the deliverable, the task is not done: re-dispatch with the gap named. These are read-only git reads, which Claude Code does not prompt for.
2. **Stage 1 — spec compliance.** Against the task's full text, its `Covers:` ids and `.workspace/shared/specs/<feature>.md`: does the change do exactly what the task specified, no more and no less? Flag missing requirements, scope creep and silent deviations.
3. **Stage 2 — code quality.** Judge correctness, simplicity and tests: does it hold on edge cases, is it the simplest thing that works, and are the tests real (proven RED→GREEN) and green? Judge it inline when the task's diff is within the fold-first threshold. Above it, dispatch a fresh `magician:reviewer` so no author bias carries over.
4. **Fix, then re-review.** For a **Critical** or **Important** finding, dispatch a fresh fix agent with a self-contained prompt, then run this loop again on the new diff. Record minor findings and batch them. A task is DONE only when its diff is clean on both stages.

**Keep moving.** Go from task to task without a pause: the approved plan bought that autonomy. Stop only on a **BLOCKER** you cannot resolve, a **merge conflict**, or all tasks done. A Workflow whose script has its own review and remediate stages runs this loop inside the script.

## Obstacles

**As a consumer:** every dispatched worker returns an Obstacles block on a non-clean run. Roll them up into one report kept apart from the deliverables, so a blocked unit never reads as done. Detect a pattern by a normalized BLOCKER + SCOPE signature, and memorize a confirmed pattern with `ctx memory add --kind pitfall --title "<signature>"` (workaround and next action on stdin) in your own words: never verbatim worker text, secrets or PII. Protocol: [lore/obstacles.md](../../lore/obstacles.md).

**As a producer:** when this skill runs as a dispatched unit and something blocks or degrades the work, do not wait for a human who is not there and do not silently ship a degraded result. Return the Obstacles block from [lore/obstacles.md](../../lore/obstacles.md) (fields: STATUS, OBSTACLE, BLOCKER, SEVERITY, WORKAROUND, RECURRENCE, SCOPE, NEXT) with what you completed. Interactively, say the same in prose.

## Completion Signal

Inline or waves: "Build complete. N tasks executed across M waves, check green; cost ≈ $X (session delta). Not reviewed, not pushed."

A Workflow with its own review stage: "Build complete: <N>/<N> units delivered (1 commit each), checked, reviewed (<C> criticals resolved over <R> remediation round(s)); cost ≈ $X (session delta). Branch <name>, not pushed."

Cost clause: only with a reading at start and end, from `~/.claude/magician/status/${CLAUDE_SESSION_ID}.cost` (status line) or, when the HUD plugin is installed, its `$.session.usage()`. Report the difference. Omit the clause otherwise. Never estimate it.

When no parent skill invoked this one, add one "Next:" line: "/critique --fix reviews the change", or after a Workflow that reviewed, "/land ships the branch (it asks before the push)".

In a top-level interactive run, run `ctx learn line` last; when it prints a line, append it unchanged as the final line. Print nothing when it prints nothing, when `ctx` is missing, and in a dispatched, headless or parent-invoked run.

Files in this skill

  • SKILL.md12 KB
  • references/engine-waves.md4.5 KB
  • references/engine-workflow.md9.7 KB
  • references/template.md15.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.