specsmd 0.0.0-dev.60 → 0.0.0-dev.62

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.
@@ -38,6 +38,7 @@ When routed from Orchestrator or user invokes this agent:
38
38
  |---------|-------|-------------|
39
39
  | `plan` | `skills/run-plan/SKILL.md` | Plan run scope (discover work, suggest groupings) |
40
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 |
41
42
  | `walkthrough` | `skills/walkthrough-generate/SKILL.md` | Generate implementation walkthrough |
42
43
  | `status` | `skills/run-status/SKILL.md` | Show current run status |
43
44
 
@@ -210,6 +211,7 @@ Each run creates a folder with its artifacts:
210
211
  | Run Log | `.specs-fire/runs/{run-id}/run.md` | **init-run.js script** | At run START |
211
212
  | Plan | `.specs-fire/runs/{run-id}/plan.md` | Agent (template) | BEFORE implementation |
212
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 |
213
215
  | Walkthrough | `.specs-fire/runs/{run-id}/walkthrough.md` | Agent (template) | After run END |
214
216
 
215
217
  **CRITICAL - Artifact Timing**:
@@ -217,7 +219,8 @@ Each run creates a folder with its artifacts:
217
219
  1. init-run.js → creates run.md (with all work items listed)
218
220
  2. BEFORE implementation → create plan.md (ALL modes, not just confirm/validate)
219
221
  3. AFTER tests pass → create test-report.md
