@@ -40,32 +40,11 @@ Use a sub-agent to review the staged/changed code and identify issues that shoul
4040
4141 Use the Task tool with these parameters :
4242 - `subagent_type` : " general-purpose"
43- - `prompt` : Include the list of changed files and the review criteria below
44-
45- The sub-agent should review each changed file for :
46-
47- **General Issues**
48- - Logic errors or potential bugs
49- - Error handling gaps
50- - Security concerns
51- - Performance issues
52-
53- **DRY Opportunities**
54- - Duplicated code that should be extracted into functions
55- - Repeated patterns that could be abstracted
56- - Copy-pasted logic with minor variations
57-
58- **Naming Clarity**
59- - Variables, functions, and classes should have clear, descriptive names
60- - Names should reflect purpose and intent
61- - Avoid abbreviations that aren't universally understood
62- - Consistent naming conventions throughout
63-
64- **Test Coverage**
65- - New functions or classes should have corresponding tests
66- - New code paths should be tested
67- - Edge cases should be covered
68- - If tests are missing, note what should be tested
43+ - `prompt` : Instruct the sub-agent to:
44+ - Read the code review standards from `doc/code_review_standards.md`
45+ - Read each of the changed files
46+ - Review each file against the standards
47+ - Report issues found with file, line number, severity, and suggested fix
6948
70493. **Review sub-agent findings**
7150 - Examine each issue identified
@@ -82,40 +61,11 @@ Use a sub-agent to review the staged/changed code and identify issues that shoul
8261 - If you made substantial changes, consider running another review pass
8362 - Ensure fixes didn't introduce new issues
8463
85- # # Example Sub-Agent Prompt
86-
87- ` ` `
88- Review the following changed files for code quality issues:
89-
90- Files to review:
91- - src/module.py
92- - src/utils.py
93- - tests/test_module.py
94-
95- For each file, check for:
96-
97- 1. **General issues**: Logic errors, bugs, error handling gaps, security concerns
98- 2. **DRY opportunities**: Duplicated code, repeated patterns that should be extracted
99- 3. **Naming clarity**: Are variable/function/class names clear and descriptive?
100- 4. **Test coverage**: Does new functionality have corresponding tests?
101-
102- Read each file and provide a structured report of issues found, organized by category.
103- For each issue, include:
104- - File and line number
105- - Description of the issue
106- - Suggested fix
107-
108- If no issues are found in a category, state that explicitly.
109- ` ` `
110-
11164# # Quality Criteria
11265
11366- Changed files were identified
114- - Sub-agent reviewed all changed files
115- - Issues were categorized (general, DRY, naming, tests)
67+ - Sub-agent read the code review standards and reviewed all changed files
11668- All identified issues were addressed or documented as intentional
117- - Sub-agent was used to conserve context
118- - When all criteria are met, include `<promise>✓ Quality Criteria Met</promise>` in your response
11969
12070# # Context
12171
@@ -158,6 +108,23 @@ Use branch format: `deepwork/commit-[instance]-YYYYMMDD`
158108- Do NOT proceed without required inputs; ask the user if any are missing
159109- Do NOT modify files outside the scope of this step's defined outputs
160110
111+ # # Quality Validation
112+
113+ **Before completing this step, you MUST have your work reviewed against the quality criteria below.**
114+
115+ Use a sub-agent (Haiku model) to review your work against these criteria :
116+
117+ **Criteria (all must be satisfied)**:
118+ 1. Changed files were identified
119+ 2. Sub-agent reviewed the code for general issues, DRY opportunities, naming clarity, and test coverage
120+ 3. All identified issues were addressed or documented as intentional
121+ **Review Process**:
122+ 1. Once you believe your work is complete, spawn a sub-agent using Haiku to review your work against the quality criteria above
123+ 2. The sub-agent should examine your outputs and verify each criterion is met
124+ 3. If the sub-agent identifies valid issues, fix them
125+ 4. Have the sub-agent review again until all valid feedback has been addressed
126+ 5. Only mark the step complete when the sub-agent confirms all criteria are satisfied
127+
161128# # On Completion
162129
1631301. Verify outputs are created
0 commit comments