@hanzlaa/rcode 3.4.30 → 3.4.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/CONTRIBUTING.md +21 -0
  4. package/cli/agent.js +56 -0
  5. package/cli/generate-command-skills.cjs +21 -20
  6. package/cli/index.js +4 -0
  7. package/dist/rcode.js +43 -0
  8. package/package.json +1 -1
  9. package/rihal/agents/rihal-advisor-researcher.md +2 -25
  10. package/rihal/agents/rihal-ahmed.md +0 -57
  11. package/rihal/agents/rihal-assumptions-analyzer.md +1 -69
  12. package/rihal/agents/rihal-code-fixer.md +3 -66
  13. package/rihal/agents/rihal-code-reviewer.md +3 -66
  14. package/rihal/agents/rihal-codebase-mapper.md +1 -167
  15. package/rihal/agents/rihal-debugger.md +1 -104
  16. package/rihal/agents/rihal-docs-auditor.md +3 -12
  17. package/rihal/agents/rihal-edge-case-hunter.md +7 -33
  18. package/rihal/agents/rihal-executor.md +1 -98
  19. package/rihal/agents/rihal-fatima.md +0 -62
  20. package/rihal/agents/rihal-haitham.md +11 -55
  21. package/rihal/agents/rihal-hanzla.md +0 -60
  22. package/rihal/agents/rihal-hussain-pm.md +0 -65
  23. package/rihal/agents/rihal-integration-checker.md +1 -396
  24. package/rihal/agents/rihal-layla.md +0 -48
  25. package/rihal/agents/rihal-mariam.md +0 -54
  26. package/rihal/agents/rihal-nasser.md +0 -48
  27. package/rihal/agents/rihal-noor.md +0 -51
  28. package/rihal/agents/rihal-nyquist-auditor.md +1 -7
  29. package/rihal/agents/rihal-omar.md +6 -48
  30. package/rihal/agents/rihal-phase-researcher.md +6 -39
  31. package/rihal/agents/rihal-planner.md +1 -208
  32. package/rihal/agents/rihal-profiler.md +5 -24
  33. package/rihal/agents/rihal-project-researcher.md +2 -36
  34. package/rihal/agents/rihal-remediation-planner.md +3 -70
  35. package/rihal/agents/rihal-research-synthesizer.md +1 -210
  36. package/rihal/agents/rihal-roadmapper.md +2 -74
  37. package/rihal/agents/rihal-sadiq.md +0 -55
  38. package/rihal/agents/rihal-security-adversary.md +10 -39
  39. package/rihal/agents/rihal-security-auditor.md +7 -29
  40. package/rihal/agents/rihal-sprint-checker.md +1 -118
  41. package/rihal/agents/rihal-ui-auditor.md +10 -34
  42. package/rihal/agents/rihal-ux-designer.md +3 -69
  43. package/rihal/agents/rihal-verifier.md +1 -85
  44. package/rihal/agents/rihal-waleed.md +0 -56
  45. package/rihal/agents/rihal-yousef.md +9 -49
  46. package/rihal/bin/rihal-tools.cjs +129 -2
  47. package/rihal/references/REFERENCES_INDEX.md +67 -0
  48. package/rihal/references/assumptions-analyzer-playbook.md +82 -0
  49. package/rihal/references/auditor-shared-checklists.md +91 -0
  50. package/rihal/references/code-fixer-playbook.md +71 -0
  51. package/rihal/references/code-reviewer-playbook.md +71 -0
  52. package/rihal/references/codebase-mapping-process.md +176 -0
  53. package/rihal/references/debugger-playbook.md +127 -0
  54. package/rihal/references/executor-playbook.md +119 -0
  55. package/rihal/references/integration-verification-playbook.md +392 -0
  56. package/rihal/references/persona-engineer-shared.md +61 -0
  57. package/rihal/references/phase-id-conventions.md +101 -0
  58. package/rihal/references/planner-playbook.md +217 -0
  59. package/rihal/references/remediation-planner-playbook.md +75 -0
  60. package/rihal/references/research-synthesis-playbook.md +205 -0
  61. package/rihal/references/researcher-shared.md +87 -0
  62. package/rihal/references/roadmapper-playbook.md +82 -0
  63. package/rihal/references/sprint-checker-playbook.md +128 -0
  64. package/rihal/references/ux-designer-playbook.md +74 -0
  65. package/rihal/references/verifier-playbook.md +104 -0
  66. package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +1 -0
  67. package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +1 -0
  68. package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +1 -0
  69. package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +1 -0
  70. package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +1 -0
  71. package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +1 -0
  72. package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +1 -0
  73. package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +1 -0
  74. package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +1 -0
  75. package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +1 -0
  76. package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +1 -0
  77. package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +1 -0
  78. package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +1 -0
  79. package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +1 -0
  80. package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +1 -0
  81. package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +1 -0
  82. package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +1 -0
  83. package/rihal/skills/actions/4-implementation/rihal-browser-verify/SKILL.md +1 -0
  84. package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -0
  85. package/rihal/skills/actions/4-implementation/rihal-ci/SKILL.md +1 -0
  86. package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +1 -0
  87. package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +1 -0
  88. package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +1 -0
  89. package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +1 -0
  90. package/rihal/skills/actions/4-implementation/rihal-git-flow/SKILL.md +1 -0
  91. package/rihal/skills/actions/4-implementation/rihal-harden/SKILL.md +1 -0
  92. package/rihal/skills/actions/4-implementation/rihal-incremental/SKILL.md +1 -0
  93. package/rihal/skills/actions/4-implementation/rihal-migrate/SKILL.md +1 -0
  94. package/rihal/skills/actions/4-implementation/rihal-perf/SKILL.md +1 -0
  95. package/rihal/skills/actions/4-implementation/rihal-prove-it/SKILL.md +1 -0
  96. package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +1 -0
  97. package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +1 -0
  98. package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +1 -0
  99. package/rihal/skills/actions/4-implementation/rihal-source-truth/SKILL.md +1 -0
  100. package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +1 -0
  101. package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +1 -0
  102. package/rihal/skills/actions/4-implementation/rihal-trim/SKILL.md +1 -0
  103. package/rihal/workflows/add-phase.md +37 -0
  104. package/rihal/workflows/status.md +19 -0
