/craft:buildfrom craft
Phase 4 — implement the active slice. Loads project-local specialist skills lazily, works sub-tasks in order, runs tests silently, bundles at sub-task boundaries.
Ships in craft. Installing the plugin adds it to Claude Code.
Phase 4 of the workflow: turn the slice plan into working code. Stay inside the plan's scope; lazy-load project specialists when needed; surface progress in bundled status messages.
Follow skills/workflow/SKILL.md Phase 4 mechanics and the autonomy matrix. Code edits inside plan scope run at Level 2; outside scope at Level 1.
Ensure-primed gate — before the checks below, if the session marker
.claude/plans/.primedis absent, emit "Session not primed — running /craft:prime first", run/craft:prime(it loads project context, verifies the required tools, and writes the marker), then resume this command. Silent no-op when the marker is already present. Defined inskills/workflow/SKILL.md→ Session Priming Gate.
Glob .claude/plans/*.md./craft:continue to select one first, then this command.No active slices. Run /craft:plan first. and stop.Read the slice plan file. Hold in context:
Slice-ID, Started, Phase, Status, plugin-version/craft:debug was used here)If Status is planning, write Status: implementing back to the slice plan.
If Status is already implementing, resume without status change. If it is paused, do not resume on your own: ask the user to confirm the resume (4a runs only on a yes; a no stops here; ask it with AskUserQuestion, two options — where the tool is not available, as text), then run /craft:continue's 4a. Resume a paused slice steps 1–5 (where, what to restore, write, check, the no-answer warning — carried in this command's output). Instead of 4a's step 6, go on here only if the restored status is implementing; otherwise stop and recommend the command /craft:continue's step 3 names for that status.
First, load the project's declared stack-pack:
Read the ## Personality section of .claude/project/rules.md.Stack-Pack: other than none, resolve the pack —
skills/<name>/SKILL.md (plugin-shipped) or
~/.claude/craft-personalities/<name>/SKILL.md (user-added). If found, Read it
(and its references/ files as the work needs) and emit ✓ Stack-pack loaded: <name>.⚠ Stack-pack <name> declared but not found — continuing with Senior-Developer baseline only
and continue.none, or no ## Personality section), proceed on the
Senior-Developer baseline alone — no stack-pack line.Then identify any project-local skills that apply to the slice's work:
.claude/skills/ — Read them only when about to touch files in that stack.rules.md.- [ ]) in the slice plan.All sub-tasks complete. Run /craft:test to start Phase 5. and stop.Briefly state the approach for the current sub-task. No long planning — this is implementation, not Phase 3.
AskUserQuestion (approve the edit / do not edit — re-plan instead); where the tool is not available, ask as text.Comments key of the ## Operational Language block in .claude/project/craft-profile.md (default English when the profile, the block, or the key is absent). Applies only to comment prose, never to identifiers, keywords, or string literals required by the code.Track fix attempts. If you make a 2nd fix attempt on the same symptom within this slice, pause and offer /craft:debug:
"I notice I'm cycling on this. Should we enter /craft:debug mode and agree on a verification protocol before more attempts?"
When verifiably complete (sub-task assertion met, no regression in tests): flip - [ ] to - [x] in the slice plan via Edit.
At the end of each sub-task, emit a compact bundle:
✓ Sub-Task <N>/<Total>: <name>
Changed: <file list, comma-separated>
Test: <status — "green" / "<N> passed" / "skipped">
Level-3 silent ops: <one-line summary, e.g. "read 4 files, ran lint">
Next: Sub-Task <N+1>/<Total> — <name>
[continuing in 3s — type 'pause' to pause the slice, anything else to stop]
If silence, continue to the next sub-task. A message that is only a pause word is the slice's pause request, in either flow
mode (skills/workflow/SKILL.md → The pause request): handoff and pause. Any other message stops the countdown and is
answered before the next sub-task.
Pause request (interactive runs only, both flow modes). After the bundle, while a sub-task is still unchecked, ask
flow-state.sh with --from implementing as skills/workflow/SKILL.md → Auto flow → The pause request (rule 2)
describes; on STOP=pause-requested run its pause action here instead of starting the next sub-task. Any other output:
go on. Not in Subagent Mode.
If the cumulative output since the last bundle exceeds 30,000 tokens (Dumb-Zone protection), force a bundle even mid-sub-task. Format the bundle the same way but mark it (token brake).
When all sub-tasks are checked, emit a final bundle:
✓ All sub-tasks complete (Phase 4 ✓)
Total commits-not-yet-made: <N> proposed
Tests: <status>
Recommended next: /craft:test to start Phase 5 (you exercise the artifact).
Update Status: testing in the slice plan.
skills/workflow/SKILL.md)pause after current sub-task.| Situation | Behavior |
|---|---|
| Slice plan missing required sections (Sub-Tasks, Test Strategy) | Refuse to start; recommend /craft:plan to repair. |
| Test fails red after a sub-task | Do not check off the sub-task. Try one fix attempt. If still red, offer /craft:debug. |
| User pauses during bundle countdown | Stop cleanly; do not start the next sub-task. Status remains implementing. |
| Slice file becomes unreadable mid-execute | Stop, surface error, do not silently overwrite. |
| Encounter a needed change outside plan scope | Drop to Level 1: ask explicitly. Either get approval, or stop and recommend re-planning. |
At the end of an interactive run, after the closing output above, run the Auto flow step of skills/workflow/SKILL.md
(Auto flow — where it applies, the --from value of this command, how to act on the verdict): ask
${CLAUDE_PLUGIN_ROOT}/scripts/flow-state.sh (in CRAFT's own source repo: scripts/flow-state.sh) and act on its
NEXT= / STOP= only.
/craft:execute)When the slice-builder subagent invokes /craft:build during an autonomous run, the main procedure runs unchanged — the build loop is mechanical and safe to automate. Five behavioral overrides apply.
Pausing for a human decision — the two overrides that need a human answer (Self-verification trigger, Outside-scope edits) end the same way: set the slice plan Status: paused with the pause record (skills/workflow/SKILL.md → Pause record) plus a Pause Note naming what the human must decide, write .craft/handoff.md in the worktree with the override's status (a handoff-file status, not a slice-plan one) and the record's Paused-since as its Episode:, and stop. The plan status matters: a marker counts as live only while the plan is at the status it pairs with, in the same episode (skills/workflow/SKILL.md → Handoff marker lifecycle), and both statuses pair with paused.
/craft:debug mode?" on a 2nd same-symptom fix attempt, pause for a human decision with Status: awaiting-protocol; the Pause Note describes the recurring symptom. The subagent does not negotiate a verification protocol with no human present. In an autopilot run (the spawn says so) it first runs skills/debug/SKILL.md → Autonomous Mode — a protocol frozen by two agents, every attempt judged by verify-run.sh — and this pause is only that mode's end stop, its escalation package in the Pause Note; on a pass the build continues with the sub-task.Status: awaiting-scope-decision; the Pause Note names the file or change outside the plan. The plan boundary is a contract; the subagent never expands scope unilaterally.decision / access / external wait stands in the way per the spawn-boundary heuristic, this is a blocker, not a scope-spill: follow the slice-builder's Blocker detection & escalation — classify, write the first-class blocked state, write .craft/handoff.md with Status: awaiting-block-decision, and stop. (The distinction from Outside-scope edits: that is permission to touch an unnamed file; this is a missing unit of work or a direction call the subagent must never make.)agents/slice-builder.md → The budget guard — defined
there once, its reason=budget stop included) before the next sub-task.On clean Phase-4 completion (all sub-tasks checked, tests green), Subagent Mode advances the slice plan Status: testing exactly as the main flow does — the slice-builder picks up at Phase 5 next.
/craft:plan first./craft:commit does that — and in a slice worktree /craft:execute step 6, which commits the worktree's work on the slice branch once the slice clears review./craft:refactor is the refactor seat.intent.md or rules.md. Decisions surfaced during implementation go into the slice plan's ## Decisions Made During This Slice section for Phase 9 promotion.What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub chriras/craft --plugin craft24 commands in this plugin
/abort/craft:abort — Abandon a SliceAbandon a slice. Asks confirmation, then closes the plan file by default — deleted, or moved into .claude/plans/.closed/ when the user's settings deny or ask on removing it. Aborted slices have no archive value — they leave only their (possibly partial) commits behind, which the user manages separately./block/craft:block — Block the Active Slice on a PrerequisiteRecord a first-class `blocked` state on the active slice when work cannot proceed until a prerequisite — itself a unit of work or a decision — is resolved. Classifies the blocker, writes on-demand frontmatter + a/checkout/craft:checkout — Inspect a WorktreeSwitch into a slice- or epic-worktree for human inspection during Recap / Review. Read-only — resolves the worktree path, prints the cd instruction and the stack-pack provisioning hint. Does not install anything./commit/craft:commit — Phase 9 Commit & CleanupPhase 9 — atomic commits, decisions promotion dialog, slice archive write, plan file closing (deleted, or moved into .claude/plans/.closed/ under a rule on removing files). On a pull-request + Protected-main profile it opens a PR and merges via gh only after a GitHub approval ("Freigabe ≠ Merge"). The slice closes here — and a finished epic (Epic-close: after an autopilot run's merge, a sequential run, or slice by slice by hand)./continue/craft:continue — Resume an Active SliceResume work on an active slice. Routes automatically to the right phase command based on the slice's recorded Status. Use after /craft:prime when picking up where you left off./epic/craft:epic — Plan a Multi-Slice EpicPlan a multi-slice epic — captures Vision and initial Slice Decomposition, writes an epic plan file under .claude/plans/.Other plugins' commands for the same job