@hivehub/rulebook 5.0.0 → 5.1.1
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 +1 -1
- package/README.md +25 -6
- package/dist/cli/commands.js +2 -2
- package/dist/cli/commands.js.map +1 -1
- package/dist/core/agent-template-engine.d.ts.map +1 -1
- package/dist/core/agent-template-engine.js +12 -0
- package/dist/core/agent-template-engine.js.map +1 -1
- package/dist/core/config-manager.d.ts.map +1 -1
- package/dist/core/config-manager.js +7 -8
- package/dist/core/config-manager.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/rulebook-server.d.ts +6 -0
- package/dist/mcp/rulebook-server.d.ts.map +1 -1
- package/dist/mcp/rulebook-server.js +117 -24
- package/dist/mcp/rulebook-server.js.map +1 -1
- package/dist/memory/hnsw-index.d.ts +3 -0
- package/dist/memory/hnsw-index.d.ts.map +1 -1
- package/dist/memory/hnsw-index.js +12 -0
- package/dist/memory/hnsw-index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/generic/code-reviewer.md +2 -0
- package/templates/agents/generic/project-manager.md +2 -0
- package/templates/agents/generic/test-engineer.md +1 -0
- package/templates/agents/implementer.md +8 -4
- package/templates/agents/tester.md +7 -4
- package/templates/rules/incremental-implementation.md +56 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: incremental-implementation
|
|
3
|
+
tier: 1
|
|
4
|
+
description: "Implement step by step, test each step, restart from scratch if stuck"
|
|
5
|
+
alwaysApply: true
|
|
6
|
+
filePatterns: ["*"]
|
|
7
|
+
tools: ["all"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Incremental Implementation — Step by Step, Test Each Step
|
|
11
|
+
|
|
12
|
+
NEVER implement everything at once. Build incrementally, verify at every step, and restart from scratch when stuck.
|
|
13
|
+
|
|
14
|
+
## Required Process
|
|
15
|
+
|
|
16
|
+
1. **Understand** the full scope before writing any code
|
|
17
|
+
2. **Decompose** into the smallest possible steps
|
|
18
|
+
3. **Implement ONE step** at a time
|
|
19
|
+
4. **Test/verify** that step immediately (compile, run, test)
|
|
20
|
+
5. **Fix any errors** before moving to the next step
|
|
21
|
+
6. **Record learnings** in the knowledge base after each significant discovery
|
|
22
|
+
7. **Repeat** until complete
|
|
23
|
+
|
|
24
|
+
## The Restart Rule
|
|
25
|
+
|
|
26
|
+
If you have spent more than 3 failed attempts fixing the same error:
|
|
27
|
+
|
|
28
|
+
1. **STOP** — do not try a 4th variation of the same approach
|
|
29
|
+
2. **Analyze** what went wrong — write down root causes, not symptoms
|
|
30
|
+
3. **Record** the failed approach as an anti-pattern in the knowledge base
|
|
31
|
+
4. **Remove** the broken code completely — do not patch on top of patches
|
|
32
|
+
5. **Reimplementation from scratch** using a different approach informed by what you learned
|
|
33
|
+
6. **Test each step** of the new approach before proceeding
|
|
34
|
+
|
|
35
|
+
## Knowledge Base Integration
|
|
36
|
+
|
|
37
|
+
After every significant implementation:
|
|
38
|
+
|
|
39
|
+
1. **Check existing knowledge** before starting: `rulebook knowledge list` or search `.rulebook/knowledge/`
|
|
40
|
+
2. **Record patterns** that worked: `rulebook knowledge add pattern "<title>" --category <cat>`
|
|
41
|
+
3. **Record anti-patterns** that failed: `rulebook knowledge add anti-pattern "<title>" --category <cat>`
|
|
42
|
+
4. **Capture learnings** from debugging: `rulebook learn capture --title "<title>" --content "<content>"`
|
|
43
|
+
|
|
44
|
+
## Forbidden
|
|
45
|
+
|
|
46
|
+
- Implementing an entire feature in one pass without intermediate verification
|
|
47
|
+
- Spending more than 3 attempts fixing the same error with the same approach
|
|
48
|
+
- Patching broken code on top of broken code instead of restarting clean
|
|
49
|
+
- Ignoring the knowledge base — check it BEFORE implementing, update it AFTER
|
|
50
|
+
- Batching all tests to the end instead of testing each step
|
|
51
|
+
|
|
52
|
+
## Why
|
|
53
|
+
|
|
54
|
+
AI agents that implement everything at once produce cascading errors. One early mistake propagates through the entire implementation, and debugging becomes exponentially harder. Step-by-step with immediate verification catches errors at the source. When stuck, restarting from scratch with new knowledge is always faster than patching endlessly. The line between persistence and stubbornness is thin.
|
|
55
|
+
|
|
56
|
+
**"Slow is smooth, smooth is fast."**
|