| name | implement |
| description | Structured implementation execution — Plan → Implement → Verify cycle. Invoked by the /implement command after pre-flight checks. |
| user-invocable | false |
| allowed-tools | ["Read","Edit","Write","Bash","Glob","Grep","Agent"] |
implement — Structured Implementation Workflow (adex)
Invoked by the /implement command. Pre-flight git checks have already been performed by the command layer.
You are executing a structured Plan → Implement → Verify cycle.
Phase 1: Plan
- Read relevant source files to understand current state
- Break the task into concrete subtasks (use TodoWrite for each)
- Identify which files will be created/modified
- Identify which e2e specs need to be added/extended (if any)
- Identify whether the change touches
prisma/schema.prisma — if so, plan the migration step
- Present the plan briefly and proceed (the user already committed by invoking the command)
Phase 2: Implement
For each subtask:
- Mark subtask as
in_progress
- Write the implementation code
- If a route handler / lib module is added, add or extend an e2e spec covering the happy path (same subtask, not separate)
- If
schema.prisma was edited:
- Run
npx prisma generate
- Run
npx prisma migrate dev --name <description> and stage the new migration directory
- Mark subtask as
completed
Phase 3: Verify
After all subtasks complete:
- Run lint on the touched files:
npx eslint <files>
- Run type-check:
npx tsc --noEmit
- If e2e was added/changed:
npm run test:e2e -- <spec>
- If any check fails → fix before proceeding
- Spawn the
reviewer agent for independent code review
- If reviewer says NEEDS_FIX → address the issues, re-verify
- Stage files with
git add (specific files, not -A)
Phase 4: Report
- Summary of changes (files modified/created)
- Lint / tsc / e2e results (X passed, 0 failed)
- Reviewer verdict
- If schema changed: confirm migration was staged
Rules
- Do NOT skip the migration step when schema changes
- Do NOT commit without lint + tsc passing
- If a subtask takes more than 3 fix attempts, stop and ask the user
- Track progress with TodoWrite so context compaction doesn't lose state
- Do NOT auto-commit — that's the user's call
Task Naming Convention
Use: [implement] <subtask description>
The task to implement is passed in by the /implement command caller.