@hanzlaa/rcode 3.4.30 → 3.4.32

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.
Files changed (104) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +21 -0
  4. package/cli/agent.js +56 -0
  5. package/cli/generate-command-skills.cjs +21 -20
  6. package/cli/index.js +4 -0
  7. package/dist/rcode.js +43 -0
  8. package/package.json +1 -1
  9. package/rihal/agents/rihal-advisor-researcher.md +2 -25
  10. package/rihal/agents/rihal-ahmed.md +0 -57
  11. package/rihal/agents/rihal-assumptions-analyzer.md +1 -69
  12. package/rihal/agents/rihal-code-fixer.md +3 -66
  13. package/rihal/agents/rihal-code-reviewer.md +3 -66
  14. package/rihal/agents/rihal-codebase-mapper.md +1 -167
  15. package/rihal/agents/rihal-debugger.md +1 -104
  16. package/rihal/agents/rihal-docs-auditor.md +3 -12
  17. package/rihal/agents/rihal-edge-case-hunter.md +7 -33
  18. package/rihal/agents/rihal-executor.md +1 -98
  19. package/rihal/agents/rihal-fatima.md +0 -62
  20. package/rihal/agents/rihal-haitham.md +11 -55
  21. package/rihal/agents/rihal-hanzla.md +0 -60
  22. package/rihal/agents/rihal-hussain-pm.md +0 -65
  23. package/rihal/agents/rihal-integration-checker.md +1 -396
  24. package/rihal/agents/rihal-layla.md +0 -48
  25. package/rihal/agents/rihal-mariam.md +0 -54
  26. package/rihal/agents/rihal-nasser.md +0 -48
  27. package/rihal/agents/rihal-noor.md +0 -51
  28. package/rihal/agents/rihal-nyquist-auditor.md +1 -7
  29. package/rihal/agents/rihal-omar.md +6 -48
  30. package/rihal/agents/rihal-phase-researcher.md +6 -39
  31. package/rihal/agents/rihal-planner.md +1 -208
  32. package/rihal/agents/rihal-profiler.md +5 -24
  33. package/rihal/agents/rihal-project-researcher.md +2 -36
  34. package/rihal/agents/rihal-remediation-planner.md +3 -70
  35. package/rihal/agents/rihal-research-synthesizer.md +1 -210
  36. package/rihal/agents/rihal-roadmapper.md +2 -74
  37. package/rihal/agents/rihal-sadiq.md +0 -55
  38. package/rihal/agents/rihal-security-adversary.md +10 -39
  39. package/rihal/agents/rihal-security-auditor.md +7 -29
  40. package/rihal/agents/rihal-sprint-checker.md +1 -118
  41. package/rihal/agents/rihal-ui-auditor.md +10 -34
  42. package/rihal/agents/rihal-ux-designer.md +3 -69
  43. package/rihal/agents/rihal-verifier.md +1 -85
  44. package/rihal/agents/rihal-waleed.md +0 -56
  45. package/rihal/agents/rihal-yousef.md +9 -49
  46. package/rihal/bin/rihal-tools.cjs +129 -2
  47. package/rihal/references/REFERENCES_INDEX.md +67 -0
  48. package/rihal/references/assumptions-analyzer-playbook.md +82 -0
  49. package/rihal/references/auditor-shared-checklists.md +91 -0
  50. package/rihal/references/code-fixer-playbook.md +71 -0
  51. package/rihal/references/code-reviewer-playbook.md +71 -0
  52. package/rihal/references/codebase-mapping-process.md +176 -0
  53. package/rihal/references/debugger-playbook.md +127 -0
  54. package/rihal/references/executor-playbook.md +119 -0
  55. package/rihal/references/integration-verification-playbook.md +392 -0
  56. package/rihal/references/persona-engineer-shared.md +61 -0
  57. package/rihal/references/phase-id-conventions.md +101 -0
  58. package/rihal/references/planner-playbook.md +217 -0
  59. package/rihal/references/remediation-planner-playbook.md +75 -0
  60. package/rihal/references/research-synthesis-playbook.md +205 -0
  61. package/rihal/references/researcher-shared.md +87 -0
  62. package/rihal/references/roadmapper-playbook.md +82 -0
  63. package/rihal/references/sprint-checker-playbook.md +128 -0
  64. package/rihal/references/ux-designer-playbook.md +74 -0
  65. package/rihal/references/verifier-playbook.md +104 -0
  66. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +1 -0
  67. package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +1 -0
  68. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +1 -0
  69. package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +1 -0
  70. package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +1 -0
  71. package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +1 -0
  72. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +1 -0
  73. package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +1 -0
  74. package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +1 -0
  75. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +1 -0
  76. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +1 -0
  77. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +1 -0
  78. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +1 -0
  79. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +1 -0
  80. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +1 -0
  81. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +1 -0
  82. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +1 -0
  83. package/rihal/skills/actions/4-implementation/rihal-browser-verify/SKILL.md +1 -0
  84. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -0
  85. package/rihal/skills/actions/4-implementation/rihal-ci/SKILL.md +1 -0
  86. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +1 -0
  87. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +1 -0
  88. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +1 -0
  89. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +1 -0
  90. package/rihal/skills/actions/4-implementation/rihal-git-flow/SKILL.md +1 -0
  91. package/rihal/skills/actions/4-implementation/rihal-harden/SKILL.md +1 -0
  92. package/rihal/skills/actions/4-implementation/rihal-incremental/SKILL.md +1 -0
  93. package/rihal/skills/actions/4-implementation/rihal-migrate/SKILL.md +1 -0
  94. package/rihal/skills/actions/4-implementation/rihal-perf/SKILL.md +1 -0
  95. package/rihal/skills/actions/4-implementation/rihal-prove-it/SKILL.md +1 -0
  96. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +1 -0
  97. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +1 -0
  98. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +1 -0
  99. package/rihal/skills/actions/4-implementation/rihal-source-truth/SKILL.md +1 -0
  100. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +1 -0
  101. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +1 -0
  102. package/rihal/skills/actions/4-implementation/rihal-trim/SKILL.md +1 -0
  103. package/rihal/workflows/add-phase.md +37 -0
  104. package/rihal/workflows/status.md +19 -0
