@hanzlaa/rcode 2.8.0 → 3.1.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.
Files changed (120) hide show
  1. package/AGENTS.md +11 -1
  2. package/CONTRIBUTING.md +7 -0
  3. package/README.md +39 -20
  4. package/package.json +2 -2
  5. package/rihal/agents/rihal-advisor-researcher.md +1 -1
  6. package/rihal/agents/rihal-assumptions-analyzer.md +1 -1
  7. package/rihal/agents/rihal-codebase-mapper.md +1 -1
  8. package/rihal/agents/rihal-docs-auditor.md +3 -3
  9. package/rihal/agents/rihal-executor.md +10 -0
  10. package/rihal/agents/rihal-integration-checker.md +1 -1
  11. package/rihal/agents/rihal-noor.md +2 -2
  12. package/rihal/agents/rihal-phase-researcher.md +1 -1
  13. package/rihal/agents/rihal-planner.md +25 -0
  14. package/rihal/agents/rihal-project-researcher.md +1 -1
  15. package/rihal/agents/rihal-research-synthesizer.md +1 -1
  16. package/rihal/agents/rihal-roadmapper.md +1 -1
  17. package/rihal/agents/rihal-sprint-checker.md +19 -1
  18. package/rihal/agents/rihal-verifier.md +1 -1
  19. package/rihal/agents/rihal-waleed.md +1 -2
  20. package/rihal/commands/code-review.md +1 -1
  21. package/rihal/commands/memory-audit.md +10 -0
  22. package/rihal/commands/memory-distill.md +11 -0
  23. package/rihal/commands/memory-init.md +12 -0
  24. package/rihal/commands/memory-update.md +12 -0
  25. package/rihal/config/model-profiles.json +5 -5
  26. package/rihal/references/karpathy-guidelines-full.md +1 -1
  27. package/rihal/references/no-unauthorized-git-ops.md +1 -1
  28. package/rihal/references/verb-dictionary.md +1 -1
  29. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +49 -139
  30. package/rihal/skills/actions/2-plan/rihal-frontend-design/references.md +79 -0
  31. package/rihal/skills/actions/4-implementation/rihal-browser-verify/SKILL.md +70 -0
  32. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -1
  33. package/rihal/skills/actions/4-implementation/rihal-ci/SKILL.md +108 -0
  34. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +78 -0
  35. package/rihal/skills/actions/4-implementation/rihal-git-flow/SKILL.md +90 -0
  36. package/rihal/skills/actions/4-implementation/rihal-harden/SKILL.md +91 -0
  37. package/rihal/skills/actions/4-implementation/rihal-incremental/SKILL.md +50 -0
  38. package/rihal/skills/actions/4-implementation/rihal-migrate/SKILL.md +86 -0
  39. package/rihal/skills/actions/4-implementation/rihal-perf/SKILL.md +96 -0
  40. package/rihal/skills/actions/4-implementation/rihal-prove-it/SKILL.md +64 -0
  41. package/rihal/skills/actions/4-implementation/rihal-source-truth/SKILL.md +76 -0
  42. package/rihal/skills/actions/4-implementation/rihal-trim/SKILL.md +73 -0
  43. package/rihal/skills/agents/dalil-scout/SKILL.md +43 -125
  44. package/rihal/skills/agents/dalil-scout/references.md +67 -0
  45. package/rihal/skills/agents/majlis-council/SKILL.md +50 -144
  46. package/rihal/skills/agents/majlis-council/references.md +90 -0
  47. package/rihal/skills/agents/raees-orchestrator/SKILL.md +56 -117
  48. package/rihal/skills/agents/raees-orchestrator/references.md +47 -0
  49. package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +36 -136
  50. package/rihal/skills/core/rihal-advanced-elicitation/references.md +101 -0
  51. package/rihal/skills/core/rihal-auth-audit/SKILL.md +93 -0
  52. package/rihal/skills/core/rihal-brainstorming/SKILL.md +5 -0
  53. package/rihal/skills/core/rihal-client-gate/SKILL.md +91 -0
  54. package/rihal/skills/core/rihal-clone-website/SKILL.md +30 -371
  55. package/rihal/skills/core/rihal-clone-website/references.md +213 -0
  56. package/rihal/skills/core/rihal-deploy-unify/SKILL.md +87 -0
  57. package/rihal/skills/core/rihal-distillator/SKILL.md +37 -187
  58. package/rihal/skills/core/rihal-distillator/references.md +118 -0
  59. package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +5 -0
  60. package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +45 -183
  61. package/rihal/skills/core/rihal-editorial-review-structure/references.md +110 -0
  62. package/rihal/skills/core/rihal-help/SKILL.md +6 -1
  63. package/rihal/skills/core/rihal-incident-record/SKILL.md +161 -0
  64. package/rihal/skills/core/rihal-index-docs/SKILL.md +5 -0
  65. package/rihal/skills/core/rihal-init/SKILL.md +5 -0
  66. package/rihal/skills/core/rihal-memory-audit/SKILL.md +88 -0
  67. package/rihal/skills/core/rihal-memory-distill/SKILL.md +87 -0
  68. package/rihal/skills/core/rihal-memory-init/SKILL.md +77 -0
  69. package/rihal/skills/core/rihal-memory-update/SKILL.md +73 -0
  70. package/rihal/skills/core/rihal-mvp-graduate/SKILL.md +116 -0
  71. package/rihal/skills/core/rihal-ocr-consistency/SKILL.md +106 -0
  72. package/rihal/skills/core/rihal-party-mode/SKILL.md +5 -0
  73. package/rihal/skills/core/rihal-rebrand/SKILL.md +133 -0
  74. package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +5 -0
  75. package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +5 -0
  76. package/rihal/skills/core/rihal-shard-doc/SKILL.md +5 -0
  77. package/rihal/skills/core/rihal-theme-system/SKILL.md +113 -0
  78. package/rihal/team.yaml +3 -22
  79. package/rihal/templates/memory/INDEX.md +46 -0
  80. package/rihal/templates/memory/change-records/.gitkeep +4 -0
  81. package/rihal/templates/memory/distillates/project.distillate.md +11 -0
  82. package/rihal/templates/memory/distillates/stack.distillate.md +11 -0
  83. package/rihal/templates/memory/incidents/known-issues.md +27 -0
  84. package/rihal/templates/memory/incidents/post-mortems/.gitkeep +3 -0
  85. package/rihal/templates/memory/milestones/archive/.gitkeep +2 -0
  86. package/rihal/templates/memory/milestones/current.md +39 -0
  87. package/rihal/templates/memory/people/stakeholders.md +25 -0
  88. package/rihal/templates/memory/people/team.md +35 -0
  89. package/rihal/templates/memory/project/decisions.md +32 -0
  90. package/rihal/templates/memory/project/glossary.md +16 -0
  91. package/rihal/templates/memory/project/stack.md +46 -0
  92. package/rihal/workflows/audit.md +3 -3
  93. package/rihal/workflows/code-review.md +32 -1
  94. package/rihal/workflows/council.md +1 -1
  95. package/rihal/workflows/discuss-phase-power.md +3 -3
  96. package/rihal/workflows/do.md +1 -1
  97. package/rihal/workflows/docs-update.md +4 -4
  98. package/rihal/workflows/execute.md +61 -5
  99. package/rihal/workflows/help.md +5 -5
  100. package/rihal/workflows/karpathy-audit.md +9 -9
  101. package/rihal/workflows/memory-audit.md +83 -0
  102. package/rihal/workflows/memory-distill.md +103 -0
  103. package/rihal/workflows/memory-init.md +102 -0
  104. package/rihal/workflows/memory-update.md +83 -0
  105. package/rihal/workflows/plan.md +66 -1
  106. package/server/dashboard.js +6 -1
  107. package/server/lib/api.js +8 -2
  108. package/server/lib/html/client.js +63 -0
  109. package/server/lib/html/shell.js +5 -0
  110. package/server/lib/scanner.js +76 -1
  111. package/rihal/agents/rihal-architect.md +0 -79
  112. package/rihal/agents/rihal-tech-writer.md +0 -80
  113. package/rihal/commands/check-implementation-readiness.md +0 -8
  114. package/rihal/commands/discuss-phase-power.md +0 -11
  115. package/rihal/commands/karpathy-audit.md +0 -12
  116. package/rihal/commands/new-project-research.md +0 -11
  117. package/rihal/commands/new-project-roadmap.md +0 -11
  118. package/rihal/commands/report.md +0 -10
  119. package/rihal/commands/review-adversarial.md +0 -8
  120. package/rihal/commands/review-edge-case-hunter.md +0 -8
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`
27
+ - Scopes allowed: `agents`, `skills`, `workflows`, `templates`, `dashboard`, `docs`, `config`, `github`, `commands`, `memory`, `brand`, `cli`, `ci`, `release`, `meta`, `tasks`, `migrations`, `refs`
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.
@@ -46,6 +46,16 @@ If a user says "just keep going" or "don't stop until done", that authorization
46
46
 
47
47
  ---
48
48
 
49
+ ## Naming & Branding (per `BRAND.md`)
50
+
51
+ - **Skill names** in frontmatter: `rihal-<verb>-<noun>` for legacy skills; new branded skills use `rcode-<verb>-<noun>` ONLY in slash command surface (`/rcode:<name>`); folder names stay `rihal-*` because `cli/install.js` hardcodes that prefix.
52
+ - **Persona IDs** in `team.yaml` stay `rihal-<name>` (dashboard scanner reads them by id; renaming breaks rendering).
53
+ - **Persona display names** keep Arabic alongside Latin: `Sadiq (صادق)`, `Dalil (دليل)`, etc.
54
+ - **Concept primitives** (Memory Bank, Distillate, Majlis, Diwan) are named tooling — capitalised, used consistently in user-facing copy.
55
+ - **Plain English over jargon in flags.** Prefer `--attack` over `--adversarial`, `--edge-cases` over `--edge-case-hunter`. Audience includes non-native English speakers.
56
+
57
+ ---
58
+
49
59
  ## File Modification Rules
50
60
 
51
61
  - **Maximum file size: 1000 lines** — refactor before exceeding
package/CONTRIBUTING.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Thank you for contributing. These guidelines exist to keep the module maintainable and impressive when demoed.
4
4
 
5
+ > **Before you contribute, also read:**
6
+ > - [`BRAND.md`](BRAND.md) — voice, naming conventions, persona glossary
7
+ > - [`AGENTS.md`](AGENTS.md) — non-negotiable rules for AI coding agents (commit policy, push policy, off-limits files)
8
+ > - [`MIGRATIONS.md`](MIGRATIONS.md) — every renamed/dropped surface in the rcode improvement programme
9
+ > - [`MEMORY_BANK.md`](MEMORY_BANK.md) — Memory Bank specification
10
+ > - [`TASKS.md`](TASKS.md) — master task tracker driving GitHub issues
11
+
5
12
  ---
6
13
 
7
14
  ## Architecture overview — what are all these files?
package/README.md CHANGED
@@ -1,16 +1,31 @@
1
- # Rihal Code
1
+ # Rihal Code (rcode)
2
2
 
3
3
  <div dir="rtl">طريقة رحال</div>
4
4
 
5
- > **Install Rihal's brain into your project in one command.** Every Rihalian engineer, PM, designer, CTO, QA — gets an AI assistant that already knows how Rihal builds: PR standards, commit conventions, architecture patterns, sprint cadence, the Rihal team's agent personas. No onboarding. No prompting. Works in Claude Code, Cursor, and any compatible AI IDE.
5
+ > **rcode is the memory bank for AI-driven SaaS teamsyour project's context, structured, visible, and never lost.**
6
+ >
7
+ > Built by Rihal. Designed for solo devs, startup teams, and SaaS builders. Install once, and your AI assistant gets a persistent project brain: structured memory, decisions log, distinctive personas, and phase-based workflows. Works in Claude Code, Cursor, and any compatible AI IDE.
8
+
9
+ ---
10
+
11
+ ## Who is rcode for
12
+
13
+ You'll feel rcode pay off if you've lived any of these:
14
+
15
+ - **AI agents lose context mid-project.** Three sessions in, the assistant has forgotten the architectural decision you made on day one.
16
+ - **Onboarding a teammate** means a 30-minute archaeology dig through Slack, Notion, and review comments to explain "why we did it this way".
17
+ - **Late client requirements** keep shifting the goal posts, and there's no record of what was decided when.
18
+ - **MVPs that work but can't be revamped** without rewriting from scratch — the original context is lost.
19
+
20
+ rcode addresses these with a checked-in **Memory Bank** (`.rihal/memory/`), distinctive engineering personas, and a phased workflow that survives session resets. **For everything in one place, read [`DOCS.md`](DOCS.md).** See [`MEMORY_BANK.md`](MEMORY_BANK.md) for the spec, and [`BRAND.md`](BRAND.md) for naming and voice conventions.
6
21
 
7
22
  ---
8
23
 
9
24
  ## Why this exists
10
25
 
11
- Every Rihal project carries unwritten context — how we review PRs, what "done" means, how we sequence milestones, how PRDs travel from Product into Engineering. That context sits in people's heads, Slack, Notion, senior engineers' review comments. AI assistants pick it up never, because every new chat session starts knowing nothing about how Rihal works.
26
+ Every project carries unwritten context — how the team reviews PRs, what "done" means, how milestones sequence, how PRDs travel from Product into Engineering. That context sits in people's heads, Slack, Notion, and senior engineers' review comments. AI assistants pick it up never, because every new chat session starts knowing nothing about how this project actually works.
12
27
 
13
- **Rihal Code fixes that.** One install, and the AI knows. Every session. Every repo. Every Rihalian.
28
+ **rcode fixes that.** One install, and the AI knows. Every session. Every repo. Every contributor.
14
29
 
15
30
  See [`docs/what-is-rihal-code.md`](docs/what-is-rihal-code.md) for the full story, and [`docs/ROADMAP.md`](docs/ROADMAP.md) for where this is going (next: live MCP server in v3.0).
16
31
 
@@ -37,8 +52,10 @@ Rihal Code packages a lot. To keep things approachable, everything is organized
37
52
 
38
53
  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
54
 
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
55
+ - **45 agents** with clear roles, cultural identity (Arabic names), and hard scope boundaries
56
+ - **95 slash commands** covering research, planning, execution, verification, and recovery
57
+ - **80 skills** including Memory Bank primitives, 11 engineering-rigor skills (TDD, harden, perf, debug, trim, etc.), and 8 real-pain skills (auth-audit, mvp-graduate, deploy-unify, etc.)
58
+ - **Persistent project memory** at `.rihal/memory/` — checked into git, visible in the Diwan dashboard, lossless distillates for fast LLM hydration
42
59
  - **3 execution modes**: parallel debate (`/rihal:council`), sequential pipelines (`/rihal:chain`), and quick-sync (`/rihal:discuss`)
43
60
  - **File-based state** in `.rihal/` that every workflow reads and updates
44
61
  - **Intent guards** on every workflow — catch wrong commands early with copy-paste redirects
@@ -48,6 +65,8 @@ Most AI tools give you one assistant pretending to be everything. **Rihal Code g
48
65
  - **Post-execute gates** (integration-checker, nyquist-auditor) verify completeness
49
66
  - **Global agents** at `~/.rihal/agents/` — customize without forking
50
67
 
68
+ See [`MIGRATIONS.md`](MIGRATIONS.md) if you're upgrading from a pre-Memory-Bank install.
69
+
51
70
  It's not a chatbot. It's a methodology.
52
71
 
53
72
  ---
@@ -65,9 +84,9 @@ npx @hanzlaa/rcode install
65
84
  One unified installer. Pure file shipping, no runtime dependencies. Installs into:
66
85
 
67
86
  - `.rihal/` — config, workflows, references, bin (Rihal infrastructure)
68
- - `.claude/agents/` — 43 first-class subagents
69
- - `.claude/commands/rihal/` — 99 slash commands
70
- - `.claude/skills/` — 56 phrase-activated skills (scaffold-project, create-prd, prfaq, retrospective, etc.)
87
+ - `.claude/agents/` — 45 first-class subagents
88
+ - `.claude/commands/rihal/` — 95 slash commands
89
+ - `.claude/skills/` — 80 phrase-activated skills (scaffold-project, create-prd, prfaq, memory-init, retrospective, etc.)
71
90
  - `rihal/brain/` — Rihal standards pulled from upstream (PR / commit / architecture docs)
72
91
  - `.planning/` — where your artifacts land (council sessions, plans, chains, summaries)
73
92
 
@@ -111,7 +130,7 @@ npx @hanzlaa/rcode install --ide gemini
111
130
  /rihal:plan --research build a rental app → researcher grounds, plan-checker verifies
112
131
  /rihal:execute .planning/plans/01/PLAN.md → atomic commits + post-gates
113
132
  /rihal:status → phases, decisions, blockers, sessions
114
- /rihal:karpathy-audit HEAD~5..HEAD → audit changes vs 4 coding principles
133
+ /rihal:code-review HEAD~5..HEAD --karpathy → audit changes vs 4 coding principles
115
134
  ```
