@hivehub/rulebook 5.1.2 → 5.2.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/commands/rulebook-task-apply.md +25 -7
- package/.claude/commands/rulebook-task-archive.md +19 -10
- package/.claude/commands/rulebook-task-create.md +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +25 -39
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +50 -8
- 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 +8 -2
- package/dist/core/agent-template-engine.js.map +1 -1
- package/dist/core/complexity-detector.d.ts.map +1 -1
- package/dist/core/complexity-detector.js +109 -29
- package/dist/core/complexity-detector.js.map +1 -1
- package/dist/core/decision-manager.d.ts.map +1 -1
- package/dist/core/decision-manager.js +2 -7
- package/dist/core/decision-manager.js.map +1 -1
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/generator.js.map +1 -1
- package/dist/core/indexer/background-indexer.d.ts +1 -0
- package/dist/core/indexer/background-indexer.d.ts.map +1 -1
- package/dist/core/indexer/background-indexer.js +107 -19
- package/dist/core/indexer/background-indexer.js.map +1 -1
- package/dist/core/indexer/indexer-types.d.ts +2 -0
- package/dist/core/indexer/indexer-types.d.ts.map +1 -1
- package/dist/core/knowledge-manager.d.ts.map +1 -1
- package/dist/core/knowledge-manager.js +1 -1
- package/dist/core/knowledge-manager.js.map +1 -1
- package/dist/core/learn-manager.d.ts.map +1 -1
- package/dist/core/learn-manager.js +1 -1
- package/dist/core/learn-manager.js.map +1 -1
- package/dist/core/rule-engine.d.ts.map +1 -1
- package/dist/core/rule-engine.js +1 -3
- package/dist/core/rule-engine.js.map +1 -1
- package/dist/core/task-manager.d.ts +23 -0
- package/dist/core/task-manager.d.ts.map +1 -1
- package/dist/core/task-manager.js +137 -3
- package/dist/core/task-manager.js.map +1 -1
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp/rulebook-server.d.ts.map +1 -1
- package/dist/mcp/rulebook-server.js +20 -8
- package/dist/mcp/rulebook-server.js.map +1 -1
- package/dist/memory/hnsw-index.d.ts.map +1 -1
- package/dist/memory/hnsw-index.js +12 -4
- package/dist/memory/hnsw-index.js.map +1 -1
- package/dist/memory/memory-store.d.ts.map +1 -1
- package/dist/memory/memory-store.js +53 -24
- package/dist/memory/memory-store.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/rules/knowledge-base-usage.md +41 -0
|
@@ -14,24 +14,35 @@ description: Implement an approved Rulebook task and keep tasks checklist in syn
|
|
|
14
14
|
**Steps**
|
|
15
15
|
Track these steps as TODOs and complete them one by one.
|
|
16
16
|
|
|
17
|
-
1. **
|
|
17
|
+
1. **Check Knowledge Base FIRST (MANDATORY)**:
|
|
18
|
+
Before writing any code, search for relevant patterns and anti-patterns:
|
|
19
|
+
```bash
|
|
20
|
+
rulebook knowledge list
|
|
21
|
+
```
|
|
22
|
+
Also search learnings related to this area:
|
|
23
|
+
```bash
|
|
24
|
+
rulebook learn list
|
|
25
|
+
```
|
|
26
|
+
Apply any relevant patterns. Avoid any documented anti-patterns.
|
|
27
|
+
|
|
28
|
+
2. **Read Task Details**:
|
|
18
29
|
```bash
|
|
19
30
|
rulebook task show <task-id>
|
|
20
31
|
```
|
|
21
32
|
Read `proposal.md`, `design.md` (if present), and `tasks.md` to confirm scope and acceptance criteria.
|
|
22
33
|
|
|
23
|
-
|
|
34
|
+
3. **Follow Priority Order (MANDATORY)**:
|
|
24
35
|
- **Tests** (HIGHEST PRIORITY) - Write tests first
|
|
25
36
|
- **Coverage Verification** (CRITICAL) - Verify coverage ≥95%
|
|
26
37
|
- **Update Task Status** (MANDATORY) - Mark completed items as `[x]` in `tasks.md`
|
|
27
38
|
- **Next Task** (Only after above steps)
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
4. **Work Through Tasks Sequentially**:
|
|
30
41
|
- Work through `tasks.md` checklist item by item
|
|
31
42
|
- Keep edits minimal and focused on the requested change
|
|
32
43
|
- Follow priority order (most critical first)
|
|
33
44
|
|
|
34
|
-
|
|
45
|
+
5. **After Each Implementation Step**:
|
|
35
46
|
- ✅ Implement the feature
|
|
36
47
|
- ✅ Test the implementation
|
|
37
48
|
- ✅ Verify test coverage (run `npm test -- --coverage`)
|
|
@@ -39,7 +50,7 @@ Track these steps as TODOs and complete them one by one.
|
|
|
39
50
|
- ✅ Commit locally (backup)
|
|
40
51
|
- ✅ Only then proceed to next task
|
|
41
52
|
|
|
42
|
-
|
|
53
|
+
6. **Update Tasks Checklist**:
|
|
43
54
|
After completing and testing each item:
|
|
44
55
|
```markdown
|
|
45
56
|
## 1. Implementation Phase
|
|
@@ -48,17 +59,24 @@ Track these steps as TODOs and complete them one by one.
|
|
|
48
59
|
- [ ] 1.3 Add archive functionality <!-- next: will start after status update -->
|
|
49
60
|
```
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
7. **Confirm Completion**:
|
|
52
63
|
- Make sure every item in `tasks.md` is finished
|
|
53
64
|
- All tests pass
|
|
54
65
|
- Coverage meets thresholds
|
|
55
66
|
- Documentation updated
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
8. **Update Checklist After All Work**:
|
|
58
69
|
- Mark each completed task as `[x]`
|
|
59
70
|
- Add comments with test status and coverage
|
|
60
71
|
- Reflect reality in the checklist
|
|
61
72
|
|
|
73
|
+
9. **Capture Learnings (MANDATORY)**:
|
|
74
|
+
After completing the task, record what you learned:
|
|
75
|
+
- **Patterns that worked** → `rulebook knowledge add pattern "<title>" --category <cat>`
|
|
76
|
+
- **Anti-patterns discovered** → `rulebook knowledge add anti-pattern "<title>" --category <cat>`
|
|
77
|
+
- **Debugging insights** → `rulebook learn capture --title "<title>" --content "<what you learned>"`
|
|
78
|
+
- If nothing significant was learned, record at minimum: `rulebook learn capture --title "Completed <task-id>" --content "Implemented <summary>. No unexpected issues."`
|
|
79
|
+
|
|
62
80
|
**Reference**
|
|
63
81
|
- Use `rulebook task show <task-id>` when additional context is required
|
|
64
82
|
- Use `rulebook task validate <task-id>` to check format before archiving
|
|
@@ -11,13 +11,22 @@ description: Archive a completed Rulebook task and apply spec deltas to main spe
|
|
|
11
11
|
- Refer to `/.rulebook/specs/RULEBOOK.md` for complete task management guidelines.
|
|
12
12
|
|
|
13
13
|
**Steps**
|
|
14
|
-
1. **
|
|
14
|
+
1. **Capture Learnings BEFORE Archiving (MANDATORY)**:
|
|
15
|
+
Before archiving, record what was learned during this task:
|
|
16
|
+
- **Patterns discovered** → `rulebook knowledge add pattern "<title>" --category <cat> --description "<desc>"`
|
|
17
|
+
- **Anti-patterns found** → `rulebook knowledge add anti-pattern "<title>" --category <cat> --description "<desc>"`
|
|
18
|
+
- **Implementation learnings** → `rulebook learn capture --title "<title>" --content "<what you learned>"`
|
|
19
|
+
- **Architectural decisions** → record via `rulebook decision create` if a significant design choice was made
|
|
20
|
+
|
|
21
|
+
Minimum: at least ONE learning must be captured per task archive. If the task was trivial, record: `rulebook learn capture --title "Completed <task-id>" --content "<1-line summary of what was done>"`
|
|
22
|
+
|
|
23
|
+
2. **Verify Task Completion**:
|
|
15
24
|
- All items in `tasks.md` must be marked as `[x]`
|
|
16
25
|
- All tests must pass
|
|
17
26
|
- Code review complete (if applicable)
|
|
18
27
|
- Documentation updated (README, CHANGELOG, specs)
|
|
19
28
|
|
|
20
|
-
|
|
29
|
+
3. **Run Quality Checks**:
|
|
21
30
|
```bash
|
|
22
31
|
npm test
|
|
23
32
|
npm run lint
|
|
@@ -26,13 +35,13 @@ description: Archive a completed Rulebook task and apply spec deltas to main spe
|
|
|
26
35
|
```
|
|
27
36
|
Ensure all checks pass before archiving.
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
4. **Validate Task Format**:
|
|
30
39
|
```bash
|
|
31
40
|
rulebook task validate <task-id>
|
|
32
41
|
```
|
|
33
42
|
Must pass all format checks.
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
5. **Archive Task**:
|
|
36
45
|
```bash
|
|
37
46
|
rulebook task archive <task-id>
|
|
38
47
|
```
|
|
@@ -42,27 +51,27 @@ description: Archive a completed Rulebook task and apply spec deltas to main spe
|
|
|
42
51
|
```
|
|
43
52
|
(Only use `--skip-validation` if you're certain the task is valid)
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
6. **Archive Process**:
|
|
46
55
|
- Validates task format (unless skipped)
|
|
47
56
|
- Checks task completion status
|
|
48
57
|
- Applies spec deltas to main specifications
|
|
49
|
-
- Moves task to `/.rulebook/
|
|
58
|
+
- Moves task to `/.rulebook/archive/YYYY-MM-DD-<task-id>/`
|
|
50
59
|
- Updates related specifications
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
7. **Verify Archive**:
|
|
53
62
|
```bash
|
|
54
63
|
rulebook task list --archived
|
|
55
64
|
```
|
|
56
65
|
Task should appear in archived list.
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
8. **Post-Archive Actions**:
|
|
59
68
|
- Ensure spec deltas are applied to main specifications
|
|
60
69
|
- Update CHANGELOG.md with the change
|
|
61
70
|
- Document any breaking changes
|
|
62
71
|
- Create migration guides (if needed)
|
|
63
72
|
- Unblock related tasks (if any)
|
|
64
73
|
|
|
65
|
-
|
|
74
|
+
9. **🚨 MANDATORY: Deferred Items → Tasks Rule**:
|
|
66
75
|
**ABSOLUTE RULE — NO EXCEPTIONS**: Whenever a task is archived with items marked as "Deferred" or "Phase X+", you MUST immediately create Rulebook tasks for those deferred items **before archiving**.
|
|
67
76
|
|
|
68
77
|
```
|
|
@@ -72,7 +81,7 @@ description: Archive a completed Rulebook task and apply spec deltas to main spe
|
|
|
72
81
|
|
|
73
82
|
✅ CORRECT — defer with tracking:
|
|
74
83
|
1. Add "- [ ] D1. feature X — deferred Phase 4" to tasks.md
|
|
75
|
-
2. Call rulebook_task_create("
|
|
84
|
+
2. Call rulebook_task_create("phase4_feature-x")
|
|
76
85
|
3. Write tasks.md for the new task with full context
|
|
77
86
|
4. THEN call rulebook_task_archive
|
|
78
87
|
```
|
|
@@ -24,7 +24,7 @@ description: Create a new Rulebook task following OpenSpec-compatible format wit
|
|
|
24
24
|
- Review related code or docs (e.g., via `rg`/`ls`) to understand current behavior
|
|
25
25
|
- Note any gaps that require clarification
|
|
26
26
|
|
|
27
|
-
3. **Choose Task ID**:
|
|
27
|
+
3. **Choose Task ID**: MUST use phase prefix: `phase<N>[subletter]_<description>` in kebab-case (e.g., `phase1_add-feature`, `phase2a_fix-login`). Must be unique. Tasks must be sized to fit a single implementation cycle — if a task is too large, split it into multiple smaller tasks within the same phase or across phases.
|
|
28
28
|
|
|
29
29
|
4. **Create Task Structure**:
|
|
30
30
|
```bash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rulebook",
|
|
3
3
|
"description": "Standardize AI-generated projects with Ralph autonomous loop, persistent memory, and quality gates. Supports 28 languages, 17 frameworks, 13 MCP modules, and 20 services.",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "HiveLLM"
|
|
7
7
|
}
|
package/README.md
CHANGED
|
@@ -63,58 +63,44 @@ npx @hivehub/rulebook@latest rules project # Project to all tools
|
|
|
63
63
|
|
|
64
64
|
See the full [CHANGELOG](CHANGELOG.md) for details.
|
|
65
65
|
|
|
66
|
-
### v5.
|
|
67
|
-
|
|
68
|
-
Fixed a critical issue where only one VSCode/Claude Code window could use the MCP server at a time. The PID lock now uses **session-scoped files** (`mcp-server.<pid>.pid`) instead of a single global lock, allowing multiple concurrent MCP instances. Stale PID files from dead processes are automatically cleaned on startup, with backward-compatible cleanup of the legacy format.
|
|
66
|
+
### v5.2.0 — Phase-Based Task Organization
|
|
69
67
|
|
|
70
|
-
|
|
68
|
+
Tasks are now organized by **phases with enforced naming**: `phase<N>_<description>` (e.g., `phase0_setup`, `phase3a_fix-auth`). Inspired by real-world project management where priority and execution order must be visible at a glance in the file explorer.
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
**Phase Naming Convention**
|
|
71
|
+
- Task IDs MUST start with `phase<N>[subletter]_` prefix — rejected at creation otherwise
|
|
72
|
+
- Phases define execution order and priority: `phase0` → `phase1` → `phase2a` → `phase2b` → ...
|
|
73
|
+
- Tasks must fit a single implementation cycle — large tasks are split into multiple phase-prefixed tasks
|
|
73
74
|
|
|
74
|
-
**
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
75
|
+
**Auto-Generated Tasks Index**
|
|
76
|
+
- `tasks/README.md` auto-generated on every task create, archive, delete, and status update
|
|
77
|
+
- Tasks grouped by phase with status icons, progress counters (`3/5`), and descriptions
|
|
78
|
+
- Optimized for LLM context loading — one file gives full project status
|
|
78
79
|
|
|
79
|
-
**
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
- Code reviewers validate against known patterns and anti-patterns
|
|
83
|
-
- Project managers track KB health and remind agents to record learnings
|
|
80
|
+
**Archive Relocated**
|
|
81
|
+
- Moved from `.rulebook/tasks/archive/` to `.rulebook/archive/` for cleaner directory structure
|
|
82
|
+
- Legacy archives auto-migrated during `rulebook update`
|
|
84
83
|
|
|
85
|
-
**
|
|
86
|
-
-
|
|
87
|
-
-
|
|
84
|
+
**Knowledge Base Enforcement**
|
|
85
|
+
- New Tier 1 rule: `knowledge-base-usage` — installed on all projects via `rulebook update`
|
|
86
|
+
- `/rulebook-task-apply`: must check `rulebook knowledge list` before starting, capture learnings after completing
|
|
87
|
+
- `/rulebook-task-archive`: must record at least 1 learning before archiving
|
|
88
88
|
|
|
89
|
-
### v5.
|
|
89
|
+
### v5.1.3 — MCP Server EMFILE Fix
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Function-based chokidar ignore, reduced watch depth, EMFILE auto-recovery to polling mode, configurable indexer settings.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
- Canonical rules live in `.rulebook/rules/` with YAML frontmatter
|
|
95
|
-
- `rulebook update` projects them to **6 tool formats simultaneously**:
|
|
96
|
-
- Claude Code (`.claude/rules/*.md`), Cursor (`.cursor/rules/*.mdc`), Gemini (`GEMINI.md`), Copilot (`.github/copilot-instructions.md`), Windsurf (`.windsurf/rules/`), Continue.dev (`.continue/rules/`)
|
|
93
|
+
### v5.1.2 — MCP Per-Session PID Lock
|
|
97
94
|
|
|
98
|
-
|
|
99
|
-
- 15 agent templates across 5 project types (game-engine, compiler, web-app, mobile, generic)
|
|
100
|
-
- Claude Code: full agents with memory directories
|
|
101
|
-
- Cursor: contextual `.mdc` rules activated by file glob patterns
|
|
102
|
-
- Gemini/Codex: inline conditional sections
|
|
95
|
+
Session-scoped PID files allow multiple concurrent MCP server instances. Auto-cleanup of stale processes.
|
|
103
96
|
|
|
104
|
-
|
|
105
|
-
- No shortcuts/stubs/TODOs, git safety allow-list, no delete without authorization, research-first, sequential editing, no deferred tasks, follow task sequence, **incremental implementation** (step by step, restart if stuck)
|
|
97
|
+
### v5.1.0 — Incremental Implementation & Knowledge Base Integration
|
|
106
98
|
|
|
107
|
-
|
|
108
|
-
- `rulebook assess` — auto-detects LOC, languages, structure
|
|
109
|
-
- Calibrated init: small projects get Tier 1 only, large/complex projects get full agent framework + Tier 2 rules
|
|
99
|
+
Step-by-step implementation and knowledge base usage mandatory for all agents. New `incremental-implementation` tier 1 rule with 3-attempt restart policy.
|
|
110
100
|
|
|
111
|
-
|
|
112
|
-
- Replaced sql.js (WASM) with better-sqlite3 (native) — eliminates 100-500MB memory copies per save
|
|
113
|
-
- Replaced fs.watch with chokidar — stops node_modules event flood
|
|
114
|
-
- HNSW search optimized with MinHeap/MaxHeap (~100x faster)
|
|
101
|
+
### v5.0.0 — Multi-Tool AI Framework
|
|
115
102
|
|
|
116
|
-
|
|
117
|
-
**New CLI**: `rulebook assess`, `rulebook rules list|add|project`, `rulebook task blockers|blocked-by`
|
|
103
|
+
Tool-agnostic AI development framework — canonical rules in `.rulebook/rules/` projected to 6 tool formats simultaneously (Claude Code, Cursor, Gemini, Copilot, Windsurf, Continue.dev). 15 adaptive agent templates, complexity detection, and critical performance fixes (better-sqlite3, chokidar, HNSW optimization).
|
|
118
104
|
|
|
119
105
|
### v4.4.0 — Context Intelligence Layer
|
|
120
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAgEA,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAgEA,wBAAsB,WAAW,CAAC,OAAO,EAAE;IACzC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GAAG,OAAO,CAAC,IAAI,CAAC,CAyiBhB;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA8DrD;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAyCtD;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CA6DtD;AAED,wBAAsB,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AAC,IAAI,CAAC,CAoBhB;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAc3D;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjF;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
package/dist/cli/commands.js
CHANGED
|
@@ -275,9 +275,21 @@ export async function initCommand(options) {
|
|
|
275
275
|
const { getTemplatesDir } = await import('../core/generator.js');
|
|
276
276
|
const templatesDir = getTemplatesDir();
|
|
277
277
|
// Tier 1 rules — always installed
|
|
278
|
-
const tier1Rules = [
|
|
278
|
+
const tier1Rules = [
|
|
279
|
+
'no-shortcuts',
|
|
280
|
+
'git-safety',
|
|
281
|
+
'sequential-editing',
|
|
282
|
+
'research-first',
|
|
283
|
+
'follow-task-sequence',
|
|
284
|
+
'incremental-implementation',
|
|
285
|
+
];
|
|
279
286
|
// Tier 2 rules — installed for medium+ complexity
|
|
280
|
-
const tier2Rules = [
|
|
287
|
+
const tier2Rules = [
|
|
288
|
+
'task-decomposition',
|
|
289
|
+
'incremental-tests',
|
|
290
|
+
'no-deferred',
|
|
291
|
+
'session-workflow',
|
|
292
|
+
];
|
|
281
293
|
const rulesToInstall = [...tier1Rules];
|
|
282
294
|
if (complexity.recommendations.tier2Rules) {
|
|
283
295
|
rulesToInstall.push(...tier2Rules);
|
|
@@ -300,8 +312,12 @@ export async function initCommand(options) {
|
|
|
300
312
|
copilot: detection.githubCopilot?.detected,
|
|
301
313
|
continueDev: detection.continueDev?.detected,
|
|
302
314
|
});
|
|
303
|
-
const totalProjected = ruleResult.claudeCode.length +
|
|
304
|
-
ruleResult.
|
|
315
|
+
const totalProjected = ruleResult.claudeCode.length +
|
|
316
|
+
ruleResult.cursor.length +
|
|
317
|
+
ruleResult.gemini.length +
|
|
318
|
+
ruleResult.copilot.length +
|
|
319
|
+
ruleResult.windsurf.length +
|
|
320
|
+
ruleResult.continueDev.length;
|
|
305
321
|
if (totalProjected > 0) {
|
|
306
322
|
console.log(chalk.gray(` • Projected rules to ${totalProjected} tool-specific files`));
|
|
307
323
|
}
|
|
@@ -1623,6 +1639,16 @@ async function updateSingleProject(cwd, options) {
|
|
|
1623
1639
|
}
|
|
1624
1640
|
}
|
|
1625
1641
|
}
|
|
1642
|
+
// Migrate legacy archive directory from tasks/archive to .rulebook/archive
|
|
1643
|
+
{
|
|
1644
|
+
const { createTaskManager } = await import('../core/task-manager.js');
|
|
1645
|
+
const rulebookDirForArchive = config.rulebookDir || '.rulebook';
|
|
1646
|
+
const tm = createTaskManager(cwd, rulebookDirForArchive);
|
|
1647
|
+
const migrated = await tm.migrateArchive();
|
|
1648
|
+
if (migrated) {
|
|
1649
|
+
console.log(chalk.gray(' • Migrated task archive to .rulebook/archive/'));
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1626
1652
|
// Merge with existing AGENTS.md (with migration support)
|
|
1627
1653
|
const mergeSpinner = ora('Updating AGENTS.md with latest templates...').start();
|
|
1628
1654
|
config.modular = config.modular ?? true; // Enable modular by default
|
|
@@ -1640,7 +1666,15 @@ async function updateSingleProject(cwd, options) {
|
|
|
1640
1666
|
const { getTemplatesDir } = await import('../core/generator.js');
|
|
1641
1667
|
const complexity = assessComplexity(cwd);
|
|
1642
1668
|
const templatesDir = getTemplatesDir();
|
|
1643
|
-
const tier1 = [
|
|
1669
|
+
const tier1 = [
|
|
1670
|
+
'no-shortcuts',
|
|
1671
|
+
'git-safety',
|
|
1672
|
+
'sequential-editing',
|
|
1673
|
+
'research-first',
|
|
1674
|
+
'follow-task-sequence',
|
|
1675
|
+
'incremental-implementation',
|
|
1676
|
+
'knowledge-base-usage',
|
|
1677
|
+
];
|
|
1644
1678
|
const tier2 = ['task-decomposition', 'incremental-tests', 'no-deferred', 'session-workflow'];
|
|
1645
1679
|
const toInstall = [...tier1];
|
|
1646
1680
|
if (complexity.recommendations.tier2Rules) {
|
|
@@ -3793,7 +3827,11 @@ export async function decisionListCommand(options) {
|
|
|
3793
3827
|
return;
|
|
3794
3828
|
}
|
|
3795
3829
|
for (const d of decisions) {
|
|
3796
|
-
const badge = d.status === 'accepted'
|
|
3830
|
+
const badge = d.status === 'accepted'
|
|
3831
|
+
? chalk.green(d.status)
|
|
3832
|
+
: d.status === 'superseded'
|
|
3833
|
+
? chalk.dim(d.status)
|
|
3834
|
+
: chalk.yellow(d.status);
|
|
3797
3835
|
console.log(` ADR-${String(d.id).padStart(3, '0')} ${d.title} ${badge}`);
|
|
3798
3836
|
}
|
|
3799
3837
|
}
|
|
@@ -3873,7 +3911,7 @@ export async function learnCaptureCommand(options) {
|
|
|
3873
3911
|
// If no title/content provided, this would be interactive (placeholder for prompts)
|
|
3874
3912
|
const title = options.title ?? 'Untitled learning';
|
|
3875
3913
|
const content = options.content ?? '';
|
|
3876
|
-
const tags = options.tags ? options.tags.split(',').map(t => t.trim()) : [];
|
|
3914
|
+
const tags = options.tags ? options.tags.split(',').map((t) => t.trim()) : [];
|
|
3877
3915
|
const spinner = ora('Capturing learning...').start();
|
|
3878
3916
|
try {
|
|
3879
3917
|
const learning = await mgr.capture(title, content, {
|
|
@@ -3914,7 +3952,11 @@ export async function learnListCommand(options) {
|
|
|
3914
3952
|
return;
|
|
3915
3953
|
}
|
|
3916
3954
|
for (const l of learnings) {
|
|
3917
|
-
const badge = l.source === 'ralph'
|
|
3955
|
+
const badge = l.source === 'ralph'
|
|
3956
|
+
? chalk.blue('ralph')
|
|
3957
|
+
: l.source === 'task-archive'
|
|
3958
|
+
? chalk.yellow('archive')
|
|
3959
|
+
: chalk.dim('manual');
|
|
3918
3960
|
const promoted = l.promotedTo ? chalk.green(` → ${l.promotedTo.type}`) : '';
|
|
3919
3961
|
console.log(` ${badge} ${l.title}${promoted}`);
|
|
3920
3962
|
}
|