@hanzlaa/rcode 3.4.4 → 3.4.6
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 +21 -9
- package/cli/index.js +0 -0
- package/cli/install.js +126 -7
- package/cli/lib/manifest.cjs +1 -1
- package/cli/uninstall.js +8 -0
- package/dist/rcode.js +1279 -2004
- 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
|
|
|
@@ -32,11 +32,23 @@ const path = require('path');
|
|
|
32
32
|
* lifecycle verbs. Internal sub-commands stay slash-only.
|
|
33
33
|
*/
|
|
34
34
|
const SIDEBAR_COMMANDS = new Set([
|
|
35
|
-
|
|
36
|
-
'
|
|
37
|
-
|
|
38
|
-
'
|
|
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
|
|
39
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',
|
|
50
|
+
// Utility
|
|
51
|
+
'debug', 'session-report', 'forensics', 'map-codebase', 'quick',
|
|
40
52
|
'note', 'add-todo', 'check-todos', 'pause-work', 'resume-work',
|
|
41
53
|
]);
|
|
42
54
|
|
|
@@ -99,7 +111,7 @@ source: rihal/commands/${cmdName}.md
|
|
|
99
111
|
---
|
|
100
112
|
|
|
101
113
|
<!--
|
|
102
|
-
AUTO-GENERATED at install time by
|
|
114
|
+
AUTO-GENERATED at install time by cli/generate-command-skills.cjs.
|
|
103
115
|
Do NOT edit this file directly — your changes will be overwritten on the next
|
|
104
116
|
install or update. To customise, create a sibling \`.local.md\` file (which
|
|
105
117
|
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;
|
|
@@ -394,7 +408,7 @@ function getPathsForIde(ide, target) {
|
|
|
394
408
|
case 'claude':
|
|
395
409
|
return {
|
|
396
410
|
agentsDir: path.join(target, '.claude', 'agents'),
|
|
397
|
-
commandsDir: path.join(target, '.claude', 'commands'
|
|
411
|
+
commandsDir: path.join(target, '.claude', 'commands'),
|
|
398
412
|
workflowsDir: path.join(target, '.rihal', 'workflows'),
|
|
399
413
|
referencesDir: path.join(target, '.rihal', 'references'),
|
|
400
414
|
binDir: path.join(target, '.rihal', 'bin'),
|
|
@@ -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.
|
|
@@ -878,10 +971,15 @@ function buildInstallPlan(ide = 'claude', target = process.cwd()) {
|
|
|
878
971
|
}
|
|
879
972
|
|
|
880
973
|
// Commands — IDE-specific
|
|
974
|
+
// Claude: output as .claude/commands/rihal-{name}.md (hyphen namespace → /rihal-name)
|
|
975
|
+
// Cursor/Gemini: keep original flat name inside their rihal/ subdirectory
|
|
881
976
|
for (const f of walkFiles(path.join(SOURCE_ROOT, 'commands'))) {
|
|
882
977
|
const rel = path.relative(path.join(SOURCE_ROOT, 'commands'), f);
|
|
883
978
|
const ext = ide === 'cursor' ? '.mdc' : '.md';
|
|
884
|
-
const
|
|
979
|
+
const baseName = path.basename(f, '.md');
|
|
980
|
+
const outName = ide === 'claude'
|
|
981
|
+
? `rihal-${baseName}${ext}`
|
|
982
|
+
: baseName + ext;
|
|
885
983
|
plan.push({ src: f, rel: path.join(relCommands, path.dirname(rel), outName), ide, cursor: ide === 'cursor' });
|
|
886
984
|
}
|
|
887
985
|
|
|
@@ -957,7 +1055,7 @@ function filterPlanByModules(plan, moduleNames) {
|
|
|
957
1055
|
if (!mod) { console.warn(` ⚠ Unknown module: ${modName}`); continue; }
|
|
958
1056
|
for (const a of mod.agents) allowed.add(path.join('.claude', 'agents', a));
|
|
959
1057
|
for (const w of mod.workflows) allowed.add(path.join('.rihal', 'workflows', w));
|
|
960
|
-
for (const c of mod.commands) allowed.add(path.join('.claude', 'commands',
|
|
1058
|
+
for (const c of mod.commands) allowed.add(path.join('.claude', 'commands', `rihal-${c}`));
|
|
961
1059
|
for (const r of mod.references) allowed.add(path.join('.rihal', 'references', r));
|
|
962
1060
|
}
|
|
963
1061
|
// Always include bin/ (shared infrastructure, not module-specific)
|
|
@@ -1669,6 +1767,10 @@ async function install(opts) {
|
|
|
1669
1767
|
// Reads opts.commitPlanning to decide whether .planning/ is in the ignore block.
|
|
1670
1768
|
const gitignoreReport = ensureRcodeGitignore(opts.target, { commitPlanning: opts.commitPlanning });
|
|
1671
1769
|
|
|
1770
|
+
// Install pre-commit hook that auto-syncs state.json when planning files change.
|
|
1771
|
+
// Respects --no-git-hooks flag; skips silently when .git/ is absent.
|
|
1772
|
+
const hookReport = ensureRcodePreCommitHook(opts.target, { gitHooks: opts.gitHooks });
|
|
1773
|
+
|
|
1672
1774
|
// Pull Rihal brain content (v2.0 — issue #158).
|
|
1673
1775
|
// Runs rihal-tools brain pull as a child process. Placeholder URLs
|
|
1674
1776
|
// are skipped gracefully so this does not fail a fresh install.
|
|
@@ -1713,6 +1815,18 @@ async function install(opts) {
|
|
|
1713
1815
|
}[gitignoreReport.action] || '.gitignore unchanged';
|
|
1714
1816
|
console.log(' ' + dim(gitMsg));
|
|
1715
1817
|
}
|
|
1818
|
+
if (hookReport) {
|
|
1819
|
+
const hookMsg = {
|
|
1820
|
+
'created': 'pre-commit hook installed (.git/hooks/pre-commit)',
|
|
1821
|
+
'appended': 'pre-commit hook updated — rcode block appended',
|
|
1822
|
+
'already-present': 'pre-commit hook rcode block already present',
|
|
1823
|
+
'updated': 'pre-commit hook rcode block refreshed',
|
|
1824
|
+
'skipped-flag': 'pre-commit hook skipped (--no-git-hooks)',
|
|
1825
|
+
'skipped-no-git': 'pre-commit hook skipped (no .git/ directory)',
|
|
1826
|
+
'skipped-error': `pre-commit hook skipped (${hookReport.error})`,
|
|
1827
|
+
}[hookReport.action] || 'pre-commit hook unchanged';
|
|
1828
|
+
console.log(' ' + dim(hookMsg));
|
|
1829
|
+
}
|
|
1716
1830
|
if (skipped > 0) console.log(' ' + dim(`${skipped} files skipped (unchanged)`));
|
|
1717
1831
|
|
|
1718
1832
|
// Diff display for preserved files (#251)
|
|
@@ -1749,7 +1863,12 @@ async function install(opts) {
|
|
|
1749
1863
|
agentCount = fs.readdirSync(agentsDir).filter(f => (f.startsWith('rihal-') || f.startsWith('rcode-')) && (f.endsWith('.md') || f.endsWith('.mdc'))).length;
|
|
1750
1864
|
}
|
|
1751
1865
|
if (fs.existsSync(commandsDir)) {
|
|
1752
|
-
commandCount = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md') || f.endsWith('.mdc')).length;
|
|
1866
|
+
commandCount = fs.readdirSync(commandsDir).filter(f => f.startsWith('rihal-') && (f.endsWith('.md') || f.endsWith('.mdc'))).length;
|
|
1867
|
+
}
|
|
1868
|
+
// Clean up legacy .claude/commands/rihal/ colon-namespace directory if it exists
|
|
1869
|
+
const legacyColonDir = path.join(opts.target, '.claude', 'commands', 'rihal');
|
|
1870
|
+
if (primaryIde === 'claude' && fs.existsSync(legacyColonDir)) {
|
|
1871
|
+
fs.rmSync(legacyColonDir, { recursive: true, force: true });
|
|
1753
1872
|
}
|
|
1754
1873
|
} catch {}
|
|
1755
1874
|
|
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`);
|