116
135
 
117
136
  ---
@@ -165,7 +184,7 @@ npx @hanzlaa/rcode install --ide gemini
165
184
  - **Execution**: rihal-executor, rihal-planner, rihal-verifier, rihal-plan-checker, rihal-debugger
166
185
  - **Discovery**: rihal-codebase-mapper, rihal-project-researcher, rihal-roadmapper, rihal-phase-researcher, rihal-advisor-researcher, rihal-assumptions-analyzer, rihal-research-synthesizer
167
186
  - **Verification**: rihal-integration-checker, rihal-nyquist-auditor
168
- - **Quality**: rihal-tech-writer, rihal-ux-designer, rihal-architect, rihal-code-reviewer, rihal-code-fixer, rihal-edge-case-hunter, rihal-deviation-analyzer
187
+ - **Quality**: rihal-noor, rihal-ux-designer, rihal-code-reviewer, rihal-code-fixer, rihal-edge-case-hunter, rihal-deviation-analyzer
169
188
  - **And more**: rihal-docs-auditor, rihal-doc-verifier, rihal-doc-writer, rihal-repo-metrics, rihal-security-auditor, etc.
170
189
 
171
190
  **Customize globally:** Define reusable agents in `~/.rihal/agents/rihal-<name>.md`. They appear in every project alongside project-local agents, without forking the repo.
@@ -256,11 +275,11 @@ Amazon's "Working Backwards" method: write the finished-product press release *b
256
275
  3. **Surgical changes** — touch only what's needed, match existing style
257
276
  4. **Goal-driven execution** — define verifiable success criteria
258
277
 
259
- `/rihal:karpathy-audit` runs these 4 principles as a post-hoc audit against any diff or phase. Use it after implementation to catch bloated, over-engineered, or scope-creeping changes before they land in a PR.
278
+ `/rihal:code-review --karpathy` runs these 4 principles as a post-hoc audit against any diff or phase. Use it after implementation to catch bloated, over-engineered, or scope-creeping changes before they land in a PR.
260
279
 
261
280
  ```
262
- /rihal:karpathy-audit HEAD~5..HEAD
263
- /rihal:karpathy-audit 03 --files=src/auth/
281
+ /rihal:code-review HEAD~5..HEAD --karpathy
282
+ /rihal:code-review 03 --files=src/auth/ --karpathy
264
283
  ```
265
284
 
266
285
  ### Plan verification + post-execute gates
@@ -309,13 +328,13 @@ Recent additions in this session:
309
328
 
310
329
  ---
311
330
 
312
- ## Full command surface (99 commands)
331
+ ## Full command surface (95 commands)
313
332
 
314
333
  ### Router + lifecycle
315
334
  `init` · `do` · `help` · `status` · `stats` · `health` · `forensics` · `update`
316
335
 
317
336
  ### Discovery + research
318
- `new-project` · `map-codebase` · `scan` · `explore` · `document-project` · `analyze-dependencies` · `discuss-phase-power`
337
+ `new-project` · `map-codebase` · `scan` · `explore` · `document-project` · `analyze-dependencies`
319
338
 
320
339
  ### Discovery + validation
321
340
  `prfaq` · `brainstorm` · `market-research` · `domain-research` · `technical-research` · `product-brief`
@@ -324,10 +343,10 @@ Recent additions in this session:
324
343
  `plan` · `chain` · `create-epics-and-stories` · `create-story` · `dev-story` · `sprint-planning`
325
344
 
326
345
  ### Execution
327
- `execute` · `quick` · `autonomous` · `audit-fix` · `undo` · `check-implementation-readiness`
346
+ `execute` · `quick` · `autonomous` · `audit-fix` · `undo`
328
347
 
329
348
  ### Observability + review
330
- `code-review` · `code-review-fix` · `review-adversarial` · `review-edge-case-hunter` · `karpathy-audit` · `checkpoint-preview` · `secure-phase` · `show` · `why` · `rerun` · `diff`
349
+ `code-review` · `code-review-fix` · `checkpoint-preview` · `secure-phase` · `show` · `why` · `rerun` · `diff`
331
350
 
332
351
  ### Recovery + correction
333
352
  `pause-work` · `resume-work` · `correct-course` · `next` · `config`
@@ -446,8 +465,8 @@ Every install runs 5 automated smoke tests before exiting:
446
465
  ✓ rihal-tools.cjs runs — syntax ok
447
466
  ✓ .rihal/config.yaml present — 412 bytes
448
467
  ✓ .rihal/state.json parses — valid JSON
449
- ✓ agents installed — 43
450
- ✓ skills + commands installed — 56 skills + 99 commands
468
+ ✓ agents installed — 45
469
+ ✓ skills + commands installed — 80 skills + 95 commands
451
470
  ```
452
471
 
453
472
  A failed check prints the debug command and returns exit code 1 so CI catches broken installs.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "2.8.0",
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.",
3
+ "version": "3.1.0",
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, and Gemini.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
7
7
  "rcode": "dist/rcode.js",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-advisor-researcher
3
3
  description: Researches a single gray area decision and returns a structured comparison table with rationale. Spawned by discuss-phase advisor mode.
4
- tools: read_file, run_shell_command, search_file_content, glob, google_web_search, web_fetch
4
+ tools: Read, Bash, Grep, Glob, WebSearch, WebFetch
5
5
  color: cyan
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-assumptions-analyzer
3
3
  description: Deeply analyzes codebase for a phase and returns structured assumptions with evidence. Spawned by discuss-phase assumptions mode.
4
- tools: read_file, run_shell_command, search_file_content, glob
4
+ tools: Read, Bash, Grep, Glob
5
5
  color: cyan
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-codebase-mapper
3
3
  description: Explores codebase and writes structured analysis documents. Spawned by map-codebase with a focus area (tech, arch, quality, concerns). Writes documents directly to reduce orchestrator context load.
4
- tools: read_file, run_shell_command, search_file_content, glob, write_file
4
+ tools: Read, Bash, Grep, Glob, Write
5
5
  color: cyan
6
6
  ---
7
7
 
@@ -15,7 +15,7 @@ You are the **Documentation Auditor** at Rihal. You are spawned to audit documen
15
15
 
16
16
  ## Who you are
17
17
 
18
- Documentation quality specialist. You assess whether critical documentation exists, is accurate, and is discoverable. You identify gaps: missing README sections, undocumented APIs, outdated examples, broken links. You defer to rihal-tech-writer for content creation and Waleed (CTO) for technical accuracy disputes.
18
+ Documentation quality specialist. You assess whether critical documentation exists, is accurate, and is discoverable. You identify gaps: missing README sections, undocumented APIs, outdated examples, broken links. You defer to rihal-noor for content creation and Waleed (CTO) for technical accuracy disputes.
19
19
 
20
20
  You do not write documentation. You audit and flag issues.
21
21
 
@@ -63,9 +63,9 @@ Structured: Coverage summary → Missing docs → Accuracy gaps → Quality issu
63
63
 
64
64
  Use command-redirect-format.md. One reason, then command.
65
65
 
66
- - Documentation writing → rihal-tech-writer
66
+ - Documentation writing → rihal-noor
67
67
  - Technical accuracy verification → Waleed (CTO)
68
- - Content updates → rihal-tech-writer
68
+ - Content updates → rihal-noor
69
69
 
70
70
  ## Constraints
71
71
 
@@ -17,6 +17,16 @@ Rihal sprint executor. Execute SPRINT.md files atomically, commit each story, ha
17
17
  **Mandatory Initial Read:** If prompt contains `<files_to_read>`, read every file listed before any other action.
18
18
  </role>
19
19
 
20
+ ## Project-specific constraints to load (every invocation)
21
+
22
+ Before executing any commits, load these constraints — they're what new executors get wrong on day one (see #444 for the original incident):
23
+
24
+ - **`.planning/` may be gitignored.** Many Rihal-style projects gitignore the planning directory. To commit SUMMARY.md, VERIFICATION.md, or any other artefact under `.planning/`, you must use `git add -f <path>`. Without `-f`, the file is silently not staged and your commit doesn't include it.
25
+ - **Read `.rihal/config.yaml`** — if `workflow.commit_planning: true`, planning artefacts SHOULD be committed; use `git add -f` for each file under `.planning/`. If `commit_planning: false`, skip the commit step for those files entirely.
26
+ - **Read `.rihal/context/active.md`** — the user may have logged additional project-specific constraints there (deploy gates, secret-handling rules, branch-naming overrides). Honour them.
27
+
28
+ If you commit a file under `.planning/` and `git status` afterwards still shows it as modified or untracked, you forgot the `-f` flag. Re-stage with `git add -f` and amend the commit (a NEW commit; never `git commit --amend` on a pushed commit).
29
+
20
30
  ## Execution Flow (Slim)
21
31
 
22
32
  1. **Load state** — Extract executor config, phase info, sprint list. Read STATE.md for position/blockers.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-integration-checker
3
3
  description: Verifies cross-phase integration and E2E flows. Checks that phases connect properly and user workflows complete end-to-end.
4
- tools: read_file, run_shell_command, search_file_content, glob
4
+ tools: Read, Bash, Grep, Glob
5
5
  color: blue
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-noor
3
- description: Technical Writer & Presentation Lead — spawned by /rihal:council for documentation, README files, API docs, architecture diagrams (Mermaid), changelogs, pitch decks, and blog posts. Defers to Hussain-PM on PRD content, Hanzla on code implementation details, Sadiq on strategic framing.
4
- tools: Read, Grep, Glob, Bash, WebFetch
3
+ description: Technical Writer & Presentation Lead — spawned by /rihal:council and /rihal:docs-update for README files, API docs, architecture diagrams (Mermaid), changelogs, migration guides, inline code comments, pitch decks, and blog posts. Defers to Hussain-PM on PRD content, Hanzla on code implementation details, Sadiq on strategic framing.
4
+ tools: Read, Write, Edit, Grep, Glob, Bash, WebFetch
5
5
  color: teal
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-phase-researcher
3
3
  description: Researches how to implement a phase before planning. Produces RESEARCH.md consumed by rihal-planner. Spawned by /rihal:plan orchestrator.
4
- tools: read_file, write_file, run_shell_command, search_file_content, glob, google_web_search, web_fetch
4
+ tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch
5
5
  color: cyan
6
6
  ---
7
7
 
@@ -116,6 +116,31 @@ else: wave = max(waves of dependencies) + 1
116
116
 
117
117
  **File ownership:** No overlap in files_modified → can run parallel. Overlap → later depends on earlier.
118
118
 
119
+ ## File-existence verification (BLOCKER — added in v3.1.0 after #441)
120
+
121
+ Before writing each entry into `files_modified`, you MUST verify the file actually exists in the project. Plans with fictional file names cause executors to scramble at runtime.
122
+
123
+ For every candidate path:
124
+
125
+ ```bash
126
+ # Try the exact name first
127
+ test -f "<candidate>" && echo "OK" && exit 0
128
+
129
+ # Then try a fuzzy match for renamed/moved files
130
+ find . -type f \( -name "<basename>" -o -iname "*$<short-slug>*" \) \
131
+ -not -path './node_modules/*' -not -path './.git/*' 2>/dev/null
132
+ ```
133
+
134
+ Apply these rules to every path you put in `files_modified`:
135
+
136
+ - **Exact match exists** → use the verified path verbatim
137
+ - **No exact match, fuzzy match found** → use the fuzzy match's path AND log a note in the SPRINT.md frontmatter (`renamed_from: <original candidate>`)
138
+ - **Neither exact nor fuzzy match** → DO NOT add the path to `files_modified`. Either:
139
+ - Mark it as a CREATE story (the executor will create the file fresh) — set `creates: [<path>]` in the story body
140
+ - OR raise a BLOCKER finding for sprint-checker to surface: file referenced by name but not present and not flagged for creation
141
+
142
+ Sprint-checker enforces this — see `rihal-sprint-checker.md` Mandatory Output Markers section. Plans that claim to modify non-existent files without a CREATE marker are rejected.
143
+
119
144
  ## Plan Structure
120
145
 
121
146
  ```markdown
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-project-researcher
3
3
  description: Researches domain ecosystem before roadmap creation. Produces files in .rihal/research/ consumed during roadmap creation. Spawned by /rihal:new-project or /rihal:new-milestone orchestrators.