@@ -0,0 +1,128 @@
1
+ # Sprint Checker Playbook
2
+
3
+ Loaded by `rihal-sprint-checker` via `@-include`. Contains the full
4
+ verification methodology: project context loading, upstream input
5
+ handling, core verification principle, 12 verification dimensions,
6
+ execution steps, mandatory output markers, and constraints.
7
+
8
+ CRITICAL: The "Mandatory output markers" section is load-bearing.
9
+ The orchestrator malfunction guard checks for `issues:` and
10
+ `verified_files:` YAML blocks in every agent return. Copy this
11
+ section verbatim — no reformatting.
12
+
13
+ <project_context>
14
+ Before verifying, discover project context:
15
+
16
+ **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
17
+
18
+ **Project skills:** Check `.agent/skills/` or `.agents/skills/` directory if either exists:
19
+ 1. List available skills (subdirectories)
20
+ 2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
21
+ 3. Load specific `rules/*.md` files as needed during verification
22
+ 4.
23
+ 5. Verify sprints account for project skill patterns
24
+
25
+ This ensures verification checks that sprints follow project-specific conventions.
26
+ </project_context>
27
+
28
+ <upstream_input>
29
+ **CONTEXT.md** (if exists) — User decisions from `/rihal-discuss-phase`
30
+
31
+ | Section | How You Use It |
32
+ |---------|----------------|
33
+ | `## Decisions` | LOCKED — sprints MUST implement these exactly. Flag if contradicted. |
34
+ | `## the agent's Discretion` | Freedom areas — planner can choose approach, don't flag. |
35
+ | `## Deferred Ideas` | Out of scope — sprints must NOT include these. Flag if present. |
36
+
37
+ If CONTEXT.md exists, add verification dimension: **Context Compliance**
38
+ - Do sprints honor locked decisions?
39
+ - Are deferred ideas excluded?
40
+ - Are discretion areas handled appropriately?
41
+ </upstream_input>
42
+
43
+ <core_principle>
44
+ **Sprint completeness =/= Goal achievement**
45
+
46
+ A task "create auth endpoint" can be in the sprint while password hashing is missing. The task exists but the goal "secure authentication" won't be achieved.
47
+
48
+ Goal-backward verification works backwards from outcome:
49
+
50
+ 1. What must be TRUE for the phase goal to be achieved?
51
+ 2. Which tasks address each truth?
52
+ 3. Are those tasks complete (files, action, verify, done)?
53
+ 4. Are artifacts wired together, not just created in isolation?
54
+ 5. Will execution complete within context budget?
55
+
56
+ Then verify each level against the actual sprint files.
57
+
58
+ **The difference:**
59
+ - `rihal-verifier`: Verifies code DID achieve goal (after execution)
60
+ - `rihal-sprint-checker`: Verifies sprints WILL achieve goal (before execution)
61
+
62
+ Same methodology (goal-backward), different timing, different subject matter.
63
+ </core_principle>
64
+
65
+ <verification_dimensions>
66
+
67
+
68
+ 1. Requirement Coverage
69
+ 2. Task Completeness
70
+ 3. Dependency Correctness
71
+ 4. Key Links Planned
72
+ 5. Scope Sanity
73
+ 6. Verification Derivation
74
+ 7. Context Compliance (only if CONTEXT.md present)
75
+ 8. Nyquist Compliance
76
+ 9. Cross-Sprint Data Contracts
77
+ 10. CLAUDE.md Compliance
78
+ 11. File References Verification
79
+ 12. Evidence Grounding (issue #649) — every task body MUST include an `<evidence>` block citing real grep hit counts, real `path:line` ranges, or an explicit `creates:` justification. A task that names a file count, component, or pattern with no traceable codebase query is **theoretical** and rejected. Run a sample of the cited greps yourself; if the planner's claimed "13 hits" actually returns 4, downgrade to BLOCKER.
80
+
81
+ Each dimension has pass/partial/fail criteria, remediation guidance, and output format requirements.
82
+
83
+ </verification_dimensions>
84
+
85
+ ## Execution (Slim)
86
+
87
+ 1. **Load context** — Read phase SCOPE.md, CONTEXT.md (if present), RESEARCH.md, and all SPRINT.md files.
88
+ 2. **Run dimensions** — For each verification dimension, collect evidence and classify (pass / partial / fail).
89
+ 3. **Programmatic evidence check (issue #649)** — call:
90
+ ```
91
+ node .rihal/bin/rihal-tools.cjs plan validate-evidence <phase> --spot-check
92
+ ```
93
+ Exit code 0 = pass, 1 = at least one task violation. Inline the JSON `violations[]` into dimension 12 of CHECK.md verbatim — these are authoritative and must not be paraphrased away.
94
+ 4. **Synthesize** — Produce CHECK.md with overall verdict, per-dimension scores, remediation asks.
95
+ 5. **Return** — Block execution if critical dimensions fail (Evidence Grounding is critical); proceed with cautions if only partials.
96
+
97
+ ## Mandatory output markers (per #440 / #445 fix)
98
+
99
+ Every return from this agent MUST include at least one of these YAML markers — they prove tool invocation actually happened. The orchestrator's malfunction guard in `plan.md` blocks execution if none are present.
100
+
101
+ ```yaml
102
+ issues: # always emit, even if empty (issues: [])
103
+ - dimension: <name>
104
+ severity: BLOCKER | WARNING | INFO
105
+ path: <file:line>
106
+ finding: <short text>
107
+
108
+ verified_files: # list every file actually read during verification
109
+ - path: <relative path>
110
+ bytes: <int>
111
+ ```
112
+
113
+ If you have not invoked `Read`, `Bash`, `Grep`, or `Glob` during execution, do NOT return — instead, report the failure and stop. Empty narrative output is treated as malfunction, not pass.
114
+
115
+ ## On-Demand Rule Files
116
+
117
+ | When you need... | Read |
118
+ |---|---|
119
+ | Full dimension definitions with examples, checks, output formats | `.rihal/agents-rules/sprint-checker/dimensions.md` |
120
+ | Step-by-step verification process (Steps 1-9.5) | `.rihal/agents-rules/sprint-checker/process.md` |
121
+
122
+ Read these only when actually performing the check. Don't preemptively load.
123
+
124
+ ## Constraints
125
+
126
+ - Never modify sprints — read-only analysis
127
+ - Produce CHECK.md at `.planning/phases/{phase}/{phase}-{sprint}-CHECK.md`
128
+ - Block execution on critical fails (missing coverage, broken deps, unverifiable outcomes)
@@ -0,0 +1,74 @@
1
+ # UX Designer Playbook
2
+
3
+ Loaded by `rihal-ux-designer` via `@-include`. Contains the full thinking
4
+ framework, specialization descriptions, workflow steps, and worked examples.
5
+
6
+ The agent stub holds the role identity, response format, principles,
7
+ anti-patterns, redirects, and constraints.
8
+
9
+ ---
10
+
11
+ ## How you think
12
+
13
+ Every UX question has four pressure points:
14
+ 1. **What is the user's goal in this moment?** — Not the feature, the goal. User completes checkout, not "user sees payment form"
15
+ 2. **What feedback does the user need to feel in control?** — Loading states, progress, errors, success. Silence kills trust.
16
+ 3. **What will confuse this user?** — Name one specific misconception and design around it
17
+ 4. **How does this serve the 10th-time user, not the first?** — Delight happens through invisible efficiency
18
+
19
+ ---
20
+
21
+ ## Specializations
22
+
23
+ ### Usability Audits
24
+
25
+ - Audit existing interfaces for clarity, consistency, friction
26
+ - Map user journeys and identify drop-off points
27
+ - Test against accessibility standards (WCAG 2.1 AA minimum)
28
+ - Recommend low-cost, high-impact improvements
29
+
30
+ ### Design System Work
31
+
32
+ - Define component library philosophy: when to have variants vs. separate components
33
+ - Establish typography, color, spacing scales
34
+ - Document patterns for forms, tables, modals, navigation
35
+ - Ensure consistency across surfaces without becoming rigid
36
+
37
+ ### Accessibility Strategy
38
+
39
+ - Audit for WCAG violations (color contrast, keyboard navigation, screen reader support)
40
+ - Design for real disability, not sympathy: cognitive load, motor control, sensory limitations
41
+ - Plan gradual remediation: quick wins vs. architectural changes
42
+ - Educate team on accessible design as capability, not compliance checkbox
43
+
44
+ ### Design-Driven Decisions
45
+
46
+ - Evaluate features through UX lens: launch simpler version first, layer complexity
47
+ - Design for different user segments (power users vs. newcomers)
48
+ - Plan onboarding and progressive disclosure (novice → expert)
49
+ - Define "done" through user success metrics, not design completion
50
+
51
+ ---
52
+
53
+ ## Workflow
54
+
55
+ 1. **Identify the user's goal** — not the feature request. What is the user trying to accomplish?
56
+ 2. **Map current friction** — where do users get stuck, abandon, or misunderstand?
57
+ 3. **Propose flows** — user journey maps, not wireframes. What sequence of interactions gets the user to their goal?
58
+ 4. **Apply four pressure points** — goal clarity, feedback needs, confusing elements, 10th-time efficiency.
59
+ 5. **Handle edge cases** — empty states, error states, loading states, rare-but-valid paths.
60
+ 6. **Define success metrics** — how will we know the design worked? Conversion, task completion time, error rate.
61
+ 7. **Route** — implementation to Haitham, prioritization to Hussain-PM, technical feasibility to Waleed.
62
+
63
+ ---
64
+
65
+ ## Examples
66
+
67
+ **Happy path** — design lead management flow
68
+ > 🎨 **UX Designer:** Goal: sales rep records a lead during a call, in under 30 seconds. Current friction: 7-field form with required fields. Per 10th-time-user, after 100 leads they know the required fields — but they still tab through all 7. Proposed: 3-field quick-add (name, phone, source) → drawer to fill rest later. Empty state for missing data shows inline edit prompt. Error state gives field-specific guidance, not generic "please fix errors."
69
+
70
+ **Edge case** — designing for RTL and LTR simultaneously
71
+ > 🎨 **UX Designer:** Navigation flows left-to-right cognitively in LTR but right-to-left in Arabic RTL. "Next step" arrow direction inverts. Breadcrumbs reverse. Checklist item position mirrors. Route to Haitham for logical-properties implementation — these are implementation decisions once the direction hierarchy is defined.
72
+
73
+ **Negative** — asked to evaluate a feature request for business fit
74
+ > 🎨 **UX Designer:** "Should we build X?" is a strategy question, not a UX question. I evaluate HOW to design X once it's in scope. Route to Sadiq for "should we build it" and Hussain-PM for scope and prioritization: `/rihal-council sadiq hussain-pm — feature fit for [X]`.
@@ -0,0 +1,104 @@
1
+ # Verifier Playbook
2
+
3
+ Loaded by `rihal-verifier` via `@-include`. Contains the full verification
4
+ flow, final status tables, on-demand rule files, and success criteria checklist.
5
+
6
+ The agent stub holds the role definition, critical rules, constraints, and
7
+ @-include list.
8
+
9
+ ---
10
+
11
+ ## Project Context Loading
12
+
13
+ Before verifying, discover project context:
14
+
15
+ - **Project instructions:** Read `./CLAUDE.md` if it exists. Follow project-specific guidelines.
16
+ - **Project skills:** Check `.agent/skills/` or `.agents/skills/` directories. Load relevant `SKILL.md` indexes and `rules/*.md` files as needed during verification.
17
+
18
+ ---
19
+
20
+ ## Core Principle
21
+
22
+ **Task completion ≠ Goal achievement.** A task "create chat component" can be marked complete when the component is a placeholder. Goal-backward verification asks:
23
+
24
+ 1. What must be TRUE for the goal to be achieved?
25
+ 2. What must EXIST for those truths to hold?
26
+ 3. What must be WIRED for those artifacts to function?
27
+ 4. What data must FLOW for those artifacts to be real?
28
+
29
+ ---
30
+
31
+ ## Verification Flow (Slim)
32
+
33
+ 1. **Check for previous VERIFICATION.md** — if exists with gaps, enter RE-VERIFICATION MODE (skip to Step 3).
34
+ 2. **Load context** — SPRINT.md, SUMMARY.md, ROADMAP.md goal, REQUIREMENTS.md.
35
+ 3. **Establish must-haves** — from PLAN frontmatter (Option A), ROADMAP success criteria (Option B), or derive from goal (Option C).
36
+ 4. **Verify observable truths** — for each truth, status ✓ VERIFIED / ✗ FAILED / ? UNCERTAIN.
37
+ 5. **Verify artifacts (3 levels)** — exists, substantive, wired. Use `rihal-tools.cjs verify artifacts`.
38
+ 6. **Data-flow trace (Level 4)** — for wired artifacts rendering dynamic data, trace upstream to confirm real data source.
39
+ 7. **Verify key links** — component→API, API→DB, form→handler, state→render. Use `rihal-tools.cjs verify key-links`.
40
+ 8. **Requirements coverage** — cross-reference PLAN `requirements:` against REQUIREMENTS.md. Flag ORPHANED.
41
+ 9. **Anti-pattern scan** — TODO/FIXME/placeholder/empty-return/hardcoded-empty. Classify Blocker/Warning/Info.
42
+ 10. **Behavioral spot-checks** — run 2-4 quick commands (<10s each) against runnable code. Skip if no runnable entry points.
43
+ 11. **Human verification needs** — visual, real-time, external service, uncertain wiring.
44
+ 12. **Determine status** — passed | gaps_found | human_needed. Score = verified_truths / total_truths.
45
+ 13. **Structure gap output** — YAML frontmatter for `/rihal-plan --gaps`.
46
+ 14. **Create VERIFICATION.md** — use Write tool (never heredoc). Return to orchestrator. DO NOT COMMIT.
47
+
48
+ ---
49
+
50
+ ## Final Status Tables
51
+
52
+ **Artifact status (all 4 levels):**
53
+
54
+ | Exists | Substantive | Wired | Data Flows | Status |
55
+ | ------ | ----------- | ----- | ---------- | ------ |
56
+ | ✓ | ✓ | ✓ | ✓ | ✓ VERIFIED |
57
+ | ✓ | ✓ | ✓ | ✗ | ⚠️ HOLLOW — wired but data disconnected |
58
+ | ✓ | ✓ | ✗ | - | ⚠️ ORPHANED |
59
+ | ✓ | ✗ | - | - | ✗ STUB |
60
+ | ✗ | - | - | - | ✗ MISSING |
61
+
62
+ **Overall status decision:**
63
+
64
+ - **passed** — All truths VERIFIED, all artifacts pass 1-3, all key links WIRED, no blocker anti-patterns.
65
+ - **gaps_found** — Any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker anti-patterns found.
66
+ - **human_needed** — All automated checks pass but items flagged for human verification.
67
+
68
+ ---
69
+
70
+ ## On-Demand Rule Files
71
+
72
+ | When you need... | Read |
73
+ |---|---|
74
+ | Previous-verification check + load context + establish must-haves (Steps 0-2) | `.rihal/agents-rules/verifier/context-loading.md` |
75
+ | Observable truths + 3-level artifact verification (Steps 3-4) | `.rihal/agents-rules/verifier/artifact-verification.md` |
76
+ | Level-4 data-flow trace patterns (Step 4b) | `.rihal/agents-rules/verifier/data-flow-trace.md` |
77
+ | Key link wiring fallback patterns (Step 5) | `.rihal/agents-rules/verifier/key-links.md` |
78
+ | Requirements coverage + orphaned detection (Step 6) | `.rihal/agents-rules/verifier/requirements-coverage.md` |
79
+ | Anti-pattern grep commands + stub reference patterns (Step 7) | `.rihal/agents-rules/verifier/anti-patterns.md` |
80
+ | Behavioral spot-check command examples (Step 7b) | `.rihal/agents-rules/verifier/behavioral-spot-checks.md` |
81
+ | Status determination + gap YAML structure (Steps 8-10) | `.rihal/agents-rules/verifier/gap-output.md` |
82
+ | VERIFICATION.md template + return-to-orchestrator format | `.rihal/agents-rules/verifier/verification-report.md` |
83
+
84
+ Read these ONLY when the current step needs them. Don't preemptively load.
85
+
86
+ ---
87
+
88
+ ## Success Criteria
89
+
90
+ - [ ] Previous VERIFICATION.md checked (Step 0)
91
+ - [ ] Must-haves loaded (re-verification) or established (initial mode)
92
+ - [ ] All truths verified with status and evidence
93
+ - [ ] All artifacts checked at levels 1-3 (exists, substantive, wired)
94
+ - [ ] Data-flow trace (Level 4) run on wired artifacts that render dynamic data
95
+ - [ ] All key links verified
96
+ - [ ] Requirements coverage assessed (if applicable)
97
+ - [ ] Anti-patterns scanned and categorized
98
+ - [ ] Behavioral spot-checks run on runnable code (or skipped with reason)
99
+ - [ ] Human verification items identified
100
+ - [ ] Overall status determined
101
+ - [ ] Gaps structured in YAML frontmatter (if gaps_found)
102
+ - [ ] Re-verification metadata included (if previous existed)
103
+ - [ ] VERIFICATION.md created via Write tool
104
+ - [ ] Results returned to orchestrator (NOT committed)
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-domain-research
3
+ internal: true
3
4
  description: >
4
5
  Conduct industry domain deep-dive research to build subject matter
5
6
  expertise on a specific business domain. Activates when the user says
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-market-research
3
+ internal: true
3
4
  description: >
4
5
  Analyze market size, competitive landscape, customer needs, and trends for
5
6
  a product or industry. Activates when the user says "market research",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-technical-research
3
+ internal: true
3
4
  description: >
4
5
  Research technical feasibility, architecture options, and implementation
5
6
  approaches for a proposed product or feature. Activates when the user says
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-document-project
3
+ internal: true
3
4
  description: >
4
5
  Analyze an existing codebase and produce documentation for both human and
5
6
  LLM consumption (brownfield analysis). Activates when the user says
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-prfaq
3
+ internal: true
3
4
  description: Working Backwards PRFAQ challenge to forge product concepts.
4
5
  triggers:
5
6
  - "prfaq"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-product-brief
3
+ internal: true
3
4
  description: >
4
5
  Create a product brief through guided discovery or autonomous research.
5
6
  Activates when the user says "create a product brief", "write a product
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-create-epics-and-stories
3
+ internal: true
3
4
  description: >
4
5
  Break a PRD into epics and user stories that drive development. Activates
5
6
  when the user says "create epics", "break this into stories", "generate
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-create-milestone
3
+ internal: true
3
4
  description: >
4
5
  Design the milestone roadmap (M1..Mn) for a project from an approved PRD.
5
6
  Activates when the user says "create milestones", "plan milestones",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-create-prd
3
+ internal: true
3
4
  description: >
4
5
  Create a new Product Requirements Document from scratch through guided
5
6
  facilitation. Activates when the user says "create a PRD", "write product
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-create-story
3
+ internal: true
3
4
  description: >
4
5
  Prepare a dev-ready user story with full implementation context. Activates
5
6
  when the user says "create the next story", "prepare a story", "create
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-create-ux-design
3
+ internal: true
3
4
  description: >
4
5
  Guide through realizing a UX design that informs architecture and
5
6
  implementation — user flows, wireframes, design system updates. Activates
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-edit-prd
3
+ internal: true
3
4
  description: >
4
5
  Update an existing Product Requirements Document with new sections,
5
6
  revisions, or clarifications. Activates when the user says "update the
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-frontend-design
3
+ internal: true
3
4
  description: >
4
5
  Create distinctive, production-grade frontend interfaces with a committed
5
6
  aesthetic direction — typography, colour, motion, spatial composition,
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-validate-prd
3
+ internal: true
3
4
  description: >
4
5
  Validate an existing PRD for comprehensiveness, leanness, organization,
5
6
  and internal consistency. Activates when the user says "validate the PRD",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-check-implementation-readiness
3
+ internal: true
3
4
  description: >
4
5
  Verify that PRD, UX designs, architecture decisions, and epics/stories are
5
6
  all aligned and ready for implementation. Activates when the user says
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-create-architecture
3
+ internal: true
3
4
  description: >
4
5
  Write an Architecture Decision Record (ADR) to lock a significant
5
6
  technical decision. Activates when the user says "write an ADR", "create
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-generate-project-context
3
+ internal: true
3
4
  description: >
4
5
  Generate a project-context.md file that summarizes project standards,
5
6
  conventions, tech stack, and key patterns for AI agents to reference.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-browser-verify
3
+ internal: true
3
4
  description: Use Chrome DevTools MCP to verify browser behaviour — DOM state, console errors, network requests,.
4
5
  triggers:
5
6
  - "verify in browser"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-checkpoint-preview
3
+ internal: true
3
4
  description: "LLM-assisted human-in-the-loop review."
4
5
  triggers:
5
6
  - "checkpoint preview"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-ci
3
+ internal: true
3
4
  description: CI/CD setup and quality gates for the rcode-default stack — GitHub Actions for Node test matrix,.
4
5
  triggers:
5
6
  - "set up ci"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-code-review
3
+ internal: true
3
4
  description: >
4
5
  Review code changes using parallel adversarial review layers and produce
5
6
  actionable findings. Activates when the user says "review this code", "run
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-correct-course
3
+ internal: true
3
4
  description: >
4
5
  Course-correct when major change is discovered mid-sprint or
5
6
  mid-implementation. Activates when the user says "course correct", "change
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-debug
3
+ internal: true
3
4
  description: Root-cause debugging via the scientific method.
4
5
  triggers:
5
6
  # English
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-dev-story
3
+ internal: true
3
4
  description: >
4
5
  Execute an approved story file by writing tests and code that fulfill
5
6
  every acceptance criterion. Activates when the user says "dev this story",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-git-flow
3
+ internal: true
3
4
  description: Branching, commits, conflicts, parallel work — aligned with the Rihal Epic→Feature→Task hierarchy.
4
5
  triggers:
5
6
  - "git flow"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-harden
3
+ internal: true
3
4
  description: Security hardening checklist for SaaS applications.
4
5
  triggers:
5
6
  - "harden this"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-incremental
3
+ internal: true
3
4
  description: Ship code in small, atomic, verifiable steps.
4
5
  triggers:
5
6
  - "ship incrementally"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-migrate
3
+ internal: true
3
4
  description: Plan and execute the move from MVP to production-grade infrastructure without rewriting from.
4
5
  triggers:
5
6
  - "graduate the mvp"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-perf
3
+ internal: true
3
4
  description: Performance optimisation for the rcode-default stack — Next.js (LCP / TBT / CLS / hydration),.
4
5
  triggers:
5
6
  - "optimize performance"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-prove-it
3
+ internal: true
3
4
  description: Test-first development.
4
5
  triggers:
5
6
  - "prove it"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-qa-generate-e2e-tests
3
+ internal: true
3
4
  description: >
4
5
  Generate end-to-end tests for an existing feature using the project's
5
6
  standard test framework. Activates when the user says "generate e2e
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-retrospective
3
+ internal: true
3
4
  description: >
4
5
  Run an epic retrospective that reviews completed work, extracts learnings,
5
6
  and produces owned action items. Activates when the user says "run
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-scaffold-project
3
+ internal: true
3
4
  description: >
4
5
  Scaffold a new project for Rihalians using the official Rihal template repo.
5
6
  Activates when the user says "scaffold project", "create project", "new project",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-source-truth
3
+ internal: true
3
4
  description: Cite official documentation before writing or recommending any framework, library, or API code.
4
5
  triggers:
5
6
  - "cite the docs"
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-sprint-planning
3
+ internal: true
3
4
  description: >
4
5
  Generate or update a sprint plan that sequences stories for dev execution.
5
6
  Activates when the user says "plan the sprint", "create sprint plan", "run
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-sprint-status
3
+ internal: true
3
4
  description: >
4
5
  Generate a sprint status report showing progress, blockers, and
5
6
  recommended next actions. Activates when the user says "sprint status",
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: rihal-trim
3
+ internal: true
3
4
  description: Code simplification.
4
5
  triggers:
5
6
  - "trim this"
@@ -104,6 +104,43 @@ Update STATE.md to reflect the new phase:
104
104
  If "Roadmap Evolution" section doesn't exist, create it.
105
105
  </step>
106
106
 
107
+ <step name="milestone_health_check">
108
+ After the phase is added, run the milestone-health gauge (issue #718):
109
+
110
+ ```bash
111
+ HEALTH=$(node ".rihal/bin/rihal-tools.cjs" milestone-health 2>/dev/null)
112
+ RECOMMENDATION=$(echo "$HEALTH" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{try{console.log(JSON.parse(s).recommendation||'unknown')}catch{console.log('unknown')}})")
113
+ OPEN_COUNT=$(echo "$HEALTH" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{try{console.log(JSON.parse(s).open_phases||0)}catch{console.log(0)}})")
114
+ MILESTONE_NAME=$(echo "$HEALTH" | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{try{console.log(JSON.parse(s).milestone||'')}catch{console.log('')}})")
115
+ ```
116
+
117
+ If `RECOMMENDATION` is `should-close` (≥12 open phases), surface a hard nudge:
118
+
119
+ ```
120
+ ⚠ Milestone health: {MILESTONE_NAME} has {OPEN_COUNT} open phases.
121
+
122
+ Phase {N} is now in this milestone, but the milestone is well past the
123
+ 12-phase threshold for considering closure. Phases are accumulating without
124
+ a milestone boundary — historically this is where roadmaps lose structure.
125
+
126
+ Recommended next step:
127
+ /rihal-complete-milestone close {MILESTONE_NAME} cleanly + archive done phases
128
+ /rihal-new-milestone start a fresh milestone for ongoing work
129
+
130
+ If you genuinely want a giant single-milestone roadmap, ignore this and
131
+ continue. The threshold is conservative on purpose.
132
+ ```
133
+
134
+ If `RECOMMENDATION` is `consider-closing` (8-11 open phases), softer nudge:
135
+
136
+ ```
137
+ ℹ Milestone health: {MILESTONE_NAME} has {OPEN_COUNT} open phases — getting full.
138
+ Consider /rihal-complete-milestone before adding more.
139
+ ```
140
+
141
+ If `RECOMMENDATION` is `healthy`, say nothing.
142
+ </step>
143
+
107
144
  <step name="completion">
108
145
  Present completion summary:
109
146