@hanzlaa/rcode 4.4.3 → 4.5.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/AGENTS.md +11 -4
- package/CLAUDE.md +11 -4
- package/CONTRIBUTING.md +6 -1
- package/README.md +1 -1
- package/cli/doctor.js +122 -0
- package/cli/index.js +4 -0
- package/cli/install.js +8 -0
- package/cli/lib/namespace-migrate.cjs +216 -0
- package/cli/migrate-namespace.js +61 -0
- package/cli/update.js +19 -0
- package/dist/rcode.js +215 -208
- package/package.json +14 -12
- package/rcode/bin/lib/brain.cjs +353 -0
- package/rcode/bin/lib/gitignore.cjs +126 -0
- package/rcode/bin/lib/memory-drift.cjs +237 -0
- package/rcode/bin/lib/memory-select.cjs +263 -0
- package/rcode/bin/lib/progress.cjs +440 -0
- package/rcode/bin/lib/state-reader.cjs +127 -0
- package/rcode/bin/lib/summary.cjs +82 -0
- package/rcode/bin/rcode-hooks.cjs +194 -64
- package/rcode/bin/rcode-tools.cjs +183 -997
- package/rcode/data/intent-table.json +19 -19
- package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/heartbeat.sh +0 -0
- package/rcode/templates/memory/INDEX.md +6 -1
- package/rcode/templates/settings-hooks.json +12 -1
- package/rcode/workflows/do.md +2 -2
- package/rcode/workflows/enable-hooks.md +3 -2
- package/rcode/workflows/execute.md +10 -1
- package/rcode/workflows/insert-phase.md +8 -0
- package/rcode/workflows/new-project-roadmap.md +2 -2
- package/rcode/workflows/plan.md +17 -0
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"intent": "new-project",
|
|
4
|
-
"keywords": ["set up a new project", "initialize a new project", "start a new project", "create a new project"],
|
|
4
|
+
"keywords": ["set up a new project", "initialize a new project", "start a new project", "create a new project", "naya project shuru karo", "naya project banao", "مشروع جديد", "ابدأ مشروع جديد"],
|
|
5
5
|
"command": "/rcode-new-project"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"intent": "map-codebase",
|
|
9
|
-
"keywords": ["map the codebase", "map this codebase", "analyze the codebase", "analyse the codebase", "map existing codebase"],
|
|
9
|
+
"keywords": ["map the codebase", "map this codebase", "analyze the codebase", "analyse the codebase", "map existing codebase", "codebase samjhao", "code ka structure dikhao", "حلل الكود", "افهم هيكل المشروع"],
|
|
10
10
|
"command": "/rcode-map-codebase"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"intent": "debug",
|
|
14
|
-
"keywords": ["bug", "getting an error", "throwing an error", "error in the", "fix the error", "debug this", "crash", "failure", "broken", "not working", "fails", "exception", "traceback"],
|
|
14
|
+
"keywords": ["bug", "getting an error", "throwing an error", "error in the", "fix the error", "debug this", "crash", "failure", "broken", "not working", "fails", "exception", "traceback", "kharab", "masla", "ye kaam nahi kar raha", "yeh kaam nahi kar raha", "error a raha hai", "theek karo", "khud se crash", "خطأ", "مشكلة", "لا يعمل", "أصلح الخطأ", "تعطل البرنامج"],
|
|
15
15
|
"command": "/rcode-debug"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"intent": "audit
|
|
19
|
-
"keywords": ["
|
|
20
|
-
"command": "/rcode-
|
|
18
|
+
"intent": "karpathy-audit",
|
|
19
|
+
"keywords": ["review changes", "check my diff", "karpathy", "too complex", "complexity", "diff check karo", "پیچیدہ کوڈ", "تحقق من التغييرات"],
|
|
20
|
+
"command": "/rcode-karpathy-audit"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"intent": "lazy",
|
|
24
|
-
"keywords": ["be lazy", "lazy mode", "simplest solution", "yagni", "over-engineered", "over-engineering", "kam code likho"],
|
|
24
|
+
"keywords": ["be lazy", "lazy mode", "simplest solution", "yagni", "over-engineered", "over-engineering", "kam code likho", "asaan tareeqa", "سهل الحل", "أبسط طريقة"],
|
|
25
25
|
"command": "/rcode-lazy"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"intent": "checkpoint",
|
|
29
|
-
"keywords": ["checkpoint", "explain this diff", "human review", "walk through the change", "walk through this change"],
|
|
29
|
+
"keywords": ["checkpoint", "explain this diff", "human review", "walk through the change", "walk through this change", "diff samjhao", "اشرح هذا التغيير"],
|
|
30
30
|
"command": "/rcode-checkpoint-preview"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"intent": "brainstorm",
|
|
34
|
-
"keywords": ["brainstorm", "generate ideas", "explore options", "what could we do", "ideate", "ideas for"],
|
|
34
|
+
"keywords": ["brainstorm", "generate ideas", "explore options", "what could we do", "ideate", "ideas for", "ideas do", "hum kya kar sakte hain", "أفكار", "ما الذي يمكننا فعله"],
|
|
35
35
|
"command": "/rcode-brainstorm"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"intent": "explore",
|
|
39
|
-
"keywords": ["explore", "research phase", "do some research", "comparing", "investigate", "look into", "understand how"],
|
|
39
|
+
"keywords": ["explore", "research phase", "do some research", "comparing", "investigate", "look into", "understand how", "research karo", "pata karo", "ابحث عن", "قارن بين"],
|
|
40
40
|
"command": "/rcode-research-phase"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"intent": "discuss",
|
|
44
|
-
"keywords": ["which one", "better ux", "how should", "still have confusion", "conflicting", "discuss the scope", "design this", "architect this"],
|
|
44
|
+
"keywords": ["which one", "better ux", "how should", "still have confusion", "conflicting", "discuss the scope", "design this", "architect this", "confusion hai", "kaunsa behtar hai", "أيهما أفضل", "لست متأكداً"],
|
|
45
45
|
"command": "/rcode-discuss-phase"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"intent": "add-phase",
|
|
49
|
-
"keywords": ["refactor", "migration", "multi-file", "system redesign", "multi file", "large refactor", "architectural", "integration", "integrate"],
|
|
49
|
+
"keywords": ["refactor", "migration", "multi-file", "system redesign", "multi file", "large refactor", "architectural", "integration", "integrate", "poora refactor karo", "migration karna hai", "إعادة هيكلة", "ترحيل النظام"],
|
|
50
50
|
"command": "/rcode-add-phase"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"intent": "sprint-planning",
|
|
54
|
-
"keywords": ["sprint planning", "plan the sprint", "next sprint", "what's in this sprint"],
|
|
54
|
+
"keywords": ["sprint planning", "plan the sprint", "next sprint", "what's in this sprint", "sprint plan karo", "تخطيط السبرنت"],
|
|
55
55
|
"command": "/rcode-sprint-planning"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"intent": "execute-sprint",
|
|
59
|
-
"keywords": ["run the sprint", "start sprint", "execute sprint", "work on sprint"],
|
|
59
|
+
"keywords": ["run the sprint", "start sprint", "execute sprint", "work on sprint", "sprint chalao", "sprint shuru karo", "نفذ السبرنت", "ابدأ السبرنت"],
|
|
60
60
|
"command": "/rcode-execute-sprint"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"intent": "plan",
|
|
64
|
-
"keywords": ["let's plan", "plan phase", "plan this", "let me plan", "planning phase", "create a plan", "please plan", "plan and think", "scope this", "scope the feature"],
|
|
64
|
+
"keywords": ["let's plan", "plan phase", "plan this", "let me plan", "planning phase", "create a plan", "please plan", "plan and think", "scope this", "scope the feature", "plan banao", "isko plan karo", "خطط لهذا", "أنشئ خطة"],
|
|
65
65
|
"command": "/rcode-plan"
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
"intent": "new-milestone",
|
|
69
|
-
"keywords": ["create milestones", "plan milestones", "create roadmap", "break project into milestones", "new milestone", "what milestones"],
|
|
69
|
+
"keywords": ["create milestones", "plan milestones", "create roadmap", "break project into milestones", "new milestone", "what milestones", "milestones banao", "خطة الطريق", "مراحل المشروع"],
|
|
70
70
|
"command": "/rcode-new-milestone"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"intent": "epics-stories",
|
|
74
|
-
"keywords": ["create epics", "user stories", "create stories", "epics and stories", "break into epics"],
|
|
74
|
+
"keywords": ["create epics", "user stories", "create stories", "epics and stories", "break into epics", "stories banao", "قصص المستخدم", "أنشئ ملاحم"],
|
|
75
75
|
"command": "/rcode-create-epics-and-stories"
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"intent": "feature-drift",
|
|
79
|
-
"keywords": ["out of date", "out-of-date", "verify docs", "audit feature docs", "fill out existing", "prd drift", "docs vs code"],
|
|
79
|
+
"keywords": ["out of date", "out-of-date", "verify docs", "audit feature docs", "fill out existing", "prd drift", "docs vs code", "docs purane hain", "الوثائق قديمة", "تحقق من التوثيق"],
|
|
80
80
|
"command": "/rcode-feature-drift"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"intent": "audit",
|
|
84
|
-
"keywords": ["re-audit", "extend the audit", "fill out the", "expand the", "re audit"],
|
|
84
|
+
"keywords": ["re-audit", "extend the audit", "fill out the", "expand the", "re audit", "audit", "code review", "dobara audit karo", "audit karo", "code review karo", "دقق الكود", "مراجعة الكود", "راجع التغييرات"],
|
|
85
85
|
"command": "/rcode-audit"
|
|
86
86
|
}
|
|
87
87
|
]
|
package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/heartbeat.sh
CHANGED
|
File without changes
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Memory Bank — `{{PROJECT_NAME}}`
|
|
2
2
|
|
|
3
|
-
> The Memory Bank is your project's persistent brain.
|
|
3
|
+
> The Memory Bank is your project's persistent brain. Full read/write access is on-demand: run `/rcode-memory-init` to scaffold it, `/rcode-memory-update` after work happens, `/rcode-memory-distill` to regenerate the compressed distillates, and `/rcode-memory-audit` to check it for staleness. Ambient injection also runs automatically (#958): the `session-start` hook emits its usual one-line phase-status primer from `.rcode/state.json`, then — when this directory exists and has content — a relevance-ranked selector (`rcode/bin/lib/memory-select.cjs`) scores every file here against the current phase, git branch, and recently touched files, and injects the top-scoring excerpts as `additionalContext` within a ~1500-token budget (override via `.rcode/config.yaml`'s `memory_inject_budget`). The `pre-compact` hook does the same with a smaller ~600-token budget as part of its survival context. This keeps agents grounded in relevant memory without a human having to run a `/rcode-memory-*` command first — full manual review is still the way to go deep.
|
|
4
|
+
>
|
|
5
|
+
> A `post-commit` hook runs a lightweight drift check after every commit (#958): it compares `project/stack.md` and `project/decisions.md` claims against the last 10 commits and the current working tree — removed/added dependencies, referenced files/dirs that no longer exist, and an `INDEX.md` older than 30 days. If it finds anything, it nudges you toward `/rcode-memory-update` once per session. Run `rcode-hooks drift` (or `node .rcode/bin/rcode-hooks.cjs drift` if the CLI isn't on your PATH) anytime for the full report.
|
|
4
6
|
|
|
5
7
|
**Last updated:** {{INIT_DATE}}
|
|
6
8
|
|
|
@@ -27,6 +29,8 @@
|
|
|
27
29
|
|
|
28
30
|
## Token budget guide
|
|
29
31
|
|
|
32
|
+
- **Ambient session-start injection** (~1.5K tokens, `memory_inject_budget`) — automatic, relevance-ranked, no command needed
|
|
33
|
+
- **Ambient pre-compact injection** (~600 tokens) — automatic survival context alongside `HANDOFF.json`
|
|
30
34
|
- **`INDEX.md` only** (~500 tokens) — quick orientation
|
|
31
35
|
- **`INDEX.md` + `distillates/project.distillate.md`** (~5K tokens) — standard session start
|
|
32
36
|
- **Full `project/` directory** (~10–15K tokens) — deep planning
|
|
@@ -39,6 +43,7 @@
|
|
|
39
43
|
- **`incidents/known-issues.md`** — add when a workaround ships, remove when a real fix lands
|
|
40
44
|
- **`distillates/`** — regenerate via `/rcode-memory-distill` when source files change
|
|
41
45
|
- **Whole bank** — audit via `/rcode-memory-audit` at every milestone close
|
|
46
|
+
- **Drift check** — runs automatically on every commit; run `rcode-hooks drift` manually anytime, or after a large dependency/refactor change
|
|
42
47
|
|
|
43
48
|
## Constraints
|
|
44
49
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "pre-edit hook is currently advisory (logs warning, does not block). Full session-read tracking requires PostToolUse Read hook to write state file. Implemented in follow-up. prompt-router (UserPromptSubmit) is advisory — emits additionalContext to nudge toward the right rcode command; never blocks.",
|
|
2
|
+
"_comment": "pre-edit hook is currently advisory (logs warning, does not block). Full session-read tracking requires PostToolUse Read hook to write state file. Implemented in follow-up. prompt-router (UserPromptSubmit) is advisory — emits additionalContext to nudge toward the right rcode command; never blocks. session-start (SessionStart) emits a one-line project status primer at session open.",
|
|
3
3
|
"hooks": {
|
|
4
4
|
"PreToolUse": [
|
|
5
5
|
{
|
|
@@ -85,6 +85,17 @@
|
|
|
85
85
|
}
|
|
86
86
|
]
|
|
87
87
|
}
|
|
88
|
+
],
|
|
89
|
+
"SessionStart": [
|
|
90
|
+
{
|
|
91
|
+
"matcher": "",
|
|
92
|
+
"hooks": [
|
|
93
|
+
{
|
|
94
|
+
"type": "command",
|
|
95
|
+
"command": "node .rcode/bin/rcode-hooks.cjs session-start"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
88
99
|
]
|
|
89
100
|
}
|
|
90
101
|
}
|
package/rcode/workflows/do.md
CHANGED
|
@@ -290,7 +290,7 @@ Evaluate `$QUESTION` against these routing rules. Apply the **first matching** r
|
|
|
290
290
|
| A bug, error, crash, failure, or something broken | `/rcode-debug` | Needs systematic investigation |
|
|
291
291
|
| Validate an idea, "working backwards", "press release", "PRFAQ", "is this worth building" | `/rcode-prfaq` | Stress-test concept before committing sprint capacity |
|
|
292
292
|
| Brainstorm, generate ideas, "explore options", "what could we do" | `/rcode-brainstorm` | Structured ideation before planning |
|
|
293
|
-
|
|
|
293
|
+
| "karpathy", "review changes", "check my diff", "too complex" — 4-principle code audit against a diff | `/rcode-karpathy-audit` | Runs the karpathy-audit workflow directly (review.md has no `--karpathy` flag) |
|
|
294
294
|
| Make it simpler, "be lazy", "lazy mode", "simplest solution", "yagni", "over-engineered", "kam code likho" | `/rcode-lazy` | Generative simplicity lens — YAGNI before code is written (rcode-trim removes bloat after the fact) |
|
|
295
295
|
| Walk through a change, "checkpoint", "explain this diff", "human review" | `/rcode-checkpoint-preview` | Human-in-the-loop diff walkthrough |
|
|
296
296
|
| Exploring, researching, comparing, or "how does X work" | `/rcode-research-phase` | Domain research before planning |
|
|
@@ -317,7 +317,7 @@ Evaluate `$QUESTION` against these routing rules. Apply the **first matching** r
|
|
|
317
317
|
| Adding tests, "write tests", "test coverage" | `/rcode-add-tests` | Test generation |
|
|
318
318
|
| Completing a milestone, shipping, releasing | `/rcode-complete-milestone` | Milestone lifecycle |
|
|
319
319
|
| Drift / out-of-date / "verify docs vs code" / "audit feature docs" / "fill out existing PRD/epics/stories" | `/rcode-feature-drift` | Detects PRD↔epics↔stories↔code drift; --fix patches trivial items |
|
|
320
|
-
|
|
|
320
|
+
| Bare "audit" / "code review" / re-audit / extend / fill out / expand an existing artifact | `/rcode-audit` | Unified audit entry — disambiguates plans/phase/milestone/UAT/code before dispatching |
|
|
321
321
|
> **SEO route guard:** Skills in this block assume a project context exists (`.planning/PROJECT.md`). If absent, the `HAS_PRD` check in `<step name="check_project">` redirects to `/rcode-new-project`.
|
|
322
322
|
|
|
323
323
|
| **— SEO / Content intent —** | | |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Workflow: rcode-enable-hooks
|
|
2
2
|
|
|
3
3
|
<purpose>
|
|
4
|
-
Merge rcode opt-in hooks from settings-hooks.json into .claude/settings.json. Creates settings.json if missing. Enables all
|
|
4
|
+
Merge rcode opt-in hooks from settings-hooks.json into .claude/settings.json. Creates settings.json if missing. Enables all 10 guardrails: pre-edit (read-before-edit check), pre-workflow (command hint), post-commit (format validation), bash-guard (blocks dangerous commands), pre-compact (refreshes HANDOFF.json before context compaction), stop-verify (syntax-checks files changed during the response), cost-track (logs measured token usage to .rcode/telemetry/cost.jsonl), compact-nudge (advises /rcode-trim or /clear after many edits), prompt-router (proactive nudge toward the right rcode command for long-term memory consistency), and session-start (SessionStart — one-line project status primer at session open).
|
|
5
5
|
</purpose>
|
|
6
6
|
|
|
7
7
|
|
|
@@ -44,7 +44,7 @@ If `.claude/` directory does not exist, create it first.
|
|
|
44
44
|
|
|
45
45
|
## Step 3 — Merge hooks
|
|
46
46
|
|
|
47
|
-
For each hook type (`PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`, `UserPromptSubmit`):
|
|
47
|
+
For each hook type (`PreToolUse`, `PostToolUse`, `PreCompact`, `Stop`, `UserPromptSubmit`, `SessionStart`):
|
|
48
48
|
|
|
49
49
|
- If the hook type does not exist in the current settings.json, add it.
|
|
50
50
|
- If it exists, append the new matchers and hook commands (avoid duplicates by checking for exact command matches).
|
|
@@ -87,6 +87,7 @@ Enabled guardrails:
|
|
|
87
87
|
• cost-track: Logs measured token usage to .rcode/telemetry/cost.jsonl
|
|
88
88
|
• compact-nudge: Advises /rcode-trim or /clear after many edits
|
|
89
89
|
• prompt-router: Nudges toward the matching /rcode-* command and /rcode-memory-update so work lands in .rcode/state.json (toggle via prompt_nudge in .rcode/config.yaml: every|once-per-intent|when-stale|off)
|
|
90
|
+
• session-start: Greets the session with one-line phase status and suggested next command
|
|
90
91
|
|
|
91
92
|
To disable, remove the hooks section from .claude/settings.json or edit .rcode/templates/settings-hooks.json and re-run.
|
|
92
93
|
```
|
|
@@ -871,7 +871,16 @@ The CLI handles:
|
|
|
871
871
|
- Updating REQUIREMENTS.md traceability
|
|
872
872
|
- Scanning for verification debt (returns `warnings` array)
|
|
873
873
|
|
|
874
|
-
Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`, `warnings`, `has_warnings`.
|
|
874
|
+
Extract from result: `next_phase`, `next_phase_name`, `is_last_phase`, `warnings`, `has_warnings`, `open_phases_remaining`, `nudge`.
|
|
875
|
+
|
|
876
|
+
**If `nudge` is present (#943 — no open phases remain, milestone finished):**
|
|
877
|
+
Surface it verbatim so the user is guided forward instead of stranded:
|
|
878
|
+
```
|
|
879
|
+
✓ Milestone complete — all phases done.
|
|
880
|
+
{nudge}
|
|
881
|
+
```
|
|
882
|
+
Do not auto-advance past a finished milestone; let the user choose
|
|
883
|
+
`/rcode-complete-milestone` or `/rcode-new-milestone`.
|
|
875
884
|
|
|
876
885
|
**If has_warnings is true:**
|
|
877
886
|
```
|
|
@@ -83,6 +83,14 @@ Next steps:
|
|
|
83
83
|
Or continue with current work and return to this phase later.
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
+
## Step 3.5 — Surface milestone-health nudge (#942)
|
|
87
|
+
|
|
88
|
+
`state insert-phase` returns a `nudge` field when the milestone has too many
|
|
89
|
+
open phases (≥8 = consider, ≥12 = should-close). If `RESULT.nudge` is present,
|
|
90
|
+
print it verbatim so the user is guided toward `/rcode-complete-milestone` +
|
|
91
|
+
`/rcode-new-milestone` instead of silently accumulating phases. If absent, say
|
|
92
|
+
nothing.
|
|
93
|
+
|
|
86
94
|
## Anti-patterns
|
|
87
95
|
|
|
88
96
|
- Don't insert before Phase 1 (decimal 0.1 makes no sense)
|
|
@@ -302,12 +302,12 @@ Use AskUserQuestion:
|
|
|
302
302
|
node .rcode/bin/rcode-tools.cjs generate-claude-md
|
|
303
303
|
```
|
|
304
304
|
|
|
305
|
-
This ensures new projects get the default rcode workflow-enforcement guidance and current project context in `CLAUDE.md
|
|
305
|
+
This ensures new projects get the default rcode workflow-enforcement guidance and current project context in `CLAUDE.md` and `AGENTS.md` (the cross-tool standard read by Codex, Cursor, Windsurf, Antigravity, and Gemini). `AGENTS.md` is only written when absent — an install-managed roster section is preserved.
|
|
306
306
|
|
|
307
307
|
**Commit roadmap (after approval or auto mode):**
|
|
308
308
|
|
|
309
309
|
```bash
|
|
310
|
-
node .rcode/bin/rcode-tools.cjs commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md CLAUDE.md
|
|
310
|
+
node .rcode/bin/rcode-tools.cjs commit "docs: create roadmap ([N] phases)" --files .planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md CLAUDE.md AGENTS.md
|
|
311
311
|
```
|
|
312
312
|
|
|
313
313
|
## 9. Done
|
package/rcode/workflows/plan.md
CHANGED
|
@@ -906,6 +906,23 @@ node ".rcode/bin/rcode-tools.cjs" state planned-phase --phase "${PHASE_NUMBER}"
|
|
|
906
906
|
|
|
907
907
|
This updates STATUS to "Ready to execute", sets the correct plan count, and timestamps Last Activity.
|
|
908
908
|
|
|
909
|
+
## 13c. Milestone-health nudge (#942)
|
|
910
|
+
|
|
911
|
+
After recording completion, check whether the milestone has accumulated too many
|
|
912
|
+
open phases — so planning the Nth phase of a sprawling milestone guides the user
|
|
913
|
+
toward closing it instead of silently growing the roadmap:
|
|
914
|
+
|
|
915
|
+
```bash
|
|
916
|
+
HEALTH=$(node ".rcode/bin/rcode-tools.cjs" milestone-health 2>/dev/null)
|
|
917
|
+
REC=$(echo "$HEALTH" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{try{console.log(JSON.parse(s).recommendation||'')}catch{console.log('')}})")
|
|
918
|
+
OPEN=$(echo "$HEALTH" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{try{console.log(JSON.parse(s).open_phases||0)}catch{console.log(0)}})")
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
- If `REC` is `should-close` (≥12 open): surface a hard nudge recommending
|
|
922
|
+
`/rcode-complete-milestone` then `/rcode-new-milestone`.
|
|
923
|
+
- If `REC` is `consider-closing` (8–11 open): softer nudge.
|
|
924
|
+
- If `healthy`: say nothing.
|
|
925
|
+
|
|
909
926
|
## 14. Present Final Status
|
|
910
927
|
|
|
911
928
|
Route to `<offer_next>` OR `auto_advance` depending on flags/config.
|