4
- tools: read_file, write_file, run_shell_command, search_file_content, glob, google_web_search, web_fetch
4
+ tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch
5
5
  color: cyan
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-research-synthesizer
3
3
  description: Synthesizes research outputs from parallel researcher agents into SUMMARY.md. Spawned by /rihal:new-project after 4 researcher agents complete.
4
- tools: read_file, write_file, run_shell_command
4
+ tools: Read, Write, Bash
5
5
  color: purple
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-roadmapper
3
3
  description: Creates project roadmaps with phase breakdown, requirement mapping, success criteria derivation, and coverage validation. Spawned by /rihal:new-project orchestrator.
4
- tools: read_file, write_file, run_shell_command, glob, search_file_content
4
+ tools: Read, Write, Bash, Glob, Grep
5
5
  color: purple
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-sprint-checker
3
3
  description: Verifies sprints will achieve phase goal before execution. Goal-backward analysis of sprint quality. Spawned by /rihal:plan orchestrator.
4
- tools: read_file, run_shell_command, glob, search_file_content
4
+ tools: Read, Bash, Glob, Grep
5
5
  color: green
6
6
  ---
7
7
 
@@ -108,6 +108,24 @@ Each dimension has pass/partial/fail criteria, remediation guidance, and output
108
108
  3. **Synthesize** — Produce CHECK.md with overall verdict, per-dimension scores, remediation asks.
