@thierrynakoa/fire-flow 10.0.0
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-plugin/plugin.json +64 -0
- package/ARCHITECTURE-DIAGRAM.md +440 -0
- package/COMMAND-REFERENCE.md +172 -0
- package/DOMINION-FLOW-OVERVIEW.md +421 -0
- package/LICENSE +21 -0
- package/QUICK-START.md +351 -0
- package/README.md +398 -0
- package/TROUBLESHOOTING.md +264 -0
- package/agents/fire-codebase-mapper.md +484 -0
- package/agents/fire-debugger.md +535 -0
- package/agents/fire-executor.md +949 -0
- package/agents/fire-fact-checker.md +276 -0
- package/agents/fire-learncoding-explainer.md +237 -0
- package/agents/fire-learncoding-walker.md +147 -0
- package/agents/fire-planner.md +675 -0
- package/agents/fire-project-researcher.md +155 -0
- package/agents/fire-research-synthesizer.md +166 -0
- package/agents/fire-researcher.md +723 -0
- package/agents/fire-reviewer.md +499 -0
- package/agents/fire-roadmapper.md +203 -0
- package/agents/fire-verifier.md +880 -0
- package/bin/cli.js +208 -0
- package/commands/fire-0-orient.md +476 -0
- package/commands/fire-1-new.md +281 -0
- package/commands/fire-1a-discuss.md +455 -0
- package/commands/fire-2-plan.md +527 -0
- package/commands/fire-3-execute.md +1303 -0
- package/commands/fire-4-verify.md +845 -0
- package/commands/fire-5-handoff.md +515 -0
- package/commands/fire-6-resume.md +501 -0
- package/commands/fire-7-review.md +409 -0
- package/commands/fire-add-new-skill.md +598 -0
- package/commands/fire-analytics.md +499 -0
- package/commands/fire-assumptions.md +78 -0
- package/commands/fire-autonomous.md +528 -0
- package/commands/fire-brainstorm.md +413 -0
- package/commands/fire-complete-milestone.md +270 -0
- package/commands/fire-dashboard.md +375 -0
- package/commands/fire-debug.md +663 -0
- package/commands/fire-discover.md +616 -0
- package/commands/fire-double-check.md +460 -0
- package/commands/fire-execute-plan.md +182 -0
- package/commands/fire-learncoding.md +242 -0
- package/commands/fire-loop-resume.md +272 -0
- package/commands/fire-loop-stop.md +198 -0
- package/commands/fire-loop.md +1168 -0
- package/commands/fire-map-codebase.md +313 -0
- package/commands/fire-new-milestone.md +356 -0
- package/commands/fire-reflect.md +235 -0
- package/commands/fire-research.md +246 -0
- package/commands/fire-search.md +330 -0
- package/commands/fire-security-audit-repo.md +293 -0
- package/commands/fire-security-scan.md +484 -0
- package/commands/fire-session-summary.md +252 -0
- package/commands/fire-skills-diff.md +506 -0
- package/commands/fire-skills-history.md +388 -0
- package/commands/fire-skills-rollback.md +408 -0
- package/commands/fire-skills-sync.md +470 -0
- package/commands/fire-test.md +520 -0
- package/commands/fire-todos.md +335 -0
- package/commands/fire-transition.md +186 -0
- package/commands/fire-update.md +312 -0
- package/commands/fire-verify-uat.md +146 -0
- package/commands/fire-vuln-scan.md +493 -0
- package/hooks/hooks.json +16 -0
- package/hooks/run-hook.cmd +69 -0
- package/hooks/run-hook.sh +8 -0
- package/hooks/run-session-end.cmd +49 -0
- package/hooks/run-session-end.sh +7 -0
- package/hooks/session-end.sh +90 -0
- package/hooks/session-start.sh +111 -0
- package/package.json +52 -0
- package/plugin.json +7 -0
- package/references/auto-skill-extraction.md +136 -0
- package/references/behavioral-directives.md +365 -0
- package/references/blocker-tracking.md +155 -0
- package/references/checkpoints.md +165 -0
- package/references/circuit-breaker.md +410 -0
- package/references/context-engineering.md +587 -0
- package/references/decision-time-guidance.md +289 -0
- package/references/error-classification.md +326 -0
- package/references/execution-mode-intelligence.md +242 -0
- package/references/git-integration.md +217 -0
- package/references/honesty-protocols.md +304 -0
- package/references/integration-architecture.md +470 -0
- package/references/issue-to-pr-pipeline.md +150 -0
- package/references/metrics-and-trends.md +234 -0
- package/references/playwright-e2e-testing.md +326 -0
- package/references/questioning.md +125 -0
- package/references/research-improvements.md +110 -0
- package/references/skills-usage-guide.md +429 -0
- package/references/tdd.md +131 -0
- package/references/testing-enforcement.md +192 -0
- package/references/ui-brand.md +383 -0
- package/references/validation-checklist.md +456 -0
- package/references/verification-patterns.md +187 -0
- package/references/warrior-principles.md +173 -0
- package/skills-library/SKILLS-INDEX.md +588 -0
- package/skills-library/_general/frontend/html-visual-reports.md +292 -0
- package/skills-library/_general/methodology/debug-swarm-researcher-escape-hatch.md +240 -0
- package/skills-library/_general/methodology/learncoding-agentic-pattern.md +114 -0
- package/skills-library/_general/methodology/shell-autonomous-loop-fixplan.md +238 -0
- package/skills-library/basics/api-rest-basics.md +162 -0
- package/skills-library/basics/env-variables.md +96 -0
- package/skills-library/basics/error-handling-basics.md +125 -0
- package/skills-library/basics/git-commit-conventions.md +106 -0
- package/skills-library/basics/readme-template.md +108 -0
- package/skills-library/common-tasks/async-await-patterns.md +157 -0
- package/skills-library/common-tasks/auth-jwt-basics.md +164 -0
- package/skills-library/common-tasks/database-schema-design.md +166 -0
- package/skills-library/common-tasks/file-upload-basics.md +166 -0
- package/skills-library/common-tasks/form-validation.md +159 -0
- package/skills-library/debugging/FAILURE_TAXONOMY_CLASSIFICATION.md +117 -0
- package/skills-library/debugging/THREE_AGENT_HYPOTHESIS_DEBUGGING.md +86 -0
- package/skills-library/methodology/BREATH_BASED_PARALLEL_EXECUTION.md +678 -0
- package/skills-library/methodology/CONFIDENCE_GATED_EXECUTION.md +243 -0
- package/skills-library/methodology/EVIDENCE_BASED_VALIDATION.md +308 -0
- package/skills-library/methodology/MULTI_PERSPECTIVE_CODE_REVIEW.md +330 -0
- package/skills-library/methodology/PATH_VERIFICATION_GATE.md +211 -0
- package/skills-library/methodology/REFLEXION_MEMORY_PATTERN.md +183 -0
- package/skills-library/methodology/RESEARCH_BACKED_WORKFLOW_UPGRADE.md +263 -0
- package/skills-library/methodology/SABBATH_REST_PATTERN.md +267 -0
- package/skills-library/methodology/STONE_AND_SCAFFOLD.md +220 -0
- package/skills-library/performance/cache-augmented-generation.md +172 -0
- package/skills-library/quality-safety/debugging-steps.md +147 -0
- package/skills-library/quality-safety/deployment-checklist.md +155 -0
- package/skills-library/quality-safety/security-checklist.md +204 -0
- package/skills-library/quality-safety/testing-basics.md +180 -0
- package/skills-library/security/agent-security-scanner.md +445 -0
- package/skills-library/specialists/api-architecture/api-designer.md +49 -0
- package/skills-library/specialists/api-architecture/graphql-architect.md +49 -0
- package/skills-library/specialists/api-architecture/mcp-developer.md +51 -0
- package/skills-library/specialists/api-architecture/microservices-architect.md +50 -0
- package/skills-library/specialists/api-architecture/websocket-engineer.md +48 -0
- package/skills-library/specialists/backend/django-expert.md +52 -0
- package/skills-library/specialists/backend/fastapi-expert.md +52 -0
- package/skills-library/specialists/backend/laravel-specialist.md +52 -0
- package/skills-library/specialists/backend/nestjs-expert.md +51 -0
- package/skills-library/specialists/backend/rails-expert.md +53 -0
- package/skills-library/specialists/backend/spring-boot-engineer.md +56 -0
- package/skills-library/specialists/data-ml/fine-tuning-expert.md +48 -0
- package/skills-library/specialists/data-ml/ml-pipeline.md +47 -0
- package/skills-library/specialists/data-ml/pandas-pro.md +47 -0
- package/skills-library/specialists/data-ml/rag-architect.md +51 -0
- package/skills-library/specialists/data-ml/spark-engineer.md +47 -0
- package/skills-library/specialists/frontend/angular-architect.md +52 -0
- package/skills-library/specialists/frontend/flutter-expert.md +51 -0
- package/skills-library/specialists/frontend/nextjs-developer.md +54 -0
- package/skills-library/specialists/frontend/react-native-expert.md +50 -0
- package/skills-library/specialists/frontend/vue-expert.md +51 -0
- package/skills-library/specialists/infrastructure/chaos-engineer.md +74 -0
- package/skills-library/specialists/infrastructure/cloud-architect.md +70 -0
- package/skills-library/specialists/infrastructure/database-optimizer.md +64 -0
- package/skills-library/specialists/infrastructure/devops-engineer.md +70 -0
- package/skills-library/specialists/infrastructure/kubernetes-specialist.md +52 -0
- package/skills-library/specialists/infrastructure/monitoring-expert.md +70 -0
- package/skills-library/specialists/infrastructure/sre-engineer.md +70 -0
- package/skills-library/specialists/infrastructure/terraform-engineer.md +51 -0
- package/skills-library/specialists/languages/cpp-pro.md +74 -0
- package/skills-library/specialists/languages/csharp-developer.md +69 -0
- package/skills-library/specialists/languages/dotnet-core-expert.md +54 -0
- package/skills-library/specialists/languages/golang-pro.md +51 -0
- package/skills-library/specialists/languages/java-architect.md +49 -0
- package/skills-library/specialists/languages/javascript-pro.md +68 -0
- package/skills-library/specialists/languages/kotlin-specialist.md +68 -0
- package/skills-library/specialists/languages/php-pro.md +49 -0
- package/skills-library/specialists/languages/python-pro.md +52 -0
- package/skills-library/specialists/languages/react-expert.md +51 -0
- package/skills-library/specialists/languages/rust-engineer.md +50 -0
- package/skills-library/specialists/languages/sql-pro.md +56 -0
- package/skills-library/specialists/languages/swift-expert.md +69 -0
- package/skills-library/specialists/languages/typescript-pro.md +51 -0
- package/skills-library/specialists/platform/atlassian-mcp.md +52 -0
- package/skills-library/specialists/platform/embedded-systems.md +53 -0
- package/skills-library/specialists/platform/game-developer.md +53 -0
- package/skills-library/specialists/platform/salesforce-developer.md +53 -0
- package/skills-library/specialists/platform/shopify-expert.md +49 -0
- package/skills-library/specialists/platform/wordpress-pro.md +49 -0
- package/skills-library/specialists/quality/code-documenter.md +51 -0
- package/skills-library/specialists/quality/code-reviewer.md +67 -0
- package/skills-library/specialists/quality/debugging-wizard.md +51 -0
- package/skills-library/specialists/quality/fullstack-guardian.md +51 -0
- package/skills-library/specialists/quality/legacy-modernizer.md +50 -0
- package/skills-library/specialists/quality/playwright-expert.md +65 -0
- package/skills-library/specialists/quality/spec-miner.md +56 -0
- package/skills-library/specialists/quality/test-master.md +65 -0
- package/skills-library/specialists/security/secure-code-guardian.md +55 -0
- package/skills-library/specialists/security/security-reviewer.md +53 -0
- package/skills-library/specialists/workflow/architecture-designer.md +53 -0
- package/skills-library/specialists/workflow/cli-developer.md +70 -0
- package/skills-library/specialists/workflow/feature-forge.md +65 -0
- package/skills-library/specialists/workflow/prompt-engineer.md +54 -0
- package/skills-library/specialists/workflow/the-fool.md +62 -0
- package/templates/ASSUMPTIONS.md +125 -0
- package/templates/BLOCKERS.md +73 -0
- package/templates/DECISION_LOG.md +116 -0
- package/templates/UAT.md +96 -0
- package/templates/blueprint.md +94 -0
- package/templates/brainstorm.md +185 -0
- package/templates/conscience.md +92 -0
- package/templates/fire-handoff.md +159 -0
- package/templates/metrics.md +67 -0
- package/templates/phase-prompt.md +142 -0
- package/templates/record.md +131 -0
- package/templates/review-report.md +117 -0
- package/templates/skills-index.md +157 -0
- package/templates/verification.md +149 -0
- package/templates/vision.md +79 -0
- package/validation-config.yml +793 -0
- package/version.json +7 -0
- package/workflows/execute-phase.md +732 -0
- package/workflows/handoff-session.md +678 -0
- package/workflows/new-project.md +578 -0
- package/workflows/plan-phase.md +592 -0
- package/workflows/verify-phase.md +874 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Multi-Perspective Code Review - 14 Specialized Reviewer Pattern
|
|
2
|
+
|
|
3
|
+
## The Problem
|
|
4
|
+
|
|
5
|
+
Single-reviewer code reviews miss important issues because one person (or AI persona) can't be an expert in everything. Security experts miss performance issues. Performance experts miss UX problems. Architecture experts miss accessibility concerns.
|
|
6
|
+
|
|
7
|
+
### Why It Was Hard
|
|
8
|
+
|
|
9
|
+
- Traditional code review is one-dimensional
|
|
10
|
+
- Reviewers naturally focus on their strengths
|
|
11
|
+
- Critical issues slip through when expertise is narrow
|
|
12
|
+
- No systematic way to ensure comprehensive coverage
|
|
13
|
+
- AI reviews tend to be generic without specialized focus
|
|
14
|
+
|
|
15
|
+
### Impact
|
|
16
|
+
|
|
17
|
+
- Security vulnerabilities reach production
|
|
18
|
+
- Performance issues discovered too late
|
|
19
|
+
- Technical debt accumulates unnoticed
|
|
20
|
+
- Poor user/developer experience
|
|
21
|
+
- Costly post-deployment fixes
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## The Solution
|
|
26
|
+
|
|
27
|
+
Use **14 specialized reviewer personas** in parallel, each examining code from their unique expertise. This ensures comprehensive coverage across all quality dimensions.
|
|
28
|
+
|
|
29
|
+
### Root Cause of Traditional Review Gaps
|
|
30
|
+
|
|
31
|
+
Reviews fail when they rely on a single generalist perspective. The solution is **deliberate specialization** - force the reviewer to adopt specific expert mindsets.
|
|
32
|
+
|
|
33
|
+
### The 14 Reviewer Personas
|
|
34
|
+
|
|
35
|
+
#### Security Reviewers (4 personas)
|
|
36
|
+
|
|
37
|
+
| Persona | Focus Area | What They Catch |
|
|
38
|
+
|---------|------------|-----------------|
|
|
39
|
+
| **Security Hawk** | OWASP Top 10, injection, auth flaws | Critical vulnerabilities |
|
|
40
|
+
| **Data Guardian** | PII exposure, encryption, privacy | Data leaks, compliance issues |
|
|
41
|
+
| **API Sentinel** | Auth tokens, rate limits, CORS | API abuse vectors |
|
|
42
|
+
| **Crypto Auditor** | Encryption strength, key handling | Weak crypto, key exposure |
|
|
43
|
+
|
|
44
|
+
#### Quality Reviewers (4 personas)
|
|
45
|
+
|
|
46
|
+
| Persona | Focus Area | What They Catch |
|
|
47
|
+
|---------|------------|-----------------|
|
|
48
|
+
| **Performance Eagle** | N+1 queries, memory, bottlenecks | Performance issues |
|
|
49
|
+
| **Test Skeptic** | Coverage gaps, test quality | Untested edge cases |
|
|
50
|
+
| **Error Hunter** | Error handling, edge cases | Unhandled failures |
|
|
51
|
+
| **Type Guardian** | Type safety, any usage | Runtime type errors |
|
|
52
|
+
|
|
53
|
+
#### Architecture Reviewers (3 personas)
|
|
54
|
+
|
|
55
|
+
| Persona | Focus Area | What They Catch |
|
|
56
|
+
|---------|------------|-----------------|
|
|
57
|
+
| **Pattern Police** | SOLID, DRY, design patterns | Anti-patterns |
|
|
58
|
+
| **Coupling Detective** | Dependencies, modularity | Tight coupling |
|
|
59
|
+
| **Scalability Scout** | Growth patterns, limits | Scaling blockers |
|
|
60
|
+
|
|
61
|
+
#### UX/DX Reviewers (3 personas)
|
|
62
|
+
|
|
63
|
+
| Persona | Focus Area | What They Catch |
|
|
64
|
+
|---------|------------|-----------------|
|
|
65
|
+
| **UX Advocate** | User flows, accessibility | Poor user experience |
|
|
66
|
+
| **DX Champion** | API ergonomics, docs | Developer friction |
|
|
67
|
+
| **Maintenance Oracle** | Long-term maintainability | Technical debt |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Implementation
|
|
72
|
+
|
|
73
|
+
### Step 1: Spawn Parallel Reviewers
|
|
74
|
+
|
|
75
|
+
Each persona reviews the same code independently:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
<persona>
|
|
79
|
+
You are the Security Hawk.
|
|
80
|
+
|
|
81
|
+
Your expertise: OWASP Top 10, injection attacks, authentication flaws
|
|
82
|
+
Your mission: Find security vulnerabilities others miss.
|
|
83
|
+
|
|
84
|
+
Review standards:
|
|
85
|
+
- Only report findings with >80% confidence
|
|
86
|
+
- Provide specific file:line references
|
|
87
|
+
- Explain WHY this is a security problem
|
|
88
|
+
- Suggest a fix when possible
|
|
89
|
+
- Rate severity: CRITICAL | HIGH | MEDIUM | LOW
|
|
90
|
+
</persona>
|
|
91
|
+
|
|
92
|
+
<code_to_review>
|
|
93
|
+
{FILE_CONTENTS}
|
|
94
|
+
</code_to_review>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 2: Collect Findings
|
|
98
|
+
|
|
99
|
+
Each persona returns structured findings:
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
### Security Hawk Findings
|
|
103
|
+
|
|
104
|
+
| Severity | Location | Issue | Recommendation |
|
|
105
|
+
|----------|----------|-------|----------------|
|
|
106
|
+
| CRITICAL | auth.ts:45 | SQL injection via string interpolation | Use parameterized queries |
|
|
107
|
+
| HIGH | api/login.ts:12 | No rate limiting | Add rate limit middleware |
|
|
108
|
+
| MEDIUM | config.ts:8 | Weak JWT secret (256-bit) | Use 512-bit minimum |
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Step 3: De-duplicate and Consolidate
|
|
112
|
+
|
|
113
|
+
When multiple personas flag the same issue, consolidate:
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
### Consolidated Finding #1
|
|
117
|
+
- **Issue:** SQL injection vulnerability
|
|
118
|
+
- **Flagged by:** Security Hawk, API Sentinel (2 personas)
|
|
119
|
+
- **Location:** auth.ts:45
|
|
120
|
+
- **Severity:** CRITICAL (consensus)
|
|
121
|
+
- **Description:** Query uses string interpolation
|
|
122
|
+
- **Fix:** Use parameterized query or ORM
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Step 4: Priority Scoring
|
|
126
|
+
|
|
127
|
+
Calculate priority based on severity and persona count:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
PRIORITY = SEVERITY_WEIGHT × PERSONA_COUNT
|
|
131
|
+
|
|
132
|
+
SEVERITY_WEIGHT:
|
|
133
|
+
CRITICAL = 4
|
|
134
|
+
HIGH = 3
|
|
135
|
+
MEDIUM = 2
|
|
136
|
+
LOW = 1
|
|
137
|
+
|
|
138
|
+
Example:
|
|
139
|
+
- CRITICAL found by 2 personas = 4 × 2 = 8 (highest priority)
|
|
140
|
+
- MEDIUM found by 3 personas = 2 × 3 = 6
|
|
141
|
+
- HIGH found by 1 persona = 3 × 1 = 3
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Step 5: Generate Report
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
# Multi-Perspective Code Review
|
|
148
|
+
|
|
149
|
+
**Target:** src/auth/
|
|
150
|
+
**Personas Used:** 14
|
|
151
|
+
**Date:** 2025-01-23
|
|
152
|
+
|
|
153
|
+
## Executive Summary
|
|
154
|
+
|
|
155
|
+
| Severity | Count | Action |
|
|
156
|
+
|----------|-------|--------|
|
|
157
|
+
| CRITICAL | 2 | Immediate fix |
|
|
158
|
+
| HIGH | 5 | Fix before merge |
|
|
159
|
+
| MEDIUM | 8 | Address soon |
|
|
160
|
+
| LOW | 12 | Optional |
|
|
161
|
+
|
|
162
|
+
**Verdict:** BLOCK (CRITICAL findings present)
|
|
163
|
+
|
|
164
|
+
## Critical Findings
|
|
165
|
+
|
|
166
|
+
### #1: SQL Injection (Priority: 8)
|
|
167
|
+
[Details...]
|
|
168
|
+
|
|
169
|
+
### #2: Hardcoded Credentials (Priority: 4)
|
|
170
|
+
[Details...]
|
|
171
|
+
|
|
172
|
+
## Actionable Summary
|
|
173
|
+
|
|
174
|
+
### Must Fix Before Merge
|
|
175
|
+
1. [ ] SQL injection in auth.ts:45
|
|
176
|
+
2. [ ] Hardcoded API key in config.ts:12
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Code Example: Persona Prompt Template
|
|
182
|
+
|
|
183
|
+
```javascript
|
|
184
|
+
const PERSONAS = {
|
|
185
|
+
securityHawk: {
|
|
186
|
+
name: 'Security Hawk',
|
|
187
|
+
expertise: 'OWASP Top 10, injection attacks, authentication flaws',
|
|
188
|
+
mission: 'Find security vulnerabilities others miss',
|
|
189
|
+
focusAreas: [
|
|
190
|
+
'SQL/NoSQL injection',
|
|
191
|
+
'XSS vulnerabilities',
|
|
192
|
+
'Authentication bypass',
|
|
193
|
+
'Authorization flaws',
|
|
194
|
+
'CSRF protection'
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
performanceEagle: {
|
|
198
|
+
name: 'Performance Eagle',
|
|
199
|
+
expertise: 'N+1 queries, memory leaks, algorithmic complexity',
|
|
200
|
+
mission: 'Identify performance bottlenecks and optimization opportunities',
|
|
201
|
+
focusAreas: [
|
|
202
|
+
'Database query efficiency',
|
|
203
|
+
'Memory usage patterns',
|
|
204
|
+
'Algorithmic complexity',
|
|
205
|
+
'Caching opportunities',
|
|
206
|
+
'Bundle size impact'
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
// ... other personas
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
function generatePersonaPrompt(persona, code) {
|
|
213
|
+
return `
|
|
214
|
+
You are the ${persona.name}.
|
|
215
|
+
|
|
216
|
+
Your expertise: ${persona.expertise}
|
|
217
|
+
Your mission: ${persona.mission}
|
|
218
|
+
|
|
219
|
+
Focus Areas:
|
|
220
|
+
${persona.focusAreas.map(f => `- ${f}`).join('\n')}
|
|
221
|
+
|
|
222
|
+
Review Standards:
|
|
223
|
+
- Only report findings with >80% confidence
|
|
224
|
+
- Provide specific file:line references
|
|
225
|
+
- Explain WHY this is a problem
|
|
226
|
+
- Suggest a fix when possible
|
|
227
|
+
- Rate severity: CRITICAL | HIGH | MEDIUM | LOW
|
|
228
|
+
|
|
229
|
+
<code_to_review>
|
|
230
|
+
${code}
|
|
231
|
+
</code_to_review>
|
|
232
|
+
|
|
233
|
+
Return your findings in this format:
|
|
234
|
+
| Severity | Location | Issue | Recommendation |
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Testing the Pattern
|
|
242
|
+
|
|
243
|
+
### Before (Single Reviewer)
|
|
244
|
+
```
|
|
245
|
+
Issues Found: 3
|
|
246
|
+
- 1 formatting issue
|
|
247
|
+
- 1 missing comment
|
|
248
|
+
- 1 typo in variable name
|
|
249
|
+
|
|
250
|
+
Time: 2 minutes
|
|
251
|
+
Critical Issues Missed: 2 (SQL injection, hardcoded key)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### After (14 Personas)
|
|
255
|
+
```
|
|
256
|
+
Issues Found: 27
|
|
257
|
+
- 2 CRITICAL security issues
|
|
258
|
+
- 5 HIGH priority issues
|
|
259
|
+
- 8 MEDIUM priority issues
|
|
260
|
+
- 12 LOW/suggestions
|
|
261
|
+
|
|
262
|
+
Time: 5 minutes (parallel execution)
|
|
263
|
+
Critical Issues Caught: 2/2 (100%)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Prevention
|
|
269
|
+
|
|
270
|
+
### When to Use Multi-Perspective Review
|
|
271
|
+
|
|
272
|
+
- **Always:** Before merging to main/production
|
|
273
|
+
- **Always:** For security-sensitive code
|
|
274
|
+
- **Always:** For new features affecting users
|
|
275
|
+
- **Optional:** For minor internal changes
|
|
276
|
+
|
|
277
|
+
### Review Depth Configurations
|
|
278
|
+
|
|
279
|
+
| Depth | Personas | Use Case |
|
|
280
|
+
|-------|----------|----------|
|
|
281
|
+
| Quick | 4 (Security Hawk, Performance Eagle, Test Skeptic, Pattern Police) | Hotfixes |
|
|
282
|
+
| Normal | 14 (all) | Standard PRs |
|
|
283
|
+
| Deep | 14 + cross-file analysis | Major features |
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Related Patterns
|
|
288
|
+
|
|
289
|
+
- [STRIDE Threat Modeling](../deployment-security/STRIDE_THREAT_MODELING.md)
|
|
290
|
+
- [Evidence-Based Validation](./EVIDENCE_BASED_VALIDATION.md)
|
|
291
|
+
- [60-Point Validation Checklist](../methodology/VALIDATION_CHECKLIST.md)
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Common Mistakes to Avoid
|
|
296
|
+
|
|
297
|
+
- **Using too few personas** - 4 minimum, 14 for comprehensive coverage
|
|
298
|
+
- **Running sequentially** - Always parallel for speed
|
|
299
|
+
- **Ignoring low-severity findings** - They accumulate into technical debt
|
|
300
|
+
- **Skipping de-duplication** - Consolidated findings are more actionable
|
|
301
|
+
- **No priority scoring** - Without scoring, all issues seem equal
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Resources
|
|
306
|
+
|
|
307
|
+
- [OWASP Code Review Guide](https://owasp.org/www-project-code-review-guide/)
|
|
308
|
+
- [Google Engineering Practices](https://google.github.io/eng-practices/review/)
|
|
309
|
+
- [compounding-engineering multi-perspective review](https://github.com/anthropics/claude-code-plugins)
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Time to Implement
|
|
314
|
+
|
|
315
|
+
**Initial Setup:** 30 minutes (create persona prompts)
|
|
316
|
+
**Per Review:** 5-10 minutes (parallel execution)
|
|
317
|
+
**ROI:** Catches 3-5x more issues than single-reviewer
|
|
318
|
+
|
|
319
|
+
## Difficulty Level
|
|
320
|
+
|
|
321
|
+
⭐⭐⭐ (3/5) - Moderate complexity, high value
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
**Author Notes:**
|
|
326
|
+
This pattern emerged from analyzing the compounding-engineering marketplace plugin. The key insight is that **specialization beats generalization** in code review. By forcing distinct expert perspectives, you eliminate blind spots that plague traditional reviews.
|
|
327
|
+
|
|
328
|
+
The 14-persona configuration was chosen to cover all major quality dimensions without excessive overlap. Fewer personas miss issues; more personas create noise without added value.
|
|
329
|
+
|
|
330
|
+
**Implementation in Dominion Flow:** Available via `/fire-7-review` command.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Path Verification Gate — Mandatory Wrong-Repo Circuit Breaker
|
|
2
|
+
|
|
3
|
+
## The Problem
|
|
4
|
+
|
|
5
|
+
In multi-project sessions (or when working directories have similar names), subagents can
|
|
6
|
+
operate on the wrong repository. This is a **silent, catastrophic failure** — the subagent
|
|
7
|
+
reads wrong files, proposes wrong fixes, and potentially modifies the wrong codebase. The
|
|
8
|
+
parent agent has no way to detect this after the fact because the subagent returns plausible-
|
|
9
|
+
looking results from the wrong project.
|
|
10
|
+
|
|
11
|
+
### Real Incident
|
|
12
|
+
|
|
13
|
+
A subagent was tasked with exploring `MINISTRY-LMS` plugin structure but instead explored
|
|
14
|
+
`my-other-project` (a different project in the same repos directory). The agent returned
|
|
15
|
+
detailed analysis of the wrong codebase. The error was only caught because the parent agent
|
|
16
|
+
noticed unfamiliar file paths in the results.
|
|
17
|
+
|
|
18
|
+
### Why It Was Hard
|
|
19
|
+
|
|
20
|
+
- Subagents inherit the parent's working directory, but path resolution can drift
|
|
21
|
+
- Similar project names (`MINISTRY-LMS` vs `my-other-project`) create confusion
|
|
22
|
+
- Subagent results look plausible even from the wrong repo (both are MERN stacks)
|
|
23
|
+
- No built-in path constraint mechanism in the subagent protocol
|
|
24
|
+
- Detection is post-hoc — by the time you notice, context has been wasted
|
|
25
|
+
|
|
26
|
+
### Impact
|
|
27
|
+
|
|
28
|
+
- Wrong analysis fed into planning decisions
|
|
29
|
+
- Wasted context window on irrelevant exploration
|
|
30
|
+
- Potential for destructive operations (deletion, modification) on wrong project
|
|
31
|
+
- Undermines trust in subagent results (which degrades the entire swarm pattern)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## The Solution
|
|
36
|
+
|
|
37
|
+
### Root Cause
|
|
38
|
+
|
|
39
|
+
Subagents receive a task prompt but no explicit path boundary. When the working directory
|
|
40
|
+
contains multiple similar projects, the agent's search/glob patterns can match files in
|
|
41
|
+
sibling directories. There is no "fence" preventing cross-project contamination.
|
|
42
|
+
|
|
43
|
+
### The Path Verification Gate
|
|
44
|
+
|
|
45
|
+
A **MANDATORY** (non-overridable) check that runs before any file operation:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
### Step 3.5: Path Verification Gate (MANDATORY — v5.0)
|
|
49
|
+
|
|
50
|
+
Before ANY file operation, verify these HARD GATES (no confidence override):
|
|
51
|
+
|
|
52
|
+
1. WORKING DIRECTORY CHECK
|
|
53
|
+
expected_project = extract from CONSCIENCE.md or VISION.md or user context
|
|
54
|
+
actual_cwd = pwd
|
|
55
|
+
IF actual_cwd does NOT contain expected_project path:
|
|
56
|
+
→ HARD STOP: "Wrong directory. Expected {expected}, got {actual_cwd}."
|
|
57
|
+
→ Do NOT proceed. Do NOT create files. Do NOT modify anything.
|
|
58
|
+
|
|
59
|
+
2. SUBAGENT PATH INJECTION
|
|
60
|
+
When spawning ANY subagent (Task tool), ALWAYS include:
|
|
61
|
+
<path_constraint>
|
|
62
|
+
PROJECT_ROOT: {absolute path to current project}
|
|
63
|
+
ALLOWED_PATHS: {PROJECT_ROOT}/**
|
|
64
|
+
FORBIDDEN: Do NOT read, write, or search files outside PROJECT_ROOT.
|
|
65
|
+
If you discover you are in the wrong directory, STOP and report.
|
|
66
|
+
</path_constraint>
|
|
67
|
+
|
|
68
|
+
3. DELETION SAFETY
|
|
69
|
+
Before deleting files:
|
|
70
|
+
- Count planned deletions vs actual files found
|
|
71
|
+
- If count mismatch > 0: STOP and report discrepancy
|
|
72
|
+
- Verify each path starts with PROJECT_ROOT
|
|
73
|
+
- Check against a keep-list of protected files
|
|
74
|
+
|
|
75
|
+
4. CROSS-PROJECT CONTAMINATION CHECK
|
|
76
|
+
In sessions with multiple working directories:
|
|
77
|
+
- Explicitly name the TARGET project in every tool call description
|
|
78
|
+
- Verify glob/grep results all share the same project root
|
|
79
|
+
- If results span multiple projects: STOP and filter
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Key Design Principle
|
|
83
|
+
|
|
84
|
+
**This gate is a circuit breaker, NOT a confidence check.**
|
|
85
|
+
|
|
86
|
+
Confidence gates (from Upgrade 6) allow override at HIGH confidence. Path verification
|
|
87
|
+
does NOT. A 100% confident agent operating on the wrong repo is 100% wrong. The gate is
|
|
88
|
+
binary: right path = proceed, wrong path = stop.
|
|
89
|
+
|
|
90
|
+
### Code Example — Subagent Spawn
|
|
91
|
+
|
|
92
|
+
**Before (No Path Constraint):**
|
|
93
|
+
```markdown
|
|
94
|
+
Task(
|
|
95
|
+
prompt="Explore plugin structure in server/plugins/installed/",
|
|
96
|
+
subagent_type="Explore",
|
|
97
|
+
description="Explore plugin files"
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**After (With Path Constraint):**
|
|
102
|
+
```markdown
|
|
103
|
+
Task(
|
|
104
|
+
prompt="""
|
|
105
|
+
<path_constraint>
|
|
106
|
+
PROJECT_ROOT: C:\path\to\your-project
|
|
107
|
+
ALLOWED_PATHS: C:\path\to\your-project\**
|
|
108
|
+
FORBIDDEN: Do NOT access files outside MINISTRY-LMS.
|
|
109
|
+
</path_constraint>
|
|
110
|
+
|
|
111
|
+
Explore plugin structure in server/plugins/installed/
|
|
112
|
+
All file paths MUST start with C:\path\to\your-project
|
|
113
|
+
""",
|
|
114
|
+
subagent_type="Explore",
|
|
115
|
+
description="Explore MINISTRY-LMS plugin files"
|
|
116
|
+
)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Implementation Locations
|
|
120
|
+
|
|
121
|
+
| Command | Location | What It Protects |
|
|
122
|
+
|---------|----------|-----------------|
|
|
123
|
+
| `fire-3-execute.md` | Step 3.5 | All plan execution (file creation, modification, deletion) |
|
|
124
|
+
| `fire-debug.md` | Steps 4 + 6 | Debug subagent spawns (investigation + continuation) |
|
|
125
|
+
| `fire-loop.md` | Step 0.5 | Loop file creation and all iteration work |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Testing the Fix
|
|
130
|
+
|
|
131
|
+
### Before
|
|
132
|
+
```
|
|
133
|
+
Subagent spawned → explores whatever directory it finds
|
|
134
|
+
Returns results from wrong project → accepted as correct
|
|
135
|
+
Parent agent builds on wrong foundation → cascading errors
|
|
136
|
+
Detection: NONE until human notices wrong file paths
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### After
|
|
140
|
+
```
|
|
141
|
+
Subagent spawned with <path_constraint> block
|
|
142
|
+
Subagent checks PROJECT_ROOT before any file operation
|
|
143
|
+
Wrong directory detected → immediate STOP + report
|
|
144
|
+
Parent agent receives clear error instead of wrong results
|
|
145
|
+
Detection: IMMEDIATE at point of divergence
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Test Cases
|
|
149
|
+
```
|
|
150
|
+
1. Spawn subagent in multi-project session
|
|
151
|
+
→ Subagent should only access files under PROJECT_ROOT
|
|
152
|
+
→ Glob results outside PROJECT_ROOT should trigger STOP
|
|
153
|
+
|
|
154
|
+
2. Attempt file deletion with count mismatch
|
|
155
|
+
→ Plan says "delete 28 files", only 27 found
|
|
156
|
+
→ Gate STOPS and reports: "Expected 28, found 27. Missing: X"
|
|
157
|
+
|
|
158
|
+
3. Session with similar project names
|
|
159
|
+
→ MINISTRY-LMS vs my-other-project
|
|
160
|
+
→ All operations explicitly name target project
|
|
161
|
+
→ Grep results filtered to single project root
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Prevention
|
|
167
|
+
|
|
168
|
+
1. **Always inject `<path_constraint>`** into every subagent spawn prompt
|
|
169
|
+
2. **Always include project name** in Task description field (not just the prompt)
|
|
170
|
+
3. **Use absolute paths** in all file operations — never relative paths that could resolve elsewhere
|
|
171
|
+
4. **Count before deleting** — verify planned count matches actual count
|
|
172
|
+
5. **Name the project explicitly** in multi-directory sessions
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Related Patterns
|
|
177
|
+
|
|
178
|
+
- [Confidence-Gated Execution](./CONFIDENCE_GATED_EXECUTION.md) — Confidence gates for non-path decisions
|
|
179
|
+
- [Evidence-Based Validation](./EVIDENCE_BASED_VALIDATION.md) — Verify results against expectations
|
|
180
|
+
- [Advanced Orchestration Patterns](./ADVANCED_ORCHESTRATION_PATTERNS.md) — Subagent management
|
|
181
|
+
|
|
182
|
+
## Common Mistakes to Avoid
|
|
183
|
+
|
|
184
|
+
- Don't make path verification confidence-overridable (100% confident + wrong repo = disaster)
|
|
185
|
+
- Don't assume subagents inherit the right context (they inherit cwd but not intent)
|
|
186
|
+
- Don't skip the gate for "simple" operations (simple operations in the wrong repo are still wrong)
|
|
187
|
+
- Don't use relative paths in multi-project sessions (they resolve unpredictably)
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Resources
|
|
192
|
+
|
|
193
|
+
- SDFT paper insight: "Recovery from own errors > memorizing expert paths" — the wrong-repo incident
|
|
194
|
+
IS the error. The gate IS the recovery mechanism.
|
|
195
|
+
- MINISTRY-LMS modular refactoring: the real incident that triggered this skill's creation
|
|
196
|
+
|
|
197
|
+
## Time to Implement
|
|
198
|
+
|
|
199
|
+
**30 minutes** — add `<path_constraint>` block to all subagent spawn templates
|
|
200
|
+
|
|
201
|
+
## Difficulty Level
|
|
202
|
+
|
|
203
|
+
2/5 — Simple to implement once you know it's needed. The hard part was experiencing the failure.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Author Notes:**
|
|
208
|
+
This skill exists because a subagent explored the wrong repository and returned plausible results.
|
|
209
|
+
The lesson: subagents are powerful but directionless. They'll happily explore any directory you
|
|
210
|
+
point them at — or that they THINK you pointed them at. The path constraint block is cheap insurance
|
|
211
|
+
against an expensive failure mode. Make it mandatory. No exceptions. No confidence override.
|