Created
January 16, 2026 20:11
-
-
Save brianmjohnson/f32b7954147c5d92fca77c1e2b2deb88 to your computer and use it in GitHub Desktop.
Principle 17: Rule of Five
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| principle_id: P17 | |
| name: Rule of Five | |
| short_name: rule-of-five | |
| category: autonomous-execution | |
| intent: Work converges through 4-5 review passes before completion | |
| triggers: | |
| - completing any deliverable | |
| - declaring work done | |
| - epic planning | |
| related_principles: | |
| - P13 | |
| - P14 | |
| - P16 | |
| sub_components: 0 | |
| version: 1.0.0 | |
| last_updated: 2025-12-11 | |
| --- | |
| # P17: Rule of Five (Convergence Passes) | |
| ## The Problem | |
| AI agents often deliver first draft as final output, leading to: | |
| - Unconverged designs missing edge cases | |
| - Shallow implementations (happy path only) | |
| - Incomplete test coverage | |
| - Planning gaps before execution | |
| ## The Principle | |
| **Work must "converge" through 4-5 review passes before complete.** | |
| Like training a neural network, work improves with each pass. First draft captures ~80%; subsequent passes refine execution. | |
| ## The Five Convergence Passes | |
| | Pass | Focus | Question | Artifact | | |
| |------|-------|----------|----------| | |
| | 1. Design | Problem definition | "What are we solving?" | Requirements | | |
| | 2. Plan | Implementation strategy | "How will we solve it?" | Plan | | |
| | 3. Implement | Code execution | "Does this work?" | Working code | | |
| | 4. Test | Quality verification | "All cases handled?" | Tests | | |
| | 5. Code Health | Maintainability | "Is this sustainable?" | Clean code | | |
| ## Scaling by Complexity | |
| | Size | Passes | Pattern | | |
| |------|--------|---------| | |
| | Small (<1 hr) | 2-3 | Implement → Test → Clean | | |
| | Medium (1-8 hr) | 3-4 | Design → Implement → Test → Health | | |
| | Large (>8 hr) | 5 | All five passes mandatory | | |
| | Issue Closure | 6 | All passes + Quality Gate validation | | |
| ## Epic Planning Protocol | |
| For epics, apply 5 passes to the PLAN itself: | |
| 1. **Draft 1:** Initial breakdown | |
| 2. **Draft 2:** Review dependencies | |
| 3. **Draft 3:** Detailed designs | |
| 4. **Draft 4:** Proofread, validate completeness | |
| 5. **Draft 5:** Final polish, file to Beads | |
| **Never begin implementation until plan has converged.** | |
| ## Pass-Specific Checklists | |
| **Pass 1 (Design):** | |
| - [ ] Problem clearly stated | |
| - [ ] Success criteria defined | |
| - [ ] Scope boundaries explicit | |
| **Pass 2 (Plan):** | |
| - [ ] Steps ordered | |
| - [ ] Dependencies identified | |
| - [ ] Risks flagged | |
| **Pass 3 (Implement):** | |
| - [ ] Code runs | |
| - [ ] Happy path works | |
| - [ ] Basic tests pass | |
| **Pass 4 (Test):** | |
| - [ ] Edge cases covered | |
| - [ ] Error paths tested | |
| - [ ] Integration verified | |
| **Pass 5 (Code Health):** | |
| - [ ] No files >500 lines | |
| - [ ] No functions >50 lines | |
| - [ ] Dead code removed | |
| **Pass 6 (Quality Gate - Issue Closure):** | |
| - [ ] Acceptance criteria all checked ([x]) | |
| - [ ] Files traceable via nanoid | |
| - [ ] Git commits reference work item | |
| - [ ] No tests deleted to pass | |
| - [ ] No shortcuts detected (batch close, etc.) | |
| ## Agent Rules | |
| ``` | |
| ❌ "Here's the implementation. Done!" | |
| ✅ "Initial implementation (Pass 1). Reviewing for edge cases..." | |
| → "Pass 2 complete. Found 3 edge cases, added handling." | |
| → "Pass 3 complete. Tests passing." | |
| → "Pass 4 complete. Code health check done." | |
| ``` | |
| ## Integration with Other Principles | |
| | Principle | Integration | | |
| |-----------|-------------| | |
| | P13 (MVC) | MVC within each pass | | |
| | P14 (Zero-Cost) | Multiple passes are FREE | | |
| | P16 (Autonomous) | 3+ attempts = convergence | | |
| ## Why This Matters | |
| **Without passes:** Ship first-draft, miss edge cases, accumulate issues | |
| **With passes:** Handle edge cases, comprehensive tests, maintainable code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment