@hanzlaa/rcode 2.3.2 → 2.3.4

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/README.md CHANGED
@@ -37,8 +37,8 @@ Rihal Code packages a lot. To keep things approachable, everything is organized
37
37
 
38
38
  Most AI tools give you one assistant pretending to be everything. **Rihal Code gives you Rihal's team — and Rihal's brain — inside every project.**
39
39
 
40
- - **44 agents** with clear roles, cultural identity (Arabic names), and hard scope boundaries
41
- - **98 slash commands** covering research, planning, execution, verification, and recovery
40
+ - **43 agents** with clear roles, cultural identity (Arabic names), and hard scope boundaries
41
+ - **99 slash commands** covering research, planning, execution, verification, and recovery
42
42
  - **3 execution modes**: parallel debate (`/rihal:council`), sequential pipelines (`/rihal:chain`), and quick-sync (`/rihal:discuss`)
43
43
  - **File-based state** in `.rihal/` that every workflow reads and updates
44
44
  - **Intent guards** on every workflow — catch wrong commands early with copy-paste redirects
@@ -65,8 +65,8 @@ npx @hanzlaa/rcode install
65
65
  One unified installer. Pure file shipping, no runtime dependencies. Installs into:
66
66
 
67
67
  - `.rihal/` — config, workflows, references, bin (Rihal infrastructure)
68
- - `.claude/agents/` — 44 first-class subagents
69
- - `.claude/commands/rihal/` — 98 slash commands
68
+ - `.claude/agents/` — 43 first-class subagents
69
+ - `.claude/commands/rihal/` — 99 slash commands
70
70
  - `.claude/skills/` — 56 phrase-activated skills (scaffold-project, create-prd, prfaq, retrospective, etc.)
71
71
  - `rihal/brain/` — Rihal standards pulled from upstream (PR / commit / architecture docs)
72
72
  - `.planning/` — where your artifacts land (council sessions, plans, chains, summaries)
@@ -309,7 +309,7 @@ Recent additions in this session:
309
309
 
310
310
  ---
311
311
 
312
- ## Full command surface (98 commands)
312
+ ## Full command surface (99 commands)
313
313
 
314
314
  ### Router + lifecycle
315
315
  `init` · `do` · `help` · `status` · `stats` · `health` · `forensics` · `update`
@@ -446,8 +446,8 @@ Every install runs 5 automated smoke tests before exiting:
446
446
  ✓ rihal-tools.cjs runs — syntax ok
447
447
  ✓ .rihal/config.yaml present — 412 bytes
448
448
  ✓ .rihal/state.json parses — valid JSON
