Package Exports
- @hanzlaa/rcode
- @hanzlaa/rcode/cli/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@hanzlaa/rcode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Rihal Code
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.
Why this exists
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.
Rihal Code fixes that. One install, and the AI knows. Every session. Every repo. Every Rihalian.
See docs/what-is-rihal-code.md for the full story, and docs/ROADMAP.md for where this is going (next: live MCP server in v3.0).
🚦 Start Here
Rihal Code packages a lot. To keep things approachable, everything is organized into four tiers:
| Tier | Who it's for | Start with |
|---|---|---|
| 🌱 Starter | First-time Rihalian | 7 skills — the Golden Path |
| 🌿 Advanced | Teams running sprints | PRD variants, architecture, UX, QA |
| 🌳 Ultra Advanced | Power users | Multi-agent council, dashboard, clone-website |
| 📐 Standards | Contributors | Skill spec, commit rules, PR checklist |
Brand new? Do the Golden Path: scaffold → PRD → stories → sprint → dev → review → status. Seven skills, one project, end-to-end.
v2.0 — Rihal Brain. v1 was a generic AI-engineering methodology. v2 keeps all of that and adds the Rihal context layer on top: standards, guides, and institutional knowledge pulled fresh from Rihal's own repos on install and on
/rihal:update. SeeCHANGELOG.mdand the v2.0 milestone.
What is this
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.
- 44 agents with clear roles, cultural identity (Arabic names), and hard scope boundaries
- 93 slash commands covering research, planning, execution, verification, and recovery
- 3 execution modes: parallel debate (
/rihal:council), sequential pipelines (/rihal:chain), and quick-sync (/rihal:discuss) - File-based state in
.rihal/that every workflow reads and updates - Intent guards on every workflow — catch wrong commands early with copy-paste redirects
- Karpathy-inspired coding guidelines wired into every code-writing agent
- Numeric ID system (M1 milestones, NN phases, NN.M plans, NN.M.T tasks, with decimal insertion for urgent work)
- Plan verification loop that validates file/symbol references before execution
- Post-execute gates (integration-checker, nyquist-auditor) verify completeness
- Global agents at
~/.rihal/agents/— customize without forking
It's not a chatbot. It's a methodology.
Install — one command
In any project directory:
npx @hanzlaa/rcode installThat's it. One unified installer. Pure file shipping, no runtime dependencies. Installs into:
.rihal/— config, workflows, references, bin (Rihal infrastructure).claude/agents/— 44 first-class subagents.claude/commands/rihal/— 93 slash commands.claude/skills/— 58 phrase-activated skills (scaffold-project, create-prd, retrospective, etc.).planning/— where your artifacts land (council sessions, plans, chains, summaries)
Restart Claude Code (or your IDE), type /, and every rihal:* command appears.
Then begin the rihla
/rihal:initDetects your project state (fresh / existing-with-no-rihal / returning), asks a few configuration questions, and routes you to the right first action.
Install a specific module
npx @hanzlaa/rcode install --module core # council + quick-sync only
npx @hanzlaa/rcode install --module execution --force
npx @hanzlaa/rcode install --module discovery --forceMulti-IDE support
npx @hanzlaa/rcode install --ide claude # default
npx @hanzlaa/rcode install --ide cursor
npx @hanzlaa/rcode install --ide gemini90-second tour
/rihal:do → interactive router
/rihal:council should I rewrite auth? → 5 agents debate in parallel, 2 rounds
/rihal:discuss waleed what stack for saas? → single expert, fast
/rihal:chain research-plan dubai affiliate → Mariam → Hussain-PM → Planner pipeline
/rihal:plan --research build a rental app → researcher grounds, plan-checker verifies
/rihal:execute .planning/plans/01/PLAN.md → atomic commits + post-gates
/rihal:status → phases, decisions, blockers, sessions
/rihal:karpathy-audit HEAD~5..HEAD → audit changes vs 4 coding principlesFilesystem layout
System-owned directories (do not edit):
.rihal/ — Rihal infrastructure + state
config.yaml — preferences (model, language, mode, branching)
state.json — project phases, decisions, sessions, workstreams
RIHLA.md — project journey baseline
HANDOFF.json — pause-work context for resuming
bin/
rihal-tools.cjs — CLI helper (state read/write, panel scoring, etc.)
lib/council-panel.cjs — deterministic panel scorer
workflows/ — 69 slash command workflows
references/ — shared contracts (council-protocol, gates, karpathy-guidelines, etc.)
agents-rules/ — lazy-loaded agent rule files (planner, executor, debugger)Your artifacts (created automatically):
.planning/ — your work outputs
phases/01-name/PLAN.md — plans organized by phase number (01, 02, 02.1, etc.)
council-sessions/ — debate artifacts
chains/ — pipeline outputs (RESEARCH.md → SCOPE.md → PLAN.md)
notes/ — quick notes from /rihal:note
HANDOFF.json — pause-work checkpoint
.continue-here.md — human-readable handoff summaryThe team
5 council agents with cultural identity, each with hard scope boundaries and response-style contracts:
| Agent | Role | Spawns for |
|---|---|---|
| 🧭 Sadiq (صادق) | Director of Strategy | Priorities, kill criteria, market timing, "should we build this" |
| 🏗️ Waleed (وليد) | CTO | Architecture, stack, feasibility, security, scale, tech debt |
| 🛡️ Fatima (فاطمة) | QA Lead | Test strategy, release readiness, regression risk, coverage |
| 📣 Mariam (مريم) | Marketing & Growth | Market research, GTM, positioning, GCC/MENA markets |
| 📋 Hussain-PM (حسين) | Product Manager | Scope, roadmap, features, user stories, PRDs, sprint planning |
30+ specialist agents for execution, discovery, and verification:
- Execution: rihal-executor, rihal-planner, rihal-verifier, rihal-plan-checker, rihal-debugger
- Discovery: rihal-codebase-mapper, rihal-project-researcher, rihal-roadmapper, rihal-phase-researcher, rihal-advisor-researcher, rihal-assumptions-analyzer, rihal-research-synthesizer
- Verification: rihal-integration-checker, rihal-nyquist-auditor
- Quality: rihal-tech-writer, rihal-ux-designer, rihal-architect, rihal-code-reviewer, rihal-code-fixer, rihal-edge-case-hunter, rihal-deviation-analyzer
- And more: rihal-docs-auditor, rihal-doc-verifier, rihal-doc-writer, rihal-repo-metrics, rihal-security-auditor, etc.
Customize globally: Define reusable agents in ~/.rihal/agents/rihal-<name>.md. They appear in every project alongside project-local agents, without forking the repo.
Three modes, three mental models
🏛️ /rihal:council — Parallel debate
3-5 agents answer simultaneously in Round 1, then Round 2 lets each agent challenge the others' Round 1 responses. Result: one session artifact with all voices + orchestrator note flagging the sharpest disagreement.
Best for: strategic decisions where you want disagreement, not consensus.
/rihal:council should we migrate from monolith to microservices?🔗 /rihal:chain — Sequential pipeline
Each agent runs after the previous one finishes, reading that agent's artifact as input. Result: a typed artifact per stage (RESEARCH.md → SCOPE.md → PLAN.md) in .planning/chains/.
Best for: when you know roughly what you want and each specialist needs to do their part in order.
/rihal:chain research-plan dubai affiliate site for mobile accessories
/rihal:chain feasibility migrate postgres to neon serverless
/rihal:chain gtm-to-build saas bookkeeping in omanPresets: research-plan · feasibility · gtm-to-build · full-discovery. Or custom: /rihal:chain mariam,waleed,fatima "your topic".
💬 /rihal:discuss — Single agent, quick-sync
One agent, one round, conversational tone, no mandatory artifact. Feels like texting one colleague.
/rihal:discuss waleed can we use postgres jsonb for this?
/rihal:discuss fatima is this release ready?
/rihal:discuss what's the kill criterion for this project?If no agent named, the panel scorer picks the top match.
What makes Rihal different
Intent guards catch wrong commands
Run the wrong command and you get a single-line copy-paste redirect — not a useless output.
/rihal:plan should we use postgres or mongo?
⚠ That's a decision question, not a planning input.
Copy-paste this to ask the council instead:
/rihal:council should we use postgres or mongo?Every workflow has a Step 0.5 intent detector.
Multilingual — Roman Urdu + Arabic + English
The classifier recognizes dubai, affiliate, bnanai, karobar, site banana, دبئی, مارکیٹ, کاروبار and many more. Mariam leads for GCC/MENA market questions.
/rihal:council yar affiliate site bnanai hai dubai ma for quick bucks
→ panel: [mariam, hussain-pm, sadiq]Karpathy coding guidelines
4 behavioral principles from Andrej Karpathy's observations on LLM coding pitfalls, wired into every code-writing agent as hard constraints:
- Think before coding — surface assumptions, don't hide confusion
- Simplicity first — minimum code, no speculative abstractions
- Surgical changes — touch only what's needed, match existing style
- Goal-driven execution — define verifiable success criteria
Audit recent changes:
/rihal:karpathy-audit HEAD~5..HEAD
/rihal:karpathy-audit 03 --files=src/auth/Plan verification + post-execute gates
/rihal:plan runs rihal-plan-checker after the planner writes PLAN.md. On failure, loops back to planner with feedback (max 2 retries).
/rihal:execute runs rihal-integration-checker (cross-phase E2E) and rihal-nyquist-auditor (test coverage) after completion. Both append to SUMMARY.md.
Model profiles
/rihal:settings # interactive config- quality — opus/sonnet-4.6 for reasoning agents
- balanced — sonnet-4.6 across the board (default)
- budget — haiku-4.5 everywhere
- inherit — use parent session's model
Session handoff
/rihal:pause-work → writes .rihal/HANDOFF.json + .continue-here.md
/rihal:resume-work → reads HANDOFF, surfaces blocking constraintsWhat's new in v2-prototype
Recent additions in this session:
- 69 slash commands across 3 modes and 3 modules (up from 64)
- Numeric ID system — milestones (M1, M2), phases (01, 02, 02.1), plans (01.01, 02.03), tasks (01.01.01) with decimal insertion for urgent inserts
- Intent guards (
Step 0.5) — every workflow detects mismatched intent and redirects instead of failing - Plan-checker loop —
/rihal:plannow verifies file existence and symbol definitions; loops back to planner on validation failure - Post-execute gates —
/rihal:executeruns integration-checker (E2E) and nyquist-auditor (coverage) as hard gates - Multilingual classifier — Roman Urdu, Arabic, English with cultural signal routing (Mariam leads GCC/MENA)
- Karpathy guidelines enforcement — 4 coding principles baked into every code-writing agent
- Global agents — customize agents in
~/.rihal/agents/without forking the repo - Multi-IDE installer — support for Claude Code, Cursor, Gemini CLI
- Hooks system — opt-in pre-edit, pre-workflow, post-commit enforcement
- Session pause/resume —
/rihal:pause-work+/rihal:resume-workwith HANDOFF.json - Workspace isolation —
/rihal:new-workspacefor parallel tracks - Decimal phase insertion —
/rihal:insert-phasefor urgent mid-cycle work
Full command surface (69 commands)
Router + lifecycle
init · do · help · status · stats · health · forensics · update
Discovery + research
new-project · map-codebase · scan · explore · document-project · analyze-dependencies · discuss-phase-power
Planning
plan · chain · create-epics-and-stories · create-story · dev-story · sprint-planning · brainstorm
Execution
execute · quick · autonomous · audit-fix · undo · check-implementation-readiness
Observability + review
code-review · code-review-fix · review-adversarial · review-edge-case-hunter · karpathy-audit · secure-phase · show · why · rerun · diff
Recovery + correction
pause-work · resume-work · correct-course · next · config
Multi-agent modes
council · chain · discuss
Configuration + setup
settings · install · enable-hooks · profile-user
Lifecycle + phases
insert-phase · new-milestone · audit-milestone · complete-milestone · milestone-summary · new-workspace · list-workspaces · remove-workspace · workstream
Docs + notes + reporting
docs-update · note · report · session-report · add-todo · import · inbox
UI design
ui-phase · ui-review
Configuration
.rihal/config.yaml — edit directly or run /rihal:settings:
user_name: "Hanzla"
project_name: "your-project"
communication_language: "English" # or Urdu, Arabic, etc.
mode: "guided" # or yolo
model_profile: "balanced" # quality | balanced | budget | inherit
workflow:
research_by_default: false
plan_checker: true
post_execute_gates: true
ui_safety_gate: true
git:
branching_strategy: "none" # none | feature-branch | worktree-isolationState tracking
.rihal/state.json tracks everything:
current_phase,current_planphases[],executions[],decisions[],blockers[]council_sessions[],chains[]workstreams[],active_workstream,last_session
View formatted:
node .rihal/bin/rihal-tools.cjs state read
# or
/rihal:statusHooks (opt-in)
/rihal:enable-hooksInstalls 3 opt-in hooks into .claude/settings.json:
- pre-edit — enforces read-before-edit
- pre-workflow — soft intent warnings on mismatched commands
- post-commit — validates commit format, blocks AI attribution
Modules
| Module | Contents |
|---|---|
| core | 5 council agents, /rihal:council, /rihal:discuss, /rihal:status, /rihal:do, /rihal:help, state management |
| execution | Executor, planner, verifier + checker agents, /rihal:execute, /rihal:plan, /rihal:quick, /rihal:debug, /rihal:audit-fix, /rihal:undo |
| discovery | Codebase-mapper, project-researcher, roadmapper, /rihal:new-project, /rihal:map-codebase, /rihal:scan, /rihal:explore, /rihal:code-review, /rihal:docs-update |
Full install = all 3 modules = 201 files.
Testing
node --test test/*.cjs test/lib/*.cjs95 tests across 10 test files (8 compliance + 87 unit) verify:
- Every command has a matching workflow file
- Every agent has valid frontmatter + constraints
- Module manifests match installed files
- rihal-tools.cjs help matches implemented subcommands
- Panel scorer routes correctly across 10+ question types
- Classifier handles Roman Urdu + Arabic + edge cases
Why "Rihal"
رحّال (Rihāl) is Arabic for "traveler" — someone who journeys between places carrying knowledge. Rihal is also one of Oman's fastest-growing tech companies. The agent names are Arabic placeholders — swap them for your team in rihal/team.yaml.
Credits
- Karpathy coding guidelines adapted from forrestchang/andrej-karpathy-skills (MIT)
- File-shipping installer pattern inspired by the broader agent-skill ecosystem
License
MIT
Roadmap
See GitHub Issues for tracked work. Current branch: v2-prototype — under active development. Main branch will track stable releases.
This branch is pre-release. For production, wait for v0.2.0 on main.