109
109
  4. **Return** — Block execution if critical dimensions fail; proceed with cautions if only partials.
110
110
 
111
+ ## Mandatory output markers (per #440 / #445 fix)
112
+
113
+ Every return from this agent MUST include at least one of these YAML markers — they prove tool invocation actually happened. The orchestrator's malfunction guard in `plan.md` blocks execution if none are present.
114
+
115
+ ```yaml
116
+ issues: # always emit, even if empty (issues: [])
117
+ - dimension: <name>
118
+ severity: BLOCKER | WARNING | INFO
119
+ path: <file:line>
120
+ finding: <short text>
121
+
122
+ verified_files: # list every file actually read during verification
123
+ - path: <relative path>
124
+ bytes: <int>
125
+ ```
126
+
127
+ If you have not invoked `Read`, `Bash`, `Grep`, or `Glob` during execution, do NOT return — instead, report the failure and stop. Empty narrative output is treated as malfunction, not pass.
128
+
111
129
  ## On-Demand Rule Files
112
130
 
113
131
  | When you need... | Read |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal-verifier
3
3
  description: Verifies phase goal achievement through goal-backward analysis. Checks codebase delivers what phase promised, not just that tasks completed. Creates VERIFICATION.md report.
4
- tools: read_file, write_file, run_shell_command, search_file_content, glob
4
+ tools: Read, Write, Bash, Grep, Glob
5
5
  color: green
6
6
  ---
7
7
 
@@ -43,7 +43,7 @@ Precise. Quantified. Trade-off oriented. Every claim cites a number, a constrain
43
43
  | Code | Description | Skill / workflow |
44
44
  |------|-------------|------------------|
45
45
  | ADR | Write a single Architecture Decision Record | rihal-create-architecture |
46
- | RV | Review existing architecture against current code | rihal-architect |
46
+ | RV | Review existing architecture against current code | inline |
47
47
  | TS | Stack selection — 2-3 options + recommendation | inline |
48
48
  | FZ | Feasibility check — can the current stack handle this? | inline |
49
49
  | KS | Kill-switch design — exit criteria, sunset plan | inline |
@@ -64,7 +64,6 @@ Always read on activation:
64
64
  - Test / QA → Fatima
65
65
  - Backend impl detail → Yousef
66
66
  - Frontend → Haitham
67
- - Greenfield system design / multi-team org bets → rihal-architect (senior tier)
68
67
 
69
68
  ## Constraints (Waleed-specific)
70
69
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: rihal:code-review
3
3
  description: Review source files for bugs, security issues, and code quality problems.
