@hanzlaa/rcode 3.6.14 → 3.6.16
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 +1 -1
- package/README.md +3 -3
- package/cli/index.js +5 -1
- package/cli/lib/manifest.cjs +51 -43
- package/dist/rcode.js +32 -35
- package/package.json +3 -2
- package/rihal/bin/rihal-tools.cjs +20 -0
- package/rihal/commands/add-todo.md +1 -1
- package/rihal/commands/check-implementation-readiness.md +18 -0
- package/rihal/commands/create-architecture.md +18 -0
- package/rihal/commands/debug.md +1 -1
- package/rihal/commands/edit-prd.md +18 -0
- package/rihal/commands/execute-milestone.md +2 -2
- package/rihal/commands/memory-audit.md +1 -1
- package/rihal/commands/memory-distill.md +1 -1
- package/rihal/commands/memory-init.md +1 -1
- package/rihal/commands/memory-update.md +1 -1
- package/rihal/commands/plan-milestone.md +2 -2
- package/rihal/commands/progress.md +1 -1
- package/rihal/commands/resume-work.md +1 -1
- package/rihal/commands/retrospective.md +18 -0
- package/rihal/commands/review-edge-case-hunter.md +18 -0
- package/rihal/commands/scaffold-milestone.md +2 -2
- package/rihal/commands/scaffold-project.md +18 -0
- package/rihal/commands/validate-prd.md +18 -0
- package/rihal/references/agent-contracts.md +46 -20
- package/rihal/references/model-profile-resolution.md +41 -5
- package/rihal/references/phase-argument-parsing.md +31 -7
- package/rihal/references/revision-loop.md +36 -9
- package/rihal/references/universal-anti-patterns.md +56 -12
- package/rihal/skills/SKILLS_INDEX.md +34 -5
- package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +1 -0
- package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +1 -0
- package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +1 -0
- package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +1 -0
- package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +1 -0
- package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/workflow.md +12 -0
- package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +1 -0
- package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +1 -0
- package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +1 -0
- package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +1 -0
- package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +3 -17
- package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-dev-story/workflow.md +13 -0
- package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-retrospective/workflow.md +12 -0
- package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +1 -0
- package/rihal/skills/actions/4-implementation/rihal-sprint-planning/workflow.md +12 -0
- package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +1 -0
- package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +1 -0
- package/rihal/skills/agents/dalil-scout/SKILL.md +1 -0
- package/rihal/skills/agents/fatima-qa/SKILL.md +1 -0
- package/rihal/skills/agents/haitham-frontend/SKILL.md +1 -0
- package/rihal/skills/agents/hanzla-engineer/SKILL.md +1 -0
- package/rihal/skills/agents/hussain-pm/SKILL.md +1 -0
- package/rihal/skills/agents/hussain-sm/SKILL.md +1 -0
- package/rihal/skills/agents/layla-designer/SKILL.md +1 -0
- package/rihal/skills/agents/majlis-council/SKILL.md +1 -0
- package/rihal/skills/agents/mariam-marketing/SKILL.md +1 -0
- package/rihal/skills/agents/nasser-eng-manager/SKILL.md +1 -0
- package/rihal/skills/agents/noor-writer/SKILL.md +1 -0
- package/rihal/skills/agents/raees-orchestrator/SKILL.md +1 -0
- package/rihal/skills/agents/rihal-cross-platform-auditor/SKILL.md +1 -0
- package/rihal/skills/agents/rihal-dep-auditor/SKILL.md +1 -0
- package/rihal/skills/agents/rihal-deviation-analyzer/SKILL.md +1 -0
- package/rihal/skills/agents/rihal-i18n-auditor/SKILL.md +1 -0
- package/rihal/skills/agents/rihal-observability-auditor/SKILL.md +1 -0
- package/rihal/skills/agents/sadiq-analyst/SKILL.md +1 -0
- package/rihal/skills/agents/waleed-architect/SKILL.md +1 -0
- package/rihal/skills/agents/yousef-backend/SKILL.md +1 -0
- package/rihal/skills/agents/zahra-branding/SKILL.md +1 -0
- package/rihal/skills/agents/zayd-ml/SKILL.md +1 -0
- package/rihal/skills/core/rihal-init/SKILL.md +1 -1
- package/rihal/skills/core/rihal-memory-audit/SKILL.md +5 -5
- package/rihal/skills/core/rihal-memory-distill/SKILL.md +5 -5
- package/rihal/skills/core/rihal-memory-init/SKILL.md +7 -7
- package/rihal/skills/core/rihal-memory-update/SKILL.md +4 -4
- package/rihal/team.yaml +56 -0
- package/rihal/templates/UAT.md +69 -18
- package/rihal/templates/memory/INDEX.md +2 -2
- package/rihal/templates/memory/distillates/project.distillate.md +2 -2
- package/rihal/templates/memory/distillates/stack.distillate.md +2 -2
- package/rihal/templates/memory/project/stack.md +1 -1
- package/rihal/templates/summary.md +54 -37
- package/rihal/templates/verification-report.md +72 -17
- package/rihal/workflows/autonomous.md +2 -2
- package/rihal/workflows/create-prd.md +1 -1
- package/rihal/workflows/diagnose-issues.md +75 -22
- package/rihal/workflows/discuss-phase.md +1 -1
- package/rihal/workflows/edit-prd.md +1 -1
- package/rihal/workflows/health.md +6 -6
- package/rihal/workflows/help.md +0 -1
- package/rihal/workflows/memory-audit.md +2 -2
- package/rihal/workflows/memory-distill.md +2 -2
- package/rihal/workflows/memory-init.md +2 -2
- package/rihal/workflows/memory-update.md +2 -2
- package/rihal/workflows/research-phase.md +1 -1
- package/rihal/workflows/scaffold-project.md +1 -1
- package/rihal/workflows/validate-prd.md +2 -2
- package/rihal/workflows/verify-work.md +1 -1
- package/server/lib/html/client/components/App.js +56 -19
- package/server/lib/html/client/components/Sidebar.js +13 -0
- package/server/lib/html/client/components/Topbar.js +6 -3
- package/server/lib/html/client/store.js +30 -0
- package/server/lib/html/client/util.js +0 -10
- package/server/lib/html/client/views/FilesView.js +4 -1
- package/server/lib/html/client/views/KanbanView.js +15 -4
- package/server/lib/html/client/views/MemoryView.js +6 -6
- package/server/lib/html/client/views/OrchestrationView.js +12 -2
- package/server/lib/html/client/views/OverviewView.js +44 -4
- package/server/lib/html/client.js +7 -0
- package/server/lib/html/css.js +16 -0
- package/server/lib/scanner.js +7 -2
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
# Agent Contracts
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
Every Rihal agent and skill operates under a contract that defines what it consumes, what it produces, and what guarantees it offers. Workflows depend on these contracts being honoured — if an agent silently broadens or narrows its contract, the orchestrator's assumptions break.
|
|
4
|
+
|
|
5
|
+
## The contract has 5 parts
|
|
6
|
+
|
|
7
|
+
1. **Inputs** — what the orchestrator passes to the agent at spawn time. Examples: phase number, sprint id, story file path, council question, file glob.
|
|
8
|
+
2. **Outputs** — concrete artifacts produced. Always file paths or structured JSON, never free-form prose. Examples: `SUMMARY.md`, `RESEARCH.md`, a `state.json` mutation, a JSON object on stdout.
|
|
9
|
+
3. **Side effects** — what the agent writes outside its primary output. Examples: state.json upserts, .planning/ artifacts, decisions log entries.
|
|
10
|
+
4. **Halt conditions** — when the agent stops and returns control. Examples: menu reached, user input required, blocker detected, budget exhausted.
|
|
11
|
+
5. **Failure modes** — what the agent does on error. Always: partial output is preserved, error is reported with a fix command, exit code is non-zero.
|
|
12
|
+
|
|
13
|
+
## Contract enforcement
|
|
14
|
+
|
|
15
|
+
- Every agent's `.md` file declares its inputs/outputs in the frontmatter or opening section.
|
|
16
|
+
- Workflows that spawn agents pass exactly the declared inputs — no more, no less.
|
|
17
|
+
- Orchestrators verify the declared outputs after the agent returns. Missing output = run failed, regardless of what the agent says.
|
|
18
|
+
- Side-effect changes (state.json, .planning/) are validated against `_shared/state-sync-rule.md`.
|
|
19
|
+
|
|
20
|
+
## Why this matters
|
|
21
|
+
|
|
22
|
+
Without contracts, agents drift. An agent originally designed to "read code and produce SUMMARY.md" starts also writing decisions and modifying state.json. The next workflow that spawns it makes assumptions that no longer hold. Cascading silent breakage.
|
|
23
|
+
|
|
24
|
+
The contract is the API. Treat agents like network services that happen to run in-process.
|
|
25
|
+
|
|
26
|
+
## When you write a new agent
|
|
27
|
+
|
|
28
|
+
Open with a contract block:
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
---
|
|
32
|
+
name: rihal-foo
|
|
33
|
+
inputs:
|
|
34
|
+
- phase: NN
|
|
35
|
+
- story_path: .planning/phases/NN/story-X.md
|
|
36
|
+
outputs:
|
|
37
|
+
- .planning/phases/NN/story-X-SUMMARY.md
|
|
38
|
+
side_effects:
|
|
39
|
+
- state.phases[N].stories[X].status: completed
|
|
40
|
+
halt_conditions:
|
|
41
|
+
- acceptance criteria not measurable
|
|
42
|
+
- user-input required for design decision
|
|
43
|
+
on_failure:
|
|
44
|
+
- emit FAILURE.md with diagnostic + suggested fix command
|
|
45
|
+
---
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If your agent doesn't fit a contract, the agent is too broad — split it.
|
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
# Model Profile Resolution
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<role>`, which reads `.rihal/config.yaml` `model_profile` and returns the
|
|
5
|
-
concrete model id for that role per `rihal/config/model-profiles.json`.
|
|
3
|
+
Rihal Code lets each project pick a `model_profile` in `.rihal/config.yaml`. The profile decides which Claude model each spawned agent uses.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
## Profiles
|
|
6
|
+
|
|
7
|
+
| Profile | When to pick | Model assignment |
|
|
8
|
+
|---------|--------------|------------------|
|
|
9
|
+
| `quality` | Critical milestone, hard problem, high blast radius | Most agents → Opus; tactical sub-agents → Sonnet |
|
|
10
|
+
| `balanced` *(default)* | Day-to-day work | Most agents → Sonnet; orchestrators → Opus; trivial helpers → Haiku |
|
|
11
|
+
| `budget` | Exploration, low-stakes prototyping, cost-sensitive | Most agents → Haiku; only orchestrators → Sonnet |
|
|
12
|
+
| `inherit` | Use whatever model the calling Claude Code session is on | All agents → session model |
|
|
13
|
+
|
|
14
|
+
## Resolution order
|
|
15
|
+
|
|
16
|
+
When a workflow spawns an agent:
|
|
17
|
+
|
|
18
|
+
1. **Per-agent override** — if the agent's `.md` frontmatter has `model: <name>`, use that.
|
|
19
|
+
2. **Profile mapping** — look up the agent role (strategic / technical / tactical / quality) in the active profile's table.
|
|
20
|
+
3. **Project profile** — read `model_profile` from `.rihal/config.yaml`.
|
|
21
|
+
4. **Global profile** — fall back to `~/.rihal-code/defaults.json` if the project doesn't specify.
|
|
22
|
+
5. **Hard default** — `balanced`.
|
|
23
|
+
|
|
24
|
+
## Model names referenced
|
|
25
|
+
|
|
26
|
+
- **Claude Opus 4.7** (`claude-opus-4-7`) — strongest reasoning. Use for orchestration, council moderation, hard architecture calls.
|
|
27
|
+
- **Claude Sonnet 4.6** (`claude-sonnet-4-6`) — balanced. Default for most agents.
|
|
28
|
+
- **Claude Haiku 4.5** (`claude-haiku-4-5-20251001`) — fast + cheap. Use for tactical helpers (file walkers, simple transforms).
|
|
29
|
+
|
|
30
|
+
When using the Anthropic API directly, defaults to the latest available model in each tier.
|
|
31
|
+
|
|
32
|
+
## Override at invocation
|
|
33
|
+
|
|
34
|
+
Per-invocation override:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
RIHAL_MODEL_PROFILE=quality /rihal:execute-phase 04
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Survives the session, doesn't persist to config.
|
|
41
|
+
|
|
42
|
+
## Why profiles exist
|
|
43
|
+
|
|
44
|
+
Cost vs quality is a real tradeoff. A retrospective doesn't need Opus. A council on a strategic decision shouldn't run on Haiku. Letting users pick a profile per-project means they don't have to reason about model selection per-agent.
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
# Phase Argument Parsing
|
|
2
2
|
|
|
3
|
-
Workflows
|
|
3
|
+
Workflows that take a phase argument (`/rihal:plan 04`, `/rihal:execute-phase 999.5`, `/rihal:research-phase 12`) all use the same parsing rules.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
`node .rihal/bin/rihal-tools.cjs init phase-op "$ARG"` to the matching
|
|
7
|
-
phase directory under `.planning/phases/`.
|
|
8
|
-
- **Path**: a direct `.planning/phases/<slug>/PLAN.md` path — used as-is.
|
|
5
|
+
## Accepted forms
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
| Input | Resolves to | Notes |
|
|
8
|
+
|-------|-------------|-------|
|
|
9
|
+
| `04` | Phase 04 | Zero-padded NN |
|
|
10
|
+
| `4` | Phase 04 | Auto-pads |
|
|
11
|
+
| `999.5` | Decimal parking-lot phase 999.5 | See `docs/parking-lot-convention.md` |
|
|
12
|
+
| `04.1` | Sub-phase 04.1 | Inserted-phase / urgent work |
|
|
13
|
+
| `current` | The phase currently in `state.current_phase` | Useful when looping |
|
|
14
|
+
| `next` | The next planned phase after current | Looks at ROADMAP.md ordering |
|
|
15
|
+
| (empty) | Same as `current` if state has one; else error | Most workflows refuse empty |
|
|
16
|
+
|
|
17
|
+
## Resolution
|
|
18
|
+
|
|
19
|
+
1. Strip whitespace.
|
|
20
|
+
2. Match against the patterns above (regex per row).
|
|
21
|
+
3. Look up the resolved number in `state.phases[]`.
|
|
22
|
+
4. If not found, fall back to looking on disk under `.planning/phases/<NN>-*/`.
|
|
23
|
+
5. If neither, exit non-zero with: `Phase X not found. Run /rihal:status to list known phases.`
|
|
24
|
+
|
|
25
|
+
## Strict vs lenient
|
|
26
|
+
|
|
27
|
+
Workflows pass `--strict` if a missing phase should hard-fail rather than offering to create. By default, planning workflows ask "Phase X doesn't exist — create it now?" before erroring. Execution workflows hard-fail because executing a phase that doesn't exist is always a bug.
|
|
28
|
+
|
|
29
|
+
## Error messages
|
|
30
|
+
|
|
31
|
+
Always include the resolved (or attempted-resolve) value in the error. Never just say "phase not found" — say "Phase 12 not found in state.json (3 phases registered: 04, 05, 999.5)".
|
|
32
|
+
|
|
33
|
+
## Multi-phase invocations
|
|
34
|
+
|
|
35
|
+
Some workflows accept `04..06` to operate on a range, or `04 05 06` as space-separated. Each gets parsed by the rules above; the workflow operates on the resolved set in roadmap order.
|
|
@@ -1,11 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Revision Loop
|
|
2
2
|
|
|
3
|
-
When
|
|
4
|
-
runs the rihal-sprint-checker after the planner. Findings drive a bounded
|
|
5
|
-
revision loop:
|
|
3
|
+
When a plan is reviewed (by `rihal-plan-checker`, by a council, or by the user) and the verdict is "needs changes", the planner must run the revision loop — not silently accept the feedback and move on.
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
## The loop
|
|
6
|
+
|
|
7
|
+
1. **Receive feedback.** Capture every reviewer concern as a structured list:
|
|
8
|
+
- Source (which reviewer / agent / user)
|
|
9
|
+
- Concern (one-sentence summary)
|
|
10
|
+
- Suggested change (if any)
|
|
11
|
+
- Severity (blocker / warning / suggestion)
|
|
12
|
+
|
|
13
|
+
2. **Triage.** For each concern, classify:
|
|
14
|
+
- **Accept** — change the plan as suggested.
|
|
15
|
+
- **Counter** — disagree, document why, keep original plan.
|
|
16
|
+
- **Defer** — out of scope for this phase; file as follow-up.
|
|
17
|
+
|
|
18
|
+
3. **Apply.** Make the accepted changes to PLAN.md. Mark the diff in a "Revision N" section so reviewers can see what changed.
|
|
19
|
+
|
|
20
|
+
4. **Re-circulate.** Send the revised plan back to the reviewer that surfaced the blocker. If a council reviewed, send to the same panel.
|
|
21
|
+
|
|
22
|
+
5. **Iterate or proceed.**
|
|
23
|
+
- All blockers resolved → proceed to execute.
|
|
24
|
+
- Any blocker still standing → either escalate (to user) or stop the phase.
|
|
25
|
+
|
|
26
|
+
## Loop bound
|
|
27
|
+
|
|
28
|
+
Three revisions is the soft cap. If a plan needs four revisions, the underlying disagreement isn't about the plan — it's about scope, requirements, or strategy. Halt the loop, run `/rihal:discuss-phase` or `/rihal:council` to resolve the upstream disagreement, then start a fresh plan.
|
|
29
|
+
|
|
30
|
+
## What never happens
|
|
31
|
+
|
|
32
|
+
- Silent acceptance. If a concern is rejected ("counter"), it's documented with a reason in the PLAN.md revision history.
|
|
33
|
+
- Blanket revisions. Each round addresses specific concerns from specific reviewers. Don't bundle "various improvements" into a single revision.
|
|
34
|
+
- Skipping the loop because the planner thinks they know better. The loop exists because reviewers catch what planners miss.
|
|
35
|
+
|
|
36
|
+
## Output of the loop
|
|
37
|
+
|
|
38
|
+
A PLAN.md with a "Revision history" section showing each round, what changed, and who signed off. This becomes the audit trail when the phase ships and someone asks "why did we build it this way?"
|
|
@@ -1,15 +1,59 @@
|
|
|
1
|
-
# Universal Anti-Patterns
|
|
1
|
+
# Universal Anti-Patterns
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Patterns that show up across every Rihal project. When a planning workflow surfaces these, halt and discuss before proceeding — they're cheap to fix during planning, expensive to fix after execution.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
are explicit.
|
|
7
|
-
- **Hidden binary choice**: presenting a "decision" that has only one
|
|
8
|
-
viable option.
|
|
9
|
-
- **Unowned action**: a "we should X" with no owner or deadline.
|
|
10
|
-
- **Sunk-cost continuation**: defending an existing plan instead of
|
|
11
|
-
evaluating fresh evidence.
|
|
12
|
-
- **Scope inflation**: bundling new work into the current decision.
|
|
5
|
+
## Scope anti-patterns
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
### "While we're at it…"
|
|
8
|
+
Phase plan picks up scope adjacent to the actual goal. Symptom: phase description starts with the real goal but acceptance criteria reference 3 unrelated files. Fix: spin the side-scope into its own phase, even if it's a 1-day phase. Linear roadmaps are easier to verify than tangled ones.
|
|
9
|
+
|
|
10
|
+
### Implicit prerequisites
|
|
11
|
+
Phase assumes another phase has shipped without declaring the dependency. Symptom: plan refers to a file or table that doesn't exist yet. Fix: surface the dependency in the phase's `Depends on` line in ROADMAP.md.
|
|
12
|
+
|
|
13
|
+
### Vague acceptance
|
|
14
|
+
Acceptance criterion is "users can do X" with no measurable threshold. Fix: make every acceptance criterion observable from outside the system — a CLI command, an API response, a log line, a UI assertion.
|
|
15
|
+
|
|
16
|
+
## Estimation anti-patterns
|
|
17
|
+
|
|
18
|
+
### Round-number capacity
|
|
19
|
+
Sprint commits to "30 points this week" because that's what last week was. No data-backed velocity. Fix: use 80% of the trailing 3-sprint average, never a round number.
|
|
20
|
+
|
|
21
|
+
### Hidden multitasking
|
|
22
|
+
Phase plan assumes the dev works on it full-time when in reality they're also on-call, in interviews, and at standups. Fix: explicit `effective_dev_hours` field in sprint capacity.
|
|
23
|
+
|
|
24
|
+
## Decision anti-patterns
|
|
25
|
+
|
|
26
|
+
### Reversible vs irreversible confusion
|
|
27
|
+
Treating reversible decisions (CSS framework choice) like irreversible ones (database engine), and vice versa. Fix: tag every recorded decision with `reversibility: reversible | one-way | nuanced`.
|
|
28
|
+
|
|
29
|
+
### Council asked, council ignored
|
|
30
|
+
Council session produces a clear recommendation, the team builds the rejected option anyway. Fix: if you reject a council recommendation, explicitly log the override in `state.decisions[]` with `override_council: <session-id>` so the disagreement is searchable later.
|
|
31
|
+
|
|
32
|
+
## Implementation anti-patterns
|
|
33
|
+
|
|
34
|
+
### Defensive code for impossible states
|
|
35
|
+
Adding null checks, fallbacks, and validation for inputs that can never occur in this code path. Fix: trust internal contracts. Validate at system boundaries (user input, network, FS), not internally.
|
|
36
|
+
|
|
37
|
+
### "Just in case" abstractions
|
|
38
|
+
Building a generic helper because someday three callers might need it, when right now there's one. Fix: three concrete callers first, then extract.
|
|
39
|
+
|
|
40
|
+
### Comments that explain what
|
|
41
|
+
"// increment counter by 1" — the code says that. Fix: comments only for *why* (hidden constraint, surprising behaviour, workaround for specific bug, invariant that's not obvious from reading).
|
|
42
|
+
|
|
43
|
+
### Silent failures
|
|
44
|
+
`try { ... } catch { /* ignore */ }`. Fix: every catch block has either a logged warning, a metric increment, or a re-throw. Never bare empty catches.
|
|
45
|
+
|
|
46
|
+
## Process anti-patterns
|
|
47
|
+
|
|
48
|
+
### Half-merged migrations
|
|
49
|
+
Old code path and new code path both running in production "for safety". Fix: complete migrations within one phase. Both paths existing forever doubles the maintenance burden.
|
|
50
|
+
|
|
51
|
+
### Documentation that ages out silently
|
|
52
|
+
README written once, never updated. Code drifts. README lies. Fix: documentation that references specific files / functions includes a sentinel marker; CI fails if the docs reference paths that no longer exist.
|
|
53
|
+
|
|
54
|
+
### "We'll fix it in v2"
|
|
55
|
+
Known broken behaviour that ships anyway because the deadline. Fix: the phase doesn't ship if known-broken behaviour reaches users. Cut the broken feature, don't ship it broken.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
When a phase plan or sprint hits any of these patterns during discussion, halt. Surface it explicitly. Adjust before execution starts. The cost compounds.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Rihal Code — Skills Index
|
|
2
2
|
|
|
3
|
-
All
|
|
3
|
+
All 85 skills in Rihal Code, organized by category: 23 agent skills, 37 action skills, 25 core skills, plus 2 shared modules.
|
|
4
4
|
|
|
5
|
-
## Agent Skills (
|
|
5
|
+
## Agent Skills (23)
|
|
6
6
|
|
|
7
7
|
Each agent has a persona, principles, and a capabilities table that lists which action skills it can invoke.
|
|
8
8
|
|
|
@@ -25,12 +25,18 @@ Each agent has a persona, principles, and a capabilities table that lists which
|
|
|
25
25
|
| **Zayd** | زيد | Senior ML Engineer | `agents/zayd-ml/` |
|
|
26
26
|
| **Raees** | رئيس | Orchestrator | `agents/raees-orchestrator/` |
|
|
27
27
|
| **Majlis** | مجلس | Multi-Agent Council | `agents/majlis-council/` |
|
|
28
|
+
| **Dalil** | دليل | Codebase Scout | `agents/dalil-scout/` |
|
|
29
|
+
| **Cross-Platform Auditor** | — | Cross-Platform Auditor | `agents/rihal-cross-platform-auditor/` |
|
|
30
|
+
| **Dep Auditor** | — | Dependency Health Auditor | `agents/rihal-dep-auditor/` |
|
|
31
|
+
| **Deviation Analyzer** | — | Deviation Analyzer | `agents/rihal-deviation-analyzer/` |
|
|
32
|
+
| **i18n Auditor** | — | i18n / L10n Auditor | `agents/rihal-i18n-auditor/` |
|
|
33
|
+
| **Observability Auditor** | — | Observability Auditor | `agents/rihal-observability-auditor/` |
|
|
28
34
|
|
|
29
35
|
Note: Hussain has two hats — **PM** (strategic product management) and **SM** (scrum master / sprint ops). Real teams often combine these.
|
|
30
36
|
|
|
31
37
|
---
|
|
32
38
|
|
|
33
|
-
## Action Skills (
|
|
39
|
+
## Action Skills (37)
|
|
34
40
|
|
|
35
41
|
Invoked by agents via the capabilities table in their SKILL.md. Organized by SDLC phase.
|
|
36
42
|
|
|
@@ -57,7 +63,7 @@ Invoked by agents via the capabilities table in their SKILL.md. Organized by SDL
|
|
|
57
63
|
- `actions/3-solutioning/rihal-check-implementation-readiness` — verify PRD/UX/arch alignment
|
|
58
64
|
- `actions/3-solutioning/rihal-generate-project-context` — generate project-context.md
|
|
59
65
|
|
|
60
|
-
### 4 — Implementation (
|
|
66
|
+
### 4 — Implementation (20)
|
|
61
67
|
- `actions/4-implementation/rihal-dev-story` — execute a story (write tests + code)
|
|
62
68
|
- `actions/4-implementation/rihal-code-review` — comprehensive code review
|
|
63
69
|
- `actions/4-implementation/rihal-qa-generate-e2e-tests` — generate e2e test suite
|
|
@@ -67,10 +73,21 @@ Invoked by agents via the capabilities table in their SKILL.md. Organized by SDL
|
|
|
67
73
|
- `actions/4-implementation/rihal-correct-course` — course-correction for off-track stories
|
|
68
74
|
- `actions/4-implementation/rihal-scaffold-project` — scaffold new project from Rihal template
|
|
69
75
|
- `actions/4-implementation/rihal-checkpoint-preview` — LLM-assisted human-in-the-loop review
|
|
76
|
+
- `actions/4-implementation/rihal-browser-verify` — verify browser behaviour via Chrome DevTools MCP
|
|
77
|
+
- `actions/4-implementation/rihal-ci` — CI/CD setup and quality gates
|
|
78
|
+
- `actions/4-implementation/rihal-debug` — root-cause debugging via the scientific method
|
|
79
|
+
- `actions/4-implementation/rihal-git-flow` — branching, commits, conflicts, parallel work
|
|
80
|
+
- `actions/4-implementation/rihal-harden` — security hardening checklist for SaaS apps
|
|
81
|
+
- `actions/4-implementation/rihal-incremental` — ship code in small, atomic, verifiable steps
|
|
82
|
+
- `actions/4-implementation/rihal-migrate` — move from MVP to production-grade infrastructure
|
|
83
|
+
- `actions/4-implementation/rihal-perf` — performance optimisation (LCP / TBT / CLS / hydration)
|
|
84
|
+
- `actions/4-implementation/rihal-prove-it` — test-first development
|
|
85
|
+
- `actions/4-implementation/rihal-source-truth` — cite official docs before writing framework code
|
|
86
|
+
- `actions/4-implementation/rihal-trim` — code simplification
|
|
70
87
|
|
|
71
88
|
---
|
|
72
89
|
|
|
73
|
-
## Core Skills (
|
|
90
|
+
## Core Skills (25)
|
|
74
91
|
|
|
75
92
|
Shared utilities used across agents and workflows.
|
|
76
93
|
|
|
@@ -87,6 +104,18 @@ Shared utilities used across agents and workflows.
|
|
|
87
104
|
- `core/rihal-review-adversarial-general` — adversarial review for robustness
|
|
88
105
|
- `core/rihal-review-edge-case-hunter` — edge case hunting and boundary testing
|
|
89
106
|
- `core/rihal-party-mode` — multi-agent collaboration mode
|
|
107
|
+
- `core/rihal-auth-audit` — audit Keycloak ↔ AD sync, JWT validation, tenant isolation
|
|
108
|
+
- `core/rihal-client-gate` — client requirement freeze gates and async-comm patterns
|
|
109
|
+
- `core/rihal-deploy-unify` — detect and unify multiple deployment paths
|
|
110
|
+
- `core/rihal-incident-record` — generate a change record + post-mortem
|
|
111
|
+
- `core/rihal-memory-init` — bootstrap the Memory Bank for a project
|
|
112
|
+
- `core/rihal-memory-update` — surgical update of specific Memory Bank files
|
|
113
|
+
- `core/rihal-memory-audit` — audit the Memory Bank for stale entries and contradictions
|
|
114
|
+
- `core/rihal-memory-distill` — regenerate token-optimised Memory Bank distillates
|
|
115
|
+
- `core/rihal-mvp-graduate` — move an MVP to production-grade infrastructure incrementally
|
|
116
|
+
- `core/rihal-ocr-consistency` — OCR pipeline determinism + ground-truth validation
|
|
117
|
+
- `core/rihal-rebrand` — stack-wide rebranding migration
|
|
118
|
+
- `core/rihal-theme-system` — audit a frontend's design tokens before launch
|
|
90
119
|
|
|
91
120
|
---
|
|
92
121
|
|
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
**Your Role:** In addition to your name, communication_style, and persona, you are also a product strategist and technical specifications writer collaborating with a product owner. This is a partnership, not a client-vendor relationship. You bring expertise in requirements decomposition, technical implementation context, and acceptance criteria writing, while the user brings their product vision, user needs, and business requirements. Work together as equals.
|
|
6
6
|
|
|
7
|
+
## State-sync rule (NO EXCEPTIONS)
|
|
8
|
+
|
|
9
|
+
After this workflow writes any `.planning/` artifact (ROADMAP.md, epics.md, sprint-*.md, SUMMARY.md, etc.) or updates phase/story status:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
node .rihal/bin/rihal-tools.cjs state sync --from-disk
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This keeps `.rihal/state.json` in sync with disk — `/rihal:progress`, `/rihal:status`, and `/rihal:execute` all read state.json. Skipping the sync silently drifts them. See `../../_shared/state-sync-rule.md`.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
7
19
|
---
|
|
8
20
|
|
|
9
21
|
## WORKFLOW ARCHITECTURE
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rihal-debug
|
|
3
|
-
description:
|
|
3
|
+
description: Scientific-method debugging: investigate first, test hypotheses, escalate at 3 failures.
|
|
4
4
|
triggers:
|
|
5
5
|
# English
|
|
6
6
|
- "debug this"
|
|
@@ -31,7 +31,6 @@ user-invocable: false
|
|
|
31
31
|
---
|
|
32
32
|
@.rihal/references/karpathy-guidelines.md
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
## The Iron Law
|
|
36
35
|
|
|
37
36
|
```
|
|
@@ -45,7 +44,6 @@ If you have not completed Phase 1, you cannot propose a fix. "It seems to work"
|
|
|
45
44
|
Debugging is investigation, not pattern-matching. Each iteration narrows the problem space — never widens it. The skill enforces a written hypothesis, an experiment that distinguishes "yes" from "no", and a captured observation. Random fixes are not allowed — the bug must be understood before the fix is written.
|
|
46
45
|
|
|
47
46
|
## Workflow
|
|
48
|
-
|
|
49
47
|
## Phase 1 — Root Cause Investigation
|
|
50
48
|
|
|
51
49
|
**BEFORE attempting ANY fix:**
|
|
@@ -137,7 +135,6 @@ If the project has Sentry (`@sentry/*` in `package.json` or `sentry-sdk` in Pyth
|
|
|
137
135
|
- Read breadcrumbs for the chain of events leading to the error
|
|
138
136
|
- Check "first seen / last seen" — recurring or one-off matters
|
|
139
137
|
- Cross-reference with deployment timestamps to identify regressions
|
|
140
|
-
|
|
141
138
|
## Red Flags — STOP and return to Phase 1
|
|
142
139
|
|
|
143
140
|
If you catch yourself thinking any of these:
|
|
@@ -153,17 +150,6 @@ If you catch yourself thinking any of these:
|
|
|
153
150
|
|
|
154
151
|
**ALL of these mean: STOP. Return to Phase 1.**
|
|
155
152
|
|
|
156
|
-
## Common Rationalizations
|
|
157
|
-
|
|
158
|
-
| Excuse | Reality |
|
|
159
|
-
|--------|---------|
|
|
160
|
-
| "Issue is simple, don't need process" | Simple bugs have root causes too. Process is fast for simple bugs. |
|
|
161
|
-
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
|
|
162
|
-
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
|
|
163
|
-
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
|
|
164
|
-
| "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
|
|
165
|
-
| "One more fix attempt" (after 2+) | 3+ failures = architectural problem. Escalate, don't fix again. |
|
|
166
|
-
|
|
167
153
|
## Output Format
|
|
168
154
|
|
|
169
155
|
```
|
|
@@ -209,5 +195,5 @@ Do NOT include: "tried X and it seems to work" · speculative "maybe it's cachin
|
|
|
209
195
|
|
|
210
196
|
## Memory Bank Hooks
|
|
211
197
|
|
|
212
|
-
- **Reads:**
|
|
213
|
-
- **Writes:** append
|
|
198
|
+
- **Reads:** `known-issues.md`, `stack.md`
|
|
199
|
+
- **Writes:** append to `post-mortems/YYYYMMDD-<slug>.md`; remove from `known-issues.md` once fixed in production
|