| name | implement |
| description | Implement a spec generated by /spec. Reads .claude/specs/{slug}/design.md, executes each task in Section 8 in order, marks tasks complete as it goes, verifies acceptance after each task, and stops on failure. Invoke when the user says "implement issue |
| disable-model-invocation | true |
| allowed-tools | Read Edit Write Bash(git *) Bash(nx *) Bash(dotnet *) Bash(mkdir *) Bash(find *) Bash(ls *) mcp__github__add_issue_comment mcp__github__get_issue |
| arguments | ["issue"] |
git branch --show-current
ls "${CLAUDE_PROJECT_DIR}/.claude/specs/"
Inputs
- Issue number:
$issue
- Project root: use
${CLAUDE_PROJECT_DIR}, already available in session context
- Today's date: use the current date already available in session context
- Current branch: taken from the
git branch --show-current output above
- Available specs: taken from the
ls output above (if empty or the directory doesn't exist, treat as no specs yet — run /spec first)
Step 1 — Locate the spec
Find the spec directory by scanning AVAILABLE_SPECS for an entry that starts with $issue-.
- Exactly one match: use it. Full spec path:
{PROJECT_DIR}/.claude/specs/{slug}/design.md
- Zero matches: stop. Print:
No spec found for issue #$issue. Run /spec $issue first.
- Multiple matches: stop. Print all matches and ask the user to re-run with the full slug.
Step 2 — Read the spec
Read the full design.md. Extract and hold in memory:
- Title and issue number from the H1 heading:
# Spec: {title} (#{N})
- Bounded Context and Layers from the metadata blockquote at the top
- All tasks from Section 8 "Implementation Tasks":
- Lines matching
- [ ] **TASK-NN** → pending (will execute)
- Lines matching
- [x] **TASK-NN** → already done (skip)
- For each pending task: task ID, title, full
**What:** block, full **Acceptance:** block
- Sections 5–7 (API Design, Data Model Changes, Frontend Changes) as implementation reference
Step 3 — Ensure correct git branch
Check CURRENT_BRANCH:
- If
master or main: run git checkout -b feature/{slug}, then print Created branch feature/{slug}.
- If already a branch matching the spec slug: proceed silently.
- If a different unrelated branch: print
Warning: working on branch {branch}, not feature/{slug}. Continuing. Do not abort.
Step 4 — Execute tasks in order
Work through pending tasks in TASK-NN ascending order. For each:
Print before starting:
▶ TASK-NN — {title}
Execute — read the "What" field and implement it. Follow these rules without exception:
.Api.Rest projects contain only controllers, DTO mapping, and routing. No business logic.
- Commands and command handlers go in
{Ctx}.Application.Write.
- Queries and query handlers go in
{Ctx}.Application.Read.
- Domain logic (entities, value objects, domain events, invariants) goes in
{Ctx}.Domain.
- EF Core configuration and migrations go in
{Ctx}.Persistence.Context.
- New Angular components are standalone. SCSS is co-located. Use path aliases (
@stories/*, @shared/*, @media/*, @users/*, @user-to-story/*, @admin/*) for all cross-folder imports — never use relative paths that cross domain boundaries.
- EF Core migrations: run
dotnet ef migrations add {Name} --project server/src/Hiscary.{Ctx}.Persistence.Context. Never hand-edit the generated file.
- Write no comments that explain what the code does. Only comment on non-obvious constraints or workarounds.
Verify — read the "Acceptance" field and execute it exactly:
Mark complete — only if acceptance passed:
Edit design.md: change - [ ] **TASK-NN** to - [x] **TASK-NN** (match the first occurrence of that exact task ID).
Print:
✓ TASK-NN — {title}
Step 5 — Final acceptance check
After all tasks are marked [x], print:
All tasks complete. Running final acceptance check...
Run the appropriate checks based on the Layers extracted in Step 2:
Angular frontend or NgRx state in layers:
cd {PROJECT_DIR}/client && nx build hiscaries-client && nx test hiscaries-client
- Any backend layer (
.NET API controller, Application layer, Domain model, EF Core/Postgres, etc.):
dotnet build {PROJECT_DIR}/server/src/Hiscary.AppHost
- If
{Ctx}.IntegrationTests project exists for the bounded context:
dotnet test {PROJECT_DIR}/server/src/Hiscary.{Ctx}.IntegrationTests
If all pass: proceed to Step 6.
If any fail: print the failure output and stop. Do not post a GitHub comment.
Step 6 — Post GitHub comment and report
Parse owner and repo from:
git remote get-url origin
Strip the github.com: or github.com/ prefix and the .git suffix.
Call mcp__github__add_issue_comment:
owner: parsed above
repo: parsed above
issue_number: $issue
body:
## Implementation complete 🎉
All tasks from the spec have been implemented and verified.
**Branch:** `feature/{slug}`
**Tasks completed:** {N}
**Layers touched:** {layers from spec metadata}
**Completed tasks:**
{TASK-01 — title}
{TASK-02 — title}
...
Next step: run `/ship` to commit, push, and open a PR.
Then print locally:
Done. {N} tasks implemented on branch feature/{slug}.
Run /ship to create the PR.