449
- ✓ agents installed — 44
450
- ✓ skills + commands installed — 56 skills + 98 commands
449
+ ✓ agents installed — 43
450
+ ✓ skills + commands installed — 56 skills + 99 commands
451
451
  ```
452
452
 
453
453
  A failed check prints the debug command and returns exit code 1 so CI catches broken installs.
package/cli/install.js CHANGED
@@ -1251,6 +1251,19 @@ async function install(opts) {
1251
1251
  // .planning/council-sessions/ empty dir
1252
1252
  ensureDir(path.join(opts.target, '.planning', 'council-sessions'));
1253
1253
 
1254
+ // .rihal/context/ — seed stub files so doctor doesn't report "never initialized"
1255
+ // The /rihal:init slash command populates these with real project content.
1256
+ const contextDir = path.join(opts.target, '.rihal', 'context');
1257
+ ensureDir(contextDir);
1258
+ const activeCtx = path.join(contextDir, 'active.md');
1259
+ const briefCtx = path.join(contextDir, 'project-brief.md');
1260
+ if (!fs.existsSync(activeCtx)) {
1261
+ fs.writeFileSync(activeCtx, '# Active Context\n\n_Run `/rihal:init` inside your AI editor to populate this file._\n');
1262
+ }
1263
+ if (!fs.existsSync(briefCtx)) {
1264
+ fs.writeFileSync(briefCtx, '# Project Brief\n\n_Run `/rihal:init` inside your AI editor to populate this file._\n');
1265
+ }
1266
+
1254
1267
  // ~/.rihal/agents/ global agents directory
1255
1268
  const globalAgentsDir = path.join(os.homedir(), '.rihal', 'agents');
1256
1269
  ensureDir(globalAgentsDir);
@@ -35,21 +35,27 @@ function readPackageManifest(packageRoot) {
35
35
  }
36
36
  }
37
37
 
38
- const actionsDir = path.join(skillsRoot, 'actions');
39
- if (fs.existsSync(actionsDir)) {
40
- for (const entry of fs.readdirSync(actionsDir, { withFileTypes: true })) {
38
+ // Mirror installSkills() walkForSkills: recurse into action bucket dirs
39
+ // (1-analysis, 2-plan, etc.) until a dir with SKILL.md is found, then add
40
+ // the dir name as installed. Bucket dirs themselves are never installed.
41
+ function walkActions(dir) {
42
+ if (!fs.existsSync(dir)) return;
43
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
41
44
  if (!entry.isDirectory()) continue;
42
- if (entry.name === 'research') {
43
- // Flatten research/* → actions set (matches installSkills)
44
- const researchDir = path.join(actionsDir, 'research');
45
- for (const sub of fs.readdirSync(researchDir, { withFileTypes: true })) {
46
- if (sub.isDirectory()) manifest.actions.add(sub.name);
47
- }
45
+ const full = path.join(dir, entry.name);
46
+ if (fs.existsSync(path.join(full, 'SKILL.md'))) {
47
+ // Use the name as it lands in .claude/skills/ (installSkills prefixes
48
+ // non-rihal- dirs with 'rihal-', but all current skills already have it)
49
+ const installedName = entry.name.startsWith('rihal-')
50
+ ? entry.name
51
+ : `rihal-${entry.name}`;
52
+ manifest.actions.add(installedName);
48
53
  } else {
49
- manifest.actions.add(entry.name);
54
+ walkActions(full);
50
55
  }
51
56
  }
52
57
  }
58
+ walkActions(path.join(skillsRoot, 'actions'));
53
59
 
54
60
  return manifest;
55
61
  }
@@ -259,12 +259,12 @@ function checkStaleness(cwd) {
259
259
  };
260
260
  }
261
261
 
262
- // Context files exist but no fingerprint stored — happened before
263
- // fingerprinting was added, or state.json got truncated.
262
+ // Context files exist but no fingerprint stored — fresh install with stub
263
+ // context files, or state.json got truncated before fingerprint was written.
264
264
  if (!stored) {
265
265
  return {
266
266
  status: 'stale',
267
- reasons: ['no fingerprint recorded — run /rihal:init once to bootstrap tracking'],
267
+ reasons: ['run /rihal:init in your editor to populate project context'],
268
268
  current,
269
269
  stored,
270
270
  context_files,
package/dist/rcode.js CHANGED
@@ -15984,6 +15984,16 @@ Say "plan a sprint" or run \`/rihal:sprint-planning\` to break Phase 01 into sto
15984
15984
  }
15985
15985
  }
15986
15986
  ensureDir(path2.join(opts.target, ".planning", "council-sessions"));
15987
+ const contextDir = path2.join(opts.target, ".rihal", "context");
15988
+ ensureDir(contextDir);
15989
+ const activeCtx = path2.join(contextDir, "active.md");
15990
+ const briefCtx = path2.join(contextDir, "project-brief.md");
15991
+ if (!fs2.existsSync(activeCtx)) {
15992
+ fs2.writeFileSync(activeCtx, "# Active Context\n\n_Run `/rihal:init` inside your AI editor to populate this file._\n");
15993
+ }
15994
+ if (!fs2.existsSync(briefCtx)) {
15995
+ fs2.writeFileSync(briefCtx, "# Project Brief\n\n_Run `/rihal:init` inside your AI editor to populate this file._\n");
15996
+ }
15987
15997
  const globalAgentsDir = path2.join(os.homedir(), ".rihal", "agents");
15988
15998
  ensureDir(globalAgentsDir);
15989
15999
  fs2.writeFileSync(
@@ -16293,20 +16303,20 @@ var require_manifest = __commonJS({
16293
16303
  if (entry.isDirectory()) manifest.agents.add(entry.name);
16294
16304
  }
16295
16305
  }
16296
- const actionsDir = path2.join(skillsRoot, "actions");
16297
- if (fs2.existsSync(actionsDir)) {
16298
- for (const entry of fs2.readdirSync(actionsDir, { withFileTypes: true })) {
16306
+ function walkActions(dir) {
16307
+ if (!fs2.existsSync(dir)) return;
16308
+ for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
16299
16309
  if (!entry.isDirectory()) continue;
16300
- if (entry.name === "research") {
16301
- const researchDir = path2.join(actionsDir, "research");
16302
- for (const sub of fs2.readdirSync(researchDir, { withFileTypes: true })) {
16303
- if (sub.isDirectory()) manifest.actions.add(sub.name);
16304
- }
16310
+ const full = path2.join(dir, entry.name);
16311
+ if (fs2.existsSync(path2.join(full, "SKILL.md"))) {
16312
+ const installedName = entry.name.startsWith("rihal-") ? entry.name : `rihal-${entry.name}`;
16313
+ manifest.actions.add(installedName);
16305
16314
  } else {
16306
- manifest.actions.add(entry.name);
16315
+ walkActions(full);
16307
16316
  }
16308
16317
  }
16309
16318
  }
16319
+ walkActions(path2.join(skillsRoot, "actions"));
16310
16320
  return manifest;
16311
16321
  }
16312
16322
  function readInstalledDirs(dir, prefix = null) {
@@ -17471,7 +17481,7 @@ var require_memory_bank = __commonJS({
17471
17481
  if (!stored) {
17472
17482
  return {
17473
17483
  status: "stale",
17474
- reasons: ["no fingerprint recorded \u2014 run /rihal:init once to bootstrap tracking"],
17484
+ reasons: ["run /rihal:init in your editor to populate project context"],
17475
17485
  current,
17476
17486
  stored,
17477
17487
  context_files
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "2.3.2",
4
- "description": "Rihal Code (rcode) — installable context-brain for Rihalians. 44 agents, 98 slash commands, 56 skills, pullable Rihal standards. Unified install for Claude Code, Cursor, and Gemini.",
3
+ "version": "2.3.4",
4
+ "description": "Rihal Code (rcode) — installable context-brain for Rihalians. 43 agents, 99 slash commands, 56 skills, pullable Rihal standards. Unified install for Claude Code, Cursor, and Gemini.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
7
7
  "rcode": "dist/rcode.js",
8
+ "rihal": "dist/rcode.js",
8
9
  "rihal-code": "dist/rcode.js"
9
10
  },
10
11
  "scripts": {
@@ -0,0 +1,22 @@
1
+ {
2
+ "version": "1",
3
+ "project": "__PROJECT_NAME__",
4
+ "created": "__INSTALL_DATE__",
5
+ "updated": "__INSTALL_DATE__",
6
+ "current_phase": "01",
7
+ "current_plan": 0,
8
+ "current_sprint": null,
9
+ "milestone": "M1 — Initial Delivery",
10
+ "phases": [
11
+ { "id": "01", "name": "Setup & Scaffolding", "status": "planned" }
12
+ ],
13
+ "executions": [],
14
+ "decisions": [],
15
+ "blockers": [],
16
+ "council_sessions": [],
17
+ "chains": [],
18
+ "workstreams": [],
19
+ "active_workstream": null,
20
+ "last_session": null,
21
+ "velocity_history": []
22
+ }
@@ -185,4 +185,4 @@ Silent on failure — state tracking is optional.
185
185
  - **state.json missing or corrupted:** continue without error — chain artifacts are mandatory, state tracking is optional.
186
186
  - **Stage fails to produce artifact:** print stage number, allow `/rihal:chain --continue` to resume.
187
187
  - **Agent returns empty output:** print "Agent produced no output. Check input and retry."
188
- - **`rihal-tools.cjs` missing:** tell user to run `rihal-code install-v2`.
188
+ - **`rihal-tools.cjs` missing:** tell user to run `npx @hanzlaa/rcode install` (or `rcode install` if installed globally).
@@ -558,7 +558,7 @@ node .rihal/bin/rihal-tools.cjs state record-session
558
558
 
559
559
  - **Empty arguments or --help:** print usage block (Step 0), stop.
560
560
  - **Single-agent question detected:** redirect to `/rihal:discuss` (Step 0.5).
561
- - **`rihal-tools.cjs` not found:** user has v1 installed or package broken. Tell user to run `rihal-code install-v2`.
561
+ - **`rihal-tools.cjs` not found:** user has v1 installed or package broken. Tell user to run `npx @hanzlaa/rcode install` (or `rcode install` if installed globally).
562
562
  - **Panel contains unknown agent:** print the installed-agent list and exit.
563
563
  - **state.json missing or corrupted:** continue without error — session artifact is mandatory, state tracking is optional.
564
564
  - **All panelists return empty responses:** likely subagents were spawned without proper prompts. Re-check Step 4 prompt construction.
@@ -219,8 +219,8 @@ This records the discuss session in `.rihal/state.json` as `last_session`.
219
219
  - **Empty arguments:** print usage block and stop (Step 0).
220
220
  - **Question redirects to council:** print redirect message (Step 0.5).
221
221
  - **state.json missing or corrupted:** continue without error — session artifact is mandatory, state tracking is optional.
222
- - **`rihal-tools.cjs` not found:** tell the user to run `rihal-code install-v2`.
223
- - **No installed agents:** print "No agents installed. Run `rihal-code install-v2`."
222
+ - **`rihal-tools.cjs` not found:** tell the user to run `npx @hanzlaa/rcode install` (or `rcode install` if installed globally).
223
+ - **No installed agents:** print "No agents installed. Run `npx @hanzlaa/rcode install`."
224
224
  - **Agent id not in installed list:** print available agents and ask the user to pick one.
225
225
  - **Agent returns empty response:** print "Agent responded empty. Check question clarity and retry."
226
226
 
@@ -30,7 +30,7 @@ cat .rihal/templates/settings-hooks.json
30
30
  Parse the JSON. If file does not exist, print error and stop:
31
31
 
32
32
  ```
33
- Error: .rihal/templates/settings-hooks.json not found. Run 'rihal-code install-v2' to reinstall.
33
+ Error: .rihal/templates/settings-hooks.json not found. Run 'npx @hanzlaa/rcode install' to reinstall.
34
34
  ```
35
35
 
36
36
  ## Step 2 — Load or create settings.json