anvil-dev-framework 0.1.6

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 (190) hide show
  1. package/README.md +719 -0
  2. package/VERSION +1 -0
  3. package/docs/ANVIL-REPO-IMPLEMENTATION-PLAN.md +441 -0
  4. package/docs/FIRST-SKILL-TUTORIAL.md +408 -0
  5. package/docs/INSTALLATION-RETRO-NOTES.md +458 -0
  6. package/docs/INSTALLATION.md +984 -0
  7. package/docs/anvil-hud.md +469 -0
  8. package/docs/anvil-init.md +255 -0
  9. package/docs/anvil-state.md +210 -0
  10. package/docs/boris-cherny-ralph-wiggum-insights.md +608 -0
  11. package/docs/command-reference.md +2022 -0
  12. package/docs/hooks-tts.md +368 -0
  13. package/docs/implementation-guide.md +810 -0
  14. package/docs/linear-github-integration.md +247 -0
  15. package/docs/local-issues.md +677 -0
  16. package/docs/patterns/README.md +419 -0
  17. package/docs/planning-responsibilities.md +139 -0
  18. package/docs/session-workflow.md +573 -0
  19. package/docs/simplification-plan-template.md +297 -0
  20. package/docs/simplification-principles.md +129 -0
  21. package/docs/specifications/CCS-RALPH-INTEGRATION-DESIGN.md +633 -0
  22. package/docs/specifications/CCS-RESEARCH-REPORT.md +169 -0
  23. package/docs/specifications/PLAN-ANV-verification-ralph-wiggum.md +403 -0
  24. package/docs/specifications/PLAN-parallel-tracks-anvil-memory-ccs.md +494 -0
  25. package/docs/specifications/SPEC-ANV-VRW/component-01-verify.md +208 -0
  26. package/docs/specifications/SPEC-ANV-VRW/component-02-stop-gate.md +226 -0
  27. package/docs/specifications/SPEC-ANV-VRW/component-03-posttooluse.md +209 -0
  28. package/docs/specifications/SPEC-ANV-VRW/component-04-ralph-wiggum.md +604 -0
  29. package/docs/specifications/SPEC-ANV-VRW/component-05-atomic-actions.md +311 -0
  30. package/docs/specifications/SPEC-ANV-VRW/component-06-verify-subagent.md +264 -0
  31. package/docs/specifications/SPEC-ANV-VRW/component-07-claude-md.md +363 -0
  32. package/docs/specifications/SPEC-ANV-VRW/index.md +182 -0
  33. package/docs/specifications/SPEC-ANV-anvil-memory.md +573 -0
  34. package/docs/specifications/SPEC-ANV-context-checkpoints.md +781 -0
  35. package/docs/specifications/SPEC-ANV-verification-ralph-wiggum.md +789 -0
  36. package/docs/sync.md +122 -0
  37. package/global/CLAUDE.md +140 -0
  38. package/global/agents/verify-app.md +164 -0
  39. package/global/commands/anvil-settings.md +527 -0
  40. package/global/commands/anvil-sync.md +121 -0
  41. package/global/commands/change.md +197 -0
  42. package/global/commands/clarify.md +252 -0
  43. package/global/commands/cleanup.md +292 -0
  44. package/global/commands/commit-push-pr.md +207 -0
  45. package/global/commands/decay-review.md +127 -0
  46. package/global/commands/discover.md +158 -0
  47. package/global/commands/doc-coverage.md +122 -0
  48. package/global/commands/evidence.md +307 -0
  49. package/global/commands/explore.md +121 -0
  50. package/global/commands/force-exit.md +135 -0
  51. package/global/commands/handoff.md +191 -0
  52. package/global/commands/healthcheck.md +302 -0
  53. package/global/commands/hud.md +84 -0
  54. package/global/commands/insights.md +319 -0
  55. package/global/commands/linear-setup.md +184 -0
  56. package/global/commands/lint-fix.md +198 -0
  57. package/global/commands/orient.md +510 -0
  58. package/global/commands/plan.md +228 -0
  59. package/global/commands/ralph.md +346 -0
  60. package/global/commands/ready.md +182 -0
  61. package/global/commands/release.md +305 -0
  62. package/global/commands/retro.md +96 -0
  63. package/global/commands/shard.md +166 -0
  64. package/global/commands/spec.md +227 -0
  65. package/global/commands/sprint.md +184 -0
  66. package/global/commands/tasks.md +228 -0
  67. package/global/commands/test-and-commit.md +151 -0
  68. package/global/commands/validate.md +132 -0
  69. package/global/commands/verify.md +251 -0
  70. package/global/commands/weekly-review.md +156 -0
  71. package/global/hooks/__pycache__/ralph_context_monitor.cpython-314.pyc +0 -0
  72. package/global/hooks/__pycache__/statusline_agent_sync.cpython-314.pyc +0 -0
  73. package/global/hooks/anvil_memory_observe.ts +322 -0
  74. package/global/hooks/anvil_memory_session.ts +166 -0
  75. package/global/hooks/anvil_memory_stop.ts +187 -0
  76. package/global/hooks/parse_transcript.py +116 -0
  77. package/global/hooks/post_merge_cleanup.sh +132 -0
  78. package/global/hooks/post_tool_format.sh +215 -0
  79. package/global/hooks/ralph_context_monitor.py +240 -0
  80. package/global/hooks/ralph_stop.sh +502 -0
  81. package/global/hooks/statusline.sh +1110 -0
  82. package/global/hooks/statusline_agent_sync.py +224 -0
  83. package/global/hooks/stop_gate.sh +250 -0
  84. package/global/lib/.claude/anvil-state.json +21 -0
  85. package/global/lib/__pycache__/agent_registry.cpython-314.pyc +0 -0
  86. package/global/lib/__pycache__/claim_service.cpython-314.pyc +0 -0
  87. package/global/lib/__pycache__/coderabbit_service.cpython-314.pyc +0 -0
  88. package/global/lib/__pycache__/config_service.cpython-314.pyc +0 -0
  89. package/global/lib/__pycache__/coordination_service.cpython-314.pyc +0 -0
  90. package/global/lib/__pycache__/doc_coverage_service.cpython-314.pyc +0 -0
  91. package/global/lib/__pycache__/gate_logger.cpython-314.pyc +0 -0
  92. package/global/lib/__pycache__/github_service.cpython-314.pyc +0 -0
  93. package/global/lib/__pycache__/hygiene_service.cpython-314.pyc +0 -0
  94. package/global/lib/__pycache__/issue_models.cpython-314.pyc +0 -0
  95. package/global/lib/__pycache__/issue_provider.cpython-314.pyc +0 -0
  96. package/global/lib/__pycache__/linear_data_service.cpython-314.pyc +0 -0
  97. package/global/lib/__pycache__/linear_provider.cpython-314.pyc +0 -0
  98. package/global/lib/__pycache__/local_provider.cpython-314.pyc +0 -0
  99. package/global/lib/__pycache__/quality_service.cpython-314.pyc +0 -0
  100. package/global/lib/__pycache__/ralph_state.cpython-314.pyc +0 -0
  101. package/global/lib/__pycache__/state_manager.cpython-314.pyc +0 -0
  102. package/global/lib/__pycache__/transcript_parser.cpython-314.pyc +0 -0
  103. package/global/lib/__pycache__/verification_runner.cpython-314.pyc +0 -0
  104. package/global/lib/__pycache__/verify_iteration.cpython-314.pyc +0 -0
  105. package/global/lib/__pycache__/verify_subagent.cpython-314.pyc +0 -0
  106. package/global/lib/agent_registry.py +995 -0
  107. package/global/lib/anvil-state.sh +435 -0
  108. package/global/lib/claim_service.py +515 -0
  109. package/global/lib/coderabbit_service.py +314 -0
  110. package/global/lib/config_service.py +423 -0
  111. package/global/lib/coordination_service.py +331 -0
  112. package/global/lib/doc_coverage_service.py +1305 -0
  113. package/global/lib/gate_logger.py +316 -0
  114. package/global/lib/github_service.py +310 -0
  115. package/global/lib/handoff_generator.py +775 -0
  116. package/global/lib/hygiene_service.py +712 -0
  117. package/global/lib/issue_models.py +257 -0
  118. package/global/lib/issue_provider.py +339 -0
  119. package/global/lib/linear_data_service.py +210 -0
  120. package/global/lib/linear_provider.py +987 -0
  121. package/global/lib/linear_provider.py.backup +671 -0
  122. package/global/lib/local_provider.py +486 -0
  123. package/global/lib/orient_fast.py +457 -0
  124. package/global/lib/quality_service.py +470 -0
  125. package/global/lib/ralph_prompt_generator.py +563 -0
  126. package/global/lib/ralph_state.py +1202 -0
  127. package/global/lib/state_manager.py +417 -0
  128. package/global/lib/transcript_parser.py +597 -0
  129. package/global/lib/verification_runner.py +557 -0
  130. package/global/lib/verify_iteration.py +490 -0
  131. package/global/lib/verify_subagent.py +250 -0
  132. package/global/skills/README.md +155 -0
  133. package/global/skills/quality-gates/SKILL.md +252 -0
  134. package/global/skills/skill-template/SKILL.md +109 -0
  135. package/global/skills/testing-strategies/SKILL.md +337 -0
  136. package/global/templates/CHANGE-template.md +105 -0
  137. package/global/templates/HANDOFF-template.md +63 -0
  138. package/global/templates/PLAN-template.md +111 -0
  139. package/global/templates/SPEC-template.md +93 -0
  140. package/global/templates/ralph/PROMPT.md.template +89 -0
  141. package/global/templates/ralph/fix_plan.md.template +31 -0
  142. package/global/templates/ralph/progress.txt.template +23 -0
  143. package/global/tests/__pycache__/test_doc_coverage.cpython-314.pyc +0 -0
  144. package/global/tests/test_doc_coverage.py +520 -0
  145. package/global/tests/test_issue_models.py +299 -0
  146. package/global/tests/test_local_provider.py +323 -0
  147. package/global/tools/README.md +178 -0
  148. package/global/tools/__pycache__/anvil-hud.cpython-314.pyc +0 -0
  149. package/global/tools/anvil-hud.py +3622 -0
  150. package/global/tools/anvil-hud.py.bak +3318 -0
  151. package/global/tools/anvil-issue.py +432 -0
  152. package/global/tools/anvil-memory/CLAUDE.md +49 -0
  153. package/global/tools/anvil-memory/README.md +42 -0
  154. package/global/tools/anvil-memory/bun.lock +25 -0
  155. package/global/tools/anvil-memory/bunfig.toml +9 -0
  156. package/global/tools/anvil-memory/package.json +23 -0
  157. package/global/tools/anvil-memory/src/__tests__/ccs/context-monitor.test.ts +535 -0
  158. package/global/tools/anvil-memory/src/__tests__/ccs/edge-cases.test.ts +645 -0
  159. package/global/tools/anvil-memory/src/__tests__/ccs/fixtures.ts +363 -0
  160. package/global/tools/anvil-memory/src/__tests__/ccs/index.ts +8 -0
  161. package/global/tools/anvil-memory/src/__tests__/ccs/integration.test.ts +417 -0
  162. package/global/tools/anvil-memory/src/__tests__/ccs/prompt-generator.test.ts +571 -0
  163. package/global/tools/anvil-memory/src/__tests__/ccs/ralph-stop.test.ts +440 -0
  164. package/global/tools/anvil-memory/src/__tests__/ccs/test-utils.ts +252 -0
  165. package/global/tools/anvil-memory/src/__tests__/commands.test.ts +657 -0
  166. package/global/tools/anvil-memory/src/__tests__/db.test.ts +641 -0
  167. package/global/tools/anvil-memory/src/__tests__/hooks.test.ts +272 -0
  168. package/global/tools/anvil-memory/src/__tests__/performance.test.ts +427 -0
  169. package/global/tools/anvil-memory/src/__tests__/test-utils.ts +113 -0
  170. package/global/tools/anvil-memory/src/commands/checkpoint.ts +197 -0
  171. package/global/tools/anvil-memory/src/commands/get.ts +115 -0
  172. package/global/tools/anvil-memory/src/commands/init.ts +94 -0
  173. package/global/tools/anvil-memory/src/commands/observe.ts +163 -0
  174. package/global/tools/anvil-memory/src/commands/search.ts +112 -0
  175. package/global/tools/anvil-memory/src/db.ts +638 -0
  176. package/global/tools/anvil-memory/src/index.ts +205 -0
  177. package/global/tools/anvil-memory/src/types.ts +122 -0
  178. package/global/tools/anvil-memory/tsconfig.json +29 -0
  179. package/global/tools/ralph-loop.sh +359 -0
  180. package/package.json +45 -0
  181. package/scripts/anvil +822 -0
  182. package/scripts/extract_patterns.py +222 -0
  183. package/scripts/init-project.sh +541 -0
  184. package/scripts/install.sh +229 -0
  185. package/scripts/postinstall.js +41 -0
  186. package/scripts/rollback.sh +188 -0
  187. package/scripts/sync.sh +623 -0
  188. package/scripts/test-statusline.sh +248 -0
  189. package/scripts/update_claude_md.py +224 -0
  190. package/scripts/verify.sh +255 -0