220
- 4. After run completescreate walkthrough.md via skill
222
+ 4. AFTER test reportinvoke code-review skill → creates review-report.md
223
+ 5. After run completes → create walkthrough.md via skill
221
224
  ```
222
225
 
223
226
  **IMPORTANT**:
@@ -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 |
@@ -0,0 +1,212 @@
1
+ # Auto-Fix Rules
2
+
3
+ This reference defines the criteria for determining whether an issue can be auto-fixed or requires user confirmation.
4
+
5
+ ---
6
+
7
+ ## Decision Framework
8
+
9
+ ```
10
+ CAN AUTO-FIX if ALL of these are true:
11
+ ├── Change is mechanical (not semantic)
12
+ ├── Change follows existing pattern in codebase
13
+ ├── Change has no functional impact
14
+ ├── Change is universally agreed best practice
15
+ ├── Reverting is trivial if wrong
16
+ └── Tests will still pass (verified after fix)
17
+
18
+ MUST CONFIRM if ANY of these are true:
19
+ ├── Change affects behavior/functionality
20
+ ├── Change requires judgment call
21
+ ├── Change involves security implications
22
+ ├── Change affects public API
23
+ ├── Multiple valid approaches exist
24
+ ├── Change is significant (>10 lines affected)
25
+ └── Change could break dependent code
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Auto-Fix Criteria by Category
31
+
32
+ ### 1. Removal Operations (SAFE)
33
+
34
+ These can be auto-fixed because removal of unused code has no functional impact:
35
+
36
+ | Operation | Criteria | Safe Because |
37
+ |-----------|----------|--------------|
38
+ | Remove unused import | Import not referenced anywhere | No runtime effect |
39
+ | Remove unused variable | Variable never read | No runtime effect |
40
+ | Remove console.log | Debug statement | No production effect |
41
+ | Remove console.debug | Debug statement | No production effect |
42
+ | Remove debugger | Debug statement | No production effect |
43
+ | Remove trailing whitespace | Whitespace only | No code effect |
44
+ | Remove empty lines (excess) | >2 consecutive blank lines | Formatting only |
45
+
46
+ ### 2. Formatting Operations (SAFE)
47
+
48
+ These can be auto-fixed because they don't change semantics:
49
+
50
+ | Operation | Criteria | Safe Because |
51
+ |-----------|----------|--------------|
52
+ | Sort imports | Reorder import statements | No runtime effect |
53
+ | Standardize quotes | Use project's quote style | String value unchanged |
54
+ | Add missing semicolons | Project uses semicolons | Parser handles both |
55
+ | Fix indentation | Match project indent style | Whitespace only |
56
+ | Add trailing newline | File doesn't end with newline | POSIX standard |
57
+
58
+ ### 3. Simple Substitutions (SAFE with verification)
59
+
60
+ These can be auto-fixed but require test verification:
61
+
62
+ | Operation | Criteria | Verify |
63
+ |-----------|----------|--------|
64
+ | `var` → `const` | Variable never reassigned | Run tests |
65
+ | `var` → `let` | Variable is reassigned | Run tests |
66
+ | `==` → `===` | Comparing same types | Run tests |
67
+ | `!=` → `!==` | Comparing same types | Run tests |
68
+
69
+ ---
70
+
71
+ ## Must-Confirm Criteria
72
+
73
+ ### 1. Behavioral Changes
74
+
75
+ Any change that could affect runtime behavior:
76
+
77
+ | Change | Why Confirm |
78
+ |--------|-------------|
79
+ | Add null check | Changes control flow |
80
+ | Add try/catch | Changes error handling |
81
+ | Add validation | May reject valid input |
82
+ | Change function signature | Affects callers |
83
+ | Add/remove async | Changes execution model |
84
+ | Modify return value | Affects callers |
85
+
86
+ ### 2. Security Changes
87
+
88
+ All security-related changes require confirmation:
89
+
90
+ | Change | Why Confirm |
91
+ |--------|-------------|
92
+ | Add input validation | May have false positives |
93
+ | Add authentication | May break intended access |
94
+ | Add authorization | May be too restrictive |
95
+ | Change crypto | May have compatibility issues |
96
+ | Add rate limiting | May affect legitimate users |
97
+
98
+ ### 3. Architectural Changes
99
+
100
+ Changes affecting code structure:
101
+
102
+ | Change | Why Confirm |
103
+ |--------|-------------|
104
+ | Extract function | Multiple valid ways |
105
+ | Move code to different file | Affects imports |
106
+ | Add abstraction layer | Judgment on necessity |
107
+ | Change dependency injection | Affects instantiation |
108
+ | Modify error propagation | Affects error handling chain |
109
+
110
+ ### 4. Size Threshold
111
+
112
+ Changes affecting many lines:
113
+
114
+ | Threshold | Action |
115
+ |-----------|--------|
116
+ | 1-5 lines | Can auto-fix if mechanical |
117
+ | 6-10 lines | Prefer confirmation |
118
+ | >10 lines | Must confirm |
119
+
120
+ ---
121
+
122
+ ## Rollback Protocol
123
+
124
+ If auto-fix causes test failure:
125
+
126
+ ```
127
+ 1. Immediately revert ALL auto-fix changes
128
+ 2. Move the fix to CONFIRM category
129
+ 3. Report: "Auto-fix for X caused test failure, moved to suggestions"
130
+ 4. Continue with remaining auto-fixes
131
+ 5. Re-run tests after each batch
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Project-Specific Overrides
137
+
138
+ The project can customize auto-fix behavior in `.specs-fire/standards/coding-standards.md`:
139
+
140
+ ```yaml
141
+ # In coding-standards.md frontmatter
142
+ auto_fix:
143
+ allow:
144
+ - unused_imports
145
+ - console_statements
146
+ - trailing_whitespace
147
+ deny:
148
+ - quote_style # Team prefers manual control
149
+ - semicolons # Mixed codebase
150
+
151
+ # Custom patterns to auto-remove
152
+ remove_patterns:
153
+ - "// TODO: remove"
154
+ - "// DEBUG"
155
+ ```
156
+
157
+ If `auto_fix` section exists, respect project preferences.
158
+ If not specified, use default rules from this document.
159
+
160
+ ---
161
+
162
+ ## Examples
163
+
164
+ ### Auto-Fix Example
165
+
166
+ **Before:**
167
+ ```javascript
168
+ import { unused } from './module'; // unused import
169
+ import { used } from './other';
170
+
171
+ function process() {
172
+ console.log('debug'); // debug statement
173
+ const result = used();
174
+ return result;
175
+ }
176
+ ```
177
+
178
+ **After (auto-fixed):**
179
+ ```javascript
180
+ import { used } from './other';
181
+
182
+ function process() {
183
+ const result = used();
184
+ return result;
185
+ }
186
+ ```
187
+
188
+ **Report:**
189
+ - Removed unused import `unused` from `./module`
190
+ - Removed console.log statement
191
+
192
+ ### Confirm Example
193
+
194
+ **Issue Detected:**
195
+ ```javascript
196
+ function getUser(id) {
197
+ return db.query(`SELECT * FROM users WHERE id = ${id}`);
198
+ }
199
+ ```
200
+
201
+ **Suggested Fix:**
202
+ ```javascript
203
+ function getUser(id) {
204
+ return db.query('SELECT * FROM users WHERE id = ?', [id]);
205
+ }
206
+ ```
207
+
208
+ **Why Confirm:**
209
+ - Security fix (SQL injection)
210
+ - Changes how query is constructed
211
+ - May have edge cases with ID format
212
+ - Requires understanding of db.query API
@@ -0,0 +1,154 @@
1
+ # Code Review Categories
2
+
3
+ This reference defines what the code-review skill checks for in each category.
4
+
5
+ ---
6
+
7
+ ## 1. Code Quality
8
+
9
+ Issues related to code cleanliness and maintainability.
10
+
11
+ ### Auto-Fixable
12
+
13
+ | Issue | Detection | Fix |
14
+ |-------|-----------|-----|
15
+ | Unused imports | Import not referenced in file | Remove import |
16
+ | Unused variables | Variable declared but never used | Remove declaration |
17
+ | Console statements | `console.log`, `console.debug`, `print()` | Remove statement |
18
+ | Commented-out code | Large blocks of commented code | Remove comments |
19
+ | Trailing whitespace | Whitespace at end of lines | Trim whitespace |
20
+ | Missing semicolons | JS/TS without semicolons (if project uses them) | Add semicolons |
21
+ | Inconsistent quotes | Mixed single/double quotes | Standardize |
22
+ | Empty blocks | Empty if/else/try/catch with no comment | Add TODO comment |
23
+ | Debugger statements | `debugger` keyword | Remove statement |
24
+
25
+ ### Requires Confirmation
26
+
27
+ | Issue | Detection | Why Confirm |
28
+ |-------|-----------|-------------|
29
+ | Long functions | Function > 50 lines | Requires judgment on how to split |
30
+ | Deep nesting | > 4 levels of nesting | Multiple valid refactoring approaches |
31
+ | Duplicate code | Similar code blocks (>10 lines) | May be intentional |
32
+ | Magic numbers | Hardcoded numbers without context | Need to understand meaning |
33
+ | Complex conditionals | Complex boolean expressions | May need domain knowledge |
34
+
35
+ ---
36
+
37
+ ## 2. Security
38
+
39
+ Issues that could lead to security vulnerabilities.
40
+
41
+ ### Auto-Fixable
42
+
43
+ | Issue | Detection | Fix |
44
+ |-------|-----------|-----|
45
+ | Hardcoded localhost | `localhost` or `127.0.0.1` in production code | Flag but usually intentional |
46
+
47
+ ### Requires Confirmation (ALWAYS)
48
+
49
+ | Issue | Detection | Risk |
50
+ |-------|-----------|------|
51
+ | Hardcoded secrets | API keys, passwords, tokens in code | Critical - secrets exposure |
52
+ | SQL injection | String concatenation in SQL queries | Critical - data breach |
53
+ | XSS vulnerabilities | Unescaped user input in HTML | High - script injection |
54
+ | Command injection | User input in shell commands | Critical - RCE |
55
+ | Path traversal | User input in file paths | High - unauthorized access |
56
+ | Missing input validation | User input used without validation | Medium - various attacks |
57
+ | Insecure crypto | Weak algorithms (MD5, SHA1 for passwords) | High - broken encryption |
58
+ | CORS misconfiguration | `Access-Control-Allow-Origin: *` | Medium - CSRF |
59
+ | Missing auth checks | Endpoints without authentication | High - unauthorized access |
60
+ | Sensitive data in logs | PII, passwords logged | Medium - data leak |
61
+
62
+ ---
63
+
64
+ ## 3. Architecture
65
+
66
+ Issues related to code organization and design.
67
+
68
+ ### Auto-Fixable
69
+
70
+ | Issue | Detection | Fix |
71
+ |-------|-----------|-----|
72
+ | Import order | Imports not grouped/sorted | Sort imports |
73
+
74
+ ### Requires Confirmation (ALWAYS)
75
+
76
+ | Issue | Detection | Why Confirm |
77
+ |-------|-----------|-------------|
78
+ | Wrong layer | Business logic in controller, DB in UI | Requires understanding architecture |
79
+ | Missing error handling | No try/catch for async/IO operations | May be intentional propagation |
80
+ | Tight coupling | Direct dependencies on concrete classes | Multiple valid solutions |
81
+ | Missing abstraction | Repeated patterns that could be extracted | Judgment on when to abstract |
82
+ | Circular dependencies | Module A imports B, B imports A | Requires refactoring design |
83
+ | God class/function | Class/function doing too many things | Domain knowledge needed |
84
+ | Inconsistent patterns | Different approaches for same problem | Need to pick canonical approach |
85
+ | Missing logging | No logging for important operations | Need to understand what matters |
86
+ | Synchronous blocking | Blocking calls in async context | May need architecture change |
87
+
88
+ ---
89
+
90
+ ## 4. Testing
91
+
92
+ Issues related to test quality and coverage.
93
+
94
+ ### Auto-Fixable
95
+
96
+ | Issue | Detection | Fix |
97
+ |-------|-----------|-----|
98
+ | Console in tests | `console.log` in test files | Remove statement |
99
+
100
+ ### Requires Confirmation (ALWAYS)
101
+
102
+ | Issue | Detection | Why Confirm |
103
+ |-------|-----------|-------------|
104
+ | Missing tests | New function without corresponding test | Need to understand what to test |
105
+ | Missing edge cases | Tests only cover happy path | Need domain knowledge |
106
+ | Brittle tests | Tests rely on implementation details | Multiple valid approaches |
107
+ | Missing assertions | Test runs but doesn't assert | May be setup test |
108
+ | Test coverage gaps | Lines not covered by tests | Need to prioritize |
109
+ | Flaky test patterns | Random data, timing dependencies | Need to understand intent |
110
+ | Missing error tests | No tests for error conditions | Need to identify error cases |
111
+ | Mock overuse | Everything mocked, no integration | Judgment on test strategy |
112
+
113
+ ---
114
+
115
+ ## Language-Specific Checks
116
+
117
+ ### JavaScript/TypeScript
118
+
119
+ | Issue | Category | Auto-Fix |
120
+ |-------|----------|----------|
121
+ | `var` instead of `let/const` | Quality | Yes |
122
+ | `==` instead of `===` | Quality | Yes (with caution) |
123
+ | Missing `await` | Quality | Confirm |
124
+ | `any` type usage | Quality | Confirm |
125
+ | Missing null checks | Security | Confirm |
126
+
127
+ ### Go
128
+
129
+ | Issue | Category | Auto-Fix |
130
+ |-------|----------|----------|
131
+ | Ignored error returns | Quality | Confirm |
132
+ | Naked returns | Quality | Confirm |
133
+ | Empty interface{} | Quality | Confirm |
134
+ | Missing context | Architecture | Confirm |
135
+
136
+ ### Python
137
+
138
+ | Issue | Category | Auto-Fix |
139
+ |-------|----------|----------|
140
+ | Bare except | Quality | Confirm |
141
+ | Mutable default args | Quality | Confirm |
142
+ | Missing type hints | Quality | Confirm |
143
+ | `import *` | Quality | Yes |
144
+
145
+ ---
146
+
147
+ ## Severity Levels
148
+
149
+ | Level | Description | Action |
150
+ |-------|-------------|--------|
151
+ | **Critical** | Security vulnerability, data loss risk | MUST address |
152
+ | **High** | Significant quality/maintainability issue | SHOULD address |
153
+ | **Medium** | Best practice violation | CONSIDER addressing |
154
+ | **Low** | Minor style/preference issue | OPTIONAL |
@@ -0,0 +1,120 @@
1
+ # Code Review Report
2
+
3
+ **Run**: {{run_id}}
4
+ **Intent**: {{intent_id}}
5
+ **Reviewed**: {{timestamp}}
6
+ **Files Reviewed**: {{files_count}}
7
+
8
+ ---
9
+
10
+ ## Summary
11
+
12
+ | Category | Auto-Fixed | Applied | Skipped |
13
+ |----------|------------|---------|---------|
14
+ | Code Quality | {{quality.auto_fixed}} | {{quality.applied}} | {{quality.skipped}} |
15
+ | Security | {{security.auto_fixed}} | {{security.applied}} | {{security.skipped}} |
16
+ | Architecture | {{architecture.auto_fixed}} | {{architecture.applied}} | {{architecture.skipped}} |
17
+ | Testing | {{testing.auto_fixed}} | {{testing.applied}} | {{testing.skipped}} |
18
+ | **Total** | **{{totals.auto_fixed}}** | **{{totals.applied}}** | **{{totals.skipped}}** |
19
+
20
+ **Tests Status**: {{#if tests_passing}}Passing{{else}}Failed{{/if}}
21
+
22
+ ---
23
+
24
+ ## Files Reviewed
25
+
26
+ {{#each files_reviewed}}
27
+ - `{{path}}` ({{type}})
28
+ {{/each}}
29
+
30
+ ---
31
+
32
+ ## Auto-Fixed Issues
33
+
34
+ {{#if auto_fixed}}
35
+ These issues were automatically fixed (mechanical, non-semantic changes):
36
+
37
+ {{#each auto_fixed}}
38
+ ### {{add @index 1}}. [{{category}}] {{title}}
39
+
40
+ - **File**: `{{file}}:{{line}}`
41
+ - **Description**: {{description}}
42
+ - **Diff**:
43
+
44
+ ```diff
45
+ {{diff}}
46
+ ```
47
+
48
+ {{/each}}
49
+ {{else}}
50
+ No auto-fixes applied.
51
+ {{/if}}
52
+
53
+ ---
54
+
55
+ ## Applied Suggestions
56
+
57
+ {{#if applied}}
58
+ These suggestions were approved and applied:
59
+
60
+ {{#each applied}}
61
+ ### {{add @index 1}}. [{{category}}] {{title}}
62
+
63
+ - **File**: `{{file}}:{{line}}`
64
+ - **Description**: {{description}}
65
+ - **Rationale**: {{rationale}}
66
+ - **Risk Level**: {{risk}}
67
+ - **Approved**: {{approved_at}}
68
+ - **Diff**:
69
+
70
+ ```diff
71
+ {{diff}}
72
+ ```
73
+
74
+ {{/each}}
75
+ {{else}}
76
+ No suggestions were applied.
77
+ {{/if}}
78
+
79
+ ---
80
+
81
+ ## Skipped Suggestions
82
+
83
+ {{#if skipped}}
84
+ These suggestions were identified but not applied:
85
+
86
+ {{#each skipped}}
87
+ ### {{add @index 1}}. [{{category}}] {{title}}
88
+
89
+ - **File**: `{{file}}:{{line}}`
90
+ - **Description**: {{description}}
91
+ - **Rationale**: {{rationale}}
92
+ - **Risk Level**: {{risk}}
93
+ - **Reason Skipped**: {{skip_reason}}
94
+
95
+ {{/each}}
96
+ {{else}}
97
+ No suggestions were skipped.
98
+ {{/if}}
99
+
100
+ ---
101
+
102
+ ## Project Tooling Used
103
+
104
+ {{#if linters_used}}
105
+ The following project linters were detected and used:
106
+
107
+ {{#each linters_used}}
108
+ - **{{name}}**: {{config_file}}
109
+ {{/each}}
110
+ {{else}}
111
+ No project linters detected. Used built-in review rules.
112
+ {{/if}}
113
+
114
+ ---
115
+
116
+ ## Standards Referenced
117
+
118
+ {{#each standards_loaded}}
119
+ - `{{path}}`
120
+ {{/each}}
@@ -285,6 +285,52 @@ For runs with multiple work items:
285
285
  </output>
286
286
  </step>
287
287
 
288
+ <step n="6b" title="Code Review">
289
+ <critical>ALWAYS run code review after tests pass</critical>
290
+ <output>Running code review...</output>
291
+
292
+ <action>Invoke code-review skill with context:</action>
293
+ <code>
294
+ invoke-skill: code-review
295
+ context:
296
+ files_created: {files_created}
297
+ files_modified: {files_modified}
298
+ run_id: {run_id}
299
+ intent_id: {intent_id}
300
+ </code>
301
+
302
+ <invoke-skill>code-review</invoke-skill>
303
+
304
+ <note>
305
+ Code review skill will:
306
+ 1. Review all files created/modified in this work item
307
+ 2. Auto-fix no-brainer issues (unused imports, console.log, etc.)
308
+ 3. Present suggestions requiring approval
309
+ 4. Create review-report.md artifact
310
+ </note>
311
+
312
+ <check if="code-review returns suggestions">
313
+ <note>User interaction happens within code-review skill</note>
314
+ <action>Wait for code-review skill to complete</action>
315
+ </check>
316
+
317
+ <check if="code-review applied fixes">
318
+ <action>Re-run tests to verify fixes didn't break anything</action>
319
+ <check if="tests fail">
320
+ <output>
321
+ Code review fixes caused test failure. Reverting...
322
+ </output>
323
+ <action>Revert code review changes</action>
324
+ <action>Re-run tests to confirm passing</action>
325
+ </check>
326
+ </check>
327
+
328
+ <output>
329
+ Code review complete.
330
+ Review report: .specs-fire/runs/{run-id}/review-report.md
331
+ </output>
332
+ </step>
333
+
288
334
  <step n="7" title="Complete Current Work Item">
289
335
  <critical>
290
336
  MUST call complete-run.js script. Check if more items remain.
@@ -332,6 +378,7 @@ For runs with multiple work items:
332
378
  - Run Log: .specs-fire/runs/{run-id}/run.md
333
379
  - Plan: .specs-fire/runs/{run-id}/plan.md
334
380
  - Test Report: .specs-fire/runs/{run-id}/test-report.md
381
+ - Code Review: .specs-fire/runs/{run-id}/review-report.md
335
382
  - Walkthrough: .specs-fire/runs/{run-id}/walkthrough.md
336
383
  </output>
337
384
  </step>
@@ -435,17 +482,19 @@ After init-run.js creates a run:
435
482
 
436
483
  ```
