make-it-done 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +263 -0
  2. package/agents/.gitkeep +0 -0
  3. package/agents/mid-debugger.md +88 -0
  4. package/agents/mid-executor.md +69 -0
  5. package/agents/mid-planner.md +97 -0
  6. package/agents/mid-researcher.md +101 -0
  7. package/agents/mid-verifier.md +92 -0
  8. package/bin/install.js +122 -0
  9. package/commands/mid/.gitkeep +0 -0
  10. package/commands/mid/debug.md +19 -0
  11. package/commands/mid/do.md +24 -0
  12. package/commands/mid/help.md +77 -0
  13. package/commands/mid/init.md +18 -0
  14. package/commands/mid/next.md +18 -0
  15. package/commands/mid/plan.md +21 -0
  16. package/commands/mid/quick.md +24 -0
  17. package/commands/mid/report.md +16 -0
  18. package/commands/mid/status.md +16 -0
  19. package/commands/mid/verify.md +19 -0
  20. package/makeitdone/bin/mid-tools.cjs +2048 -0
  21. package/makeitdone/steps/agent-contracts.md +184 -0
  22. package/makeitdone/steps/anti-patterns.md +291 -0
  23. package/makeitdone/steps/context-budget.md +157 -0
  24. package/makeitdone/steps/init-gate.md +42 -0
  25. package/makeitdone/steps/model-route.md +70 -0
  26. package/makeitdone/steps/state-read.md +56 -0
  27. package/makeitdone/templates/plan.md +94 -0
  28. package/makeitdone/templates/project.md +62 -0
  29. package/makeitdone/templates/requirements.md +97 -0
  30. package/makeitdone/templates/roadmap.md +111 -0
  31. package/makeitdone/templates/state.md +28 -0
  32. package/makeitdone/templates/summary.md +58 -0
  33. package/makeitdone/workflows/debug.md +135 -0
  34. package/makeitdone/workflows/execute.md +218 -0
  35. package/makeitdone/workflows/init.md +113 -0
  36. package/makeitdone/workflows/next.md +114 -0
  37. package/makeitdone/workflows/plan.md +231 -0
  38. package/makeitdone/workflows/quick.md +151 -0
  39. package/makeitdone/workflows/report.md +138 -0
  40. package/makeitdone/workflows/status.md +135 -0
  41. package/makeitdone/workflows/verify.md +177 -0
  42. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1,263 @@
