- AUTO-FIX: LOW — Only mechanical, non-semantic changes
- SUGGESTIONS: MEDIUM — Present options, let user decide
files_created:
- path: src/auth/login.ts
purpose: Login endpoint handler
- path: src/auth/login.test.ts
purpose: Unit tests for login
files_modified:
- path: src/routes/index.ts
changes: Added login route
run_id: run-fabriqa-2026-001
intent_id: user-auth
<action>Detect project tooling:</action>
<substep>Check for .eslintrc, eslint.config.js (JavaScript/TypeScript)</substep>
<substep>Check for .prettierrc (formatting)</substep>
<substep>Check for golangci.yml (Go)</substep>
<substep>Check for pyproject.toml, ruff.toml (Python)</substep>
<action>Read each file to be reviewed</action>
<output>Reviewing {file_count} files...</output>
<check if="golangci config exists">
<action>Run: golangci-lint run --fix {files}</action>
<action>Parse output for remaining issues</action>
</check>
<check if="ruff/pyproject config exists">
<action>Run: ruff check --fix {files}</action>
<action>Parse output for remaining issues</action>
</check>
<check if="no linter configured">
<action>Use built-in review rules from references/review-categories.md</action>
</check>
<action>Classify each finding using references/auto-fix-rules.md:</action>
<substep>AUTO-FIX: Mechanical, non-semantic, reversible, tests won't break</substep>
<substep>CONFIRM: Behavioral change, security implication, judgment required</substep>
<action>Group findings by category and severity</action>
<critical>Re-run tests to verify no breakage</critical>
<action>Run project test command</action>
<check if="tests fail after auto-fix">
<output>Auto-fix caused test failure. Reverting...</output>
<action>Revert all auto-fix changes</action>
<action>Move failed fixes to CONFIRM category</action>
</check>
<check if="tests pass">
<output>Auto-fixed {count} issues. Tests still passing.</output>
</check>
</check>
Auto-fixed {auto_count} issues. No additional suggestions.
Review report: .specs-fire/runs/{run-id}/review-report.md
</output>
<return>success</return>
</check>
<check if="suggestions exist">
<template_output section="suggestions">
## Code Review Complete
**Auto-fixed ({auto_count} issues)**:
{for each auto_fixed}
- {description} ({file}:{line})
{/for}
**Suggestions requiring approval ({suggest_count} issues)**:
{for each suggestion with index}
{index}. **[{category}]** {title}
- File: {file}:{line}
- Suggestion: {description}
- Risk: {risk_level}
{/for}
---
Apply suggestions?
[a] Apply all suggestions
{for each suggestion with index}
[{index}] Apply #{index} only ({category})
{/for}
[s] Skip all suggestions
[r] Review each individually
</template_output>
<checkpoint>Wait for user response</checkpoint>
</check>
<check if="response == s">
<action>Skip all suggestions</action>
<action>Update review-report.md with skipped status</action>
</check>
<check if="response == r">
<iterate over="suggestions" as="suggestion">
<template_output section="individual_suggestion">
**[{suggestion.category}]** {suggestion.title}
File: {suggestion.file}:{suggestion.line}
Current code:
```
{suggestion.current_code}
```
Suggested change:
```
{suggestion.suggested_code}
```
Rationale: {suggestion.rationale}
Apply this change? [y/n]
</template_output>
<checkpoint>Wait for response</checkpoint>
<check if="response == y">
<action>Apply this suggestion</action>
</check>
</iterate>
<action>Re-run tests if any changes applied</action>
</check>
<check if="response is number">
<action>Apply only the numbered suggestion</action>
<action>Re-run tests</action>
<action>Update review-report.md</action>
</check>
- Summary table (auto-fixed, suggested, skipped by category)
- Detailed list of auto-fixed issues with diffs
- Applied suggestions with approval timestamps
- Skipped suggestions with reasons
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: code-review-1003description: Review code written during a run, auto-fix no-brainer issues, and suggest improvements requiring confirmation. Invoked after tests pass. Use when this capability is needed.4---56<objective>7Review code written during a run, auto-fix no-brainer issues, and suggest improvements requiring confirmation.8</objective>910<triggers>11 - Invoked by run-execute after tests pass (Step 6b)12 - Receives: files_created, files_modified, run_id, intent context13</triggers>1415<degrees_of_freedom>1617- **AUTO-FIX**: LOW — Only mechanical, non-semantic changes18- **SUGGESTIONS**: MEDIUM — Present options, let user decide19</degrees_of_freedom>2021<llm critical="true">22 <mandate>REVIEW all files created/modified in current run</mandate>23 <mandate>AUTO-FIX only mechanical, non-semantic issues</mandate>24 <mandate>ALWAYS CONFIRM security, architecture, and behavioral changes</mandate>25 <mandate>RESPECT project coding standards from .specs-fire/standards/</mandate>26 <mandate>NEVER break working code — if tests passed, be conservative</mandate>27 <mandate>RE-RUN tests after auto-fixes — revert if tests fail</mandate>28</llm>2930<input_context>31 The skill receives from run-execute:3233 ```yaml34 files_created:35 - path: src/auth/login.ts36 purpose: Login endpoint handler37 - path: src/auth/login.test.ts38 purpose: Unit tests for login3940 files_modified:41 - path: src/routes/index.ts42 changes: Added login route4344 run_id: run-fabriqa-2026-00145 intent_id: user-auth46 ```4748</input_context>4950<references_index>51 <reference name="review-categories" path="references/review-categories.md" load_when="analyzing code"/>52 <reference name="auto-fix-rules" path="references/auto-fix-rules.md" load_when="classifying findings"/>53</references_index>5455<flow>56 <step n="1" title="Gather Context">57 <action>Receive files_created and files_modified from parent workflow</action>58 <action>Load project standards:</action>59 <substep>.specs-fire/standards/coding-standards.md</substep>60 <substep>.specs-fire/standards/testing-standards.md</substep>6162 <action>Detect project tooling:</action>63 <substep>Check for .eslintrc, eslint.config.js (JavaScript/TypeScript)</substep>64 <substep>Check for .prettierrc (formatting)</substep>65 <substep>Check for golangci.yml (Go)</substep>66 <substep>Check for pyproject.toml, ruff.toml (Python)</substep>6768 <action>Read each file to be reviewed</action>6970 <output>Reviewing {file_count} files...</output>71 </step>7273 <step n="2" title="Run Project Linters (if available)">74 <check if="eslint config exists">75 <action>Run: npm run lint --fix 2>&1 || npx eslint --fix {files}</action>76 <action>Parse output for remaining issues</action>77 </check>7879 <check if="golangci config exists">80 <action>Run: golangci-lint run --fix {files}</action>81 <action>Parse output for remaining issues</action>82 </check>8384 <check if="ruff/pyproject config exists">85 <action>Run: ruff check --fix {files}</action>86 <action>Parse output for remaining issues</action>87 </check>8889 <check if="no linter configured">90 <action>Use built-in review rules from references/review-categories.md</action>91 </check>92 </step>9394 <step n="3" title="Analyze Code">95 <action>For each file, check against review categories:</action>96 <substep>Code Quality — unused imports, console statements, formatting</substep>97 <substep>Security — hardcoded secrets, injection vulnerabilities, missing validation</substep>98 <substep>Architecture — code placement, coupling, error handling</substep>99 <substep>Testing — coverage gaps, edge cases, brittle patterns</substep>100101 <action>Classify each finding using references/auto-fix-rules.md:</action>102 <substep>AUTO-FIX: Mechanical, non-semantic, reversible, tests won't break</substep>103 <substep>CONFIRM: Behavioral change, security implication, judgment required</substep>104105 <action>Group findings by category and severity</action>106 </step>107108 <step n="4" title="Apply Auto-Fixes">109 <check if="auto-fix issues found">110 <action>Apply all AUTO-FIX changes</action>111 <action>Track each change made (file, line, before, after)</action>112113 <critical>Re-run tests to verify no breakage</critical>114 <action>Run project test command</action>115116 <check if="tests fail after auto-fix">117 <output>Auto-fix caused test failure. Reverting...</output>118 <action>Revert all auto-fix changes</action>119 <action>Move failed fixes to CONFIRM category</action>120 </check>121122 <check if="tests pass">123 <output>Auto-fixed {count} issues. Tests still passing.</output>124 </check>125 </check>126 </step>127128 <step n="5" title="Generate Review Report">129 <action>Create review report using template: templates/review-report.md.hbs</action>130 <action>Write to: .specs-fire/runs/{run-id}/review-report.md</action>131 <action>Include: auto-fixed issues, pending suggestions, skipped items</action>132 </step>133134 <step n="6" title="Present Suggestions">135 <check if="no suggestions requiring confirmation">136 <output>137 ## Code Review Complete138139 Auto-fixed {auto_count} issues. No additional suggestions.140141 Review report: .specs-fire/runs/{run-id}/review-report.md142 </output>143 <return>success</return>144 </check>145146 <check if="suggestions exist">147 <template_output section="suggestions">148 ## Code Review Complete149150 **Auto-fixed ({auto_count} issues)**:151 {for each auto_fixed}152 - {description} ({file}:{line})153 {/for}154155 **Suggestions requiring approval ({suggest_count} issues)**:156157 {for each suggestion with index}158 {index}. **[{category}]** {title}159 - File: {file}:{line}160 - Suggestion: {description}161 - Risk: {risk_level}162 {/for}163164 ---165 Apply suggestions?166 [a] Apply all suggestions167 {for each suggestion with index}168 [{index}] Apply #{index} only ({category})169 {/for}170 [s] Skip all suggestions171 [r] Review each individually172 </template_output>173174 <checkpoint>Wait for user response</checkpoint>175 </check>176 </step>177178 <step n="7" title="Process User Choice">179 <check if="response == a">180 <action>Apply all suggestions</action>181 <action>Re-run tests</action>182 <action>Update review-report.md with applied status</action>183 </check>184185 <check if="response == s">186 <action>Skip all suggestions</action>187 <action>Update review-report.md with skipped status</action>188 </check>189190 <check if="response == r">191 <iterate over="suggestions" as="suggestion">192 <template_output section="individual_suggestion">193 **[{suggestion.category}]** {suggestion.title}194195 File: {suggestion.file}:{suggestion.line}196197 Current code:198 ```199 {suggestion.current_code}200 ```201202 Suggested change:203 ```204 {suggestion.suggested_code}205 ```206207 Rationale: {suggestion.rationale}208209 Apply this change? [y/n]210 </template_output>211 <checkpoint>Wait for response</checkpoint>212 <check if="response == y">213 <action>Apply this suggestion</action>214 </check>215 </iterate>216 <action>Re-run tests if any changes applied</action>217 </check>218219 <check if="response is number">220 <action>Apply only the numbered suggestion</action>221 <action>Re-run tests</action>222 <action>Update review-report.md</action>223 </check>224 </step>225226 <step n="8" title="Return to Parent">227 <action>Return summary to run-execute workflow:</action>228 <return_value>229 {230 "success": true,231 "auto_fixed_count": {count},232 "suggestions_applied": {count},233 "suggestions_skipped": {count},234 "tests_passing": true,235 "report_path": ".specs-fire/runs/{run-id}/review-report.md"236 }237 </return_value>238 </step>239</flow>240241<output_artifact>242 Creates `.specs-fire/runs/{run-id}/review-report.md` with:243244- Summary table (auto-fixed, suggested, skipped by category)245- Detailed list of auto-fixed issues with diffs246- Applied suggestions with approval timestamps247- Skipped suggestions with reasons248</output_artifact>249250<success_criteria>251 <criterion>All files created/modified in run reviewed</criterion>252 <criterion>Auto-fixes applied without breaking tests</criterion>253 <criterion>Suggestions presented for user approval</criterion>254 <criterion>review-report.md created in run folder</criterion>255 <criterion>Return status to parent workflow</criterion>256</success_criteria>257258---259> Converted and distributed by [TomeVault](https://tomevault.io/claim/fabriqaai) — claim your Tome and manage your conversions.260<!-- tomevault:4.0:skill_md:2026-04-11 -->