437
484
  .specs-fire/runs/run-001/
438
- ├── run.md # Created by init-run.js, updated by complete-run.js
439
- ├── plan.md # Created BEFORE implementation (ALL modes - required)
440
- ├── test-report.md # Created AFTER tests pass (required)
441
- └── walkthrough.md # Created by walkthrough-generate skill
485
+ ├── run.md # Created by init-run.js, updated by complete-run.js
486
+ ├── plan.md # Created BEFORE implementation (ALL modes - required)
487
+ ├── test-report.md # Created AFTER tests pass (required)
488
+ ├── review-report.md # Created by code-review skill (Step 6b)
489
+ └── walkthrough.md # Created by walkthrough-generate skill
442
490
  ```
443
491
 
444
492
  **Artifact Creation Timeline:**
445
493
  1. `run.md` — Created at run start by init-run.js
446
494
  2. `plan.md` — Created BEFORE implementation begins (Step 4)
447
495
  3. `test-report.md` — Created AFTER tests pass (Step 6)
448
- 4. `walkthrough.md` — Created after run completes (Step 8)
496
+ 4. `review-report.md` — Created by code-review skill (Step 6b)
497
+ 5. `walkthrough.md` — Created after run completes (Step 8)
449
498
 
450
499
  The run.md contains:
451
500
  - All work items with their statuses
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specsmd",
3
- "version": "0.0.0-dev.60",
3
+ "version": "0.0.0-dev.62",
4
4
  "description": "Multi-agent orchestration system for AI-native software development. Delivers AI-DLC, Agile, and custom SDLC flows as markdown-based agent systems.",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {