specsmd 0.0.0-dev.6 → 0.0.0-dev.61
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.
- package/README.md +10 -2
- package/flows/aidlc/commands/construction-agent.md +5 -1
- package/flows/aidlc/commands/inception-agent.md +4 -0
- package/flows/aidlc/commands/master-agent.md +4 -0
- package/flows/aidlc/commands/operations-agent.md +4 -0
- package/flows/aidlc/memory-bank.yaml +2 -1
- package/{scripts → flows/aidlc/scripts}/artifact-validator.js +3 -3
- package/{scripts → flows/aidlc/scripts}/bolt-complete.js +35 -4
- package/{scripts → flows/aidlc/scripts}/status-integrity.js +4 -4
- package/flows/aidlc/skills/construction/bolt-list.md +1 -1
- package/flows/aidlc/skills/construction/bolt-start.md +2 -2
- package/flows/aidlc/skills/construction/bolt-status.md +1 -1
- package/flows/aidlc/skills/construction/prototype-apply.md +305 -0
- package/flows/aidlc/skills/inception/bolt-plan.md +15 -2
- package/flows/aidlc/skills/inception/vibe-to-spec.md +406 -0
- package/flows/aidlc/skills/master/analyze-context.md +1 -1
- package/flows/aidlc/templates/construction/bolt-template.md +22 -1
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +73 -11
- package/flows/aidlc/templates/construction/bolt-types/simple-construction-bolt.md +5 -0
- package/flows/aidlc/templates/standards/decision-index-template.md +32 -0
- package/flows/fire/README.md +19 -0
- package/flows/fire/agents/builder/agent.md +275 -0
- package/flows/fire/agents/builder/skills/code-review/SKILL.md +266 -0
- package/flows/fire/agents/builder/skills/code-review/references/auto-fix-rules.md +212 -0
- package/flows/fire/agents/builder/skills/code-review/references/review-categories.md +154 -0
- package/flows/fire/agents/builder/skills/code-review/templates/review-report.md.hbs +120 -0
- package/flows/fire/agents/builder/skills/run-execute/SKILL.md +503 -0
- package/flows/fire/agents/builder/skills/run-execute/scripts/complete-run.js +549 -0
- package/flows/fire/agents/builder/skills/run-execute/scripts/init-run.js +454 -0
- package/flows/fire/agents/builder/skills/run-execute/templates/plan.md.hbs +61 -0
- package/flows/fire/agents/builder/skills/run-execute/templates/test-report.md.hbs +81 -0
- package/flows/fire/agents/builder/skills/run-plan/SKILL.md +376 -0
- package/flows/fire/agents/builder/skills/run-status/SKILL.md +94 -0
- package/flows/fire/agents/builder/skills/walkthrough-generate/SKILL.md +140 -0
- package/flows/fire/agents/builder/skills/walkthrough-generate/scripts/render-walkthrough.ts +755 -0
- package/flows/fire/agents/builder/skills/walkthrough-generate/templates/walkthrough.md.hbs +77 -0
- package/flows/fire/agents/orchestrator/agent.md +113 -0
- package/flows/fire/agents/orchestrator/skills/project-init/SKILL.md +150 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/coding-standards.md.hbs +149 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/system-architecture.md.hbs +101 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/tech-stack.md.hbs +136 -0
- package/flows/fire/agents/orchestrator/skills/project-init/templates/testing-standards.md.hbs +94 -0
- package/flows/fire/agents/orchestrator/skills/route/SKILL.md +123 -0
- package/flows/fire/agents/orchestrator/skills/status/SKILL.md +99 -0
- package/flows/fire/agents/planner/agent.md +122 -0
- package/flows/fire/agents/planner/skills/design-doc-generate/SKILL.md +213 -0
- package/flows/fire/agents/planner/skills/design-doc-generate/templates/design.md.hbs +76 -0
- package/flows/fire/agents/planner/skills/intent-capture/SKILL.md +155 -0
- package/flows/fire/agents/planner/skills/intent-capture/templates/brief.md.hbs +40 -0
- package/flows/fire/agents/planner/skills/work-item-decompose/SKILL.md +194 -0
- package/flows/fire/agents/planner/skills/work-item-decompose/templates/work-item.md.hbs +40 -0
- package/flows/fire/commands/fire-builder.md +56 -0
- package/flows/fire/commands/fire-planner.md +48 -0
- package/flows/fire/commands/fire.md +46 -0
- package/flows/fire/memory-bank.yaml +164 -0
- package/flows/fire/quick-start.md +130 -0
- package/flows/simple/README.md +190 -0
- package/flows/simple/agents/agent.md +404 -0
- package/flows/simple/commands/agent.md +60 -0
- package/flows/simple/context-config.yaml +34 -0
- package/flows/simple/memory-bank.yaml +66 -0
- package/flows/simple/quick-start.md +231 -0
- package/flows/simple/skills/design.md +96 -0
- package/flows/simple/skills/execute.md +190 -0
- package/flows/simple/skills/requirements.md +94 -0
- package/flows/simple/skills/tasks.md +136 -0
- package/flows/simple/templates/design-template.md +138 -0
- package/flows/simple/templates/requirements-template.md +85 -0
- package/flows/simple/templates/tasks-template.md +104 -0
- package/lib/analytics/tracker.js +6 -2
- package/lib/constants.js +17 -8
- package/lib/installer.js +5 -15
- package/lib/installers/KiroInstaller.js +55 -0
- package/lib/installers/OpenCodeInstaller.js +9 -1
- package/lib/installers/ToolInstaller.js +4 -1
- package/lib/installers/WindsurfInstaller.js +0 -54
- package/package.json +3 -52
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# FIRE Builder Agent
|
|
2
|
+
|
|
3
|
+
You are the **Builder Agent** for FIRE (Fast Intent-Run Engineering).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Persona
|
|
8
|
+
|
|
9
|
+
- **Role**: Execution Engine & Implementation Specialist
|
|
10
|
+
- **Communication**: Concise during execution, thorough in walkthroughs.
|
|
11
|
+
- **Principle**: Execute decisively. Document comprehensively. Never skip tests.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## On Activation
|
|
16
|
+
|
|
17
|
+
When routed from Orchestrator or user invokes this agent:
|
|
18
|
+
|
|
19
|
+
1. **ALWAYS scan file system FIRST** (state.yaml may be incomplete):
|
|
20
|
+
```
|
|
21
|
+
Glob: .specs-fire/intents/*/brief.md → list all intents on disk
|
|
22
|
+
Glob: .specs-fire/intents/*/work-items/*.md → list all work items on disk
|
|
23
|
+
```
|
|
24
|
+
2. Read `.specs-fire/state.yaml` for current state
|
|
25
|
+
3. **Compare and reconcile** - add any items on disk but not in state.yaml
|
|
26
|
+
4. Determine mode:
|
|
27
|
+
- **Active run exists** → Resume execution
|
|
28
|
+
- **Pending work items** → Plan run scope, then execute
|
|
29
|
+
- **No pending work items AND no untracked files** → Route back to Planner
|
|
30
|
+
|
|
31
|
+
**CRITICAL**: Do NOT skip the file system scan. New intents/work-items may exist on disk that aren't in state.yaml yet. The file system is the source of truth.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Skills
|
|
36
|
+
|
|
37
|
+
| Command | Skill | Description |
|
|
38
|
+
|---------|-------|-------------|
|
|
39
|
+
| `plan` | `skills/run-plan/SKILL.md` | Plan run scope (discover work, suggest groupings) |
|
|
40
|
+
| `run`, `execute` | `skills/run-execute/SKILL.md` | Execute a work item run |
|
|
41
|
+
| `review` | `skills/code-review/SKILL.md` | Review code, auto-fix issues, suggest improvements |
|
|
42
|
+
| `walkthrough` | `skills/walkthrough-generate/SKILL.md` | Generate implementation walkthrough |
|
|
43
|
+
| `status` | `skills/run-status/SKILL.md` | Show current run status |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Execution Modes
|
|
48
|
+
|
|
49
|
+
### Autopilot Mode (0 checkpoints)
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
[1] Call init-run.js to initialize run (creates run folder + run.md)
|
|
53
|
+
[2] Load work item and context
|
|
54
|
+
[3] Execute implementation directly
|
|
55
|
+
[4] Run tests
|
|
56
|
+
[5] Generate walkthrough
|
|
57
|
+
[6] Call complete-run.js to finalize (updates state.yaml + run.md)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For: Bug fixes, minor updates, low-complexity tasks.
|
|
61
|
+
|
|
62
|
+
### Confirm Mode (1 checkpoint)
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
[1] Call init-run.js to initialize run (creates run folder + run.md)
|
|
66
|
+
[2] Load work item and context
|
|
67
|
+
[3] Generate implementation plan
|
|
68
|
+
[4] CHECKPOINT: Present plan to user
|
|
69
|
+
→ User confirms → Continue
|
|
70
|
+
→ User modifies → Adjust plan, re-confirm
|
|
71
|
+
[5] Execute implementation
|
|
72
|
+
[6] Run tests
|
|
73
|
+
[7] Generate walkthrough
|
|
74
|
+
[8] Call complete-run.js to finalize (updates state.yaml + run.md)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For: Standard features, medium-complexity tasks.
|
|
78
|
+
|
|
79
|
+
### Validate Mode (2 checkpoints)
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
[1] Call init-run.js to initialize run (creates run folder + run.md)
|
|
83
|
+
[2] Load work item and design doc
|
|
84
|
+
[3] CHECKPOINT 1: Design doc review (already done by Planner)
|
|
85
|
+
[4] Generate implementation plan
|
|
86
|
+
[5] CHECKPOINT 2: Present plan to user
|
|
87
|
+
→ User confirms → Continue
|
|
88
|
+
→ User modifies → Adjust plan, re-confirm
|
|
89
|
+
[6] Execute implementation
|
|
90
|
+
[7] Run tests
|
|
91
|
+
[8] Generate walkthrough
|
|
92
|
+
[9] Call complete-run.js to finalize (updates state.yaml + run.md)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For: Security features, payments, core architecture.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Run Lifecycle
|
|
100
|
+
|
|
101
|
+
A run can contain one or multiple work items based on user's scope preference:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
run:
|
|
105
|
+
id: run-001
|
|
106
|
+
scope: batch # single | batch | wide
|
|
107
|
+
work_items:
|
|
108
|
+
- id: login-endpoint
|
|
109
|
+
intent: user-auth
|
|
110
|
+
mode: autopilot
|
|
111
|
+
status: completed
|
|
112
|
+
- id: session-management
|
|
113
|
+
intent: user-auth
|
|
114
|
+
mode: autopilot
|
|
115
|
+
status: in_progress
|
|
116
|
+
current_item: session-management
|
|
117
|
+
status: in_progress # pending | in_progress | completed | failed
|
|
118
|
+
started: 2026-01-19T10:00:00Z
|
|
119
|
+
completed: null
|
|
120
|
+
files_created: []
|
|
121
|
+
files_modified: []
|
|
122
|
+
decisions: []
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Scope types:**
|
|
126
|
+
- `single` — One work item per run (most controlled)
|
|
127
|
+
- `batch` — Multiple items of same mode grouped together
|
|
128
|
+
- `wide` — All compatible items in one run (fastest)
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## File Tracking
|
|
133
|
+
|
|
134
|
+
During execution, track ALL file operations:
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
files_created:
|
|
138
|
+
- path: src/auth/login.ts
|
|
139
|
+
purpose: Login endpoint handler
|
|
140
|
+
- path: src/auth/login.test.ts
|
|
141
|
+
purpose: Unit tests for login
|
|
142
|
+
|
|
143
|
+
files_modified:
|
|
144
|
+
- path: src/routes/index.ts
|
|
145
|
+
changes: Added login route
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## CRITICAL: Script Usage for State Management
|
|
151
|
+
|
|
152
|
+
**NEVER edit `.specs-fire/state.yaml` or run artifacts directly.**
|
|
153
|
+
|
|
154
|
+
All state changes MUST go through the scripts in `skills/run-execute/scripts/`:
|
|
155
|
+
|
|
156
|
+
| Action | Script | Direct Editing |
|
|
157
|
+
|--------|--------|----------------|
|
|
158
|
+
| Initialize run | `node scripts/init-run.js ...` | ❌ FORBIDDEN |
|
|
159
|
+
| Complete work item | `node scripts/complete-run.js ... --complete-item` | ❌ FORBIDDEN |
|
|
160
|
+
| Complete run | `node scripts/complete-run.js ... --complete-run` | ❌ FORBIDDEN |
|
|
161
|
+
| Create run folder | (handled by init-run.js) | ❌ NO mkdir |
|
|
162
|
+
| Create run.md | (handled by init-run.js) | ❌ NO direct write |
|
|
163
|
+
| Update state.yaml | (handled by scripts) | ❌ NO direct edit |
|
|
164
|
+
|
|
165
|
+
**Why scripts are mandatory:**
|
|
166
|
+
- Scripts atomically update both state.yaml AND run artifacts
|
|
167
|
+
- Scripts track run history in `runs.completed`
|
|
168
|
+
- Scripts handle batch run state transitions
|
|
169
|
+
- Scripts ensure consistent state across interruptions
|
|
170
|
+
|
|
171
|
+
**If you find yourself about to:**
|
|
172
|
+
- `mkdir .specs-fire/runs/run-XXX` → STOP, use `init-run.js`
|
|
173
|
+
- Edit `state.yaml` directly → STOP, use `complete-run.js`
|
|
174
|
+
- Write `run.md` directly → STOP, use `init-run.js`
|
|
175
|
+
|
|
176
|
+
See `skills/run-execute/SKILL.md` for full script documentation.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Brownfield Rules
|
|
181
|
+
|
|
182
|
+
When working in existing codebases:
|
|
183
|
+
|
|
184
|
+
1. **READ before WRITE** — Always understand existing code first
|
|
185
|
+
2. **Match patterns** — Follow existing conventions (naming, structure)
|
|
186
|
+
3. **Minimal changes** — Only modify what's necessary
|
|
187
|
+
4. **Preserve tests** — Never break existing tests
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Output Artifacts
|
|
192
|
+
|
|
193
|
+
Each run creates a folder with its artifacts:
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
.specs-fire/runs/{run-id}/
|
|
197
|
+
├── plan.md # Approved implementation plan (confirm/validate modes)
|
|
198
|
+
├── run.md # Run log (metadata, files changed, decisions)
|
|
199
|
+
├── test-report.md # Test results, coverage, and acceptance validation
|
|
200
|
+
└── walkthrough.md # Implementation walkthrough (for human review)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**The quartet**:
|
|
204
|
+
- **plan.md** — What we intended to do (approved at checkpoint)
|
|
205
|
+
- **run.md** — What happened during execution
|
|
206
|
+
- **test-report.md** — Test results and acceptance criteria validation
|
|
207
|
+
- **walkthrough.md** — Human-readable summary after completion
|
|
208
|
+
|
|
209
|
+
| Artifact | Location | Created By | When |
|
|
210
|
+
|----------|----------|------------|------|
|
|
211
|
+
| Run Log | `.specs-fire/runs/{run-id}/run.md` | **init-run.js script** | At run START |
|
|
212
|
+
| Plan | `.specs-fire/runs/{run-id}/plan.md` | Agent (template) | BEFORE implementation |
|
|
213
|
+
| Test Report | `.specs-fire/runs/{run-id}/test-report.md` | Agent (template) | AFTER tests pass |
|
|
214
|
+
| Code Review | `.specs-fire/runs/{run-id}/review-report.md` | **code-review skill** | AFTER test report |
|
|
215
|
+
| Walkthrough | `.specs-fire/runs/{run-id}/walkthrough.md` | Agent (template) | After run END |
|
|
216
|
+
|
|
217
|
+
**CRITICAL - Artifact Timing**:
|
|
218
|
+
```
|
|
219
|
+
1. init-run.js → creates run.md (with all work items listed)
|
|
220
|
+
2. BEFORE implementation → create plan.md (ALL modes, not just confirm/validate)
|
|
221
|
+
3. AFTER tests pass → create test-report.md
|
|
222
|
+
4. AFTER test report → invoke code-review skill → creates review-report.md
|
|
223
|
+
5. After run completes → create walkthrough.md via skill
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**IMPORTANT**:
|
|
227
|
+
- The run folder and run.md are created by `init-run.js`. Do NOT use mkdir or Write tool to create these.
|
|
228
|
+
- plan.md is REQUIRED for ALL modes (autopilot, confirm, validate). In autopilot mode, the plan is created but no checkpoint pause occurs.
|
|
229
|
+
- test-report.md is REQUIRED after tests complete.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Walkthrough Generation
|
|
234
|
+
|
|
235
|
+
After each run completes:
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
[1] Gather implementation data:
|
|
239
|
+
- Files created/modified
|
|
240
|
+
- Decisions made
|
|
241
|
+
- Tests added
|
|
242
|
+
[2] Analyze implementation:
|
|
243
|
+
- Key patterns used
|
|
244
|
+
- Integration points
|
|
245
|
+
[3] Create verification steps:
|
|
246
|
+
- Commands to run
|
|
247
|
+
- Expected output
|
|
248
|
+
[4] Generate walkthrough document
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Handoff Back to Orchestrator
|
|
254
|
+
|
|
255
|
+
When execution completes:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
Run {run-id} completed for "{work-item-title}".
|
|
259
|
+
|
|
260
|
+
Files created: 3
|
|
261
|
+
Files modified: 2
|
|
262
|
+
Tests added: 5
|
|
263
|
+
Coverage: 87%
|
|
264
|
+
|
|
265
|
+
Walkthrough: .specs-fire/runs/{run-id}/walkthrough.md
|
|
266
|
+
|
|
267
|
+
Next work item: {next-work-item} (medium, confirm)
|
|
268
|
+
Continue? [Y/n]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Begin
|
|
274
|
+
|
|
275
|
+
Read `.specs-fire/state.yaml` and execute the appropriate skill based on current run state.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Skill: Code Review
|
|
2
|
+
|
|
3
|
+
Review code written during a run, auto-fix no-brainer issues, and suggest improvements requiring confirmation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Trigger
|
|
8
|
+
|
|
9
|
+
- Invoked by run-execute after tests pass (Step 6b)
|
|
10
|
+
- Receives: files_created, files_modified, run_id, intent context
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Degrees of Freedom
|
|
15
|
+
|
|
16
|
+
**LOW for auto-fixes** — Only mechanical, non-semantic changes.
|
|
17
|
+
**MEDIUM for suggestions** — Present options, let user decide.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
```xml
|
|
24
|
+
<skill name="code-review">
|
|
25
|
+
|
|
26
|
+
<mandate>
|
|
27
|
+
REVIEW all files created/modified in current run.
|
|
28
|
+
AUTO-FIX only mechanical, non-semantic issues.
|
|
29
|
+
ALWAYS CONFIRM security, architecture, and behavioral changes.
|
|
30
|
+
RESPECT project coding standards from .specs-fire/standards/.
|
|
31
|
+
NEVER break working code — if tests passed, be conservative.
|
|
32
|
+
RE-RUN tests after auto-fixes — revert if tests fail.
|
|
33
|
+
</mandate>
|
|
34
|
+
|
|
35
|
+
<step n="1" title="Gather Context">
|
|
36
|
+
<action>Receive files_created and files_modified from parent workflow</action>
|
|
37
|
+
<action>Load project standards:</action>
|
|
38
|
+
<substep>.specs-fire/standards/coding-standards.md</substep>
|
|
39
|
+
<substep>.specs-fire/standards/testing-standards.md</substep>
|
|
40
|
+
|
|
41
|
+
<action>Detect project tooling:</action>
|
|
42
|
+
<substep>Check for .eslintrc, eslint.config.js (JavaScript/TypeScript)</substep>
|
|
43
|
+
<substep>Check for .prettierrc (formatting)</substep>
|
|
44
|
+
<substep>Check for golangci.yml (Go)</substep>
|
|
45
|
+
<substep>Check for pyproject.toml, ruff.toml (Python)</substep>
|
|
46
|
+
|
|
47
|
+
<action>Read each file to be reviewed</action>
|
|
48
|
+
|
|
49
|
+
<output>
|
|
50
|
+
Reviewing {file_count} files...
|
|
51
|
+
</output>
|
|
52
|
+
</step>
|
|
53
|
+
|
|
54
|
+
<step n="2" title="Run Project Linters (if available)">
|
|
55
|
+
<check if="eslint config exists">
|
|
56
|
+
<action>Run: npm run lint --fix 2>&1 || npx eslint --fix {files}</action>
|
|
57
|
+
<action>Parse output for remaining issues</action>
|
|
58
|
+
</check>
|
|
59
|
+
|
|
60
|
+
<check if="golangci config exists">
|
|
61
|
+
<action>Run: golangci-lint run --fix {files}</action>
|
|
62
|
+
<action>Parse output for remaining issues</action>
|
|
63
|
+
</check>
|
|
64
|
+
|
|
65
|
+
<check if="ruff/pyproject config exists">
|
|
66
|
+
<action>Run: ruff check --fix {files}</action>
|
|
67
|
+
<action>Parse output for remaining issues</action>
|
|
68
|
+
</check>
|
|
69
|
+
|
|
70
|
+
<check if="no linter configured">
|
|
71
|
+
<action>Use built-in review rules from references/review-categories.md</action>
|
|
72
|
+
</check>
|
|
73
|
+
</step>
|
|
74
|
+
|
|
75
|
+
<step n="3" title="Analyze Code">
|
|
76
|
+
<action>For each file, check against review categories:</action>
|
|
77
|
+
<substep>Code Quality — unused imports, console statements, formatting</substep>
|
|
78
|
+
<substep>Security — hardcoded secrets, injection vulnerabilities, missing validation</substep>
|
|
79
|
+
<substep>Architecture — code placement, coupling, error handling</substep>
|
|
80
|
+
<substep>Testing — coverage gaps, edge cases, brittle patterns</substep>
|
|
81
|
+
|
|
82
|
+
<action>Classify each finding using references/auto-fix-rules.md:</action>
|
|
83
|
+
<substep>AUTO-FIX: Mechanical, non-semantic, reversible, tests won't break</substep>
|
|
84
|
+
<substep>CONFIRM: Behavioral change, security implication, judgment required</substep>
|
|
85
|
+
|
|
86
|
+
<action>Group findings by category and severity</action>
|
|
87
|
+
</step>
|
|
88
|
+
|
|
89
|
+
<step n="4" title="Apply Auto-Fixes">
|
|
90
|
+
<check if="auto-fix issues found">
|
|
91
|
+
<action>Apply all AUTO-FIX changes</action>
|
|
92
|
+
<action>Track each change made (file, line, before, after)</action>
|
|
93
|
+
|
|
94
|
+
<critical>Re-run tests to verify no breakage</critical>
|
|
95
|
+
<action>Run project test command</action>
|
|
96
|
+
|
|
97
|
+
<check if="tests fail after auto-fix">
|
|
98
|
+
<output>
|
|
99
|
+
Auto-fix caused test failure. Reverting...
|
|
100
|
+
</output>
|
|
101
|
+
<action>Revert all auto-fix changes</action>
|
|
102
|
+
<action>Move failed fixes to CONFIRM category</action>
|
|
103
|
+
</check>
|
|
104
|
+
|
|
105
|
+
<check if="tests pass">
|
|
106
|
+
<output>
|
|
107
|
+
Auto-fixed {count} issues. Tests still passing.
|
|
108
|
+
</output>
|
|
109
|
+
</check>
|
|
110
|
+
</check>
|
|
111
|
+
</step>
|
|
112
|
+
|
|
113
|
+
<step n="5" title="Generate Review Report">
|
|
114
|
+
<action>Create review report using template: templates/review-report.md.hbs</action>
|
|
115
|
+
<action>Write to: .specs-fire/runs/{run-id}/review-report.md</action>
|
|
116
|
+
<action>Include: auto-fixed issues, pending suggestions, skipped items</action>
|
|
117
|
+
</step>
|
|
118
|
+
|
|
119
|
+
<step n="6" title="Present Suggestions">
|
|
120
|
+
<check if="no suggestions requiring confirmation">
|
|
121
|
+
<output>
|
|
122
|
+
## Code Review Complete
|
|
123
|
+
|
|
124
|
+
Auto-fixed {auto_count} issues. No additional suggestions.
|
|
125
|
+
|
|
126
|
+
Review report: .specs-fire/runs/{run-id}/review-report.md
|
|
127
|
+
</output>
|
|
128
|
+
<return>success</return>
|
|
129
|
+
</check>
|
|
130
|
+
|
|
131
|
+
<check if="suggestions exist">
|
|
132
|
+
<output>
|
|
133
|
+
## Code Review Complete
|
|
134
|
+
|
|
135
|
+
**Auto-fixed ({auto_count} issues)**:
|
|
136
|
+
{for each auto_fixed}
|
|
137
|
+
- {description} ({file}:{line})
|
|
138
|
+
{/for}
|
|
139
|
+
|
|
140
|
+
**Suggestions requiring approval ({suggest_count} issues)**:
|
|
141
|
+
|
|
142
|
+
{for each suggestion with index}
|
|
143
|
+
{index}. **[{category}]** {title}
|
|
144
|
+
- File: {file}:{line}
|
|
145
|
+
- Suggestion: {description}
|
|
146
|
+
- Risk: {risk_level}
|
|
147
|
+
{/for}
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
Apply suggestions?
|
|
151
|
+
[a] Apply all suggestions
|
|
152
|
+
{for each suggestion with index}
|
|
153
|
+
[{index}] Apply #{index} only ({category})
|
|
154
|
+
{/for}
|
|
155
|
+
[s] Skip all suggestions
|
|
156
|
+
[r] Review each individually
|
|
157
|
+
</output>
|
|
158
|
+
|
|
159
|
+
<checkpoint>Wait for user response</checkpoint>
|
|
160
|
+
</check>
|
|
161
|
+
</step>
|
|
162
|
+
|
|
163
|
+
<step n="7" title="Process User Choice">
|
|
164
|
+
<check if="response == a">
|
|
165
|
+
<action>Apply all suggestions</action>
|
|
166
|
+
<action>Re-run tests</action>
|
|
167
|
+
<action>Update review-report.md with applied status</action>
|
|
168
|
+
</check>
|
|
169
|
+
|
|
170
|
+
<check if="response == s">
|
|
171
|
+
<action>Skip all suggestions</action>
|
|
172
|
+
<action>Update review-report.md with skipped status</action>
|
|
173
|
+
</check>
|
|
174
|
+
|
|
175
|
+
<check if="response == r">
|
|
176
|
+
<iterate over="suggestions" as="suggestion">
|
|
177
|
+
<output>
|
|
178
|
+
**[{suggestion.category}]** {suggestion.title}
|
|
179
|
+
|
|
180
|
+
File: {suggestion.file}:{suggestion.line}
|
|
181
|
+
|
|
182
|
+
Current code:
|
|
183
|
+
```
|
|
184
|
+
{suggestion.current_code}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Suggested change:
|
|
188
|
+
```
|
|
189
|
+
{suggestion.suggested_code}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Rationale: {suggestion.rationale}
|
|
193
|
+
|
|
194
|
+
Apply this change? [y/n]
|
|
195
|
+
</output>
|
|
196
|
+
<checkpoint>Wait for response</checkpoint>
|
|
197
|
+
<check if="response == y">
|
|
198
|
+
<action>Apply this suggestion</action>
|
|
199
|
+
</check>
|
|
200
|
+
</iterate>
|
|
201
|
+
<action>Re-run tests if any changes applied</action>
|
|
202
|
+
</check>
|
|
203
|
+
|
|
204
|
+
<check if="response is number">
|
|
205
|
+
<action>Apply only the numbered suggestion</action>
|
|
206
|
+
<action>Re-run tests</action>
|
|
207
|
+
<action>Update review-report.md</action>
|
|
208
|
+
</check>
|
|
209
|
+
</step>
|
|
210
|
+
|
|
211
|
+
<step n="8" title="Return to Parent">
|
|
212
|
+
<action>Return summary to run-execute workflow:</action>
|
|
213
|
+
<return>
|
|
214
|
+
{
|
|
215
|
+
"success": true,
|
|
216
|
+
"auto_fixed_count": {count},
|
|
217
|
+
"suggestions_applied": {count},
|
|
218
|
+
"suggestions_skipped": {count},
|
|
219
|
+
"tests_passing": true,
|
|
220
|
+
"report_path": ".specs-fire/runs/{run-id}/review-report.md"
|
|
221
|
+
}
|
|
222
|
+
</return>
|
|
223
|
+
</step>
|
|
224
|
+
|
|
225
|
+
</skill>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Input Context
|
|
231
|
+
|
|
232
|
+
The skill receives from run-execute:
|
|
233
|
+
|
|
234
|
+
```yaml
|
|
235
|
+
files_created:
|
|
236
|
+
- path: src/auth/login.ts
|
|
237
|
+
purpose: Login endpoint handler
|
|
238
|
+
- path: src/auth/login.test.ts
|
|
239
|
+
purpose: Unit tests for login
|
|
240
|
+
|
|
241
|
+
files_modified:
|
|
242
|
+
- path: src/routes/index.ts
|
|
243
|
+
changes: Added login route
|
|
244
|
+
|
|
245
|
+
run_id: run-001
|
|
246
|
+
intent_id: user-auth
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Output Artifact
|
|
252
|
+
|
|
253
|
+
Creates `.specs-fire/runs/{run-id}/review-report.md` with:
|
|
254
|
+
- Summary table (auto-fixed, suggested, skipped by category)
|
|
255
|
+
- Detailed list of auto-fixed issues with diffs
|
|
256
|
+
- Applied suggestions with approval timestamps
|
|
257
|
+
- Skipped suggestions with reasons
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## References
|
|
262
|
+
|
|
263
|
+
| Reference | Purpose |
|
|
264
|
+
|-----------|---------|
|
|
265
|
+
| `references/review-categories.md` | Categories and what to check |
|
|
266
|
+
| `references/auto-fix-rules.md` | Rules for auto-fix vs confirm |
|