@hanzlaa/rcode 4.7.0 → 4.7.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "4.7.0",
3
+ "version": "4.7.2",
4
4
  "description": "rcode — the AI team that never forgets. Persistent memory, specialist agents, and slash commands for AI IDEs. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -4589,6 +4589,7 @@ This file is loaded by Claude Code, Codex, and compatible AI coding tools at the
4589
4589
  - No "while I'm here" improvements
4590
4590
  - No speculative abstractions
4591
4591
  - No new files unless necessary
4592
+ - **No freehand status/handoff docs** (\`HANDOFF.md\`, \`AGENT_X_DONE.md\`, anything at the project root summarizing "what I did"). That record is \`<N>-SUMMARY.md\` under \`.planning/phases/\` — even mid-task or in a parallel multi-agent run, write there, not a new root-level file.
4592
4593
 
4593
4594
  ---
4594
4595
 
@@ -1,6 +1,15 @@
1
1
  ---
2
2
  name: rcode-do
3
- description: "[ROUTER] Interactive picker — describe what you want and rcode picks the command"
3
+ description: >-
4
+ [ROUTER] Interactive picker — describe what you want and rcode picks
5
+ the command. Activates whenever the user says "use rcode", "using
6
+ rcode", "rcode kar do", "rcode say kara do", "let rcode handle
7
+ this/it", "rcode this", or otherwise names rcode as the tool to use
8
+ for a task without naming a specific /rcode-* command — especially
9
+ when the request bundles multiple asks (e.g. "init a phase, build a
10
+ checklist, make a sprint"). Route through this picker instead of
11
+ hand-rolling files or Bash workarounds for what rcode already has a
12
+ command for.
4
13
  argument-hint: "[optional question or task description]"
5
14
  allowed-tools:
6
15
  - Read
@@ -48,6 +48,12 @@
48
48
 
49
49
  ---
50
50
 
51
+ ## File placement discipline
52
+
53
+ **Completion notes go in the sprint file, never a freehand root-level doc.** When work finishes, the record is `.planning/phases/{phase}/{sprint}-SUMMARY.md` (written by `/rcode-execute`) or a note in the existing `SPRINT.md`/`REVIEW.md` — never a new `SOMETHING_DONE.md`, `HANDOFF.md`, or `AGENT_X_DONE.md` at the project root or anywhere outside `.planning/`/`.rcode/`. If you're in a parallel multi-agent run and were asked for a "handoff doc," that handoff still belongs inside the sprint's own files — a sibling agent reads the next `SPRINT.md`/`CONTEXT.md`, not a scavenger hunt through the repo root for status files with inconsistent names.
54
+
55
+ **Never invent a new top-level artifact type.** `PROJECT.md`, `ROADMAP.md`, `REQUIREMENTS.md`, `CONTEXT.md`, `RESEARCH.md`, `SPRINT.md`, `SUMMARY.md`, `REVIEW.md` — this is the closed set. If a task genuinely needs a new kind of record, that's a call for the user, not something to freehand mid-task.
56
+
51
57
  ## Framework discipline
52
58
 
53
59
  **Cite the heuristic by name.** When refusing or recommending, name the rule that drove the call. *"Per the Reversibility test, this is a one-way door — ADR required."* Traceable reasoning beats opinion.
@@ -26,7 +26,7 @@ If you commit a file under `.planning/` and `git status` afterwards still shows
26
26
  2. **Load sprint** — Parse SPRINT.md frontmatter (phase, sprint, type, autonomous, wave, depends_on). Honor CONTEXT.md if referenced.
27
27
  3. **Determine pattern** — Pattern A (no checkpoints → execute all), B (has checkpoints → stop at first), C (continuation → resume).
28
28
  4. **Execute stories** — For each story: if `type="auto"`, execute and commit. If `type="checkpoint:*"`, STOP and return checkpoint. Update story status via `rcode-tools.cjs state story move --id NN.S.TT --status done`.
29
- 5. **Create SUMMARY** — After all auto stories complete, write `.planning/phases/XX-name/{phase}-{sprint}-SUMMARY.md`.
29
+ 5. **Create SUMMARY** — After all auto stories complete, write `.planning/phases/XX-name/{phase}-{sprint}-SUMMARY.md`. This is the *only* completion artefact. Never write a parallel status/handoff doc (`AGENT_X_DONE.md`, `HANDOFF.md`, a root-level `*_DONE.md`) — if the run involves multiple parallel executors, each still records its own SUMMARY.md under its own sprint; there is no separate hand-off format.
30
30
  6. **Update state** — Run state tools to record metrics, mark stories complete, advance sprint.
31
31
  7. **Final commit** — Commit SUMMARY.md, STATE.md, ROADMAP.md with docs message.
32
32
 
@@ -12,6 +12,7 @@ hierarchical ID format, and output routing.
12
12
 
13
13
  ### Context Fidelity
14
14
  - **Locked Decisions** (CONTEXT.md): MUST implement exactly. Reference decision ID (D-01, D-02) in task actions.
15
+ - **Reference, don't restate.** A decision ID is a pointer, not a license to re-paste the rationale. `<action>` explains WHAT to do and cites the ID for WHY (`"per D-02's flattening rule"`) — it does not re-explain the decision's reasoning, alternatives, or findings inline. The full "why" already lives in CONTEXT.md/RESEARCH.md; the executor opens those if they need it. A task whose `<action>` reads like a design doc (multi-paragraph rationale, full alternatives-considered writeups) is a sign the planner copied instead of pointed — cut it down to the instruction + the ID.
15
16
  - **Deferred Ideas**: MUST NOT appear in plans.
16
17
  - **Agent's Discretion**: Use judgment, document choices.
17
18
 
@@ -285,6 +285,18 @@ After writing both files, refresh the memory bank fingerprint so staleness check
285
285
  node .rcode/bin/rcode-tools.cjs context refresh >/dev/null 2>&1 || true
286
286
  ```
287
287
 
288
+ ## Step 4c — Scaffold CLAUDE.md / AGENTS.md if missing
289
+
290
+ `generate-claude-md` (the command routing rule + project rules block every agent needs at session start) previously only ran via the `/rcode-new-project` roadmap flow — a project set up with `/rcode-init` alone (the common "add rcode to an existing codebase" path) never got it, so agents had no ambient instruction to check `do.md` before acting ad-hoc. Close that gap here, unconditionally (not just on `fresh`):
291
+
292
+ ```bash
293
+ if [ ! -f CLAUDE.md ]; then
294
+ node .rcode/bin/rcode-tools.cjs generate-claude-md
295
+ fi
296
+ ```
297
+
298
+ Never pass `--force` here — an existing `CLAUDE.md` is the user's own file (or was already generated by a prior init/new-project run) and must not be overwritten. Silent no-op when `CLAUDE.md` already exists.
299
+
288
300
  ## Step 5 — Suggest the next step
289
301
 
290
302
  Print a contextual recommendation, **one line of copy-paste per suggestion** (per `.rcode/references/command-redirect-format.md`):
@@ -339,6 +351,7 @@ Silent if state tools fail.
339
351
  - [ ] `.rcode/JOURNEY.md` written (unless `--skip-scan` or no code)
340
352
  - [ ] `.rcode/context/active.md` populated with project state (not the placeholder stub)
341
353
  - [ ] `.rcode/context/project-brief.md` populated with project overview (not the placeholder stub)
354
+ - [ ] `CLAUDE.md` exists (generated if it didn't already)
342
355
  - [ ] State detected correctly (fresh / existing-new-rcode / returning)
343
356
  - [ ] Contextual next-step suggestion printed as single-line copy-paste
344
357
 
@@ -161,42 +161,32 @@ Use AskUserQuestion:
161
161
 
162
162
  **Generate or refresh project instruction file before final commit:**
163
163
 
164
- The rcode-tools CLI does not expose a `generate-claude-md` subcommand. Instead, if `$INSTRUCTION_FILE` does not already exist, write a minimal instruction file pointing at the rcode workflow docs:
165
-
166
- ```markdown
167
- # {INSTRUCTION_FILE} — project instructions
168
-
169
- This project uses rcode for planning and execution. See `.planning/PROJECT.md` for context and `.planning/ROADMAP.md` for phases.
170
-
171
- Common commands:
172
- - /rcode-progress — check status and next action
173
- - /rcode-discuss-phase N — gather context before planning phase N
174
- - /rcode-plan N — create a SPRINT.md for phase N
175
- - /rcode-execute N — execute a SPRINT.md
176
- - /rcode-verify-work — conversational UAT
177
- - /rcode-complete-milestone — archive milestone and reset
178
-
179
- Rules:
180
- - Never run `git push` without explicit user authorization.
181
- - No Claude/AI attribution in commits.
182
- - Prefer editing existing files over creating new ones.
164
+ ```bash
165
+ node .rcode/bin/rcode-tools.cjs generate-claude-md
183
166
  ```
184
167
 
185
- If it already exists, leave it alone (respect user-customized content).
168
+ Writes `CLAUDE.md` and `AGENTS.md` from rcode's own template (commit rules,
169
+ push rules, phase workflow rules, scope discipline, and the command-routing
170
+ rule pointing at `do.md`). Refuses to touch an existing `CLAUDE.md` — if it
171
+ already exists, this is a silent no-op (respects user-customized content).
172
+ `AGENTS.md` is written only when absent, so an install-appended `## rcode
173
+ Agents (installed)` roster section is never clobbered.
186
174
 
187
175
  **Commit roadmap (guarded):**
188
176
 
189
177
  ```bash
190
- git add \
191
- .planning/ROADMAP.md \
192
- .planning/STATE.md \
193
- .planning/REQUIREMENTS.md \
194
- "$INSTRUCTION_FILE" 2>/dev/null \
178
+ # git add fails its whole invocation on any missing pathspec, so only pass
179
+ # paths that actually exist (CLAUDE.md/AGENTS.md are conditional — see above).
180
+ ADD_PATHS=(.planning/ROADMAP.md .planning/STATE.md .planning/REQUIREMENTS.md)
181
+ for f in CLAUDE.md AGENTS.md; do [ -f "$f" ] && ADD_PATHS+=("$f"); done
182
+
183
+ git add "${ADD_PATHS[@]}" 2>/dev/null \
195
184
  && git commit -m "docs: create roadmap ([N] phases)" 2>/dev/null \
196
- || echo "ℹ .planning/ gitignored — roadmap written, not committed (instruction file committed separately)"
185
+ || echo "ℹ .planning/ gitignored — roadmap written, not committed (instruction files committed separately)"
197
186
 
198
- # Fallback: also try committing just the instruction file if .planning was ignored
199
- git add "$INSTRUCTION_FILE" 2>/dev/null && git commit -m "docs: add project instruction file" 2>/dev/null || true
187
+ # Fallback: also try committing just the instruction files if .planning was ignored
188
+ IFILES=(); for f in CLAUDE.md AGENTS.md; do [ -f "$f" ] && IFILES+=("$f"); done
189
+ [ ${#IFILES[@]} -gt 0 ] && git add "${IFILES[@]}" 2>/dev/null && git commit -m "docs: add project instruction files" 2>/dev/null || true
200
190
 
201
191
  # Sync all roadmapper-created phases into state.json.
202
192
  # rcode-roadmapper writes ROADMAP.md as text — it never calls `phase add` — so
@@ -79,6 +79,12 @@ Planner prompt:
79
79
  **Phase:** {phase_number}
80
80
  **Mode:** {standard | gap_closure | reviews}
81
81
 
82
+ ## Scope
83
+
84
+ Default: `phase` (one SPRINT.md, up to 8 stories — see Scope-Driven Sizing in your role instructions).
85
+
86
+ **Self-upgrade to `initiative` mid-decomposition** if, once you've read CONTEXT.md/ROADMAP.md and started breaking down the work, it splits into independent waves or work-streams (e.g. shared-primitive foundation → feature-local migrations → cleanup/tests) and total stories would exceed 8. When that happens, emit multiple SPRINT.md files (`{phase}-1-SPRINT.md`, `{phase}-2-SPRINT.md`, ...) in this same run instead of one oversized plan. Do not wait for rcode-sprint-checker's "scope exceeds context budget" rejection to force a resharding pass — that costs a full extra planner run. Decide the split now, while you're already looking at the file/story list.
87
+
82
88
  <files_to_read>
83
89
  - {state_path} (Project State)
84
90
  - {roadmap_path} (Roadmap)
@@ -131,7 +131,11 @@ export function Breadcrumb({ items }) {
131
131
  * @param {{ cmd: string, desc: string }} props
132
132
  */
133
133
  export function CmdHint({ cmd, desc }) {
134
- function handleClick() {
134
+ function handleClick(e) {
135
+ // CmdHint often sits inside a clickable card row (SprintCard's empty
136
+ // state, etc.) — without this, copying the command also fires the
137
+ // row's own click (e.g. navigating away mid-copy).
138
+ if (e && e.stopPropagation) e.stopPropagation();
135
139
  navigator.clipboard.writeText(cmd)
136
140
  .then(() => showToast('Copied: ' + cmd))
137
141
  .catch(() => {
@@ -291,9 +295,7 @@ export function SprintCard({ sprint: s, S }) {
291
295
  </div>
292
296
  <div style="margin-top:6px;"><${ProgressBar} done=${done} total=${stories.length}/></div>
293
297
  ${stories.length === 0 ? html`
294
- <div class="empty-action" style="margin-top:var(--space-2);font-size:var(--text-xs);">
295
- No tasks — run <code>/rcode-plan ${phaseId}</code> to populate
296
- </div>
298
+ <${CmdHint} cmd=${'/rcode-plan ' + phaseId} desc="Populate this sprint with tasks"/>
297
299
  ` : null}
298
300
  ${s.started_at ? html`
299
301
  <div style="color:var(--text-muted);font-size:var(--text-xs);margin-top:4px;">
@@ -9,7 +9,7 @@
9
9
 
10
10
  import { html } from '../preact.js';
11
11
  import { useStore } from '../store.js';
12
- import { pressable } from '../components/shared.js';
12
+ import { pressable, CmdHint } from '../components/shared.js';
13
13
  import { Icon } from '../icons-client.js';
14
14
 
15
15
  export function BacklogView() {
@@ -23,7 +23,7 @@ export function BacklogView() {
23
23
  ? html`
24
24
  <div class="empty">
25
25
  No phases waiting in the backlog.
26
- <div class="empty-action">Run /rcode-add-phase to queue up new work</div>
26
+ <${CmdHint} cmd="/rcode-add-phase" desc="Queue up new work"/>
27
27
  </div>
28
28
  `
29
29
  : html`
@@ -9,11 +9,11 @@
9
9
 
10
10
  import { html, useState, useCallback } from '../preact.js';
11
11
  import { useStore, refresh } from '../store.js';
12
- import { allTasks, currentPhaseName } from '../util.js';
12
+ import { allTasks, currentPhaseName, currentPhaseId } from '../util.js';
13
13
  import { stopStory, openOrchPanel, openTermPanel, setTaskStatus } from '../orchestrator.js';
14
14
  import { openFileViewer } from '../store.js';
15
15
  import { openRunnerPicker } from '../components/RunnerPicker.js';
16
- import { showToast } from '../components/shared.js';
16
+ import { showToast, CmdHint } from '../components/shared.js';
17
17
 
18
18
  // ---- Column descriptors ----
19
19
  const COLS = [
@@ -262,9 +262,11 @@ export function KanbanView() {
262
262
  ${' is active.'}
263
263
  </div>
264
264
  ` : null}
265
+ <${CmdHint}
266
+ cmd=${'/rcode-plan' + (currentPhaseId(currentPhase) ? ' ' + currentPhaseId(currentPhase) : '')}
267
+ desc="Generate sprint stories"/>
265
268
  <div class="empty-action">
266
- Run <code>/rcode-plan</code> to generate sprint stories, or browse
267
- planning docs in the <a href="#files">Files</a> view.
269
+ Or browse planning docs in the <a href="#files">Files</a> view.
268
270
  </div>
269
271
  </div>
270
272
  </div>
@@ -14,6 +14,7 @@
14
14
 
15
15
  import { html, useState, useEffect } from '../preact.js';
16
16
  import { FileReader } from '../components/FileReader.js';
17
+ import { CmdHint } from '../components/shared.js';
17
18
 
18
19
  // ---- Command hints accordion ----
19
20
  const MEMORY_HINTS = [
@@ -127,7 +128,7 @@ export function MemoryView() {
127
128
  <div class="empty">
128
129
  <h3 style="color:var(--rcode-gold);">Not initialised</h3>
129
130
  <p>The Memory Bank is rcode's structured project context.</p>
130
- <div class="empty-action">Run <code>/rcode-memory-init</code> to bootstrap</div>
131
+ <${CmdHint} cmd="/rcode-memory-init" desc="Bootstrap the Memory Bank"/>
131
132
  </div>
132
133
  </div>
133
134
  `;
@@ -11,7 +11,7 @@ import { html, useState } from '../preact.js';
11
11
  import { useStore } from '../store.js';
12
12
  import { pct, humanDate, phaseHints, chip, phaseMilestone } from '../util.js';
13
13
  import {
14
- Chip, ProgressBar, Breadcrumb, CmdHints, RunningBadge, SprintCard, PhaseCard,
14
+ Chip, ProgressBar, Breadcrumb, CmdHint, CmdHints, RunningBadge, SprintCard, PhaseCard,
15
15
  } from '../components/shared.js';
16
16
  import { openTermPanel, runningInPhase } from '../orchestrator.js';
17
17
  import { openFileViewer } from '../store.js';
@@ -118,7 +118,7 @@ function PhaseDetail({ phase: p, S }) {
118
118
  : html`
119
119
  <div class="empty">
120
120
  No sprints in this phase yet.
121
- <div class="empty-action">Run /rcode-plan to create sprints</div>
121
+ <${CmdHint} cmd=${'/rcode-plan ' + p.id} desc="Create sprints for this phase"/>
122
122
  </div>
123
123
  `}
124
124
  </div>
@@ -212,7 +212,7 @@ export function PhasesView({ subId, filters }) {
212
212
  : html`
213
213
  <div class="empty">
214
214
  No phases yet.
215
- <div class="empty-action">Run /rcode-new-project to start</div>
215
+ <${CmdHint} cmd="/rcode-new-project" desc="Design your first project"/>
216
216
  </div>
217
217
  `}
218
218
  </div>
@@ -10,9 +10,9 @@
10
10
 
11
11
  import { html, useState } from '../preact.js';
12
12
  import { useStore } from '../store.js';
13
- import { pct, humanDate, allSprints, sprintHints, chip, phaseMilestone } from '../util.js';
13
+ import { pct, humanDate, allSprints, sprintHints, chip, phaseMilestone, currentPhaseId } from '../util.js';
14
14
  import {
15
- Chip, ProgressBar, Breadcrumb, CmdHints, RunningBadge, SprintCard, TaskCard,
15
+ Chip, ProgressBar, Breadcrumb, CmdHint, CmdHints, RunningBadge, SprintCard, TaskCard,
16
16
  } from '../components/shared.js';
17
17
  import { openTermPanel, runningInSprint } from '../orchestrator.js';
18
18
  import { openFileViewer } from '../store.js';
@@ -105,7 +105,7 @@ function SprintDetail({ sprint: s, S }) {
105
105
  : html`
106
106
  <div class="empty">
107
107
  No tasks in this sprint yet.
108
- <div class="empty-action">Run /rcode-create-story to add tasks</div>
108
+ <${CmdHint} cmd=${'/rcode-create-story ' + s.id} desc="Add a task to this sprint"/>
109
109
  </div>
110
110
  `}
111
111
  </div>
@@ -210,7 +210,7 @@ export function SprintsView({ subId, filters }) {
210
210
  : html`
211
211
  <div class="empty">
212
212
  No sprints yet.
213
- <div class="empty-action">Run /rcode-plan to create sprints</div>
213
+ <${CmdHint} cmd=${'/rcode-plan' + (currentPhaseId(S.currentPhase) ? ' ' + currentPhaseId(S.currentPhase) : '')} desc="Plan sprints for the current phase"/>
214
214
  </div>
215
215
  `}
216
216
  </div>
@@ -9,7 +9,7 @@
9
9
  import { html, useState, useMemo } from '../preact.js';
10
10
  import { useStore } from '../store.js';
11
11
  import { allTasks, currentPhaseId } from '../util.js';
12
- import { CmdHints, TaskCard } from '../components/shared.js';
12
+ import { CmdHint, CmdHints, TaskCard } from '../components/shared.js';
13
13
 
14
14
  function TaskGrouped({ tasks }) {
15
15
  if (!tasks.length) return null;
@@ -137,9 +137,7 @@ export function TasksView() {
137
137
  : html`
138
138
  <div class="empty">
139
139
  No tasks yet.
140
- <div class="empty-action">
141
- Run <code>/rcode-plan${phaseHint}</code> to generate tasks for this project.
142
- </div>
140
+ <${CmdHint} cmd=${'/rcode-plan' + phaseHint} desc="Generate tasks for this project"/>
143
141
  </div>
144
142
  `}
145
143
  </div>