aiblueprint-cli 1.4.23 → 1.4.24
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/claude-code-config/skills/git-commit/SKILL.md +42 -0
- package/claude-code-config/{commands/git/create-pr.md → skills/git-create-pr/SKILL.md} +12 -18
- package/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
- package/claude-code-config/skills/git-merge/SKILL.md +68 -0
- package/claude-code-config/skills/{claude-memory → meta-claude-memory}/SKILL.md +7 -2
- package/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
- package/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
- package/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
- package/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
- package/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
- package/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
- package/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
- package/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
- package/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
- package/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
- package/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
- package/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
- package/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
- package/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
- package/claude-code-config/skills/meta-skill-creator/package.json +5 -0
- package/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
- package/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
- package/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
- package/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
- package/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
- package/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
- package/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
- package/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
- package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/SKILL.md +41 -15
- package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-00-init.md +2 -3
- package/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
- package/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
- package/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
- package/claude-code-config/skills/workflow-apex/SKILL.md +303 -0
- package/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +134 -0
- package/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00-init.md +288 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
- package/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +153 -0
- package/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
- package/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +264 -0
- package/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
- package/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
- package/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
- package/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
- package/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
- package/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
- package/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
- package/claude-code-config/skills/workflow-apex/templates/00-context.md +51 -0
- package/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
- package/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
- package/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
- package/package.json +1 -1
- package/claude-code-config/commands/explore.md +0 -90
- package/claude-code-config/commands/git/commit.md +0 -60
- package/claude-code-config/commands/git/fix-pr-comments.md +0 -59
- package/claude-code-config/commands/oneshot.md +0 -57
- package/claude-code-config/skills/create-slash-commands/SKILL.md +0 -1110
- package/claude-code-config/skills/create-slash-commands/references/arguments.md +0 -273
- package/claude-code-config/skills/create-slash-commands/references/patterns.md +0 -947
- package/claude-code-config/skills/create-slash-commands/references/prompt-examples.md +0 -656
- package/claude-code-config/skills/create-slash-commands/references/tool-restrictions.md +0 -389
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/comprehensive-example.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/project-patterns.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/prompting-techniques.md +0 -0
- /package/claude-code-config/skills/{claude-memory → meta-claude-memory}/references/section-templates.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/context-management.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/debugging-agents.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/error-handling-and-recovery.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/evaluation-and-testing.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/orchestration-patterns.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/subagents.md +0 -0
- /package/claude-code-config/skills/{create-subagents → meta-subagent-creator}/references/writing-subagent-prompts.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/SKILL.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/scripts/setup.sh +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-01-interactive-prd.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-02-create-stories.md +0 -0
- /package/claude-code-config/skills/{setup-ralph → ralph-loop}/steps/step-03-finish.md +0 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-04-validate
|
|
3
|
+
description: Self-check - run tests, verify AC, audit implementation quality
|
|
4
|
+
prev_step: steps/step-03-execute.md
|
|
5
|
+
next_step: steps/step-05-examine.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 4: Validate (Self-Check)
|
|
9
|
+
|
|
10
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
11
|
+
|
|
12
|
+
- 🛑 NEVER claim checks pass when they don't
|
|
13
|
+
- 🛑 NEVER skip any validation step
|
|
14
|
+
- ✅ ALWAYS run typecheck, lint, and tests
|
|
15
|
+
- ✅ ALWAYS verify each acceptance criterion
|
|
16
|
+
- ✅ ALWAYS fix failures before proceeding
|
|
17
|
+
- 📋 YOU ARE A VALIDATOR, not an implementer
|
|
18
|
+
- 💬 FOCUS on "Does it work correctly?"
|
|
19
|
+
- 🚫 FORBIDDEN to proceed with failing checks
|
|
20
|
+
|
|
21
|
+
## EXECUTION PROTOCOLS:
|
|
22
|
+
|
|
23
|
+
- 🎯 Run all validation commands
|
|
24
|
+
- 💾 Log results to output (if save_mode)
|
|
25
|
+
- 📖 Check each AC against implementation
|
|
26
|
+
- 🚫 FORBIDDEN to mark complete with failures
|
|
27
|
+
|
|
28
|
+
## CONTEXT BOUNDARIES:
|
|
29
|
+
|
|
30
|
+
- Implementation from step-03 is complete
|
|
31
|
+
- Tests may or may not pass yet
|
|
32
|
+
- Type errors may exist
|
|
33
|
+
- Focus is on verification, not new implementation
|
|
34
|
+
|
|
35
|
+
## YOUR TASK:
|
|
36
|
+
|
|
37
|
+
Validate the implementation by running checks, verifying acceptance criteria, and ensuring quality.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<available_state>
|
|
42
|
+
From previous steps:
|
|
43
|
+
|
|
44
|
+
| Variable | Description |
|
|
45
|
+
|----------|-------------|
|
|
46
|
+
| `{task_description}` | What was implemented |
|
|
47
|
+
| `{task_id}` | Kebab-case identifier |
|
|
48
|
+
| `{acceptance_criteria}` | Success criteria |
|
|
49
|
+
| `{auto_mode}` | Skip confirmations |
|
|
50
|
+
| `{save_mode}` | Save outputs to files |
|
|
51
|
+
| `{test_mode}` | Include test steps |
|
|
52
|
+
| `{examine_mode}` | Auto-proceed to review |
|
|
53
|
+
| `{output_dir}` | Path to output (if save_mode) |
|
|
54
|
+
| Implementation | Completed in step-03 |
|
|
55
|
+
</available_state>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## EXECUTION SEQUENCE:
|
|
60
|
+
|
|
61
|
+
### 1. Initialize Save Output (if save_mode)
|
|
62
|
+
|
|
63
|
+
**If `{save_mode}` = true:**
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
bash {skill_dir}/scripts/update-progress.sh "{task_id}" "04" "validate" "in_progress"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Append results to `{output_dir}/04-validate.md` as you work.
|
|
70
|
+
|
|
71
|
+
### 2. Discover Available Commands
|
|
72
|
+
|
|
73
|
+
Check `package.json` for exact command names:
|
|
74
|
+
```bash
|
|
75
|
+
cat package.json | grep -A 20 '"scripts"'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Look for: `typecheck`, `lint`, `test`, `build`, `format`
|
|
79
|
+
|
|
80
|
+
### 3. Run Validation Suite
|
|
81
|
+
|
|
82
|
+
**3.1 Typecheck**
|
|
83
|
+
```bash
|
|
84
|
+
pnpm run typecheck # or npm run typecheck
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**MUST PASS.** If fails:
|
|
88
|
+
1. Read error messages
|
|
89
|
+
2. Fix type issues
|
|
90
|
+
3. Re-run until passing
|
|
91
|
+
|
|
92
|
+
**3.2 Lint**
|
|
93
|
+
```bash
|
|
94
|
+
pnpm run lint
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**MUST PASS.** If fails:
|
|
98
|
+
1. Try auto-fix: `pnpm run lint --fix`
|
|
99
|
+
2. Manually fix remaining
|
|
100
|
+
3. Re-run until passing
|
|
101
|
+
|
|
102
|
+
**3.3 Tests**
|
|
103
|
+
```bash
|
|
104
|
+
pnpm run test -- --filter={affected-area}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**MUST PASS.** If fails:
|
|
108
|
+
1. Identify failing test
|
|
109
|
+
2. Determine if code bug or test bug
|
|
110
|
+
3. Fix the root cause
|
|
111
|
+
4. Re-run until passing
|
|
112
|
+
|
|
113
|
+
**If `{save_mode}` = true:** Log each result
|
|
114
|
+
|
|
115
|
+
### 4. Self-Audit Checklist
|
|
116
|
+
|
|
117
|
+
Verify each item:
|
|
118
|
+
|
|
119
|
+
**Tasks Complete:**
|
|
120
|
+
- [ ] All todos from step-03 marked complete
|
|
121
|
+
- [ ] No tasks skipped without reason
|
|
122
|
+
- [ ] Any blocked tasks have explanation
|
|
123
|
+
|
|
124
|
+
**Tests Passing:**
|
|
125
|
+
- [ ] All existing tests pass
|
|
126
|
+
- [ ] New tests written for new functionality
|
|
127
|
+
- [ ] No skipped tests without reason
|
|
128
|
+
|
|
129
|
+
**Acceptance Criteria:**
|
|
130
|
+
- [ ] Each AC demonstrably met
|
|
131
|
+
- [ ] Can explain how implementation satisfies AC
|
|
132
|
+
- [ ] Edge cases considered
|
|
133
|
+
|
|
134
|
+
**Patterns Followed:**
|
|
135
|
+
- [ ] Code follows existing patterns
|
|
136
|
+
- [ ] Error handling consistent
|
|
137
|
+
- [ ] Naming conventions match
|
|
138
|
+
|
|
139
|
+
### 5. Format Code
|
|
140
|
+
|
|
141
|
+
If format command available:
|
|
142
|
+
```bash
|
|
143
|
+
pnpm run format
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 6. Final Verification
|
|
147
|
+
|
|
148
|
+
Re-run all checks:
|
|
149
|
+
```bash
|
|
150
|
+
pnpm run typecheck && pnpm run lint
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Both MUST pass.
|
|
154
|
+
|
|
155
|
+
### 7. Present Validation Results
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
**Validation Complete**
|
|
159
|
+
|
|
160
|
+
**Typecheck:** ✓ Passed
|
|
161
|
+
**Lint:** ✓ Passed
|
|
162
|
+
**Tests:** ✓ {X}/{X} passing
|
|
163
|
+
**Format:** ✓ Applied
|
|
164
|
+
|
|
165
|
+
**Acceptance Criteria:**
|
|
166
|
+
- [✓] AC1: Verified by [how]
|
|
167
|
+
- [✓] AC2: Verified by [how]
|
|
168
|
+
|
|
169
|
+
**Files Modified:** {list}
|
|
170
|
+
|
|
171
|
+
**Summary:** All checks passing, ready for next step.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 8. Determine Next Step
|
|
175
|
+
|
|
176
|
+
**Decision tree:**
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
IF {test_mode} = true:
|
|
180
|
+
→ Load step-07-tests.md (test analysis and creation)
|
|
181
|
+
|
|
182
|
+
ELSE IF {examine_mode} = true:
|
|
183
|
+
→ Load step-05-examine.md (adversarial review)
|
|
184
|
+
|
|
185
|
+
ELSE IF {auto_mode} = false:
|
|
186
|
+
→ Ask user:
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```yaml
|
|
190
|
+
questions:
|
|
191
|
+
- header: "Next"
|
|
192
|
+
question: "Validation complete. What would you like to do?"
|
|
193
|
+
options:
|
|
194
|
+
- label: "Run adversarial review"
|
|
195
|
+
description: "Deep review for security, logic, and quality"
|
|
196
|
+
- label: "Complete workflow"
|
|
197
|
+
description: "Skip review and finalize"
|
|
198
|
+
- label: "Add tests"
|
|
199
|
+
description: "Create additional tests first"
|
|
200
|
+
multiSelect: false
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
ELSE:
|
|
205
|
+
→ Complete workflow (show final summary)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### 9. Complete Save Output (if save_mode)
|
|
209
|
+
|
|
210
|
+
**If `{save_mode}` = true:**
|
|
211
|
+
|
|
212
|
+
Append to `{output_dir}/04-validate.md`:
|
|
213
|
+
```markdown
|
|
214
|
+
---
|
|
215
|
+
## Step Complete
|
|
216
|
+
**Status:** ✓ Complete
|
|
217
|
+
**Typecheck:** ✓
|
|
218
|
+
**Lint:** ✓
|
|
219
|
+
**Tests:** ✓
|
|
220
|
+
**Next:** {next step based on flags}
|
|
221
|
+
**Timestamp:** {ISO timestamp}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## SUCCESS METRICS:
|
|
227
|
+
|
|
228
|
+
✅ Typecheck passes
|
|
229
|
+
✅ Lint passes
|
|
230
|
+
✅ All tests pass
|
|
231
|
+
✅ All AC verified
|
|
232
|
+
✅ Code formatted
|
|
233
|
+
✅ User informed of status
|
|
234
|
+
|
|
235
|
+
## FAILURE MODES:
|
|
236
|
+
|
|
237
|
+
❌ Claiming checks pass when they don't
|
|
238
|
+
❌ Not running all validation commands
|
|
239
|
+
❌ Skipping tests for modified code
|
|
240
|
+
❌ Missing AC verification
|
|
241
|
+
❌ Proceeding with failures
|
|
242
|
+
❌ **CRITICAL**: Not using AskUserQuestion for next step
|
|
243
|
+
|
|
244
|
+
## VALIDATION PROTOCOLS:
|
|
245
|
+
|
|
246
|
+
- Run EVERY validation command
|
|
247
|
+
- Fix failures IMMEDIATELY
|
|
248
|
+
- Don't proceed until all green
|
|
249
|
+
- Verify EACH acceptance criterion
|
|
250
|
+
- Document all results
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## NEXT STEP:
|
|
255
|
+
|
|
256
|
+
Based on flags (check in order):
|
|
257
|
+
- **If test_mode:** Load `./step-07-tests.md`
|
|
258
|
+
- **If examine_mode OR user requests:** Load `./step-05-examine.md`
|
|
259
|
+
- **If pr_mode:** Load `./step-09-finish.md` to create pull request
|
|
260
|
+
- **Otherwise:** Workflow complete - show summary
|
|
261
|
+
|
|
262
|
+
<critical>
|
|
263
|
+
Remember: NEVER proceed with failing checks - fix everything first!
|
|
264
|
+
</critical>
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-05-examine
|
|
3
|
+
description: Adversarial code review - security, logic, and quality analysis
|
|
4
|
+
prev_step: steps/step-04-validate.md
|
|
5
|
+
next_step: steps/step-06-resolve.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 5: Examine (Adversarial Review)
|
|
9
|
+
|
|
10
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
11
|
+
|
|
12
|
+
- 🛑 NEVER skip security review
|
|
13
|
+
- 🛑 NEVER dismiss findings without justification
|
|
14
|
+
- 🛑 NEVER auto-approve without thorough review
|
|
15
|
+
- ✅ ALWAYS check OWASP top 10 vulnerabilities
|
|
16
|
+
- ✅ ALWAYS classify findings by severity and validity
|
|
17
|
+
- ✅ ALWAYS present findings table to user
|
|
18
|
+
- 📋 YOU ARE A SKEPTICAL REVIEWER, not a defender
|
|
19
|
+
- 💬 FOCUS on "What could go wrong?"
|
|
20
|
+
- 🚫 FORBIDDEN to approve without thorough analysis
|
|
21
|
+
|
|
22
|
+
## EXECUTION PROTOCOLS:
|
|
23
|
+
|
|
24
|
+
- 🎯 Launch parallel review agents (unless economy_mode)
|
|
25
|
+
- 💾 Document all findings with severity
|
|
26
|
+
- 📖 Create todos for each finding
|
|
27
|
+
- 🚫 FORBIDDEN to skip security analysis
|
|
28
|
+
|
|
29
|
+
## CONTEXT BOUNDARIES:
|
|
30
|
+
|
|
31
|
+
- Implementation is complete and validated
|
|
32
|
+
- All tests pass
|
|
33
|
+
- Now looking for issues that tests miss
|
|
34
|
+
- Adversarial mindset - assume bugs exist
|
|
35
|
+
|
|
36
|
+
## YOUR TASK:
|
|
37
|
+
|
|
38
|
+
Conduct an adversarial code review to identify security vulnerabilities, logic flaws, and quality issues.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
<available_state>
|
|
43
|
+
From previous steps:
|
|
44
|
+
|
|
45
|
+
| Variable | Description |
|
|
46
|
+
|----------|-------------|
|
|
47
|
+
| `{task_description}` | What was implemented |
|
|
48
|
+
| `{task_id}` | Kebab-case identifier |
|
|
49
|
+
| `{auto_mode}` | Auto-fix Real findings |
|
|
50
|
+
| `{save_mode}` | Save outputs to files |
|
|
51
|
+
| `{economy_mode}` | No subagents, direct review |
|
|
52
|
+
| `{output_dir}` | Path to output (if save_mode) |
|
|
53
|
+
| Files modified | From step-03 |
|
|
54
|
+
</available_state>
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## EXECUTION SEQUENCE:
|
|
59
|
+
|
|
60
|
+
### 1. Initialize Save Output (if save_mode)
|
|
61
|
+
|
|
62
|
+
**If `{save_mode}` = true:**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bash {skill_dir}/scripts/update-progress.sh "{task_id}" "05" "examine" "in_progress"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Append findings to `{output_dir}/05-examine.md` as you work.
|
|
69
|
+
|
|
70
|
+
### 2. Gather Changes
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git diff --name-only HEAD~1
|
|
74
|
+
git status --porcelain
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Group files: source, tests, config, other.
|
|
78
|
+
|
|
79
|
+
### 3. Conduct Review
|
|
80
|
+
|
|
81
|
+
**If `{economy_mode}` = true:**
|
|
82
|
+
→ Self-review with checklist:
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
## Security Checklist
|
|
86
|
+
- [ ] No SQL injection (parameterized queries)
|
|
87
|
+
- [ ] No XSS (output encoding)
|
|
88
|
+
- [ ] No secrets in code
|
|
89
|
+
- [ ] Input validation present
|
|
90
|
+
- [ ] Auth checks on protected routes
|
|
91
|
+
|
|
92
|
+
## Logic Checklist
|
|
93
|
+
- [ ] Error handling for all failure modes
|
|
94
|
+
- [ ] Edge cases handled
|
|
95
|
+
- [ ] Null/undefined checks
|
|
96
|
+
- [ ] Race conditions considered
|
|
97
|
+
|
|
98
|
+
## Quality Checklist
|
|
99
|
+
- [ ] Follows existing patterns
|
|
100
|
+
- [ ] No code duplication
|
|
101
|
+
- [ ] Clear naming
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**If `{economy_mode}` = false:**
|
|
105
|
+
→ Launch parallel review agents
|
|
106
|
+
|
|
107
|
+
**CRITICAL: Launch ALL in a SINGLE message:**
|
|
108
|
+
|
|
109
|
+
**Agent 1: Security** (`code-reviewer`)
|
|
110
|
+
```
|
|
111
|
+
Review for OWASP Top 10:
|
|
112
|
+
- Injection flaws
|
|
113
|
+
- Auth/authz issues
|
|
114
|
+
- Data exposure
|
|
115
|
+
- Security misconfiguration
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Agent 2: Logic** (`code-reviewer`)
|
|
119
|
+
```
|
|
120
|
+
Review for:
|
|
121
|
+
- Edge cases not handled
|
|
122
|
+
- Race conditions
|
|
123
|
+
- Null handling
|
|
124
|
+
- Incorrect logic
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Agent 3: Clean Code** (`code-reviewer`)
|
|
128
|
+
```
|
|
129
|
+
Review for:
|
|
130
|
+
- SOLID violations
|
|
131
|
+
- Code smells
|
|
132
|
+
- Complexity issues
|
|
133
|
+
- Duplication >20 lines
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Agent 4: Vercel/Next.js Best Practices** (CONDITIONAL)
|
|
137
|
+
|
|
138
|
+
→ **Detection:** Check if modified files match Next.js/Vercel patterns:
|
|
139
|
+
```
|
|
140
|
+
- *.tsx, *.jsx files in app/, pages/, components/
|
|
141
|
+
- next.config.* files
|
|
142
|
+
- Server actions (use server)
|
|
143
|
+
- API routes (app/api/*, pages/api/*)
|
|
144
|
+
- Middleware (middleware.ts)
|
|
145
|
+
- Server components, client components
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
→ **If Next.js/Vercel code detected:**
|
|
149
|
+
|
|
150
|
+
Launch additional agent using Skill tool:
|
|
151
|
+
```yaml
|
|
152
|
+
skill: "vercel-react-best-practices"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
This agent reviews for:
|
|
156
|
+
- Async parallel patterns (Promise.all vs sequential awaits)
|
|
157
|
+
- Bundle optimization (barrel imports, dynamic imports)
|
|
158
|
+
- Server-side caching (React cache, unstable_cache)
|
|
159
|
+
- Re-render optimization (memo, useMemo, useCallback usage)
|
|
160
|
+
- Server vs Client component boundaries
|
|
161
|
+
- Data fetching patterns (preloading, parallel fetching)
|
|
162
|
+
|
|
163
|
+
→ **If NOT Next.js/Vercel code:** Skip this agent
|
|
164
|
+
|
|
165
|
+
### 4. Classify Findings
|
|
166
|
+
|
|
167
|
+
For each finding:
|
|
168
|
+
|
|
169
|
+
**Severity:**
|
|
170
|
+
- CRITICAL: Security vulnerability, data loss risk
|
|
171
|
+
- HIGH: Significant bug, will cause issues
|
|
172
|
+
- MEDIUM: Should fix, not urgent
|
|
173
|
+
- LOW: Minor improvement
|
|
174
|
+
|
|
175
|
+
**Validity:**
|
|
176
|
+
- Real: Definitely needs fixing
|
|
177
|
+
- Noise: Not actually a problem
|
|
178
|
+
- Uncertain: Needs discussion
|
|
179
|
+
|
|
180
|
+
### 5. Present Findings Table
|
|
181
|
+
|
|
182
|
+
```markdown
|
|
183
|
+
## Findings
|
|
184
|
+
|
|
185
|
+
| ID | Severity | Category | Location | Issue | Validity |
|
|
186
|
+
|----|----------|----------|----------|-------|----------|
|
|
187
|
+
| F1 | CRITICAL | Security | auth.ts:42 | SQL injection | Real |
|
|
188
|
+
| F2 | HIGH | Logic | handler.ts:78 | Missing null check | Real |
|
|
189
|
+
| F3 | MEDIUM | Quality | utils.ts:15 | Complex function | Uncertain |
|
|
190
|
+
|
|
191
|
+
**Summary:** {count} findings ({blocking} blocking)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### 6. Create Finding Todos
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
- [ ] F1 [CRITICAL] Fix SQL injection in auth.ts:42
|
|
198
|
+
- [ ] F2 [HIGH] Add null check in handler.ts:78
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 7. Get User Approval (review → resolve/test)
|
|
202
|
+
|
|
203
|
+
**If `{auto_mode}` = true:**
|
|
204
|
+
→ Proceed automatically based on findings
|
|
205
|
+
|
|
206
|
+
**If `{auto_mode}` = false:**
|
|
207
|
+
|
|
208
|
+
```yaml
|
|
209
|
+
questions:
|
|
210
|
+
- header: "Review"
|
|
211
|
+
question: "Review complete. How would you like to proceed?"
|
|
212
|
+
options:
|
|
213
|
+
- label: "Resolve findings (Recommended)"
|
|
214
|
+
description: "Address the identified issues"
|
|
215
|
+
- label: "Skip to tests"
|
|
216
|
+
description: "Skip resolution, proceed to test creation"
|
|
217
|
+
- label: "Skip resolution"
|
|
218
|
+
description: "Accept findings, don't make changes"
|
|
219
|
+
- label: "Discuss findings"
|
|
220
|
+
description: "I want to discuss specific findings"
|
|
221
|
+
multiSelect: false
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
<critical>
|
|
225
|
+
This is one of the THREE transition points that requires user confirmation:
|
|
226
|
+
1. plan → execute
|
|
227
|
+
2. validate → review
|
|
228
|
+
3. review → resolve/test (THIS ONE)
|
|
229
|
+
</critical>
|
|
230
|
+
|
|
231
|
+
### 8. Complete Save Output (if save_mode)
|
|
232
|
+
|
|
233
|
+
**If `{save_mode}` = true:**
|
|
234
|
+
|
|
235
|
+
Append to `{output_dir}/05-examine.md`:
|
|
236
|
+
```markdown
|
|
237
|
+
---
|
|
238
|
+
## Step Complete
|
|
239
|
+
**Status:** ✓ Complete
|
|
240
|
+
**Findings:** {count}
|
|
241
|
+
**Critical:** {count}
|
|
242
|
+
**Next:** step-06-resolve.md
|
|
243
|
+
**Timestamp:** {ISO timestamp}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## SUCCESS METRICS:
|
|
249
|
+
|
|
250
|
+
✅ All modified files reviewed
|
|
251
|
+
✅ Security checklist completed
|
|
252
|
+
✅ Findings classified by severity
|
|
253
|
+
✅ Validity assessed for each finding
|
|
254
|
+
✅ Findings table presented
|
|
255
|
+
✅ Todos created for tracking
|
|
256
|
+
✅ Next.js/Vercel best practices checked (if applicable)
|
|
257
|
+
|
|
258
|
+
## FAILURE MODES:
|
|
259
|
+
|
|
260
|
+
❌ Skipping security review
|
|
261
|
+
❌ Not classifying by severity
|
|
262
|
+
❌ Auto-dismissing findings
|
|
263
|
+
❌ Launching agents sequentially
|
|
264
|
+
❌ Using subagents when economy_mode
|
|
265
|
+
❌ Skipping Vercel/Next.js review when React/Next.js files are modified
|
|
266
|
+
❌ **CRITICAL**: Not using AskUserQuestion for review → resolve/test transition
|
|
267
|
+
|
|
268
|
+
## REVIEW PROTOCOLS:
|
|
269
|
+
|
|
270
|
+
- Adversarial mindset - assume bugs exist
|
|
271
|
+
- Check security FIRST
|
|
272
|
+
- Every finding gets severity and validity
|
|
273
|
+
- Don't dismiss without justification
|
|
274
|
+
- Present clear summary
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## NEXT STEP:
|
|
279
|
+
|
|
280
|
+
After user confirms via AskUserQuestion (or auto-proceed):
|
|
281
|
+
|
|
282
|
+
**If user chooses "Resolve findings":** → Load `./step-06-resolve.md`
|
|
283
|
+
|
|
284
|
+
**If user chooses "Skip to tests" (and test_mode):** → Load `./step-07-tests.md`
|
|
285
|
+
|
|
286
|
+
**If user chooses "Skip resolution":**
|
|
287
|
+
- **If test_mode:** → Load `./step-07-tests.md`
|
|
288
|
+
- **If pr_mode:** → Load `./step-09-finish.md` to create pull request
|
|
289
|
+
- **Otherwise:** → Workflow complete - show summary
|
|
290
|
+
|
|
291
|
+
<critical>
|
|
292
|
+
Remember: Be SKEPTICAL - your job is to find problems, not approve code!
|
|
293
|
+
This step MUST ask before proceeding (unless auto_mode).
|
|
294
|
+
</critical>
|