@hanzlaa/rcode 3.4.3 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CONTRIBUTING.md +63 -1
- package/README.md +9 -4
- package/cli/generate-command-skills.cjs +5 -5
- package/cli/index.js +0 -0
- package/cli/install.js +128 -3
- package/cli/lib/manifest.cjs +1 -1
- package/cli/uninstall.js +8 -0
- package/dist/rcode.js +19 -1
- package/package.json +16 -17
- package/rihal/agents/rihal-ahmed.md +2 -1
- package/rihal/agents/rihal-code-fixer.md +46 -0
- package/rihal/agents/rihal-code-reviewer.md +46 -1
- package/rihal/agents/rihal-deviation-analyzer.md +1 -0
- package/rihal/agents/rihal-docs-auditor.md +106 -1
- package/rihal/agents/rihal-edge-case-hunter.md +47 -1
- package/rihal/agents/rihal-executor.md +1 -1
- package/rihal/agents/rihal-khalid.md +40 -1
- package/rihal/agents/rihal-layla.md +2 -1
- package/rihal/agents/rihal-nasser.md +2 -1
- package/rihal/agents/rihal-noor.md +3 -2
- package/rihal/agents/rihal-nyquist-auditor.md +1 -1
- package/rihal/agents/rihal-phase-researcher.md +46 -1
- package/rihal/agents/rihal-planner.md +1 -1
- package/rihal/agents/rihal-profiler.md +45 -2
- package/rihal/agents/rihal-project-researcher.md +47 -0
- package/rihal/agents/rihal-remediation-planner.md +45 -0
- package/rihal/agents/rihal-roadmapper.md +46 -0
- package/rihal/agents/rihal-security-adversary.md +46 -1
- package/rihal/agents/rihal-security-auditor.md +45 -1
- package/rihal/agents/rihal-ui-auditor.md +44 -1
- package/rihal/agents/rihal-ux-designer.md +41 -1
- package/rihal/agents/rihal-zahra.md +2 -1
- package/rihal/agents/rihal-zayd.md +2 -1
- package/rihal/bin/lib/config.cjs +13 -1
- package/rihal/bin/lib/council-panel.cjs +185 -23
- package/rihal/bin/lib/roadmap.cjs +27 -2
- package/rihal/bin/rihal-tools.cjs +1837 -99
- package/rihal/commands/audit.md +2 -2
- package/rihal/commands/capture.md +12 -0
- package/rihal/commands/diagnose-issues.md +18 -0
- package/rihal/commands/discuss-phase-power.md +18 -0
- package/rihal/commands/feature-drift.md +18 -0
- package/rihal/commands/karpathy-audit.md +18 -0
- package/rihal/commands/lens-audit.md +70 -0
- package/rihal/commands/new-project-research.md +18 -0
- package/rihal/commands/new-project-roadmap.md +18 -0
- package/rihal/commands/phase.md +11 -0
- package/rihal/references/continuation-format.md +3 -3
- package/rihal/references/output-format.md +79 -0
- package/rihal/references/revision-loop.md +1 -1
- package/rihal/references/verb-dictionary.md +85 -28
- package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +1 -1
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +12 -2
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/steps/step-04-final-validation.md +12 -0
- package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +12 -2
- package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +12 -2
- package/rihal/skills/actions/4-implementation/rihal-browser-verify/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-ci/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +16 -4
- package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +14 -1
- package/rihal/skills/actions/4-implementation/rihal-git-flow/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-harden/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-incremental/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-migrate/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-perf/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-prove-it/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-scaffold-project/steps/step-01-target.md +6 -0
- package/rihal/skills/actions/4-implementation/rihal-source-truth/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +14 -3
- package/rihal/skills/actions/4-implementation/rihal-trim/SKILL.md +1 -1
- package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +15 -1
- package/rihal/skills/agents/dalil-scout/SKILL.md +14 -2
- package/rihal/skills/agents/fatima-qa/SKILL.md +16 -1
- package/rihal/skills/agents/haitham-frontend/SKILL.md +13 -1
- package/rihal/skills/agents/hanzla-engineer/SKILL.md +13 -1
- package/rihal/skills/agents/hussain-pm/SKILL.md +16 -1
- package/rihal/skills/agents/hussain-sm/SKILL.md +14 -1
- package/rihal/skills/agents/layla-designer/SKILL.md +13 -1
- package/rihal/skills/agents/majlis-council/SKILL.md +16 -1
- package/rihal/skills/agents/mariam-marketing/SKILL.md +14 -1
- package/rihal/skills/agents/nasser-eng-manager/SKILL.md +16 -1
- package/rihal/skills/agents/noor-writer/SKILL.md +15 -1
- package/rihal/skills/agents/raees-orchestrator/SKILL.md +15 -1
- package/rihal/skills/agents/rihal-cross-platform-auditor/SKILL.md +162 -0
- package/rihal/skills/agents/rihal-dep-auditor/SKILL.md +151 -0
- package/rihal/skills/agents/rihal-deviation-analyzer/SKILL.md +78 -0
- package/rihal/skills/agents/rihal-i18n-auditor/SKILL.md +152 -0
- package/rihal/skills/agents/rihal-observability-auditor/SKILL.md +156 -0
- package/rihal/skills/agents/sadiq-analyst/SKILL.md +12 -2
- package/rihal/skills/agents/waleed-architect/SKILL.md +12 -2
- package/rihal/skills/agents/yousef-backend/SKILL.md +12 -2
- package/rihal/skills/agents/zahra-branding/SKILL.md +15 -1
- package/rihal/skills/agents/zayd-ml/SKILL.md +13 -1
- package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +2 -2
- package/rihal/skills/core/rihal-auth-audit/SKILL.md +1 -1
- package/rihal/skills/core/rihal-brainstorming/SKILL.md +13 -2
- package/rihal/skills/core/rihal-client-gate/SKILL.md +1 -1
- package/rihal/skills/core/rihal-clone-website/SKILL.md +11 -1
- package/rihal/skills/core/rihal-deploy-unify/SKILL.md +1 -1
- package/rihal/skills/core/rihal-distillator/SKILL.md +2 -2
- package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +1 -1
- package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +2 -2
- package/rihal/skills/core/rihal-help/SKILL.md +18 -1
- package/rihal/skills/core/rihal-incident-record/SKILL.md +1 -1
- package/rihal/skills/core/rihal-index-docs/SKILL.md +1 -1
- package/rihal/skills/core/rihal-memory-audit/SKILL.md +18 -1
- package/rihal/skills/core/rihal-memory-init/SKILL.md +13 -1
- package/rihal/skills/core/rihal-memory-update/SKILL.md +13 -1
- package/rihal/skills/core/rihal-mvp-graduate/SKILL.md +1 -1
- package/rihal/skills/core/rihal-ocr-consistency/SKILL.md +1 -1
- package/rihal/skills/core/rihal-rebrand/SKILL.md +1 -1
- package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +1 -1
- package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +17 -1
- package/rihal/skills/core/rihal-shard-doc/SKILL.md +1 -1
- package/rihal/skills/core/rihal-theme-system/SKILL.md +1 -1
- package/rihal/team.yaml +0 -7
- package/rihal/templates/RESEARCH.md +84 -0
- package/rihal/templates/VALIDATION.md +45 -0
- package/rihal/templates/memory/INDEX.md +1 -0
- package/rihal/templates/memory/project/design-system.md +128 -0
- package/rihal/templates/summary.md +33 -3
- package/rihal/workflows/add-tests.md +1 -1
- package/rihal/workflows/add-todo.md +6 -0
- package/rihal/workflows/analyze-dependencies.md +6 -0
- package/rihal/workflows/audit-fix.md +12 -0
- package/rihal/workflows/audit-milestone.md +2 -2
- package/rihal/workflows/audit.md +23 -14
- package/rihal/workflows/autonomous-smart-discuss.md +247 -0
- package/rihal/workflows/autonomous.md +54 -267
- package/rihal/workflows/capture.md +60 -0
- package/rihal/workflows/chain.md +1 -1
- package/rihal/workflows/code-review-fix.md +6 -3
- package/rihal/workflows/code-review.md +34 -10
- package/rihal/workflows/complete-milestone.md +17 -8
- package/rihal/workflows/correct-course.md +6 -0
- package/rihal/workflows/council.md +37 -23
- package/rihal/workflows/create-architecture.md +31 -0
- package/rihal/workflows/create-epics-and-stories.md +7 -1
- package/rihal/workflows/create-prd.md +25 -0
- package/rihal/workflows/dashboard.md +1 -1
- package/rihal/workflows/debug.md +8 -0
- package/rihal/workflows/decisions.md +1 -1
- package/rihal/workflows/diff.md +6 -0
- package/rihal/workflows/discuss-phase-discuss-areas.md +271 -0
- package/rihal/workflows/discuss-phase.md +27 -266
- package/rihal/workflows/do.md +51 -12
- package/rihal/workflows/docs-update.md +3 -0
- package/rihal/workflows/document-project.md +7 -1
- package/rihal/workflows/edit-prd.md +31 -0
- package/rihal/workflows/enable-hooks.md +1 -1
- package/rihal/workflows/execute-regression-gates.md +131 -0
- package/rihal/workflows/execute-sprint.md +31 -2
- package/rihal/workflows/execute-verify-phase-goal.md +136 -0
- package/rihal/workflows/execute-waves.md +404 -0
- package/rihal/workflows/execute.md +101 -642
- package/rihal/workflows/feature-drift.md +243 -0
- package/rihal/workflows/forensics.md +10 -2
- package/rihal/workflows/health.md +65 -16
- package/rihal/workflows/help.md +36 -9
- package/rihal/workflows/import.md +17 -3
- package/rihal/workflows/init.md +20 -10
- package/rihal/workflows/install.md +2 -10
- package/rihal/workflows/lens-audit.md +689 -0
- package/rihal/workflows/map-codebase.md +7 -1
- package/rihal/workflows/memory-audit.md +67 -5
- package/rihal/workflows/memory-distill.md +10 -0
- package/rihal/workflows/memory-init.md +4 -0
- package/rihal/workflows/memory-update.md +4 -0
- package/rihal/workflows/new-milestone.md +7 -1
- package/rihal/workflows/new-project-create-roadmap.md +176 -0
- package/rihal/workflows/new-project-define-requirements.md +160 -0
- package/rihal/workflows/new-project-research-decision.md +247 -0
- package/rihal/workflows/new-project.md +3 -557
- package/rihal/workflows/note.md +1 -1
- package/rihal/workflows/phase.md +54 -0
- package/rihal/workflows/plan-milestone-gaps.md +1 -1
- package/rihal/workflows/plan-prd-express.md +108 -0
- package/rihal/workflows/plan-research-validation.md +313 -0
- package/rihal/workflows/plan-spawn-planner.md +204 -0
- package/rihal/workflows/plan.md +91 -532
- package/rihal/workflows/plant-seed.md +1 -1
- package/rihal/workflows/pr-branch.md +1 -1
- package/rihal/workflows/profile-user.md +1 -1
- package/rihal/workflows/quick.md +3 -3
- package/rihal/workflows/remove-phase.md +6 -1
- package/rihal/workflows/remove-workspace.md +6 -0
- package/rihal/workflows/rerun.md +1 -1
- package/rihal/workflows/research-phase.md +4 -2
- package/rihal/workflows/resume-work.md +8 -3
- package/rihal/workflows/retrospective.md +31 -0
- package/rihal/workflows/review-adversarial.md +12 -0
- package/rihal/workflows/review.md +6 -0
- package/rihal/workflows/scaffold-project.md +31 -0
- package/rihal/workflows/scan.md +10 -0
- package/rihal/workflows/secure-phase.md +15 -2
- package/rihal/workflows/session-report.md +32 -7
- package/rihal/workflows/ship.md +7 -2
- package/rihal/workflows/show.md +6 -0
- package/rihal/workflows/sprint-status.md +4 -4
- package/rihal/workflows/status.md +2 -2
- package/rihal/workflows/ui-phase.md +1 -1
- package/rihal/workflows/undo.md +2 -3
- package/rihal/workflows/update.md +2 -2
- package/rihal/workflows/validate-phase.md +1 -1
- package/rihal/workflows/validate-prd.md +31 -0
- package/rihal/workflows/verify-phase.md +38 -5
- package/rihal/workflows/verify-work.md +25 -11
- package/rihal/workflows/workstream.md +20 -8
- package/server/lib/html/client.js +13 -63
- package/server/lib/html/shell.js +0 -1
- package/server/lib/scanner.js +33 -2
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`
|
|
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`, 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/CONTRIBUTING.md
CHANGED
|
@@ -184,6 +184,31 @@ gh pr create --title "feat(skills): sharper PRD discovery on pricing models"
|
|
|
184
184
|
|
|
185
185
|
---
|
|
186
186
|
|
|
187
|
+
## Adding a New Agent — Registration Checklist
|
|
188
|
+
|
|
189
|
+
When you add a new agent to `rihal/team.yaml`, update **all** of these locations to keep parity tests green:
|
|
190
|
+
|
|
191
|
+
| File | What to add |
|
|
192
|
+
|------|-------------|
|
|
193
|
+
| `rihal/team.yaml` | Agent entry with `id`, `name`, `role`, `domain_keywords` |
|
|
194
|
+
| `rihal/agents/rihal-<id>.md` | Agent persona stub |
|
|
195
|
+
| `rihal/skills/agents/<slug>/SKILL.md` | Full skill definition (5-component standard) |
|
|
196
|
+
| `.claude/skills/rihal-<id>/SKILL.md` | Installed skill copy (or let install sync it) |
|
|
197
|
+
| `rihal/workflows/do.md` | Routing alias row in the persona table |
|
|
198
|
+
| `rihal/workflows/discuss.md` | Add to single-agent dispatch list |
|
|
199
|
+
| `rihal/bin/rihal-tools.cjs` `QUALITY_AGENTS` | Add model assignment if the agent is `quality` tier |
|
|
200
|
+
| `README.md` team table | Add a row for the new persona |
|
|
201
|
+
| `server/dashboard.js` roster | Add to dashboard display roster |
|
|
202
|
+
|
|
203
|
+
**Parity tests that will fail if you miss a location:**
|
|
204
|
+
- `agent-team-parity.test.cjs` — team.yaml ↔ agent files
|
|
205
|
+
- `agents-registry.test.cjs` — agent registry consistency
|
|
206
|
+
- `help-md-parity.test.cjs` — any new command stubs
|
|
207
|
+
|
|
208
|
+
Run `node --test` before opening a PR.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
187
212
|
## 🚨 Critical Rule — Never Auto-Push
|
|
188
213
|
|
|
189
214
|
**AI agents and automation tools working on this repository MUST NEVER push to any remote without explicit, interactive user approval on every push.**
|
|
@@ -233,11 +258,48 @@ We use [Conventional Commits](https://www.conventionalcommits.org/) format. The
|
|
|
233
258
|
- `agents` — agent persona files
|
|
234
259
|
- `skills` — action or agent skills
|
|
235
260
|
- `workflows` — multi-step workflows
|
|
261
|
+
- `commands` — `rihal/commands/*.md` slash command files
|
|
236
262
|
- `templates` — memory bank or pitch templates
|
|
237
263
|
- `dashboard` — Majlis/Diwan server
|
|
238
|
-
- `docs` — README, METHODOLOGY, SKILLS_INDEX
|
|
264
|
+
- `docs` — README, METHODOLOGY, SKILLS_INDEX, USER-GUIDE, FAQ
|
|
239
265
|
- `config` — team.yaml, config.yaml
|
|
240
266
|
- `github` — CI/CD, issue templates, PR templates
|
|
267
|
+
- `cli` — `cli/*.js` and `rihal/bin/rihal-tools.cjs`
|
|
268
|
+
- `state` — `.rihal/state.json` and state-manipulation code paths
|
|
269
|
+
- `refs` — files inside `rihal/references/`
|
|
270
|
+
- `hooks` — `.claude/hooks/*` and install-time hook wiring
|
|
271
|
+
- `install` — installer flow, manifest, side-effects
|
|
272
|
+
- `memory` — Memory Bank distillates and templates
|
|
273
|
+
- `brand` — branding/voice across surfaces
|
|
274
|
+
- `ci` — CI workflow YAML and gating logic
|
|
275
|
+
- `release` — version bumps, CHANGELOG, npm publish artifacts
|
|
276
|
+
- `meta` — repo-level files (AGENTS.md, CONTRIBUTING.md, this list)
|
|
277
|
+
- `tasks` — TaskCreate/TaskUpdate-shaped task tracking
|
|
278
|
+
- `migrations` — schema/data migrations between versions
|
|
279
|
+
- `parity` — drift gate / parity test additions
|
|
280
|
+
- `triggers` — multilingual trigger phrase additions
|
|
281
|
+
- `dogfood` — `scripts/dogfood-check.sh` and self-test gates
|
|
282
|
+
- `state` — state.json schema or sync logic
|
|
283
|
+
- `namespace` — namespace standardization across files
|
|
284
|
+
- `planning` — `.planning/` artifacts (STATE.md, ROADMAP.md, REQUIREMENTS.md)
|
|
285
|
+
- `insights` — runtime insight surfaces
|
|
286
|
+
- `help` — help.md content
|
|
287
|
+
- `roadmap` — `.planning/ROADMAP.md` edits
|
|
288
|
+
- `session` — session reports / closing notes
|
|
289
|
+
- `audits` — `.planning/audits/` artifacts
|
|
290
|
+
- `execute` — execute workflow
|
|
291
|
+
- `executor` — executor agent
|
|
292
|
+
- `plan` — plan workflow
|
|
293
|
+
- `planner` — planner agent
|
|
294
|
+
- `readme` — README.md
|
|
295
|
+
- `sync` — install/state sync flows
|
|
296
|
+
- `sprint` — sprint-level workflow additions and fixes
|
|
297
|
+
- `agent-exp` — agent experience improvements
|
|
298
|
+
- `extensibility` — extensibility and plugin hooks
|
|
299
|
+
- `lens-audit` — 15-lens audit system and lenses
|
|
300
|
+
- `tiers` — TIERS.md and tier-related documentation
|
|
301
|
+
- `<phase-id>` — numeric phase scope when committing inside a phase (e.g. `docs(15)`, `feat(8.3)`)
|
|
302
|
+
- `<sprint-id>` — numeric sprint scope inside a phase (e.g. `feat(15.1)`)
|
|
241
303
|
|
|
242
304
|
### Subject rules
|
|
243
305
|
- Lowercase first letter (enforced by `semantic-pull-request`)
|
package/README.md
CHANGED
|
@@ -11,8 +11,7 @@ npx @hanzlaa/rcode install # one command, zero dependencies
|
|
|
11
11
|
[](https://www.npmjs.com/package/@hanzlaa/rcode)
|
|
12
12
|
[](https://www.npmjs.com/package/@hanzlaa/rcode)
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
<!--  -->
|
|
14
|
+
**Quick look:** `npx @hanzlaa/rcode install` → `/rihal-council` → `/rihal-plan 1` → `/rihal-execute 1` — that's the full loop in three commands.
|
|
16
15
|
|
|
17
16
|
---
|
|
18
17
|
|
|
@@ -58,8 +57,8 @@ Rihal Code packages a lot. To keep things approachable, everything is organized
|
|
|
58
57
|
|
|
59
58
|
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.**
|
|
60
59
|
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
60
|
+
- **44 agents** with clear roles, cultural identity (Arabic names), and hard scope boundaries
|
|
61
|
+
- **96 slash commands** covering research, planning, execution, verification, and recovery
|
|
63
62
|
- **105 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.)
|
|
64
63
|
- **102 workflows** — the execution backbone behind every slash command
|
|
65
64
|
- **Persistent project memory** at `.rihal/memory/` — checked into git, visible in the Diwan dashboard, lossless distillates for fast LLM hydration
|
|
@@ -499,6 +498,12 @@ UNLICENSED — proprietary. All rights reserved.
|
|
|
499
498
|
|
|
500
499
|
---
|
|
501
500
|
|
|
501
|
+
## Auto-heal cadence
|
|
502
|
+
|
|
503
|
+
rihal-code ships continuous auto-heal tools — `/rihal-feature-drift`, `/rihal-memory-audit`, `/rihal-health` — plus a CI dogfood gate that runs them against this repo on every push. See [docs/AUTO-HEAL-CADENCE.md](docs/AUTO-HEAL-CADENCE.md) for recommended schedules, `/loop` examples, crontab entries, and the safety rules around `--fix` modes.
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
502
507
|
## Roadmap
|
|
503
508
|
|
|
504
509
|
See [GitHub Issues](https://github.com/hanzlahabib/rihal-code/issues) for tracked work. Current focus: marketing launch, MCP server, dashboard enhancements.
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* WHY: VS Code's Claude Code extension lists `.claude/skills/` in its
|
|
6
6
|
* sidebar, but slash commands at `.claude/commands/rihal/` are only
|
|
7
|
-
* reachable via the `/` autocomplete. Users
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* reachable via the `/` autocomplete. Users expect to see lifecycle
|
|
8
|
+
* commands like `rihal-do` in the sidebar — generating a thin skill
|
|
9
|
+
* stub per command makes them browsable without duplicating real skills.
|
|
10
10
|
*
|
|
11
11
|
* This script creates ONE skill stub per slash command at install time,
|
|
12
12
|
* unless a real skill with the same name already exists at the source.
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* `generated-by: rcode-install` in frontmatter so it can be detected
|
|
20
20
|
* and refreshed on subsequent installs without confusing real skills.
|
|
21
21
|
*
|
|
22
|
-
* Run: node
|
|
22
|
+
* Run: node cli/generate-command-skills.cjs <package-root> <target-skills-dir>
|
|
23
23
|
* (called from cli/install.js)
|
|
24
24
|
*/
|
|
25
25
|
|
|
@@ -99,7 +99,7 @@ source: rihal/commands/${cmdName}.md
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
<!--
|
|
102
|
-
AUTO-GENERATED at install time by
|
|
102
|
+
AUTO-GENERATED at install time by cli/generate-command-skills.cjs.
|
|
103
103
|
Do NOT edit this file directly — your changes will be overwritten on the next
|
|
104
104
|
install or update. To customise, create a sibling \`.local.md\` file (which
|
|
105
105
|
is preserved across installs) or modify the source command at
|
package/cli/index.js
CHANGED
|
File without changes
|
package/cli/install.js
CHANGED
|
@@ -134,6 +134,9 @@ function parseArgs(argv) {
|
|
|
134
134
|
noUpdateCheck: false,
|
|
135
135
|
// #381 — skip backup tarball on --force-overwrite (CI escape hatch)
|
|
136
136
|
noBackup: false,
|
|
137
|
+
// #199 — git pre-commit hook. null = install if .git/ present (default).
|
|
138
|
+
// Set false by --no-git-hooks, true by --git-hooks.
|
|
139
|
+
gitHooks: null,
|
|
137
140
|
};
|
|
138
141
|
const positional = [];
|
|
139
142
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -157,6 +160,8 @@ function parseArgs(argv) {
|
|
|
157
160
|
else if (arg === '--accept-all') opts.acceptAll = true; // #251 overwrite all preserved
|
|
158
161
|
else if (arg === '--no-update-check') opts.noUpdateCheck = true; // #252
|
|
159
162
|
else if (arg === '--no-backup') opts.noBackup = true; // #381
|
|
163
|
+
else if (arg === '--no-git-hooks') opts.gitHooks = false; // #199
|
|
164
|
+
else if (arg === '--git-hooks') opts.gitHooks = true; // #199
|
|
160
165
|
else if (!arg.startsWith('--')) positional.push(arg);
|
|
161
166
|
}
|
|
162
167
|
if (positional[0]) {
|
|
@@ -300,7 +305,16 @@ function detectIdeSignals(target) {
|
|
|
300
305
|
*/
|
|
301
306
|
async function resolveIde(opts) {
|
|
302
307
|
if (opts.ideProvided) return [opts.ide]; // user passed --ide, respect it
|
|
303
|
-
if (opts.yes || !process.stdin.isTTY)
|
|
308
|
+
if (opts.yes || !process.stdin.isTTY) {
|
|
309
|
+
// #182 — non-interactive mode: install into every detected IDE, not just
|
|
310
|
+
// the default claude. The interactive flow already preselects detected
|
|
311
|
+
// ones; --yes should match that intent. Falls back to ['claude'] when
|
|
312
|
+
// nothing detected. (Note: opts.ide defaults to 'claude' from parseArgs,
|
|
313
|
+
// so check opts.ideProvided not opts.ide to honor real --ide overrides.)
|
|
314
|
+
const signals = detectIdeSignals(opts.target);
|
|
315
|
+
const detected = ['claude', 'cursor', 'gemini', 'vscode', 'antigravity'].filter(k => signals[k]);
|
|
316
|
+
return detected.length > 0 ? detected : ['claude'];
|
|
317
|
+
}
|
|
304
318
|
|
|
305
319
|
const signals = detectIdeSignals(opts.target);
|
|
306
320
|
const detected = ['claude', 'cursor', 'gemini', 'vscode'].filter(k => signals[k]);
|
|
@@ -333,8 +347,8 @@ async function resolveIde(opts) {
|
|
|
333
347
|
|
|
334
348
|
/**
|
|
335
349
|
* Resolve commit-planning preference — CLI flag wins, then interactive
|
|
336
|
-
* prompt (when TTY + not --yes), else
|
|
337
|
-
* #189.
|
|
350
|
+
* prompt (when TTY + not --yes), else default to true (commit planning
|
|
351
|
+
* artifacts so they version with the code). #189.
|
|
338
352
|
*/
|
|
339
353
|
async function resolveCommitPlanning(opts) {
|
|
340
354
|
if (opts.commitPlanning !== null) return opts.commitPlanning;
|
|
@@ -687,6 +701,85 @@ function ensureRcodeGitignore(target, options = {}) {
|
|
|
687
701
|
}
|
|
688
702
|
}
|
|
689
703
|
|
|
704
|
+
/**
|
|
705
|
+
* Ensure .git/hooks/pre-commit includes the rcode-managed block that auto-syncs
|
|
706
|
+
* state.json when .planning/ or .rihal/brain/sources.yaml files change.
|
|
707
|
+
*
|
|
708
|
+
* Idempotent via sentinels — existing user hook content is preserved.
|
|
709
|
+
* Respects opts.gitHooks: false → skip entirely (--no-git-hooks flag).
|
|
710
|
+
*
|
|
711
|
+
* Returns: { action: 'created' | 'appended' | 'already-present' | 'skipped-no-git' | 'skipped-flag' | 'skipped-error' }
|
|
712
|
+
*/
|
|
713
|
+
function ensureRcodePreCommitHook(target, options = {}) {
|
|
714
|
+
if (options.gitHooks === false) return { action: 'skipped-flag' };
|
|
715
|
+
|
|
716
|
+
const gitDir = path.join(target, '.git');
|
|
717
|
+
if (!fs.existsSync(gitDir) || !fs.statSync(gitDir).isDirectory()) {
|
|
718
|
+
return { action: 'skipped-no-git' };
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
const BEGIN = '# ===== rcode-managed pre-commit block =====';
|
|
722
|
+
const END = '# ===== end rcode pre-commit block =====';
|
|
723
|
+
|
|
724
|
+
const BLOCK = [
|
|
725
|
+
'',
|
|
726
|
+
BEGIN,
|
|
727
|
+
'# Auto-syncs .rihal/state.json when planning files change.',
|
|
728
|
+
'# Added by rcode install — safe to re-run (idempotent).',
|
|
729
|
+
'if git diff --cached --name-only | grep -qE "^\\.planning/|^\\.rihal/brain/sources\\.yaml$"; then',
|
|
730
|
+
' if [ -x .rihal/bin/rihal-tools.cjs ]; then',
|
|
731
|
+
' node .rihal/bin/rihal-tools.cjs state sync --from-disk > /dev/null 2>&1 || true',
|
|
732
|
+
' git add .rihal/state.json 2>/dev/null || true',
|
|
733
|
+
' fi',
|
|
734
|
+
'fi',
|
|
735
|
+
END,
|
|
736
|
+
'',
|
|
737
|
+
].join('\n');
|
|
738
|
+
|
|
739
|
+
const hooksDir = path.join(gitDir, 'hooks');
|
|
740
|
+
const hookPath = path.join(hooksDir, 'pre-commit');
|
|
741
|
+
|
|
742
|
+
try {
|
|
743
|
+
fs.mkdirSync(hooksDir, { recursive: true });
|
|
744
|
+
|
|
745
|
+
if (!fs.existsSync(hookPath)) {
|
|
746
|
+
fs.writeFileSync(hookPath, `#!/bin/sh\n${BLOCK}`);
|
|
747
|
+
fs.chmodSync(hookPath, 0o755);
|
|
748
|
+
return { action: 'created' };
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
const existing = fs.readFileSync(hookPath, 'utf8');
|
|
752
|
+
|
|
753
|
+
function spliceBlock(text, newBlock) {
|
|
754
|
+
const start = text.indexOf(BEGIN);
|
|
755
|
+
if (start < 0) return null;
|
|
756
|
+
const endIdx = text.indexOf(END, start);
|
|
757
|
+
if (endIdx < 0) return null;
|
|
758
|
+
let sliceStart = start;
|
|
759
|
+
if (sliceStart > 0 && text[sliceStart - 1] === '\n') sliceStart -= 1;
|
|
760
|
+
let sliceEnd = endIdx + END.length;
|
|
761
|
+
if (text[sliceEnd] === '\n') sliceEnd += 1;
|
|
762
|
+
return text.slice(0, sliceStart) + newBlock + text.slice(sliceEnd);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
if (existing.includes(BEGIN)) {
|
|
766
|
+
const rewritten = spliceBlock(existing, BLOCK);
|
|
767
|
+
if (rewritten !== null && rewritten !== existing) {
|
|
768
|
+
fs.writeFileSync(hookPath, rewritten);
|
|
769
|
+
fs.chmodSync(hookPath, 0o755);
|
|
770
|
+
return { action: 'updated' };
|
|
771
|
+
}
|
|
772
|
+
return { action: 'already-present' };
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
fs.writeFileSync(hookPath, existing + BLOCK);
|
|
776
|
+
fs.chmodSync(hookPath, 0o755);
|
|
777
|
+
return { action: 'appended' };
|
|
778
|
+
} catch (err) {
|
|
779
|
+
return { action: 'skipped-error', error: err.message };
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
690
783
|
/**
|
|
691
784
|
* Install brain scaffold (sources.yaml + README.md) into .rihal/brain/ on target.
|
|
692
785
|
* Actual brain content lands after `brain pull` runs.
|
|
@@ -817,6 +910,22 @@ function parseFrontmatter(text) {
|
|
|
817
910
|
* For cursor IDE, converts command files from .md to .mdc format.
|
|
818
911
|
*/
|
|
819
912
|
function buildInstallPlan(ide = 'claude', target = process.cwd()) {
|
|
913
|
+
// Support array of IDEs — merge plans with deduplication (#449/#450 multi-IDE).
|
|
914
|
+
if (Array.isArray(ide)) {
|
|
915
|
+
const seen = new Set();
|
|
916
|
+
const merged = [];
|
|
917
|
+
for (const i of ide) {
|
|
918
|
+
for (const entry of buildInstallPlan(i, target)) {
|
|
919
|
+
const key = entry.rel;
|
|
920
|
+
if (!seen.has(key)) {
|
|
921
|
+
seen.add(key);
|
|
922
|
+
merged.push(entry);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
return merged;
|
|
927
|
+
}
|
|
928
|
+
|
|
820
929
|
const plan = [];
|
|
821
930
|
const paths = getPathsForIde(ide, target);
|
|
822
931
|
|
|
@@ -1653,6 +1762,10 @@ async function install(opts) {
|
|
|
1653
1762
|
// Reads opts.commitPlanning to decide whether .planning/ is in the ignore block.
|
|
1654
1763
|
const gitignoreReport = ensureRcodeGitignore(opts.target, { commitPlanning: opts.commitPlanning });
|
|
1655
1764
|
|
|
1765
|
+
// Install pre-commit hook that auto-syncs state.json when planning files change.
|
|
1766
|
+
// Respects --no-git-hooks flag; skips silently when .git/ is absent.
|
|
1767
|
+
const hookReport = ensureRcodePreCommitHook(opts.target, { gitHooks: opts.gitHooks });
|
|
1768
|
+
|
|
1656
1769
|
// Pull Rihal brain content (v2.0 — issue #158).
|
|
1657
1770
|
// Runs rihal-tools brain pull as a child process. Placeholder URLs
|
|
1658
1771
|
// are skipped gracefully so this does not fail a fresh install.
|
|
@@ -1697,6 +1810,18 @@ async function install(opts) {
|
|
|
1697
1810
|
}[gitignoreReport.action] || '.gitignore unchanged';
|
|
1698
1811
|
console.log(' ' + dim(gitMsg));
|
|
1699
1812
|
}
|
|
1813
|
+
if (hookReport) {
|
|
1814
|
+
const hookMsg = {
|
|
1815
|
+
'created': 'pre-commit hook installed (.git/hooks/pre-commit)',
|
|
1816
|
+
'appended': 'pre-commit hook updated — rcode block appended',
|
|
1817
|
+
'already-present': 'pre-commit hook rcode block already present',
|
|
1818
|
+
'updated': 'pre-commit hook rcode block refreshed',
|
|
1819
|
+
'skipped-flag': 'pre-commit hook skipped (--no-git-hooks)',
|
|
1820
|
+
'skipped-no-git': 'pre-commit hook skipped (no .git/ directory)',
|
|
1821
|
+
'skipped-error': `pre-commit hook skipped (${hookReport.error})`,
|
|
1822
|
+
}[hookReport.action] || 'pre-commit hook unchanged';
|
|
1823
|
+
console.log(' ' + dim(hookMsg));
|
|
1824
|
+
}
|
|
1700
1825
|
if (skipped > 0) console.log(' ' + dim(`${skipped} files skipped (unchanged)`));
|
|
1701
1826
|
|
|
1702
1827
|
// Diff display for preserved files (#251)
|
package/cli/lib/manifest.cjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* package's source skills against what was written to the project.
|
|
9
9
|
*
|
|
10
10
|
* Reused by:
|
|
11
|
-
* - cli/
|
|
11
|
+
* - cli/index.js — post-install verification with friendly report
|
|
12
12
|
* - cli/doctor.js — preflight/healthcheck
|
|
13
13
|
*/
|
|
14
14
|
|
package/cli/uninstall.js
CHANGED
|
@@ -659,6 +659,14 @@ async function runUninstall(args) {
|
|
|
659
659
|
console.log(` For a fully clean slate next time, use: rcode uninstall --purge`);
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
+
// IDE cache reload hint — Claude Code caches the slash-command list in memory.
|
|
663
|
+
// Without a window reload the removed commands remain visible.
|
|
664
|
+
console.log();
|
|
665
|
+
console.log(`💡 IDE reload required:`);
|
|
666
|
+
console.log(` VS Code / Cursor: Cmd+Shift+P → "Developer: Reload Window"`);
|
|
667
|
+
console.log(` If commands still appear after reload, check ~/.claude/commands/ for`);
|
|
668
|
+
console.log(` any globally-installed rihal-* items (rcode does not touch global installs).`);
|
|
669
|
+
|
|
662
670
|
// Hint about reinstalling
|
|
663
671
|
console.log(`\nTo reinstall later:`);
|
|
664
672
|
console.log(` rcode install`);
|
package/dist/rcode.js
CHANGED
|
@@ -15973,7 +15973,11 @@ var require_install = __commonJS({
|
|
|
15973
15973
|
}
|
|
15974
15974
|
async function resolveIde(opts) {
|
|
15975
15975
|
if (opts.ideProvided) return [opts.ide];
|
|
15976
|
-
if (opts.yes || !process.stdin.isTTY)
|
|
15976
|
+
if (opts.yes || !process.stdin.isTTY) {
|
|
15977
|
+
const signals2 = detectIdeSignals(opts.target);
|
|
15978
|
+
const detected2 = ["claude", "cursor", "gemini", "vscode", "antigravity"].filter((k) => signals2[k]);
|
|
15979
|
+
return detected2.length > 0 ? detected2 : ["claude"];
|
|
15980
|
+
}
|
|
15977
15981
|
const signals = detectIdeSignals(opts.target);
|
|
15978
15982
|
const detected = ["claude", "cursor", "gemini", "vscode"].filter((k) => signals[k]);
|
|
15979
15983
|
const initialValues = detected.length > 0 ? detected : ["claude"];
|
|
@@ -16381,6 +16385,20 @@ Say "plan a sprint" or run \`/rihal-sprint-planning\` to break Phase 01 into sto
|
|
|
16381
16385
|
return { frontmatter: fm, body };
|
|
16382
16386
|
}
|
|
16383
16387
|
function buildInstallPlan(ide = "claude", target = process.cwd()) {
|
|
16388
|
+
if (Array.isArray(ide)) {
|
|
16389
|
+
const seen = /* @__PURE__ */ new Set();
|
|
16390
|
+
const merged = [];
|
|
16391
|
+
for (const i of ide) {
|
|
16392
|
+
for (const entry of buildInstallPlan(i, target)) {
|
|
16393
|
+
const key = entry.rel;
|
|
16394
|
+
if (!seen.has(key)) {
|
|
16395
|
+
seen.add(key);
|
|
16396
|
+
merged.push(entry);
|
|
16397
|
+
}
|
|
16398
|
+
}
|
|
16399
|
+
}
|
|
16400
|
+
return merged;
|
|
16401
|
+
}
|
|
16384
16402
|
const plan = [];
|
|
16385
16403
|
const paths = getPathsForIde(ide, target);
|
|
16386
16404
|
const relWorkflows = path2.relative(target, paths.workflowsDir);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzlaa/rcode",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.5",
|
|
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": {
|
|
@@ -8,12 +8,20 @@
|
|
|
8
8
|
"rihal": "dist/rcode.js",
|
|
9
9
|
"rihal-code": "dist/rcode.js"
|
|
10
10
|
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dashboard": "node server/dashboard.js",
|
|
13
|
+
"test": "node --test",
|
|
14
|
+
"test:ci": "node --test --test-reporter=spec",
|
|
15
|
+
"postinstall": "node cli/postinstall.js",
|
|
16
|
+
"build:cli": "node scripts/build.cjs",
|
|
17
|
+
"build": "node scripts/build.cjs",
|
|
18
|
+
"dogfood": "bash scripts/dogfood-check.sh"
|
|
19
|
+
},
|
|
11
20
|
"files": [
|
|
12
21
|
"cli/",
|
|
13
22
|
"rihal/",
|
|
14
23
|
"server/",
|
|
15
24
|
"dist/",
|
|
16
|
-
".rihal-template/",
|
|
17
25
|
"README.md",
|
|
18
26
|
"AGENTS.md",
|
|
19
27
|
"CLAUDE.md",
|
|
@@ -49,26 +57,17 @@
|
|
|
49
57
|
"engines": {
|
|
50
58
|
"node": ">=18.0.0"
|
|
51
59
|
},
|
|
52
|
-
"dependencies": {},
|
|
53
60
|
"devDependencies": {
|
|
61
|
+
"@clack/prompts": "^0.9.1",
|
|
62
|
+
"diff": "^8.0.4",
|
|
54
63
|
"esbuild": "^0.25.0",
|
|
55
|
-
"picocolors": "^1.1.1",
|
|
56
|
-
"nanospinner": "^1.2.2",
|
|
57
64
|
"fast-glob": "^3.3.3",
|
|
58
|
-
"
|
|
65
|
+
"nanospinner": "^1.2.2",
|
|
66
|
+
"picocolors": "^1.1.1",
|
|
59
67
|
"semver": "^7.7.1",
|
|
60
|
-
"
|
|
61
|
-
"@clack/prompts": "^0.9.1"
|
|
68
|
+
"zod": "^3.24.0"
|
|
62
69
|
},
|
|
63
70
|
"publishConfig": {
|
|
64
71
|
"access": "public"
|
|
65
|
-
},
|
|
66
|
-
"scripts": {
|
|
67
|
-
"dashboard": "node server/dashboard.js",
|
|
68
|
-
"test": "node --test",
|
|
69
|
-
"test:ci": "node --test --test-reporter=spec",
|
|
70
|
-
"postinstall": "node cli/postinstall.js",
|
|
71
|
-
"build:cli": "node scripts/build.cjs",
|
|
72
|
-
"build": "node scripts/build.cjs"
|
|
73
72
|
}
|
|
74
|
-
}
|
|
73
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rihal-ahmed
|
|
3
|
-
description: Technology & Development Director — spawned by /rihal-council for delivery timelines, engineering standards, DORA metrics, cross-team coordination,
|
|
3
|
+
description: Technology & Development Director — spawned by /rihal-council for delivery timelines, engineering standards, DORA metrics, cross-team coordination, and tech debt prioritization.
|
|
4
4
|
tools: Read, Grep, Glob, Bash
|
|
5
5
|
color: blue
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
@.rihal/references/response-style.md
|
|
9
9
|
@.rihal/references/codebase-grounding.md
|
|
10
|
+
@.rihal/skills/agents/ahmed-hassani-director/SKILL.md
|
|
10
11
|
|
|
11
12
|
# Ahmed Al Hassani — Technology & Development Director
|
|
12
13
|
|
|
@@ -56,6 +56,52 @@ Structured: What I found → Minimal changes → Tests verified → Risk assessm
|
|
|
56
56
|
- Fix authentication and authorization gaps
|
|
57
57
|
- Remove dangerous patterns identified by rihal-code-reviewer
|
|
58
58
|
|
|
59
|
+
## Principles
|
|
60
|
+
|
|
61
|
+
Named rules. Cite by name when applying.
|
|
62
|
+
|
|
63
|
+
- **Increment-not-rewrite** — every change is the minimal delta that fixes the issue.
|
|
64
|
+
- **Test-before-after** — run tests before and after each change; verify no regressions.
|
|
65
|
+
- **One-commit-per-fix** — separate logical fixes into separate commits; never bundle unrelated changes.
|
|
66
|
+
- **No silent behavior changes** — if a fix changes observable behavior, document it in the commit message.
|
|
67
|
+
- **Clarity beats cleverness** — readable code over clever code; the next reader is a future teammate.
|
|
68
|
+
|
|
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
|
+
## Anti-Patterns / Refuse List
|
|
80
|
+
|
|
81
|
+
- **Never rewrite a working module** — incremental changes only. Per Increment-not-rewrite.
|
|
82
|
+
- **Never change behavior while fixing style** — one concern per commit.
|
|
83
|
+
- **Never add features** — if the fix requires new behavior, stop and redirect to the development team.
|
|
84
|
+
- **Never skip test verification** — "it looks right" is not a test. Per Test-before-after.
|
|
85
|
+
- **Never make architectural decisions** — design tradeoffs belong to Waleed (CTO).
|
|
86
|
+
- **Never fix what wasn't reported** — scope creep in refactors introduces unexpected regressions.
|
|
87
|
+
|
|
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
|
+
|
|
59
105
|
## Redirects
|
|
60
106
|
|
|
61
107
|
Use command-redirect-format.md. One reason, then command.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rihal-code-reviewer
|
|
3
|
-
description: Code Review Specialist — spawned for architectural review, code quality assessment, test coverage analysis, and best
|
|
3
|
+
description: Code Review Specialist — spawned for architectural review, code quality assessment, test coverage analysis, and best-practices validation.
|
|
4
4
|
tools: Read, Grep, Glob, Bash
|
|
5
5
|
color: purple
|
|
6
6
|
---
|
|
@@ -57,6 +57,51 @@ Structured: Pattern check → Risk assessment → Test coverage → Maintainabil
|
|
|
57
57
|
- Flag unsafe patterns and recommend hardening
|
|
58
58
|
- Note: Defer deep security audit to rihal-security-auditor
|
|
59
59
|
|
|
60
|
+
## Principles
|
|
61
|
+
|
|
62
|
+
Named rules. Cite by name when applying.
|
|
63
|
+
|
|
64
|
+
- **Read-existing-first** — read the codebase patterns before suggesting changes. Suggestions that contradict house conventions are worse than the code they flag.
|
|
65
|
+
- **Severity-ordered** — security and breakage before style. Never lead with formatting when a null-deref exists.
|
|
66
|
+
- **Evidence-based** — every finding cites file:line. No "this code seems to have issues".
|
|
67
|
+
- **Why-not-what** — explain the reason for a change, not just what to change. Teams that understand why don't repeat the mistake.
|
|
68
|
+
- **6-month test** — ask "what will a maintainer curse you for in 6 months?" before flagging anything.
|
|
69
|
+
|
|
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
|
+
## Anti-Patterns / Refuse List
|
|
80
|
+
|
|
81
|
+
- **Never suggest a rewrite** — reviewers find issues; fixers and architects fix them. Route to code-fixer or Waleed.
|
|
82
|
+
- **Never lead with style** when security or breakage findings exist. Per Severity-ordered.
|
|
83
|
+
- **Never cite a style guide** without verifying it matches what the codebase already does.
|
|
84
|
+
- **Never produce vague findings** — "this function is complex" is noise. Per Evidence-based: name the file, the line, the problem.
|
|
85
|
+
- **Never skip reading the existing code** before suggesting changes. Per Read-existing-first.
|
|
86
|
+
- **Never write production code** — reviewers identify; fixers implement.
|
|
87
|
+
|
|
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
|
+
|
|
60
105
|
## Redirects
|
|
61
106
|
|
|
62
107
|
Use command-redirect-format.md. One reason, then command.
|