4
- argument-hint: "<phase> [--depth=quick|standard|deep] [--files=file1,file2,...]"
4
+ argument-hint: "<phase> [--depth=quick|standard|deep] [--files=file1,file2,...] [--karpathy] [--attack] [--edge-cases]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Grep
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: rcode:memory-audit
3
+ description: Audit the Memory Bank for stale entries, contradictions, and unfilled placeholders — read-only report
4
+ argument-hint: "[--severity {critical|warn|info}]"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ ---
9
+
10
+ @.rihal/workflows/memory-audit.md
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: rcode:memory-distill
3
+ description: Regenerate Memory Bank distillates — token-optimised lossless compressions for fast LLM context loading
4
+ argument-hint: "[--force] [--target {project|stack|all}]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ ---
10
+
11
+ @.rihal/workflows/memory-distill.md
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: rcode:memory-init
3
+ description: Bootstrap the rcode Memory Bank for this project — copies templates, asks 5 questions, populates seed files
4
+ argument-hint: ""
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ @.rihal/workflows/memory-init.md
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: rcode:memory-update
3
+ description: Append a decision, known issue, stakeholder, or milestone update to the Memory Bank from conversation context
4
+ argument-hint: "<content>"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - AskUserQuestion
10
+ ---
11
+
12
+ @.rihal/workflows/memory-update.md
@@ -41,7 +41,7 @@
41
41
  "ux-designer": "sonnet",
42
42
  "doc-verifier": "haiku",
43
43
  "docs-auditor": "haiku",
44
- "tech-writer": "haiku"
44
+ "noor": "haiku"
45
45
  }
46
46
  },
47
47
 
@@ -82,7 +82,7 @@
82
82
  "ux-designer": "sonnet",
83
83
  "doc-verifier": "haiku",
84
84
  "docs-auditor": "haiku",
85
- "tech-writer": "haiku"
85
+ "noor": "haiku"
86
86
  }
87
87
  },
88
88
 
@@ -123,7 +123,7 @@
123
123
  "ux-designer": "haiku",
124
124
  "doc-verifier": "haiku",
125
125
  "docs-auditor": "haiku",
126
- "tech-writer": "haiku"
126
+ "noor": "haiku"
127
127
  }
128
128
  },
129
129
 
@@ -164,7 +164,7 @@
164
164
  "ux-designer": "inherit",
165
165
  "doc-verifier": "inherit",
166
166
  "docs-auditor": "inherit",
167
- "tech-writer": "inherit"
167
+ "noor": "inherit"
168
168
  }
169
169
  }
170
170
  },
@@ -197,7 +197,7 @@
197
197
  "model_overrides": {
198
198
  "waleed": "opus",
199
199
  "code-reviewer": "sonnet",
200
- "tech-writer": "inherit"
200
+ "noor": "inherit"
201
201
  }
202
202
  }
203
203
  },
@@ -69,7 +69,7 @@ Strong success criteria let you loop independently. Weak criteria ("make it work
69
69
 
70
70
  ## Enforcement
71
71
 
72
- Agents that write or modify code (rihal-executor, rihal-planner, rihal-tech-writer, rihal-codebase-mapper when producing code docs) must:
72
+ Agents that write or modify code (rihal-executor, rihal-planner, rihal-noor, rihal-codebase-mapper when producing code docs) must:
73
73
  1. @-include this file
74
74
  2. Apply the 4 principles as hard constraints, not suggestions
75
75
  3. Reference the specific principle when refusing to make a change (e.g., "Declining per Karpathy #3: that's adjacent to the requested change but not part of it")
@@ -60,7 +60,7 @@ Spawn the debug agent with git worktree isolation?
60
60
 
61
61
  ## Agent enforcement
62
62
 
63
- Every Rihal agent that can execute shell commands (rihal-executor, rihal-debugger, rihal-planner, rihal-tech-writer, etc.) must:
63
+ Every Rihal agent that can execute shell commands (rihal-executor, rihal-debugger, rihal-planner, rihal-noor, etc.) must:
64
64
 
65
65
  1. Reject any prompt asking them to perform a banned operation without a prior user-confirmed authorization in their input
66
66
  2. Surface a warning if a parent workflow or user prompt tries to include a banned flag
@@ -87,7 +87,7 @@ These are matched alongside §Create / §Add / §Plan verbs to determine the dis
87
87
  | plan (verb form — "plan phase N") | `plan` | `/rihal:plan` |
88
88
  | story (impl) | `dev story`, `implement story`, `build story` | `/rihal:dev-story` |
89
89
  | brainstorm | `brainstorm`, `ideas`, `sochain`, `sochna` | `/rihal:brainstorm` |
90
- | review (code) | `code review`, `karpathy`, `check my diff` | `/rihal:karpathy-audit` / `/rihal:code-review` |
90
+ | review (code) | `code review`, `karpathy`, `check my diff` | `/rihal:code-review [--karpathy]` |
91
91
  | debug | `debug`, `fix`, `bug`, `error`, `crash`, `kharab`, `theek` | `/rihal:debug` |
92
92
 
93
93
  ---