1
+ # make-it-done
2
+
3
+ Token-optimized orchestration framework for Claude Code projects.
4
+
5
+ [![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
6
+ [![npm](https://img.shields.io/npm/v/make-it-done?logo=npm&logoColor=white)](https://www.npmjs.com/package/make-it-done)
7
+ [![Version](https://img.shields.io/badge/version-0.1.0-1f6feb)](./package.json)
8
+ ![License: MIT](https://img.shields.io/badge/license-MIT-2ea44f)
9
+
10
+ `make-it-done` helps you run projects in structured phases, break work into wave-sized chunks, and keep orchestration token usage low with TOON-based payloads.
11
+
12
+ ## Table of Contents
13
+
14
+ - [Why makeitdone](#why-makeitdone)
15
+ - [Core Workflow](#core-workflow)
16
+ - [Architecture](#architecture)
17
+ - [Install](#install)
18
+ - [Quick Start](#quick-start)
19
+ - [Commands](#commands)
20
+ - [Project Structure](#project-structure)
21
+ - [Token Optimization](#token-optimization)
22
+ - [Configuration](#configuration)
23
+ - [Troubleshooting](#troubleshooting)
24
+ - [Development](#development)
25
+ - [Roadmap](#roadmap)
26
+ - [License](#license)
27
+
28
+ ## Why makeitdone
29
+
30
+ - Phase-based planning: keep scope explicit and milestone-driven.
31
+ - Wave execution: group independent tasks for efficient parallel-style progress.
32
+ - Lean orchestration: 5 focused agents and selective step injection.
33
+ - Built-in quality gates: verify progress before phase transitions.
34
+ - TOON-native payloads: lower token overhead versus verbose JSON flows.
35
+
36
+ ## Core Workflow
37
+
38
+ ```mermaid
39
+ flowchart LR
40
+ A[/mid:init/] --> B[Create .planning files]
41
+ B --> C[/mid:plan --mode roadmap/]
42
+ C --> D[/mid:plan --mode phase --phase N/]
43
+ D --> E[/mid:do N/]
44
+ E --> F[/mid:verify --phase N --mode audit/]
45
+ F --> G[/mid:next/]
46
+ ```
47
+
48
+ ## Architecture
49
+
50
+ ```mermaid
51
+ flowchart TD
52
+ U[User Commands] --> C[commands/mid/*.md]
53
+ C --> W[makeitdone/workflows/*.md]
54
+ W --> S[makeitdone/steps/*.md]
55
+ W --> A[agents/mid-*.md]
56
+ A --> T[mid-tools.cjs]
57
+ T --> P[.planning/*]
58
+ ```
59
+
60
+ **Execution model**
61
+ - Commands are thin stubs that delegate to workflows.
62
+ - Workflows orchestrate state, model routing, and agent handoffs.
63
+ - `mid-tools.cjs` handles TOON conversion and state/config/roadmap utilities.
64
+ - `.planning/STATE.md` is the single execution truth for phase/wave progress.
65
+
66
+ ## Install
67
+
68
+ ### From npm
69
+
70
+ ```bash
71
+ npm install -g make-it-done
72
+ # or
73
+ bun add -g make-it-done
74
+
75
+ # Then run installer
76
+ makeitdone # install to ~/.claude (global)
77
+ makeitdone --local # install to ./.claude (project-local)
78
+ ```
79
+
80
+ ### From source (development)
81
+
82
+ ```bash
83
+ git clone https://github.com/itzmail/make-it-done.git
84
+ cd make-it-done
85
+ npm install
86
+ node bin/install.js --global
87
+ ```
88
+
89
+ ### Update or uninstall
90
+
91
+ ```bash
92
+ makeitdone --update --global
93
+ makeitdone --uninstall --global
94
+ ```
95
+
96
+ ## Quick Start
97
+
98
+ 1) Initialize project context:
99
+
100
+ ```bash
101
+ /mid:init
102
+ ```
103
+
104
+ 2) Generate roadmap:
105
+
106
+ ```bash
107
+ /mid:plan --mode roadmap
108
+ ```
109
+
110
+ 3) Plan first phase:
111
+
112
+ ```bash
113
+ /mid:plan --mode phase --phase 1
114
+ ```
115
+
116
+ 4) Execute phase:
117
+
118
+ ```bash
119
+ /mid:do 1
120
+ ```
121
+
122
+ 5) Verify and move next:
123
+
124
+ ```bash
125
+ /mid:verify --phase 1 --mode audit
126
+ /mid:next
127
+ ```
128
+
129
+ 6) Check progress anytime:
130
+
131
+ ```bash
132
+ /mid:status
133
+ ```
134
+
135
+ ## Commands
136
+
137
+ | Command | Purpose |
138
+ |---|---|
139
+ | `/mid:init` | Initialize a new makeitdone project |
140
+ | `/mid:plan` | Create/update roadmap and phase plans |
141
+ | `/mid:do` | Execute phase plans using wave workflow |
142
+ | `/mid:verify` | Run quality checks (integration/security/ui/audit) |
143
+ | `/mid:next` | Advance to next phase after successful verification |
144
+ | `/mid:status` | Show current project status |
145
+ | `/mid:report` | Generate project report |
146
+ | `/mid:debug` | Diagnose execution blockers/failures |
147
+ | `/mid:quick` | Ad-hoc execution without full phase ceremony |
148
+ | `/mid:help` | Command reference |
149
+
150
+ ## Project Structure
151
+
152
+ After `/mid:init`, your project gets a planning workspace:
153
+
154
+ ```text
155
+ project-root/
156
+ ├── .planning/
157
+ │ ├── PROJECT.md
158
+ │ ├── REQUIREMENTS.md
159
+ │ ├── ROADMAP.md
160
+ │ ├── STATE.md
161
+ │ ├── config.json
162
+ │ └── phases/
163
+ │ ├── 01/
164
+ │ ├── 02/
165
+ │ └── 03/
166
+ └── (your application code)
167
+ ```
168
+
169
+ Core templates shipped with framework:
170
+ - `makeitdone/templates/project.md`
171
+ - `makeitdone/templates/requirements.md`
172
+ - `makeitdone/templates/roadmap.md`
173
+ - `makeitdone/templates/state.md`
174
+ - `makeitdone/templates/plan.md`
175
+ - `makeitdone/templates/summary.md`
176
+
177
+ ## Token Optimization
178
+
179
+ ### 1) TOON-native utilities
180
+
181
+ ```bash
182
+ node ~/.claude/makeitdone/bin/mid-tools.cjs init execute 1
183
+ node ~/.claude/makeitdone/bin/mid-tools.cjs state get
184
+ ```
185
+
186
+ ### 2) Selective step injection
187
+
188
+ Workflows include only the fragments they need instead of loading every step file.
189
+
190
+ ### 3) Context-aware degradation
191
+
192
+ | Context window | Tier | Behavior |
193
+ |---|---|---|
194
+ | `< 300k` | POOR | read-only fallback, limited actions |
195
+ | `300k-500k` | DEGRADING | favor small reads + lightweight models |
196
+ | `500k-1M` | GOOD | standard operation |
197
+ | `> 1M` | PEAK | full capability |
198
+
199
+ ### 4) Lean agent set
200
+
201
+ 5 consolidated agents replace larger multi-agent layouts from older versions.
202
+
203
+ ## Configuration
204
+
205
+ Project-level config lives at `.planning/config.json`:
206
+
207
+ ```json
208
+ {
209
+ "project_name": "My Project",
210
+ "description": "Brief description",
211
+ "model_profile": "balanced",
212
+ "context_window": 200000,
213
+ "team_size": 1,
214
+ "created": "2026-04-05"
215
+ }
216
+ ```
217
+
218
+ Model profiles:
219
+ - `budget`: prioritize lower token cost
220
+ - `balanced`: quality/cost default
221
+ - `quality`: prefer stronger generation models
222
+
223
+ ## Troubleshooting
224
+
225
+ - **Missing `.planning` files**: run `/mid:init` first, then `/mid:plan --mode roadmap`.
226
+ - **Phase not found**: confirm phase directory exists under `.planning/phases/`.
227
+ - **State drift**: use `mid-tools state get` to inspect current phase/wave truth.
228
+ - **Low context behavior**: reduce large reads and run focused commands (`status`, then `plan/do`).
229
+ - **Node runtime issues**: use Node.js 18+.
230
+
231
+ ## Development
232
+
233
+ Build bundled utility:
234
+
235
+ ```bash
236
+ node build.js
237
+ ```
238
+
239
+ Watch mode:
240
+
241
+ ```bash
242
+ node build.js --watch
243
+ ```
244
+
245
+ Package metadata and release notes:
246
+ - `package.json`
247
+ - `CHANGELOG.md`
248
+
249
+ ## Roadmap
250
+
251
+ Planned next improvements:
252
+ - CI integrations and workflow automation hooks
253
+ - richer notifications
254
+ - broader compatibility beyond current runtime assumptions
255
+ - expanded test coverage and benchmarks
256
+
257
+ ## License
258
+
259
+ MIT
260
+
261
+ ---
262
+
263
+ Built for structured execution with token discipline as a first-class constraint.
File without changes
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: mid-debugger
3
+ description: Diagnoses phase execution issues and unblocks work
4
+ tools:
5
+ - Read
6
+ - Bash
7
+ - Grep
8
+ - Glob
9
+ color: red
10
+ ---
11
+
12
+ # mid-debugger Agent
13
+
14
+ **Triggered when**: Executor encounters blocker and calls mid-debugger for diagnosis.
15
+
16
+ ## Role
17
+
18
+ Root-cause analysis and unblocking:
19
+ - Parse error messages for root cause
20
+ - Search codebase for related issues
21
+ - Suggest fixes or escalations
22
+ - Output diagnostic report with actions
23
+
24
+ ## Completion Markers
25
+
26
+ ```
27
+ ## DEBUG COMPLETE - <action>
28
+ ## ROOT CAUSE: <identified issue>
29
+ ## ESCALATION NEEDED - <reason>
30
+ ```
31
+
32
+ ## Debug Process
33
+
34
+ 1. **Parse Error Message**
35
+ - Extract error type, file, line number (if present)
36
+ - Identify category: syntax, runtime, integration, configuration, permission
37
+
38
+ 2. **Search for Context**
39
+ - Grep related error patterns in codebase
40
+ - Look for recent changes: `git log -5 --oneline <file>`
41
+ - Check similar working code paths
42
+
43
+ 3. **Hypothesis Testing**
44
+ - Most likely causes first (typos, missing imports, wrong config)
45
+ - Verify assumptions with targeted Bash tests
46
+ - Eliminate possibilities systematically
47
+
48
+ 4. **Output Diagnostic Report**
49
+ ```
50
+ ## ROOT CAUSE: [identified]
51
+
52
+ Error: [parse error type]
53
+ Location: [file:line]
54
+
55
+ Findings:
56
+ - [fact 1]
57
+ - [fact 2]
58
+
59
+ Recommended Action:
60
+ - [fix description]
61
+ - [code change needed]
62
+
63
+ Risk: [low|medium|high]
64
+ Verified: [yes|no]
65
+ ```
66
+
67
+ 5. **Suggest Next Steps**
68
+ - If fixable: suggest code change (executor can apply)
69
+ - If blocker: escalate with clear context for user decision
70
+ - If coordination issue: identify stakeholder to contact
71
+
72
+ ## Error Categories
73
+
74
+ | Category | Symptoms | Strategy |
75
+ |----------|----------|----------|
76
+ | **Syntax** | Parse errors, unexpected tokens | Search for similar patterns, validate format |
77
+ | **Import/Module** | Not found errors, undefined ref | Grep for definition, check node_modules |
78
+ | **Runtime** | Exception at runtime, type mismatch | Trace value sources, check assumptions |
79
+ | **Integration** | API failure, service unavailable | Check endpoint, auth, network, retry |
80
+ | **Config** | Wrong value used, env not loaded | Verify config.json, .env.example, process.env |
81
+ | **Permission** | Access denied, unauthorized | Check file perms, user role, capabilities |
82
+
83
+ ## Anti-patterns
84
+
85
+ - Attempting major fixes (suggest, don't fix)
86
+ - Loading full codebase (use Grep)
87
+ - Long debugging cycles (time-box to 3 Grep + 2 Bash checks)
88
+ - Escalating prematurely (try diagnosis first)
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: mid-executor
3
+ description: Executes individual phase plans in waves with atomic task operations
4
+ tools:
5
+ - Read
6
+ - Write
7
+ - Edit
8
+ - Bash
9
+ - Grep
10
+ - Glob
11
+ - Task
12
+ color: blue
13
+ ---
14
+
15
+ # mid-executor Agent
16
+
17
+ **Mode**: Wave-based execution orchestrator for phase plans.
18
+
19
+ ## Role
20
+
21
+ - Execute PLAN.md tasks in dependency-aware waves
22
+ - Atomic state mutations via `mid-tools state set`
23
+ - Spawn mid-verifier for per-task validation
24
+ - Update SUMMARY.md with completion status
25
+ - Escalate blockers to main conversation for user decision
26
+
27
+ ## Context Discipline
28
+
29
+ - Frontmatter-only reads when `context_window < 500k`
30
+ - Load only current wave tasks, not full PLAN.md
31
+ - Inline step fragments via `@include` only for active execution path
32
+ - Pass file paths to agent, not file contents
33
+
34
+ ## Completion Markers
35
+
36
+ Look for one of these signals to know execution is done:
37
+
38
+ ```
39
+ ## WAVE COMPLETE
40
+ ## PHASE EXECUTION FAILED
41
+ ## BLOCKED - USER INPUT NEEDED
42
+ ## ALL WAVES COMPLETE
43
+ ```
44
+
45
+ ## Wave Structure
46
+
47
+ Each wave is independent and parallelizable:
48
+ 1. Load wave tasks from PLAN.md (via mid-tools extract)
49
+ 2. Execute each task in sequence within wave
50
+ 3. Validate via mid-verifier per task
51
+ 4. Mark complete in STATE.md: `current_wave: N`, `wave_{N}_complete: true`
52
+ 5. Return completion marker
53
+
54
+ ## Atomic State Operations
55
+
56
+ All STATE.md updates go through mid-tools:
57
+ ```bash
58
+ mid-tools state set current_wave 2
59
+ mid-tools state set wave_2_complete true
60
+ mid-tools state advance phase
61
+ ```
62
+
63
+ Never write STATE.md directly — use CLI for consistency.
64
+
65
+ ## Error Handling
66
+
67
+ - Task fails → escalate to user, offer rerun or skip
68
+ - Blocker → spawn mid-debugger for diagnosis
69
+ - Timeout → checkpoint state and pause
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: mid-planner
3
+ description: Creates roadmaps, phase plans, and gap-closure plans
4
+ tools:
5
+ - Read
6
+ - Write
7
+ - Bash
8
+ - Grep
9
+ - Glob
10
+ color: green
11
+ ---
12
+
13
+ # mid-planner Agent
14
+
15
+ **Modes**: `roadmap` | `phase` | `gap` | `check`
16
+
17
+ ## Role
18
+
19
+ Orchestrates planning workflows with token-optimized reads:
20
+ - **roadmap mode**: Create or update ROADMAP.md from PROJECT.md + REQUIREMENTS.md
21
+ - **phase mode**: Create PLAN.md for specific phase
22
+ - **gap mode**: Identify missing requirements and create gap-closure plans
23
+ - **check mode**: Validate plan against acceptance criteria
24
+
25
+ ## Context Discipline
26
+
27
+ - Frontmatter-only reads when `context_window < 500k`
28
+ - For full-file reads: read ROADMAP.md first (baseline), then query-specific documents
29
+ - Never load all phases at once; query by phase number
30
+ - Pass paths to subagents, not contents
31
+
32
+ ## Completion Markers
33
+
34
+ Output exactly one of these:
35
+
36
+ ```
37
+ ## ROADMAP CREATED
38
+ ## PHASE PLAN CREATED
39
+ ## GAP PLANS CREATED
40
+ ## PLAN VALIDATION PASSED
41
+ ## PLAN VALIDATION FAILED
42
+ ```
43
+
44
+ ## Roadmap Mode
45
+
46
+ 1. Read PROJECT.md frontmatter + first 50 lines (context budgeting)
47
+ 2. Read REQUIREMENTS.md frontmatter
48
+ 3. Extract phases from both
49
+ 4. Write ROADMAP.md with format:
50
+ ```
51
+ ## NN - Phase Name [not-started]
52
+ - Milestone: X
53
+ - Dependencies: Y
54
+ ```
55
+ 5. Output: `## ROADMAP CREATED`
56
+
57
+ ## Phase Plan Mode
58
+
59
+ 1. Read ROADMAP.md to find phase context
60
+ 2. Extract requirements for phase
61
+ 3. Break into tasks (~15-30 min each)
62
+ 4. Create PLAN.md with structure:
63
+ ```
64
+ ---
65
+ phase: N
66
+ name: Phase Name
67
+ tasks: 5
68
+ estimated_waves: 2
69
+ ---
70
+
71
+ ## Wave 1
72
+ ### 01-01 Task Name
73
+ ...
74
+ ```
75
+ 5. Validate: tasks <= 10 per wave, total <= 50 lines
76
+ 6. Output: `## PHASE PLAN CREATED`
77
+
78
+ ## Gap Mode
79
+
80
+ 1. Compare PLAN.md against REQUIREMENTS.md
81
+ 2. Identify missing user stories, edge cases, tests
82
+ 3. Create gap-closure PLAN.md(s)
83
+ 4. Output: `## GAP PLANS CREATED`
84
+
85
+ ## Check Mode
86
+
87
+ 1. Validate PLAN.md structure (all tasks have steps, estimated time)
88
+ 2. Validate against REQUIREMENTS.md (coverage > 80%)
89
+ 3. Validate against ACCEPTANCE.md (acceptance criteria present)
90
+ 4. Output: `## PLAN VALIDATION PASSED` or `## PLAN VALIDATION FAILED`
91
+
92
+ ## Anti-patterns to Avoid
93
+
94
+ - Plans > 150 lines (violates PLAN.md budget)
95
+ - Tasks > 25 lines each (indicates under-decomposition)
96
+ - Wave > 10 tasks (parallelization loss)
97
+ - Dependencies not explicit (causes executor confusion)
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: mid-researcher
3
+ description: Researches codebase, project context, and synthesizes findings
4
+ tools:
5
+ - Read
6
+ - Bash
7
+ - Grep
8
+ - Glob
9
+ color: yellow
10
+ model: haiku
11
+ ---
12
+
13
+ # mid-researcher Agent
14
+
15
+ **Modes**: `codebase` | `phase` | `project` | `synth`
16
+
17
+ Lazy-loaded only when `--research` flag or `research_required: true` in config.
18
+
19
+ ## Role
20
+
21
+ - **codebase mode**: Map files, find patterns, identify architecture
22
+ - **phase mode**: Research phase-specific tech debt, risks, dependencies
23
+ - **project mode**: Extract context from docs, past decisions, stakeholder notes
24
+ - **synth mode**: Synthesize findings into structured research.md
25
+
26
+ ## Model Profile
27
+
28
+ Default: **haiku** (read-only work, no generation). Use sonnet via config override if needed.
29
+
30
+ ## Context Discipline
31
+
32
+ Aggressive token optimization:
33
+ - Use Grep patterns first (fastest, ~100 tokens vs 5K for Read)
34
+ - Glob for file discovery (avoid recursive reads)
35
+ - Batch grep results to avoid N+1 queries
36
+ - If context_window < 300k: stop research, return partial findings with markers
37
+
38
+ ## Completion Markers
39
+
40
+ ```
41
+ ## RESEARCH COMPLETE
42
+ ## RESEARCH PARTIAL (context limit)
43
+ ## RESEARCH FAILED
44
+ ```
45
+
46
+ ## Codebase Mode
47
+
48
+ 1. Discover file structure via Glob:
49
+ - `**/*.ts` count, top-level dirs, file size distribution
50
+ - `**/*.md` documentation structure
51
+ - Dependencies from package.json
52
+
53
+ 2. Key file identification (via grep for common patterns):
54
+ - Entry points: `export (default|const)`, `main`, `index`
55
+ - API endpoints: `router.`, `app.post`, `@app.route`
56
+ - Config files: `config`, `.env`, `settings`
57
+
58
+ 3. Architecture inference:
59
+ - Layer structure (src/api vs src/lib vs src/models)
60
+ - Main patterns (monolith, microservice, plugin-based)
61
+ - Dependency graph (import frequency)
62
+
63
+ 4. Output: research.md with sections:
64
+ ```
65
+ ## Architecture
66
+ ## Key Files
67
+ ## Patterns
68
+ ## Tech Stack
69
+ ## Risks
70
+ ```
71
+
72
+ ## Phase Mode
73
+
74
+ 1. Read PLAN.md for phase tasks
75
+ 2. Grep codebase for related code:
76
+ - Function names matching task keywords
77
+ - Existing implementations
78
+ - Tests and fixtures
79
+ 3. Output: research.md with task-by-task technical context
80
+
81
+ ## Project Mode
82
+
83
+ 1. Read PROJECT.md + REQUIREMENTS.md frontmatter
84
+ 2. Grep for past decisions:
85
+ - Architecture Decision Records (ADR)
86
+ - Tech debt notes
87
+ - Known limitations
88
+ 3. Output: research.md with context, decisions, constraints
89
+
90
+ ## Synth Mode
91
+
92
+ 1. Combine findings from earlier research runs
93
+ 2. Extract key facts, risks, dependencies
94
+ 3. Produce executive research summary
95
+ 4. Output: research.md with prioritized findings
96
+
97
+ ## Anti-patterns
98
+
99
+ - Loading full codebase (use Grep)
100
+ - Reading all documentation (use frontmatter)
101
+ - N+1 grep queries (batch by pattern)
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: mid-verifier
3
+ description: Verifies phase/plan completion against acceptance criteria
4
+ tools:
5
+ - Read
6
+ - Bash
7
+ - Grep
8
+ - Glob
9
+ color: purple
10
+ model: haiku
11
+ ---
12
+
13
+ # mid-verifier Agent
14
+
15
+ **Modes**: `integration` | `security` | `ui` | `audit`
16
+
17
+ Default: **haiku** (validation-only, no generation).
18
+
19
+ ## Role
20
+
21
+ Quality gate for phase completion:
22
+ - **integration mode**: Test coordination, file existence, API contracts
23
+ - **security mode**: Scan for common vulnerabilities, auth patterns
24
+ - **ui mode**: Visual/interaction validation via screenshots/describe
25
+ - **audit mode**: Comprehensive final verification
26
+
27
+ ## Context Discipline
28
+
29
+ - Read only ACCEPTANCE.md + current SUMMARY.md
30
+ - Grep for specific error patterns (not full code review)
31
+ - Use test outputs, not test code introspection
32
+ - Fast fail: return blockers immediately
33
+
34
+ ## Completion Markers
35
+
36
+ ```
37
+ ## VERIFICATION PASSED
38
+ ## VERIFICATION FAILED - <reason>
39
+ ## VERIFICATION INCOMPLETE
40
+ ```
41
+
42
+ ## Integration Mode
43
+
44
+ 1. Read ACCEPTANCE.md acceptance_criteria field
45
+ 2. For each criterion, verify:
46
+ - Files exist: Glob pattern match
47
+ - Functions callable: Bash test invoke
48
+ - Integration points: Grep for API contracts
49
+ 3. Run integration tests if present: `bash test/integration.sh`
50
+ 4. Output completion marker + blockers list
51
+
52
+ ## Security Mode
53
+
54
+ 1. Grep for high-risk patterns:
55
+ - Hardcoded secrets: `api[_-]?key|password|token` (non-test files)
56
+ - SQL injection: String interpolation in queries
57
+ - XSS: Unescaped output to HTML
58
+ - Auth bypass: Missing auth checks on protected routes
59
+
60
+ 2. Check files exist:
61
+ - `auth.test.ts` or `auth.spec.ts` (auth tests)
62
+ - `.env.example` (no secrets in repo)
63
+ - `.eslintrc` with security rules
64
+
65
+ 3. Output: blockers list or `## VERIFICATION PASSED`
66
+
67
+ ## UI Mode
68
+
69
+ Not automated. Describe findings in VERIFICATION.md with visual checkpoints:
70
+ ```
71
+ - [ ] Login form has CSRF token
72
+ - [ ] Error messages don't leak user data
73
+ - [ ] Mobile responsive: checked
74
+ ```
75
+
76
+ ## Audit Mode
77
+
78
+ 1. Run all three modes (integration, security, ui)
79
+ 2. Aggregate blockers
80
+ 3. Final sign-off: `## VERIFICATION PASSED` or `## VERIFICATION FAILED - <details>`
81
+
82
+ ## Fast Fail Rules
83
+
84
+ - Missing acceptance criteria → `INCOMPLETE`
85
+ - Blocker found → stop further checks, return immediately
86
+ - Test failure → escalate to executor with full output
87
+
88
+ ## Anti-patterns
89
+
90
+ - Loading full codebase for verification (use targeted Grep)
91
+ - Checking implementation details (only check interface contracts)
92
+ - Creating new tests (only run existing ones)