@@ -0,0 +1,311 @@
1
+ ---
2
+ shard_id: SPEC-ANV-VRW/component-05
3
+ parent: SPEC-ANV-VRW
4
+ title: Atomic Action Commands
5
+ status: draft
6
+ linear_issue: ANV-146
7
+ priority: P1
8
+ estimated_hours: 3-4
9
+ dependencies:
10
+ - component-01-verify
11
+ ---
12
+
13
+ # Component 5: Atomic Action Commands
14
+
15
+ ## Overview
16
+
17
+ Single commands that execute complete workflows for rapid inner-loop execution. These are the "one-liners" that Boris Cherny uses for fast iteration.
18
+
19
+ > Boris Cherny: "Atomic action commands for inner loops"
20
+
21
+ ---
22
+
23
+ ## Commands
24
+
25
+ | Command | Purpose | Workflow |
26
+ |---------|---------|----------|
27
+ | `/test-and-commit` | Safe commit with tests | test → commit |
28
+ | `/commit-push-pr` | Full PR workflow | commit → push → PR |
29
+ | `/lint-fix` | Auto-fix lint issues | lint --fix → stage |
30
+
31
+ ---
32
+
33
+ ## Requirements
34
+
35
+ | ID | Requirement | Priority | Acceptance Criteria |
36
+ |----|-------------|----------|---------------------|
37
+ | REQ-AA-100 | `/test-and-commit` runs tests before committing | P0 | No commit if tests fail |
38
+ | REQ-AA-101 | `/commit-push-pr` handles full workflow | P0 | PR created successfully |
39
+ | REQ-AA-102 | `/lint-fix` auto-fixes lintable issues | P1 | Fixable issues resolved |
40
+ | REQ-AA-103 | All commands have clear success/failure output | P0 | Status visible |
41
+ | REQ-AA-104 | Commands respect git conventions | P0 | Conventional commits |
42
+ | REQ-AA-105 | Atomic execution (all-or-nothing) | P0 | No partial state |
43
+
44
+ ---
45
+
46
+ ## Implementation Tasks
47
+
48
+ ### Task 1: Create /test-and-commit
49
+ **File**: `global/commands/test-and-commit.md`
50
+ **Estimated**: 1 hour
51
+
52
+ - [ ] Run test suite first
53
+ - [ ] If pass: stage and commit
54
+ - [ ] If fail: report errors, no commit
55
+ - [ ] Accept commit message argument
56
+ - [ ] Support conventional commit format
57
+
58
+ ### Task 2: Create /commit-push-pr
59
+ **File**: `global/commands/commit-push-pr.md`
60
+ **Estimated**: 1.5 hours
61
+
62
+ - [ ] Stage all changes
63
+ - [ ] Create commit with message
64
+ - [ ] Push to remote
65
+ - [ ] Create PR with `gh pr create`
66
+ - [ ] Return PR URL
67
+ - [ ] Handle push failures
68
+
69
+ ### Task 3: Create /lint-fix
70
+ **File**: `global/commands/lint-fix.md`
71
+ **Estimated**: 0.5 hours
72
+
73
+ - [ ] Run linter with `--fix` flag
74
+ - [ ] Report remaining unfixable issues
75
+ - [ ] Stage auto-fixed changes
76
+ - [ ] Support multiple linters
77
+
78
+ ### Task 4: Error Handling
79
+ **Estimated**: 1 hour
80
+
81
+ - [ ] Clear failure messages for each command
82
+ - [ ] No partial state on failure
83
+ - [ ] Rollback on error
84
+ - [ ] Suggest fixes for common issues
85
+
86
+ ---
87
+
88
+ ## Command: `/test-and-commit`
89
+
90
+ ```markdown
91
+ # /test-and-commit - Test Then Commit
92
+
93
+ > Run tests, and if passing, commit changes.
94
+
95
+ ## Arguments
96
+ - `message` (required) - Commit message
97
+
98
+ ## Execution
99
+ 1. Run configured test suite
100
+ 2. If pass:
101
+ - Stage all changes
102
+ - Create commit with provided message
103
+ - Report success
104
+ 3. If fail:
105
+ - Report test failures
106
+ - Do NOT create commit
107
+ - Suggest fixes
108
+
109
+ ## Usage
110
+ /test-and-commit "feat: add user authentication"
111
+
112
+ ## Success Output
113
+ ✅ Tests passed (47 tests)
114
+ ✅ Committed: feat: add user authentication
115
+ abc1234 - 3 files changed, 145 insertions(+), 23 deletions(-)
116
+
117
+ ## Failure Output
118
+ ❌ Tests failed (2 failures)
119
+
120
+ Failing tests:
121
+ - src/auth/login.test.ts:45 - Expected 200, got 401
122
+ - src/auth/login.test.ts:67 - Timeout
123
+
124
+ No commit created. Fix tests first.
125
+ ```
126
+
127
+ ---
128
+
129
+ ## Command: `/commit-push-pr`
130
+
131
+ ```markdown
132
+ # /commit-push-pr - Full Commit Workflow
133
+
134
+ > Commit, push, and create PR in one command.
135
+
136
+ ## Arguments
137
+ - `message` (required) - Commit message (used for PR title)
138
+
139
+ ## Execution
140
+ 1. Stage all changes
141
+ 2. Create commit with conventional message
142
+ 3. Push to current branch (or create branch)
143
+ 4. Create PR with `gh pr create`
144
+ 5. Return PR URL
145
+
146
+ ## Usage
147
+ /commit-push-pr "feat: add OAuth support"
148
+
149
+ ## Success Output
150
+ ✅ Committed: feat: add OAuth support
151
+ abc1234 - 5 files changed
152
+ ✅ Pushed to origin/feature/oauth
153
+ ✅ PR created: https://github.com/org/repo/pull/42
154
+
155
+ ## Failure Output
156
+ ❌ Push failed: no upstream branch
157
+
158
+ Suggested fix:
159
+ git push -u origin $(git branch --show-current)
160
+
161
+ ## Prerequisites
162
+ - `gh` CLI installed and authenticated
163
+ - Remote repository configured
164
+ - Git credentials available
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Command: `/lint-fix`
170
+
171
+ ```markdown
172
+ # /lint-fix - Auto-Fix Lint Issues
173
+
174
+ > Run linter with auto-fix enabled.
175
+
176
+ ## Arguments
177
+ - (none) - Fix all files
178
+ - `path` (optional) - Fix specific path
179
+
180
+ ## Execution
181
+ 1. Run linter with --fix flag
182
+ 2. Report remaining unfixable issues
183
+ 3. Stage auto-fixed changes
184
+
185
+ ## Usage
186
+ /lint-fix
187
+ /lint-fix src/components/
188
+
189
+ ## Success Output
190
+ ✅ Lint auto-fix complete
191
+
192
+ Fixed 12 issues:
193
+ - 5 formatting issues
194
+ - 4 import order issues
195
+ - 3 unused import removals
196
+
197
+ Remaining (manual fix required):
198
+ - src/utils/api.ts:45 - 'x' is defined but never used
199
+
200
+ Changes staged for commit.
201
+
202
+ ## Supported Linters
203
+ - ESLint (--fix)
204
+ - Prettier (--write)
205
+ - Ruff (--fix)
206
+ - Biome (--apply)
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Skill Implementations
212
+
213
+ ### test-and-commit.md
214
+
215
+ ```markdown
216
+ # /test-and-commit - Test Then Commit
217
+
218
+ > Run tests, and if passing, commit changes.
219
+
220
+ ## Execution Steps
221
+
222
+ ### Step 1: Run Tests
223
+ Execute the project's test suite:
224
+ - npm test / pytest / cargo test / etc.
225
+ - Capture exit code and output
226
+
227
+ ### Step 2: Evaluate Results
228
+ If tests pass (exit 0):
229
+ - Proceed to commit
230
+ If tests fail (exit non-zero):
231
+ - Report failures
232
+ - Stop execution
233
+
234
+ ### Step 3: Create Commit
235
+ If tests passed:
236
+ - git add .
237
+ - git commit -m "[message]"
238
+ - Report commit details
239
+
240
+ ## Anti-Patterns
241
+ - ❌ Committing without running tests
242
+ - ❌ Ignoring test failures
243
+ - ❌ Using generic commit messages
244
+ ```
245
+
246
+ ### commit-push-pr.md
247
+
248
+ ```markdown
249
+ # /commit-push-pr - Full Commit Workflow
250
+
251
+ > Commit, push, and create PR in one command.
252
+
253
+ ## Execution Steps
254
+
255
+ ### Step 1: Stage Changes
256
+ git add .
257
+
258
+ ### Step 2: Create Commit
259
+ git commit -m "[message]"
260
+
261
+ ### Step 3: Push to Remote
262
+ git push origin [current-branch]
263
+ - If no upstream, use: git push -u origin [branch]
264
+
265
+ ### Step 4: Create PR
266
+ gh pr create --title "[message]" --body "[auto-generated]"
267
+ - Include summary of changes
268
+ - Add conventional commit type
269
+
270
+ ### Step 5: Report Result
271
+ Return PR URL for user reference
272
+
273
+ ## Anti-Patterns
274
+ - ❌ Pushing to protected branches directly
275
+ - ❌ Creating PRs without tests passing
276
+ - ❌ Using force push
277
+ ```
278
+
279
+ ---
280
+
281
+ ## Test Cases
282
+
283
+ | Command | Scenario | Expected |
284
+ |---------|----------|----------|
285
+ | `/test-and-commit` | Tests pass | Commit created |
286
+ | `/test-and-commit` | Tests fail | No commit, errors shown |
287
+ | `/commit-push-pr` | Normal workflow | PR created, URL returned |
288
+ | `/commit-push-pr` | No remote | Error with suggestion |
289
+ | `/lint-fix` | Fixable issues | Issues fixed, staged |
290
+ | `/lint-fix` | Unfixable issues | Report remaining |
291
+
292
+ ---
293
+
294
+ ## Error Handling
295
+
296
+ | Error | Command | Response |
297
+ |-------|---------|----------|
298
+ | Tests failing | test-and-commit | List failures, no commit |
299
+ | No git repo | all | "Not a git repository" |
300
+ | Push rejected | commit-push-pr | Suggest pull/rebase |
301
+ | gh not installed | commit-push-pr | Install instructions |
302
+ | Nothing to commit | all | "No changes to commit" |
303
+
304
+ ---
305
+
306
+ ## Integration Points
307
+
308
+ - **Trigger**: User invokes command
309
+ - **Input**: Commit message
310
+ - **Output**: Success/failure with details
311
+ - **Dependencies**: component-01 (verify) for test-and-commit
@@ -0,0 +1,264 @@
1
+ ---
2
+ shard_id: SPEC-ANV-VRW/component-06
3
+ parent: SPEC-ANV-VRW
4
+ title: Verification Subagent
5
+ status: draft
6
+ linear_issue: ANV-147
7
+ priority: P2
8
+ estimated_hours: 2-3
9
+ dependencies:
10
+ - component-01-verify
11
+ ---
12
+
13
+ # Component 6: Verification Subagent
14
+
15
+ ## Overview
16
+
17
+ A dedicated subagent for verification that keeps verification context out of the main session. This prevents context pollution from test output and verification logs.
18
+
19
+ > Boris Cherny: "Subagents for research... don't pollute main context"
20
+
21
+ ---
22
+
23
+ ## Requirements
24
+
25
+ | ID | Requirement | Priority | Acceptance Criteria |
26
+ |----|-------------|----------|---------------------|
27
+ | REQ-VS-100 | Subagent runs all verification checks | P0 | Tests, lint, types all execute |
28
+ | REQ-VS-101 | Returns structured pass/fail report | P0 | JSON response format |
29
+ | REQ-VS-102 | Isolates verification context from main session | P0 | No context pollution |
30
+ | REQ-VS-103 | Supports custom verification commands | P1 | Config overrides work |
31
+
32
+ ---
33
+
34
+ ## Implementation Tasks
35
+
36
+ ### Task 1: Create Subagent Configuration
37
+ **File**: `global/agents/verify-app.json`
38
+ **Estimated**: 0.5 hours
39
+
40
+ - [ ] Define agent name and description
41
+ - [ ] Limit available tools (Bash, Read, Glob)
42
+ - [ ] Create specialized prompt
43
+ - [ ] Set appropriate model
44
+
45
+ ### Task 2: Create Agent Definition
46
+ **Estimated**: 1 hour
47
+
48
+ - [ ] Register in agent system
49
+ - [ ] Define invocation pattern
50
+ - [ ] Set context limits
51
+ - [ ] Add error handling
52
+
53
+ ### Task 3: Create Invocation Wrapper
54
+ **File**: `global/lib/verify_subagent.py`
55
+ **Estimated**: 1 hour
56
+
57
+ - [ ] Parse verification config
58
+ - [ ] Spawn subagent with prompt
59
+ - [ ] Collect structured results
60
+ - [ ] Handle timeout and errors
61
+
62
+ ---
63
+
64
+ ## Agent Configuration
65
+
66
+ ```json
67
+ {
68
+ "name": "verify-app",
69
+ "description": "Verification subagent for running tests, lint, and type checks",
70
+ "model": "haiku",
71
+ "tools": ["Bash", "Read", "Glob"],
72
+ "max_tokens": 4096,
73
+ "prompt": "You are a verification agent. Your job is to run all project checks and report results in structured JSON format.\n\nAlways output results as:\n{\n \"tests\": { \"passed\": true, \"count\": 47, \"failures\": [] },\n \"lint\": { \"passed\": true, \"errors\": 0 },\n \"types\": { \"passed\": true, \"errors\": 0 }\n}"
74
+ }
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Invocation Pattern
80
+
81
+ ### From Main Agent
82
+
83
+ ```python
84
+ # Using Task tool with verify-app subagent
85
+ Task(
86
+ subagent_type="verify-app",
87
+ prompt="Run full verification suite and report results",
88
+ model="haiku"
89
+ )
90
+ ```
91
+
92
+ ### Response Format
93
+
94
+ ```json
95
+ {
96
+ "overall": "pass",
97
+ "tests": {
98
+ "passed": true,
99
+ "count": 47,
100
+ "duration_ms": 3200,
101
+ "failures": []
102
+ },
103
+ "lint": {
104
+ "passed": true,
105
+ "errors": 0,
106
+ "warnings": 3
107
+ },
108
+ "types": {
109
+ "passed": true,
110
+ "errors": 0
111
+ },
112
+ "summary": "All 47 tests passed. Lint clean. Types clean."
113
+ }
114
+ ```
115
+
116
+ ### Failure Response
117
+
118
+ ```json
119
+ {
120
+ "overall": "fail",
121
+ "tests": {
122
+ "passed": false,
123
+ "count": 47,
124
+ "duration_ms": 3200,
125
+ "failures": [
126
+ {
127
+ "file": "src/auth/login.test.ts",
128
+ "line": 45,
129
+ "message": "Expected 200, got 401"
130
+ }
131
+ ]
132
+ },
133
+ "lint": {
134
+ "passed": true,
135
+ "errors": 0
136
+ },
137
+ "types": {
138
+ "passed": true,
139
+ "errors": 0
140
+ },
141
+ "summary": "1 test failure. See failures array for details."
142
+ }
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Subagent Prompt
148
+
149
+ ```markdown
150
+ # Verification Agent
151
+
152
+ You are a specialized verification agent. Your sole purpose is to run project checks and report results.
153
+
154
+ ## Your Task
155
+ 1. Run the test suite
156
+ 2. Run the linter
157
+ 3. Run the type checker
158
+ 4. Report results in JSON format
159
+
160
+ ## Commands to Run
161
+ - Tests: `npm test` or `pytest` (detect from package.json/pyproject.toml)
162
+ - Lint: `npm run lint` or `ruff check`
163
+ - Types: `npm run typecheck` or `mypy`
164
+
165
+ ## Output Format
166
+ Always respond with a JSON object containing:
167
+ - `overall`: "pass" or "fail"
168
+ - `tests`: test results with count and failures
169
+ - `lint`: lint results with error count
170
+ - `types`: type check results with error count
171
+ - `summary`: human-readable one-line summary
172
+
173
+ ## Rules
174
+ - Run ALL checks, even if one fails
175
+ - Capture full error output for failures
176
+ - Include file and line numbers when available
177
+ - Never attempt to fix issues, only report
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Usage Examples
183
+
184
+ ### Basic Verification
185
+
186
+ ```
187
+ Main Agent: I need to check if the code is ready for commit.
188
+
189
+ [Spawns verify-app subagent]
190
+
191
+ verify-app: Running verification suite...
192
+ - npm test: 47 passed
193
+ - npm run lint: clean
194
+ - npm run typecheck: clean
195
+
196
+ {
197
+ "overall": "pass",
198
+ "tests": { "passed": true, "count": 47 },
199
+ "lint": { "passed": true, "errors": 0 },
200
+ "types": { "passed": true, "errors": 0 },
201
+ "summary": "All checks passed."
202
+ }
203
+
204
+ Main Agent: Verification passed. Proceeding with commit.
205
+ ```
206
+
207
+ ### Verification with Failures
208
+
209
+ ```
210
+ Main Agent: Run verification before merging.
211
+
212
+ [Spawns verify-app subagent]
213
+
214
+ verify-app: Running verification suite...
215
+ - npm test: 2 failures
216
+ - npm run lint: 3 errors
217
+ - npm run typecheck: clean
218
+
219
+ {
220
+ "overall": "fail",
221
+ "tests": {
222
+ "passed": false,
223
+ "failures": [
224
+ { "file": "src/auth.test.ts", "line": 45, "message": "..." }
225
+ ]
226
+ },
227
+ "lint": { "passed": false, "errors": 3 },
228
+ "summary": "2 test failures, 3 lint errors."
229
+ }
230
+
231
+ Main Agent: Verification failed. I'll fix the test and lint issues.
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Benefits
237
+
238
+ | Benefit | Description |
239
+ |---------|-------------|
240
+ | Context isolation | Test output doesn't pollute main context |
241
+ | Fast execution | Use haiku model for quick checks |
242
+ | Structured output | JSON format for easy parsing |
243
+ | Parallel execution | Can run while main agent continues |
244
+
245
+ ---
246
+
247
+ ## Test Cases
248
+
249
+ | Test Case | Input | Expected |
250
+ |-----------|-------|----------|
251
+ | All pass | Clean codebase | `overall: "pass"` |
252
+ | Test failures | Failing tests | `tests.passed: false` with details |
253
+ | Lint errors | ESLint errors | `lint.errors: N` with count |
254
+ | Mixed failures | Multiple issues | All failures reported |
255
+ | Timeout | Hanging tests | Error response with timeout |
256
+
257
+ ---
258
+
259
+ ## Integration Points
260
+
261
+ - **Trigger**: Main agent needs verification
262
+ - **Input**: Verification config from project
263
+ - **Output**: Structured JSON results
264
+ - **Consumer**: Main agent, stop hook, Ralph mode