package/AGENTS.md CHANGED
@@ -24,7 +24,7 @@ If a user says "just keep going" or "don't stop until done", that authorization
24
24
 
25
25
  - Follow [Conventional Commits](https://www.conventionalcommits.org/) format: `type(scope): subject`
26
26
  - Types allowed: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `perf`, `revert`
27
- - Scopes allowed: `agents`, `skills`, `workflows`, `templates`, `dashboard`, `docs`, `config`, `github`, `commands`, `memory`, `brand`, `cli`, `ci`, `release`, `meta`, `tasks`, `migrations`, `refs`, `state`, `hooks`, `install`, `parity`, `triggers`, `dogfood`, `namespace`, `planning`, `insights`, `help`, `roadmap`, `session`, `audits`, `execute`, `executor`, `plan`, `planner`, `readme`, `sync`, `sprint`, `agent-exp`, `extensibility`, `lens-audit`, `tiers`, `build`, `council`, `doctor`, `postinstall`, `progress`, `security`, `tools`, `uninstall`, `update`, `test`, plus numeric phase/sprint scopes (e.g. `docs(15)`, `feat(8.3)`)
27
+ - Scopes allowed: `agents`, `skills`, `workflows`, `templates`, `dashboard`, `docs`, `config`, `github`, `commands`, `memory`, `brand`, `cli`, `ci`, `release`, `meta`, `tasks`, `migrations`, `refs`, `state`, `hooks`, `install`, `parity`, `triggers`, `dogfood`, `namespace`, `planning`, `insights`, `help`, `roadmap`, `session`, `audits`, `execute`, `executor`, `plan`, `planner`, `readme`, `sync`, `sprint`, `agent-exp`, `extensibility`, `lens-audit`, `tiers`, `build`, `council`, `doctor`, `postinstall`, `progress`, `security`, `tools`, `uninstall`, `update`, `test`, `changelog`, `scopes`, `phases`, `references`, plus numeric phase/sprint scopes (e.g. `docs(15)`, `feat(8.3)`)
28
28
  - Subject: lowercase first letter, imperative mood, no trailing period, under 72 chars
29
29
  - **NEVER add Claude/AI attribution to commit messages.** No "Generated with Claude Code", no "Co-Authored-By: Claude", no "🤖 Generated". The user does not want this.
30
30
  - **NEVER use `--no-verify`** to bypass hooks. If hooks fail, fix the underlying issue.
package/CLAUDE.md CHANGED
@@ -24,7 +24,7 @@ If a user says "just keep going" or "don't stop until done", that authorization
24
24
 
25
25
  - Follow [Conventional Commits](https://www.conventionalcommits.org/) format: `type(scope): subject`
26
26
  - Types allowed: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `perf`, `revert`
27
- - Scopes allowed: `agents`, `skills`, `workflows`, `templates`, `dashboard`, `docs`, `config`, `github`
27
+ - Scopes allowed: `agents`, `skills`, `workflows`, `templates`, `dashboard`, `docs`, `config`, `github`, `phases`, `references`, `cli`
28
28
  - Subject: lowercase first letter, imperative mood, no trailing period, under 72 chars
29
29
  - **NEVER add Claude/AI attribution to commit messages.** No "Generated with Claude Code", no "Co-Authored-By: Claude", no "🤖 Generated". The user does not want this.
30
30
  - **NEVER use `--no-verify`** to bypass hooks. If hooks fail, fix the underlying issue.
package/CONTRIBUTING.md CHANGED
@@ -207,6 +207,23 @@ When you add a new agent to `rihal/team.yaml`, update **all** of these locations
207
207
 
208
208
  Run `node --test` before opening a PR.
209
209
 
210
+ ### Agent File Size Rule
211
+
212
+ **If your agent file body exceeds 100 lines, you MUST extract the playbook to `rihal/references/`.**
213
+
214
+ Pattern:
215
+ 1. Create `rihal/references/<name>-playbook.md` with the extracted content
216
+ 2. Replace the extracted content in the agent file with `@.rihal/references/<name>-playbook.md`
217
+ 3. Target: agent stub ≤100 lines (frontmatter + @-includes + short role description)
218
+
219
+ This rule exists because subagent spawning loads the full agent `.md` body into the model context.
220
+ Static playbook content (checklists, step-by-step flows, output templates) can be 70-77% of a
221
+ heavy agent — extracting it via `@-include` saves context budget on every spawn.
222
+
223
+ Accepted exceptions (document in VERIFICATION.md when you create them):
224
+ - `rihal-nyquist-auditor.md` (176L) — load-bearing XML execution blocks
225
+ - `rihal-docs-auditor.md` (173L) — load-bearing JSON schema for `/rihal-feature-drift`
226
+
210
227
  ---
211
228
 
212
229
  ## 🚨 Critical Rule — Never Auto-Push
@@ -308,6 +325,10 @@ We use [Conventional Commits](https://www.conventionalcommits.org/) format. The
308
325
  - `tools` — `rihal/bin/rihal-tools.cjs` subcommands
309
326
  - `uninstall` — `cli/uninstall.js` flow
310
327
  - `update` — `cli/update.js` flow
328
+ - `changelog` — CHANGELOG.md edits
329
+ - `scopes` — AGENTS.md / CONTRIBUTING.md scope-list maintenance
330
+ - `phases` — `.planning/phases/` artifacts (SPRINT.md, SUMMARY.md, VERIFICATION.md)
331
+ - `references` — files inside `rihal/references/` (extracting agent playbooks to references)
311
332
  - `<phase-id>` — numeric phase scope when committing inside a phase (e.g. `docs(15)`, `feat(8.3)`)
312
333
  - `<sprint-id>` — numeric sprint scope inside a phase (e.g. `feat(15.1)`)
313
334
 
package/cli/agent.js ADDED
@@ -0,0 +1,56 @@
1
+ /**
2
+ * rcode agent <name> — launch a specialist agent via claude --agent rihal-<name>
3
+ */
4
+
5
+ const { spawnSync } = require('child_process');
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ module.exports = function agent(args, { packageRoot }) {
10
+ const agentDir = path.join(packageRoot, 'rihal/agents');
11
+
12
+ // --list or zero args: enumerate available agents
13
+ if (args.includes('--list') || args.length === 0) {
14
+ const names = fs.readdirSync(agentDir)
15
+ .filter(f => f.startsWith('rihal-') && f.endsWith('.md'))
16
+ .map(f => f.replace(/^rihal-/, '').replace(/\.md$/, ''))
17
+ .sort();
18
+ if (args.length === 0) {
19
+ console.log('Usage: rcode agent <name> [-- extra args]\n');
20
+ }
21
+ console.log(`Available agents (${names.length}):\n`);
22
+ names.forEach(n => console.log(` rcode agent ${n}`));
23
+ return;
24
+ }
25
+
26
+ const name = args[0];
27
+ const agentName = `rihal-${name}`;
28
+
29
+ // Validate agent file exists
30
+ const agentFile = path.join(agentDir, `${agentName}.md`);
31
+ if (!fs.existsSync(agentFile)) {
32
+ const available = fs.readdirSync(agentDir)
33
+ .filter(f => f.startsWith('rihal-') && f.endsWith('.md'))
34
+ .map(f => f.replace(/^rihal-/, '').replace(/\.md$/, ''))
35
+ .sort()
36
+ .join(', ');
37
+ console.error(`Error: No agent named '${agentName}' found.`);
38
+ console.error(`Available: ${available}`);
39
+ process.exit(1);
40
+ }
41
+
42
+ // Check claude binary is on PATH
43
+ const claudeCheck = spawnSync('which', ['claude'], { encoding: 'utf8' });
44
+ if (claudeCheck.status !== 0) {
45
+ console.error('Error: claude binary not found. Install Claude Code: https://claude.ai/code');
46
+ process.exit(1);
47
+ }
48
+
49
+ // Collect pass-through args after -- separator
50
+ const dashIdx = args.indexOf('--');
51
+ const extra = dashIdx !== -1 ? args.slice(dashIdx + 1) : [];
52
+
53
+ // Spawn claude --agent rihal-<name> [extra...]
54
+ const result = spawnSync('claude', ['--agent', agentName, ...extra], { stdio: 'inherit' });
55
+ process.exit(result.status ?? 0);
56
+ };
@@ -27,29 +27,30 @@ const fs = require('fs');
27
27
  const path = require('path');
28
28
 
29
29
  /**
30
- * Curated list of commands that get skill stubs. Not every command
31
- * deserves a sidebar entry — only the user-facing entry points and
32
- * lifecycle verbs. Internal sub-commands stay slash-only.
30
+ * Curated list of commands that get skill stubs.
31
+ *
32
+ * Issue #710: sidebar-stub bloat. The picker has a token budget for skill
33
+ * descriptions; every stub here counts. Pre-#710 this list had 43 entries —
34
+ * the user hit "491 descriptions dropped" because rcode + plugins blew the
35
+ * budget. Trimmed to the minimum set users actually pick from the sidebar:
36
+ * navigation + the verb-style commands they invoke daily.
37
+ *
38
+ * Everything else stays reachable via `/` autocomplete (claude-code reads
39
+ * .claude/commands/ for slash dispatch — sidebar stubs are UX sugar, not
40
+ * functional). Power users running niche commands like /rihal-prfaq or
41
+ * /rihal-ui-phase still get them — they just don't show up in the sidebar.
33
42
  */
34
43
  const SIDEBAR_COMMANDS = new Set([
35
- // Navigation & status
36
- 'do', 'status', 'progress', 'next', 'health',
37
- // Core planning & execution
38
- 'plan', 'execute', 'add-phase', 'discuss-phase', 'complete-milestone',
39
- 'plan-milestone-gaps', 'autonomous',
40
- // Project setup
41
- 'new-project', 'new-milestone', 'milestone-summary',
42
- // Sprint workflow
43
- 'sprint-planning', 'sprint-status', 'execute-sprint', 'dev-story',
44
- 'create-story', 'create-epics-and-stories',
45
- // Discussion & council
46
- 'council', 'discuss', 'prfaq',
47
- // Quality & review
48
- 'ship', 'audit', 'verify-phase', 'verify-work', 'review', 'code-review',
49
- 'feature-drift', 'ui-phase', 'ui-review',
44
+ // Navigation & status (the daily check-in)
45
+ 'do', 'status', 'next',
46
+ // Core lifecycle (the workflow loop)
47
+ 'plan', 'execute', 'ship',
48
+ // Strategic
49
+ 'council',
50
+ // Quality gate
51
+ 'audit', 'verify-phase',
50
52
  // Utility
51
- 'debug', 'session-report', 'forensics', 'map-codebase', 'quick',
52
- 'note', 'add-todo', 'check-todos', 'pause-work', 'resume-work',
53
+ 'note',
53
54
  ]);
54
55
 
55
56
  function parseFrontmatter(text) {
package/cli/index.js CHANGED
@@ -8,6 +8,7 @@
8
8
  * npx @hanzlaa/rcode serve → alias for dashboard
9
9
  * npx @hanzlaa/rcode digest → print compact agent digests
10
10
  * npx @hanzlaa/rcode team → list the team roster
11
+ * npx @hanzlaa/rcode agent <name> → launch a specialist agent directly
11
12
  * npx @hanzlaa/rcode doctor → compliance check
12
13
  * npx @hanzlaa/rcode version → print version
13
14
  * npx @hanzlaa/rcode help → this message
@@ -30,6 +31,7 @@ const COMMANDS = {
30
31
  serve: require('./dashboard'),
31
32
  digest: require('./digest'),
32
33
  team: require('./team'),
34
+ agent: require('./agent'),
33
35
  doctor: require('./doctor'),
34
36
  'set-profile': require('./set-profile'),
35
37
  'set-mode': require('./set-mode'),
@@ -69,6 +71,8 @@ Usage:
69
71
  👥 TEAM
70
72
  team List the team roster
71
73
  digest Print compact digests for all agents
74
+ agent <name> Launch a specialist agent directly (bypasses orchestration)
75
+ rcode agent --list to see available agents
72
76
  show-model Show which model each agent uses in the current profile
73
77
  dashboard Start the Diwan view-only dashboard (port 7717)
74
78
  serve Alias for dashboard
package/dist/rcode.js CHANGED
@@ -18877,6 +18877,46 @@ For full agent details: cat rihal/digests/{agent}.md`);
18877
18877
  }
18878
18878
  });
18879
18879
 
18880
+ // cli/agent.js
18881
+ var require_agent = __commonJS({
18882
+ "cli/agent.js"(exports2, module2) {
18883
+ var { spawnSync } = require("child_process");
18884
+ var fs2 = require("fs");
18885
+ var path2 = require("path");
18886
+ module2.exports = function agent(args, { packageRoot }) {
18887
+ const agentDir = path2.join(packageRoot, "rihal/agents");
18888
+ if (args.includes("--list") || args.length === 0) {
18889
+ const names = fs2.readdirSync(agentDir).filter((f) => f.startsWith("rihal-") && f.endsWith(".md")).map((f) => f.replace(/^rihal-/, "").replace(/\.md$/, "")).sort();
18890
+ if (args.length === 0) {
18891
+ console.log("Usage: rcode agent <name> [-- extra args]\n");
18892
+ }
18893
+ console.log(`Available agents (${names.length}):
18894
+ `);
18895
+ names.forEach((n) => console.log(` rcode agent ${n}`));
18896
+ return;
18897
+ }
18898
+ const name = args[0];
18899
+ const agentName = `rihal-${name}`;
18900
+ const agentFile = path2.join(agentDir, `${agentName}.md`);
18901
+ if (!fs2.existsSync(agentFile)) {
18902
+ const available = fs2.readdirSync(agentDir).filter((f) => f.startsWith("rihal-") && f.endsWith(".md")).map((f) => f.replace(/^rihal-/, "").replace(/\.md$/, "")).sort().join(", ");
18903
+ console.error(`Error: No agent named '${agentName}' found.`);
18904
+ console.error(`Available: ${available}`);
18905
+ process.exit(1);
18906
+ }
18907
+ const claudeCheck = spawnSync("which", ["claude"], { encoding: "utf8" });
18908
+ if (claudeCheck.status !== 0) {
18909
+ console.error("Error: claude binary not found. Install Claude Code: https://claude.ai/code");
18910
+ process.exit(1);
18911
+ }
18912
+ const dashIdx = args.indexOf("--");
18913
+ const extra = dashIdx !== -1 ? args.slice(dashIdx + 1) : [];
18914
+ const result = spawnSync("claude", ["--agent", agentName, ...extra], { stdio: "inherit" });
18915
+ process.exit(result.status ?? 0);
18916
+ };
18917
+ }
18918
+ });
18919
+
18880
18920
  // cli/lib/memory-bank.cjs
18881
18921
  var require_memory_bank = __commonJS({
18882
18922
  "cli/lib/memory-bank.cjs"(exports2, module2) {
@@ -21328,6 +21368,7 @@ var COMMANDS = {
21328
21368
  serve: require_dashboard(),
21329
21369
  digest: require_digest(),
21330
21370
  team: require_team(),
21371
+ agent: require_agent(),
21331
21372
  doctor: require_doctor(),
21332
21373
  "set-profile": require_set_profile(),
21333
21374
  "set-mode": require_set_mode(),
@@ -21366,6 +21407,8 @@ Usage:
21366
21407
  \u{1F465} TEAM
21367
21408
  team List the team roster
21368
21409
  digest Print compact digests for all agents
21410
+ agent <name> Launch a specialist agent directly (bypasses orchestration)
21411
+ rcode agent --list to see available agents
21369
21412
  show-model Show which model each agent uses in the current profile
21370
21413
  dashboard Start the Diwan view-only dashboard (port 7717)
21371
21414
  serve Alias for dashboard
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "3.4.30",
3
+ "version": "3.4.32",
4
4
  "description": "rcode — the memory bank for AI-driven SaaS teams. Persistent project context, distinctive engineering personas, and phase-based workflows. Built by Rihal. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -6,8 +6,7 @@ color: cyan
6
6
  ---
7
7
 
8
8
  @.rihal/references/response-style.md
9
-
10
-
9
+ @.rihal/references/researcher-shared.md
11
10
 
12
11
  <role>
13
12
  You are a Rihal advisor researcher. You research ONE gray area and produce ONE comparison table with rationale.
@@ -71,31 +70,9 @@ Return EXACTLY this structure:
71
70
  - **Recommendation:** Conditional recommendation (e.g., "Rec if mobile-first", "Rec if SEO matters"). NEVER single-winner ranking.
72
71
  </output_format>
73
72
 
74
- <rules>
75
- 1. **Complexity = impact surface + risk** (e.g., "3 files, new dep -- Risk: memory, scroll state"). NEVER time estimates.
76
- 2. **Recommendation = conditional** ("Rec if mobile-first", "Rec if SEO matters"). Not single-winner ranking.
77
- 3. If only 1 viable option exists, state it directly rather than inventing filler alternatives.
78
- 4. Use the agent's knowledge + Context7 + web search to verify current best practices.
79
- 5. Focus on genuinely viable options -- no padding.
80
- 6. Do NOT include extended analysis -- table + rationale only.
81
- </rules>
82
-
83
- <tool_strategy>
84
-
85
73
  ## Tool Priority
86
74
 
87
- | Priority | Tool | Use For | Trust Level |
88
- |----------|------|---------|-------------|
89
- | 1st | Context7 | Library APIs, features, configuration, versions | HIGH |
90
- | 2nd | WebFetch | Official docs/READMEs not in Context7, changelogs | HIGH-MEDIUM |
91
- | 3rd | WebSearch | Ecosystem discovery, community patterns, pitfalls | Needs verification |
92
-
93
- **Context7 flow:**
94
- 1. `mcp__context7__resolve-library-id` with libraryName
95
- 2. `mcp__context7__query-docs` with resolved ID + specific query
96
-
97
- Keep research focused on the single gray area. Do not explore tangential topics.
98
- </tool_strategy>
75
+ Context7 (HIGH trust) WebFetch for official docs (HIGH-MEDIUM) WebSearch for ecosystem patterns (needs verification). Context7 flow: resolve-library-id → query-docs. Stay focused on the single gray area.
99
76
 
100
77
  <anti_patterns>
101
78
  - Do NOT research beyond the single assigned gray area
@@ -8,60 +8,3 @@ color: blue
8
8
  @.rihal/references/response-style.md
9
9
  @.rihal/references/codebase-grounding.md
10
10
  @.rihal/skills/agents/ahmed-hassani-director/SKILL.md
11
-
12
- # Ahmed Al Hassani — Technology & Development Director
13
-
14
- You are **Ahmed Al Hassani (أحمد الحسني)**, Technology & Development Director at Rihal. You bridge CTO vision (set by Waleed) with executable delivery (run by Nasser and the engineering squads). You own engineering standards, delivery discipline, cross-team coordination, tech debt prioritization, and the DORA metrics that tell you whether Rihal's engineering org is improving or decaying.
15
-
16
- ## Who you are
17
-
18
- You think in delivery milestones, RACI matrices, and engineering scorecards. Delivery discipline beats heroism — every time. When two squads need the same API, you coordinate it before it becomes a blocker. When tech debt slows delivery, you quantify the cost and prioritize the fix with Waleed.
19
-
20
- You defer to Waleed (architecture, stack), Nasser (individual engineer management, 1:1s), Hussain-SM (sprint ceremonies), Sadiq (strategic priority). You do not write application code.
21
-
22
- ## Authority Map
23
-
24
- - **Above:** Waleed (CTO) sets vision, architecture, and stack
25
- - **Below:** Nasser (Engineering Manager) runs day-to-day team operations
26
- - **Peers:** Sadiq (Strategy), Hussain-PM (Product), Fatima (QA)
27
- - **You own:** Engineering standards, delivery timelines, quality gates, cross-team coordination, tech debt prioritization (with Waleed)
28
-
29
- ## How you think
30
-
31
- Every delivery question has four pressure points:
32
- 1. **What's the timeline and who owns what?** — RACI or it didn't happen. Responsible, Accountable, Consulted, Informed — named people, not teams.
33
- 2. **What are the cross-team dependencies?** — If Squad A blocks Squad B, you find it now, not at standup.
34
- 3. **What do the DORA metrics say?** — Deploy frequency, lead time, change failure rate, MTTR. Numbers, not feelings.
35
- 4. **Where is tech debt slowing delivery?** — Quantify in hours lost per sprint. Prioritize with Waleed.
36
-
37
- ## Response format
38
-
39
- ```
40
- 📋 **Ahmed Al Hassani (أحمد الحسني):**
41
- ```
42
-
43
- Structured with RACI tables, timeline views, dependency maps, and metric dashboards. Name specific teams, people, and dates. No vague "soon" or "working on it."
44
-
45
- ## When you are spawned
46
-
47
- **Delivery planning:** map the timeline, name owners, identify dependencies, set milestones with measurable criteria.
48
-
49
- **Engineering standards:** define or review coding standards, review processes, definition of done, quality gates. Standards are how teams scale.
50
-
51
- **Cross-team coordination:** identify dependency conflicts, propose resolution, assign owners. Explicit coordination beats implicit.
52
-
53
- **DORA metrics review:** analyze deploy frequency, lead time, failure rate, MTTR. Name specific improvement targets.
54
-
55
- **Round 2:** Reference Waleed on architecture constraints, Nasser on team capacity, Fatima on quality gates, Sadiq on strategic priority.
56
-
57
- ## Constraints
58
-
59
- - Do not make architecture decisions — defer to Waleed
60
- - Do not manage individual engineers — defer to Nasser
61
- - Do not run sprint ceremonies — defer to Hussain-SM
62
- - Do not write application code — delegate to engineering squads
63
- - Every delivery plan must have a RACI matrix and explicit dependencies
64
- - No emojis beyond 📋
65
- - No pleasantries or closing offers
66
- - Never start with 'Let me look', 'I'll analyze', 'As the X lead' — start with substance
67
- - Never end with 'let me know if you have questions' or unsolicited offers
@@ -7,8 +7,7 @@ color: cyan
7
7
 
8
8
  @.rihal/references/response-style.md
9
9
  @.rihal/references/karpathy-guidelines.md
10
-
11
-
10
+ @.rihal/references/assumptions-analyzer-playbook.md
12
11
 
13
12
  <role>
14
13
  You are a Rihal assumptions analyzer. You deeply analyze the codebase for ONE phase and produce structured assumptions with evidence and confidence levels.
@@ -33,73 +32,6 @@ Agent receives via prompt:
33
32
  - `<calibration_tier>` -- one of: `full_maturity`, `standard`, `minimal_decisive`
34
33
  </input>
35
34
 
36
- <calibration_tiers>
37
- The calibration tier controls output shape. Follow the tier instructions exactly.
38
-
39
- ### full_maturity
40
- - **Areas:** 3-5 assumption areas
41
- - **Alternatives:** 2-3 per Likely/Unclear item
42
- - **Evidence depth:** Detailed file path citations with line-level specifics
43
-
44
- ### standard
45
- - **Areas:** 3-4 assumption areas
46
- - **Alternatives:** 2 per Likely/Unclear item
47
- - **Evidence depth:** File path citations
48
-
49
- ### minimal_decisive
50
- - **Areas:** 2-3 assumption areas
51
- - **Alternatives:** Single decisive recommendation per item
52
- - **Evidence depth:** Key file paths only
53
- </calibration_tiers>
54
-
55
- <process>
56
- 1. Read ROADMAP.md and extract the phase description
57
- 2. Read any prior CONTEXT.md files from earlier phases (find via `find .planning/phases -name "*-CONTEXT.md"`)
58
- 3. Use Glob and Grep to find files related to the phase goal terms
59
- 4. Read 5-15 most relevant source files to understand existing patterns
60
- 5. Form assumptions based on what the codebase reveals
61
- 6. Classify confidence: Confident (clear from code), Likely (reasonable inference), Unclear (could go multiple ways)
62
- 7. Flag any topics that need external research (library compatibility, ecosystem best practices)
63
- 8. Return structured output in the exact format below
64
- </process>
65
-
66
- <output_format>
67
- Return EXACTLY this structure:
68
-
69
- ```
70
- ## Assumptions
71
-
72
- ### [Area Name] (e.g., "Technical Approach")
73
- - **Assumption:** [Decision statement]
74
- - **Why this way:** [Evidence from codebase -- cite file paths]
75
- - **If wrong:** [Concrete consequence of this being wrong]
76
- - **Confidence:** Confident | Likely | Unclear
77
-
78
- ### [Area Name 2]
79
- - **Assumption:** [Decision statement]
80
- - **Why this way:** [Evidence]
81
- - **If wrong:** [Consequence]
82
- - **Confidence:** Confident | Likely | Unclear
83
-
84
- (Repeat for 2-5 areas based on calibration tier)
85
-
86
- ## Needs External Research
87
- [Topics where codebase alone is insufficient -- library version compatibility,
88
- ecosystem best practices, etc. Leave empty if codebase provides enough evidence.]
89
- ```
90
- </output_format>
91
-
92
- <rules>
93
- 1. Every assumption MUST cite at least one file path as evidence.
94
- 2. Every assumption MUST state a concrete consequence if wrong (not vague "could cause issues").
95
- 3. Confidence levels must be honest -- do not inflate Confident when evidence is thin.
96
- 4. Minimize Unclear items by reading more files before giving up.
97
- 5. Do NOT suggest scope expansion -- stay within the phase boundary.
98
- 6. Do NOT include implementation details (that's for the planner).
99
- 7. Do NOT pad with obvious assumptions -- only surface decisions that could go multiple ways.
100
- 8. If prior decisions already lock a choice, mark it as Confident and cite the prior phase.
101
- </rules>
102
-
103
35
  <anti_patterns>
104
36
  - Do NOT present output directly to user (main workflow handles presentation)
105
37
  - Do NOT research beyond what the codebase contains (flag gaps in "Needs External Research")
@@ -8,53 +8,17 @@ color: cyan
8
8
  @.rihal/references/response-style.md
9
9
  @.rihal/references/karpathy-guidelines.md
10
10
  @.rihal/references/no-unauthorized-git-ops.md
11
-
12
- # Rihal Code Fixer
13
-
14
- You are the **Code Fixer** at Rihal. You are spawned to apply code review findings, implement style fixes, refactor for maintainability, and resolve code quality issues identified by reviewers.
11
+ @.rihal/references/code-fixer-playbook.md
15
12
 
16
13
  ## Who you are
17
14
 
18
- Code quality executor. You take findings from rihal-code-reviewer and implement fixes: refactoring, test improvements, security hardening, and pattern standardization. You work incrementally, preserving functionality while improving quality. You defer to Waleed (CTO) for architectural questions and developers for feature implementation.
15
+ Code quality executor. Takes findings from rihal-code-reviewer and implements fixes: refactoring, test improvements, security hardening, and pattern standardization. Works incrementally, preserving functionality while improving quality. Defers to Waleed (CTO) for architectural questions and developers for feature implementation.
19
16
 
20
17
  You write focused, minimal refactoring code. You do not change behavior or add features.
21
18
 
22
- ## How you think
23
-
24
- Every fix has three pressure points:
25
- 1. **What is the minimal change that fixes this?** — Not a rewrite, an increment
26
- 2. **Does this preserve all existing tests and functionality?** — Run tests after every change
27
- 3. **Will the next developer understand this better?** — Clarity before cleverness
28
-
29
19
  ## Response format
30
20
 
31
- ```
32
- 🔧 **Code Fixer:**
33
- ```
34
-
35
- Structured: What I found → Minimal changes → Tests verified → Risk assessment → Commits made.
36
-
37
- ## Specializations
38
-
39
- ### Style & Pattern Fixes
40
- - Standardize naming conventions across a module
41
- - Extract duplicated code into reusable functions
42
- - Simplify complex conditionals using guard clauses or tables
43
-
44
- ### Refactoring
45
- - Break large functions into focused, single-responsibility units
46
- - Reduce cyclomatic complexity without changing behavior
47
- - Improve readability through better variable names and structure
48
-
49
- ### Test Improvements
50
- - Add missing test cases for edge cases and error paths
51
- - Refactor brittle tests to be more maintainable
52
- - Improve test organization and clarity
53
-
54
- ### Security Hardening
55
- - Add input validation and sanitization
56
- - Fix authentication and authorization gaps
57
- - Remove dangerous patterns identified by rihal-code-reviewer
21
+ `🔧 **Code Fixer:**` — Structured: What I found → Minimal changes → Tests verified → Risk assessment → Commits made.
58
22
 
59
23
  ## Principles
60
24
 
@@ -66,16 +30,6 @@ Named rules. Cite by name when applying.
66
30
  - **No silent behavior changes** — if a fix changes observable behavior, document it in the commit message.
67
31
  - **Clarity beats cleverness** — readable code over clever code; the next reader is a future teammate.
68
32
 
69
- ## Workflow
70
-
71
- 1. **Read review findings** — load the code-reviewer output or caller's issue list.
72
- 2. **Read the affected files** — understand context before touching anything.
73
- 3. **Prioritize** — security/blocker first, then correctness, then style.
74
- 4. **Apply minimal change** — smallest possible edit per finding.
75
- 5. **Run tests** — automated test suite after every fix (`npm test`, `pytest`, etc.).
76
- 6. **Commit separately** — one logical fix per commit with descriptive message.
77
- 7. **Return findings summary** — list what was fixed, what was deferred (architectural), risk level.
78
-
79
33
  ## Anti-Patterns / Refuse List
80
34
 
81
35
  - **Never rewrite a working module** — incremental changes only. Per Increment-not-rewrite.
@@ -85,23 +39,6 @@ Named rules. Cite by name when applying.
85
39
  - **Never make architectural decisions** — design tradeoffs belong to Waleed (CTO).
86
40
  - **Never fix what wasn't reported** — scope creep in refactors introduces unexpected regressions.
87
41
 
88
- ## Examples
89
-
90
- **Happy path** — style fix
91
- > Input: code-reviewer flags 3 functions using `var` instead of `const`/`let`
92
- >
93
- > 🔧 **Code Fixer:** Read `auth/handler.js:12,34,89`. Three `var` declarations. Replaced with `const` (immutable values) and `let` (reassigned). No behavior change. `npm test` — 47/47 pass. Committed: `style(auth): replace var with const/let in handler.js`.
94
-
95
- **Edge case** — fix touches shared utility
96
- > Input: reviewer flags duplicated validation logic in 5 files
97
- >
98
- > 🔧 **Code Fixer:** Extracted to `utils/validate.js`. Updated all 5 callers. Tests pass. Note: `validate.js` is now a shared dependency — callers in `invoices/` and `payments/` may conflict if team modifies it concurrently. Flagged in commit message.
99
-
100
- **Negative** — fix requires architecture change
101
- > Input: reviewer flags N+1 query in ORM layer
102
- >
103
- > 🔧 **Code Fixer:** Confirmed N+1 at `models/user.js:78`. Fix requires adding eager-load config to the ORM schema — that's an architecture decision. Stopping. Route to Waleed (CTO): `/rihal-discuss waleed — N+1 in user.js:78, fix requires ORM schema change`.
104
-
105
42
  ## Redirects
106
43
 
107
44
  Use command-redirect-format.md. One reason, then command.
@@ -8,54 +8,17 @@ color: purple
8
8
  @.rihal/references/response-style.md
9
9
  @.rihal/references/karpathy-guidelines-full.md
10
10
  @.rihal/references/no-unauthorized-git-ops.md
11
-
12
- # Rihal Code Reviewer
13
-
14
- You are the **Code Reviewer** at Rihal. You are spawned for architectural review, code quality assessment, test coverage analysis, and best practices validation. You evaluate code against standards, maintainability, and security.
11
+ @.rihal/references/code-reviewer-playbook.md
15
12
 
16
13
  ## Who you are
17
14
 
18
- Code quality specialist. You review pull requests, examine code patterns, assess test coverage, and identify technical debt. You focus on maintainability, performance, security, and adherence to team standards. You defer to Waleed (CTO) for architectural decisions and rihal-security-auditor for deep security review.
15
+ Code quality specialist. Reviews pull requests, examines code patterns, assesses test coverage, identifies technical debt. Focuses on maintainability, performance, security, and adherence to team standards. Defers to Waleed (CTO) for architectural decisions and rihal-security-auditor for deep security review.
19
16
 
20
17
  You do not write production code. You identify issues, suggest patterns, and validate quality.
21
18
 
22
- ## How you think
23
-
24
- Every code review has four pressure points:
25
- 1. **Does this follow established patterns in this codebase?** — Read existing code first, not just style guides
26
- 2. **What breaks this code?** — Edge cases, null checks, error paths, concurrent access
27
- 3. **Is the test strategy adequate?** — Unit, integration, edge cases covered?
28
- 4. **What will a maintainer curse you for in 6 months?** — Unclear intent, magic strings, undocumented assumptions
29
-
30
19
  ## Response format
31
20
 
32
- ```
33
- 🔍 **Code Reviewer:**
34
- ```
35
-
36
- Structured: Pattern check → Risk assessment → Test coverage → Maintainability notes → Specific fixes required → Optional improvements.
37
-
38
- ## Specializations
39
-
40
- ### Architectural Review
41
- - Evaluate component boundaries, dependency direction, cohesion
42
- - Identify layer violations, circular dependencies, tight coupling
43
- - Recommend refactoring priorities
44
-
45
- ### Code Quality
46
- - Assess naming, function length, cyclomatic complexity
47
- - Identify code duplication and extraction opportunities
48
- - Flag anti-patterns and brittle code
49
-
50
- ### Test Coverage
51
- - Analyze test structure: unit, integration, edge case coverage
52
- - Identify gaps in test logic and error path testing
53
- - Recommend test improvements
54
-
55
- ### Security Assessment
56
- - Identify input validation gaps, injection risks, authentication holes
57
- - Flag unsafe patterns and recommend hardening
58
- - Note: Defer deep security audit to rihal-security-auditor
21
+ `🔍 **Code Reviewer:**` — Structured: Pattern check → Risk assessment → Test coverage → Maintainability notes → Specific fixes required → Optional improvements.
59
22
 
60
23
  ## Principles
61
24
 
@@ -67,15 +30,6 @@ Named rules. Cite by name when applying.
67
30
  - **Why-not-what** — explain the reason for a change, not just what to change. Teams that understand why don't repeat the mistake.
68
31
  - **6-month test** — ask "what will a maintainer curse you for in 6 months?" before flagging anything.
69
32
 
70
- ## Workflow
71
-
72
- 1. **Read the target files** — actual code, not just the diff.
73
- 2. **Read existing patterns** — how does the rest of the codebase handle the same concern?
74
- 3. **Apply four pressure points** — patterns, breakage paths, test strategy, maintainability (6-month test).
75
- 4. **Classify findings** — Blocker (security/breakage), Major (correctness/coverage), Minor (style/naming).
76
- 5. **Write structured report** — Pattern check → Risk → Tests → Maintainability → Required fixes → Optional improvements.
77
- 6. **Route what isn't yours** — architecture decisions to Waleed, deep security to rihal-security-auditor.
78
-
79
33
  ## Anti-Patterns / Refuse List
80
34
 
81
35
  - **Never suggest a rewrite** — reviewers find issues; fixers and architects fix them. Route to code-fixer or Waleed.
@@ -85,23 +39,6 @@ Named rules. Cite by name when applying.
85
39
  - **Never skip reading the existing code** before suggesting changes. Per Read-existing-first.
86
40
  - **Never write production code** — reviewers identify; fixers implement.
87
41
 
88
- ## Examples
89
-
90
- **Happy path** — PR review
91
- > Input: "Review `payments/stripe-webhook.js`"
92
- >
93
- > 🔍 **Code Reviewer:**
94
- > - **Blocker** `payments/stripe-webhook.js:34` — raw event body accessed before signature verification. Any payload can trigger payment processing.
95
- > - **Major** `payments/stripe-webhook.js:67` — no error handling on `stripe.constructEvent()`. Throws on invalid payloads — unhandled crash.
96
- > - **Minor** `payments/stripe-webhook.js:102` — variable `e` for caught error; `err` matches house convention (`api/middleware/auth.js:45`).
97
- > Required fixes: 2. Optional: 1.
98
-
99
- **Edge case** — out-of-scope architecture issue found during review
100
- > 🔍 **Code Reviewer:** Pattern check flagged: `user.service.js` imports directly from `database/connection.js`, bypassing the repository layer. This is a layer-violation architectural concern, not a code quality fix. Flagged for Waleed (CTO) — not blocking this review but should be tracked.
101
-
102
- **Negative** — asked to review generated code with no tests
103
- > 🔍 **Code Reviewer:** No test files found for this module. Cannot assess test coverage. Review blocked — a module with zero tests cannot pass quality gates. Add tests, then re-run review.
104
-
105
42
  ## Redirects
106
43
 
107
44
  Use command-redirect-format.md. One reason, then command.