@hanzlaa/rcode 2.2.0 → 2.3.2
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/CLAUDE.md +15 -0
- package/CONTRIBUTING.md +138 -0
- package/README.md +74 -15
- package/cli/install.js +312 -80
- package/cli/postinstall.js +4 -4
- package/cli/uninstall.js +8 -0
- package/dist/rcode.js +19777 -0
- package/package.json +18 -5
- package/rihal/DOCS-AUDIT.md +14 -0
- package/rihal/agents/rihal-code-reviewer.md +1 -1
- package/rihal/agents/rihal-codebase-mapper.md +1 -1
- package/rihal/agents/rihal-docs-auditor.md +1 -1
- package/rihal/agents/rihal-edge-case-hunter.md +1 -1
- package/rihal/agents/rihal-executor.md +2 -1
- package/rihal/agents/rihal-hussain-pm.md +1 -0
- package/rihal/agents/rihal-nyquist-auditor.md +1 -1
- package/rihal/agents/rihal-phase-researcher.md +2 -2
- package/rihal/agents/rihal-planner.md +3 -2
- package/rihal/agents/rihal-roadmapper.md +1 -0
- package/rihal/agents/rihal-security-adversary.md +1 -1
- package/rihal/agents/rihal-security-auditor.md +1 -1
- package/rihal/agents/rihal-sprint-checker.md +1 -1
- package/rihal/agents/rihal-verifier.md +1 -1
- package/rihal/bin/lib/roadmap.cjs +2 -3
- package/rihal/bin/rihal-tools.cjs +11 -31
- package/rihal/brain/best-practices/no-theoretical-suggestions.md +56 -0
- package/rihal/commands/add-phase.md +2 -2
- package/rihal/commands/audit.md +8 -0
- package/rihal/commands/checkpoint-preview.md +13 -0
- package/rihal/commands/cleanup.md +2 -2
- package/rihal/commands/config.md +4 -4
- package/rihal/commands/pr-branch.md +2 -2
- package/rihal/commands/prfaq.md +15 -0
- package/rihal/commands/remove-phase.md +2 -2
- package/rihal/commands/research-phase.md +2 -2
- package/rihal/commands/settings.md +2 -2
- package/rihal/commands/ship.md +15 -3
- package/rihal/commands/validate-phase.md +1 -1
- package/rihal/commands/verify-phase.md +2 -2
- package/rihal/references/agent-contracts.md +12 -0
- package/rihal/references/karpathy-guidelines-full.md +79 -0
- package/rihal/references/karpathy-guidelines.md +8 -76
- package/rihal/references/model-profile-resolution.md +8 -0
- package/rihal/references/phase-argument-parsing.md +11 -0
- package/rihal/references/revision-loop.md +11 -0
- package/rihal/references/universal-anti-patterns.md +15 -0
- package/rihal/skills/actions/1-analysis/research/rihal-domain-research/SKILL.md +11 -0
- package/rihal/skills/actions/1-analysis/research/rihal-market-research/SKILL.md +11 -0
- package/rihal/skills/actions/1-analysis/research/rihal-technical-research/SKILL.md +13 -0
- package/rihal/skills/actions/1-analysis/rihal-document-project/SKILL.md +11 -0
- package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +12 -0
- package/rihal/skills/actions/1-analysis/rihal-product-brief/SKILL.md +7 -0
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +15 -1
- package/rihal/skills/actions/2-plan/rihal-create-milestone/SKILL.md +21 -1
- package/rihal/skills/actions/2-plan/rihal-create-milestone/steps/step-10-complete.md +1 -1
- package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +26 -0
- package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +16 -2
- package/rihal/skills/actions/2-plan/rihal-create-ux-design/SKILL.md +12 -0
- package/rihal/skills/actions/2-plan/rihal-edit-prd/SKILL.md +11 -0
- package/rihal/skills/actions/2-plan/rihal-frontend-design/SKILL.md +13 -0
- package/rihal/skills/actions/2-plan/rihal-validate-prd/SKILL.md +12 -0
- package/rihal/skills/actions/3-solutioning/rihal-check-implementation-readiness/SKILL.md +12 -0
- package/rihal/skills/actions/3-solutioning/rihal-create-architecture/SKILL.md +14 -0
- package/rihal/skills/actions/3-solutioning/rihal-generate-project-context/SKILL.md +12 -0
- package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +16 -0
- package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +12 -0
- package/rihal/skills/actions/4-implementation/rihal-correct-course/SKILL.md +13 -0
- package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +12 -0
- package/rihal/skills/actions/4-implementation/rihal-qa-generate-e2e-tests/SKILL.md +12 -0
- package/rihal/skills/actions/4-implementation/rihal-retrospective/SKILL.md +11 -0
- package/rihal/skills/actions/4-implementation/rihal-scaffold-project/SKILL.md +10 -0
- package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +14 -1
- package/rihal/skills/actions/4-implementation/rihal-sprint-status/SKILL.md +10 -0
- package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +13 -1
- package/rihal/skills/agents/fatima-qa/SKILL.md +14 -1
- package/rihal/skills/agents/haitham-frontend/SKILL.md +15 -1
- package/rihal/skills/agents/hanzla-engineer/SKILL.md +14 -1
- package/rihal/skills/agents/hussain-pm/SKILL.md +22 -1
- package/rihal/skills/agents/hussain-sm/SKILL.md +22 -1
- package/rihal/skills/agents/layla-designer/SKILL.md +15 -1
- package/rihal/skills/agents/majlis-council/SKILL.md +14 -1
- package/rihal/skills/agents/mariam-marketing/SKILL.md +15 -1
- package/rihal/skills/agents/nasser-eng-manager/SKILL.md +14 -1
- package/rihal/skills/agents/noor-writer/SKILL.md +14 -1
- package/rihal/skills/agents/raees-orchestrator/SKILL.md +13 -1
- package/rihal/skills/agents/sadiq-analyst/SKILL.md +15 -1
- package/rihal/skills/agents/waleed-architect/SKILL.md +16 -1
- package/rihal/skills/agents/yousef-backend/SKILL.md +16 -1
- package/rihal/skills/agents/zahra-branding/SKILL.md +15 -1
- package/rihal/skills/agents/zayd-ml/SKILL.md +17 -1
- package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +12 -0
- package/rihal/skills/core/rihal-brainstorming/SKILL.md +16 -0
- package/rihal/skills/core/rihal-clone-website/SKILL.md +21 -0
- package/rihal/skills/core/rihal-distillator/SKILL.md +8 -0
- package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +12 -0
- package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +18 -0
- package/rihal/skills/core/rihal-help/SKILL.md +12 -0
- package/rihal/skills/core/rihal-index-docs/SKILL.md +18 -0
- package/rihal/skills/core/rihal-init/SKILL.md +8 -0
- package/rihal/skills/core/rihal-party-mode/SKILL.md +14 -0
- package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +12 -0
- package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +18 -0
- package/rihal/skills/core/rihal-shard-doc/SKILL.md +18 -0
- package/rihal/team.yaml +205 -0
- package/rihal/templates/UAT.md +29 -0
- package/rihal/templates/milestone.md +2 -0
- package/rihal/templates/sprint.md +11 -28
- package/rihal/templates/summary.md +30 -0
- package/rihal/templates/verification-report.md +28 -0
- package/rihal/workflows/audit-milestone.md +34 -2
- package/rihal/workflows/audit.md +172 -0
- package/rihal/workflows/autonomous.md +67 -0
- package/rihal/workflows/checkpoint-preview.md +7 -0
- package/rihal/workflows/council.md +3 -1
- package/rihal/workflows/debug.md +8 -1
- package/rihal/workflows/diagnose-issues.md +34 -0
- package/rihal/workflows/do.md +47 -3
- package/rihal/workflows/document-project.md +1 -1
- package/rihal/workflows/execute-sprint.md +11 -4
- package/rihal/workflows/execute.md +9 -3
- package/rihal/workflows/help.md +1 -1
- package/rihal/workflows/karpathy-audit.md +7 -14
- package/rihal/workflows/pause-work.md +7 -1
- package/rihal/workflows/prfaq.md +7 -0
- package/rihal/workflows/profile-user.md +2 -2
- package/rihal/workflows/settings.md +116 -117
- package/rihal/workflows/ship.md +31 -1
- package/rihal/workflows/sprint-planning.md +39 -8
- package/rihal/workflows/status.md +5 -0
- package/rihal/workflows/ui-phase.md +3 -3
- package/rihal/workflows/update.md +80 -22
- package/rihal/workflows/validate-phase.md +7 -1
- package/server/dashboard.js +34 -575
- package/server/lib/api.js +123 -0
- package/server/lib/html/client.js +969 -0
- package/server/lib/html/css.js +416 -0
- package/server/lib/html/shell.js +230 -0
- package/server/lib/scanner.js +142 -0
- package/rihal/agents/rihal-ui-designer.md +0 -6
- package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/SKILL.md +0 -148
- package/rihal/skills/core/rihal-advanced-elicitation/rihal-advanced-elicitation/methods.csv +0 -51
- package/rihal/skills/core/rihal-shard-doc/rihal-shard-doc/SKILL.md +0 -122
- package/rihal/workflows/config.md +0 -105
|
@@ -4,16 +4,83 @@ Drive milestone phases autonomously — all remaining phases, a range via `--fro
|
|
|
4
4
|
|
|
5
5
|
</purpose>
|
|
6
6
|
|
|
7
|
+
<critical_rules priority="absolute">
|
|
8
|
+
|
|
9
|
+
These rules apply throughout autonomous execution. Violations broke the
|
|
10
|
+
interpos audit (issue #221) — DO NOT regress.
|
|
11
|
+
|
|
12
|
+
1. **NEVER modify `.rihal/config.yaml`.** Specifically: never write
|
|
13
|
+
`mode: yolo`, never call `rihal-tools config-set mode`, never `sed`
|
|
14
|
+
the file. The user's mode preference is sacred. Autonomous behavior
|
|
15
|
+
is governed by the workflow's own internal flags + the `--auto`
|
|
16
|
+
invocation flag, NOT by mutating persistent config.
|
|
17
|
+
|
|
18
|
+
2. **NEVER skip the methodology chain on greenfield projects.** Before
|
|
19
|
+
the phase loop runs, the prerequisite check (next step) MUST verify:
|
|
20
|
+
- `.planning/prd.md` exists (else halt → /rihal:create-prd)
|
|
21
|
+
- ROADMAP.md has milestone structure (else halt → /rihal:create-milestone)
|
|
22
|
+
- `.planning/epics.md` exists (else halt → /rihal:create-epics-and-stories)
|
|
23
|
+
See issue #219 + #229.
|
|
24
|
+
|
|
25
|
+
3. **NEVER write SPRINT.md directly.** Sprint creation MUST go through
|
|
26
|
+
the `rihal-sprint-planning` skill so the capacity gate (#127) fires.
|
|
27
|
+
If autonomous needs a sprint, invoke the skill — don't shortcut.
|
|
28
|
+
|
|
29
|
+
4. **ALWAYS call `state sync --from-disk` after writing any
|
|
30
|
+
.planning/ artifact.** Otherwise state.json drifts and downstream
|
|
31
|
+
workflows lie. See `_shared/state-sync-rule.md` (#198).
|
|
32
|
+
|
|
33
|
+
5. **ALWAYS record decisions via `rihal-tools state add-decision`.**
|
|
34
|
+
Never write decision prose to STATE.md. See #224.
|
|
35
|
+
|
|
36
|
+
</critical_rules>
|
|
37
|
+
|
|
7
38
|
<required_reading>
|
|
8
39
|
|
|
9
40
|
@.rihal/references/output-format.md
|
|
10
41
|
@.rihal/references/workstream-flag.md
|
|
11
42
|
@.rihal/references/output-realism.md
|
|
43
|
+
@rihal/brain/best-practices/no-autonomous-bypass.md
|
|
44
|
+
@rihal/brain/best-practices/state-sync-rule.md
|
|
12
45
|
|
|
13
46
|
Read all files referenced by the invoking prompt's execution_context before starting.
|
|
14
47
|
|
|
15
48
|
</required_reading>
|
|
16
49
|
|
|
50
|
+
<step name="prerequisite_check" priority="before-everything">
|
|
51
|
+
|
|
52
|
+
## 0. Prerequisite check (greenfield guard)
|
|
53
|
+
|
|
54
|
+
Before any phase work, verify the methodology chain has run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
HAS_PRD=$([ -f .planning/prd.md ] && echo true || echo false)
|
|
58
|
+
HAS_ROADMAP_MILESTONES=$(grep -qE "^## Milestone\s+M[0-9]+" .planning/ROADMAP.md 2>/dev/null && echo true || echo false)
|
|
59
|
+
HAS_EPICS=$([ -f .planning/epics.md ] && echo true || echo false)
|
|
60
|
+
SKIP_FLAG=$(echo "$ARGUMENTS" | grep -qE "\-\-skip-prerequisites" && echo true || echo false)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If `SKIP_FLAG=false` AND any prerequisite is missing, HALT with a clear message:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
⚠ Cannot run autonomous: missing prerequisite — {what}.
|
|
67
|
+
|
|
68
|
+
The autonomous flow assumes a project that has already gone through:
|
|
69
|
+
1. /rihal:create-prd → produces .planning/prd.md
|
|
70
|
+
2. /rihal:create-milestone → produces ROADMAP.md with M1..Mn
|
|
71
|
+
3. /rihal:create-epics-and-stories → produces .planning/epics.md
|
|
72
|
+
4. THEN /rihal:autonomous ← you are here
|
|
73
|
+
|
|
74
|
+
Suggested first step: /rihal:{first-missing-command}
|
|
75
|
+
|
|
76
|
+
If you genuinely want to skip these (rare — usually inverted methodology),
|
|
77
|
+
re-invoke with: /rihal:autonomous --skip-prerequisites
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If `SKIP_FLAG=true`: print a warning that downstream workflows may produce low-quality output without upstream artifacts, then proceed.
|
|
81
|
+
|
|
82
|
+
</step>
|
|
83
|
+
|
|
17
84
|
<output_format>
|
|
18
85
|
|
|
19
86
|
Open with banner:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Workflow: rihal:checkpoint-preview
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Human-in-the-loop change review. Make sense of a diff, focus attention where it matters, and walk through testing. Delegates to the rihal-checkpoint-preview skill for the full review protocol.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
@rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md
|
|
@@ -404,7 +404,9 @@ Rules for compact mode:
|
|
|
404
404
|
- Round 2 deltas: ≤ 15 words each. "Held position" is a valid delta.
|
|
405
405
|
- No section headers beyond the four above. No numbered story breakdowns. No tables from panelists verbatim.
|
|
406
406
|
|
|
407
|
-
### Verbose mode (`--verbose` flag)
|
|
407
|
+
### Verbose mode (`--verbose` flag or `output.verbose: true` in config)
|
|
408
|
+
|
|
409
|
+
Activated by: `--verbose` in `$ARGUMENTS` OR `$(node .rihal/bin/rihal-tools.cjs config-get output.verbose)` equals `"true"`.
|
|
408
410
|
|
|
409
411
|
Print Round 1 (and Round 2 if ran) verbatim in panel order. Do NOT summarize.
|
|
410
412
|
|
package/rihal/workflows/debug.md
CHANGED
|
@@ -118,8 +118,15 @@ Task(
|
|
|
118
118
|
)
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
**Never pass `isolation="worktree"` without explicit user consent.** Worktree isolation creates a git worktree, which is a write operation the user may not want. If you believe isolation is genuinely needed (e.g., the debug agent may edit files)
|
|
121
|
+
**Never pass `isolation="worktree"` without explicit user consent.** Worktree isolation creates a git worktree, which is a write operation the user may not want. If you believe isolation is genuinely needed (e.g., the debug agent may edit files):
|
|
122
122
|
|
|
123
|
+
```bash
|
|
124
|
+
CONFIG_MODE=$(node .rihal/bin/rihal-tools.cjs config-get mode 2>/dev/null || echo "guided")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**If `CONFIG_MODE == "yolo"`:** Skip isolation — default to no worktree, proceed immediately.
|
|
128
|
+
|
|
129
|
+
Otherwise ask via AskUserQuestion:
|
|
123
130
|
```
|
|
124
131
|
Spawn the debug agent with git worktree isolation?
|
|
125
132
|
- Safer: agent edits stay isolated until you merge
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Workflow: rihal:diagnose-issues
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Reusable diagnosis subroutine called from /rihal:verify-work when
|
|
5
|
+
verification fails. Walks symptom → hypothesis → evidence → minimal
|
|
6
|
+
repro and returns a structured finding. Not a top-level command.
|
|
7
|
+
</purpose>
|
|
8
|
+
|
|
9
|
+
## Step 1 — Symptom capture
|
|
10
|
+
|
|
11
|
+
Record:
|
|
12
|
+
- failing assertion / log line / wrong output
|
|
13
|
+
- file:line where divergence first appears
|
|
14
|
+
- last commit before symptom appeared (`git log -S<token>`)
|
|
15
|
+
|
|
16
|
+
## Step 2 — Hypotheses
|
|
17
|
+
|
|
18
|
+
List 2–3 plausible causes. For each:
|
|
19
|
+
- a one-line predicted mechanism
|
|
20
|
+
- the cheapest test that would falsify it
|
|
21
|
+
|
|
22
|
+
## Step 3 — Evidence
|
|
23
|
+
|
|
24
|
+
Run the falsifying tests in cheapest-first order. Stop at the first
|
|
25
|
+
hypothesis that matches all evidence.
|
|
26
|
+
|
|
27
|
+
## Step 4 — Minimal repro
|
|
28
|
+
|
|
29
|
+
Reduce to the smallest input that still triggers the bug. Save under
|
|
30
|
+
`.planning/diagnostics/<slug>.md`.
|
|
31
|
+
|
|
32
|
+
## Step 5 — Hand-off
|
|
33
|
+
|
|
34
|
+
Return JSON: `{ root_cause, repro_path, suggested_fix }` to the caller.
|
package/rihal/workflows/do.md
CHANGED
|
@@ -10,7 +10,7 @@ Read all files referenced by the invoking prompt's execution_context before star
|
|
|
10
10
|
<process>
|
|
11
11
|
|
|
12
12
|
<step name="parse_args">
|
|
13
|
-
Extract `$ARGUMENTS
|
|
13
|
+
Extract `$ARGUMENTS`, detect `--auto` flag, and check config mode:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
AUTO_MODE=false
|
|
@@ -19,6 +19,11 @@ if [[ "$ARGUMENTS" == *"--auto"* ]]; then
|
|
|
19
19
|
AUTO_MODE=true
|
|
20
20
|
QUESTION=$(echo "$ARGUMENTS" | sed 's/--auto[[:space:]]*//' | xargs)
|
|
21
21
|
fi
|
|
22
|
+
# Also auto-dispatch in yolo mode
|
|
23
|
+
CONFIG_MODE=$(node .rihal/bin/rihal-tools.cjs config-get mode 2>/dev/null || echo "guided")
|
|
24
|
+
if [[ "$CONFIG_MODE" == "yolo" ]]; then
|
|
25
|
+
AUTO_MODE=true
|
|
26
|
+
fi
|
|
22
27
|
```
|
|
23
28
|
</step>
|
|
24
29
|
|
|
@@ -52,18 +57,53 @@ If user picks 1-15, invoke that command. If 16, capture text and continue.
|
|
|
52
57
|
</step>
|
|
53
58
|
|
|
54
59
|
<step name="check_project">
|
|
55
|
-
**Check if project exists.**
|
|
60
|
+
**Check if project exists + state survey.**
|
|
56
61
|
|
|
57
62
|
```bash
|
|
58
63
|
INIT=$(node ".rihal/bin/rihal-tools.cjs" state load 2>/dev/null)
|
|
64
|
+
HAS_PRD=$([ -f .planning/prd.md ] && echo true || echo false)
|
|
65
|
+
HAS_EPICS=$([ -f .planning/epics.md ] && echo true || echo false)
|
|
66
|
+
PHASE_COUNT=$(node ".rihal/bin/rihal-tools.cjs" progress init 2>/dev/null | python3 -c "import sys,json;print(json.load(sys.stdin).get('phase_count',0))" 2>/dev/null || echo 0)
|
|
67
|
+
HAS_PHASES=$([ "$PHASE_COUNT" -gt 0 ] && echo true || echo false)
|
|
59
68
|
```
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
These flags drive the greenfield guard in the next step. `.planning/` existing alone is not enough — we need to know whether the methodology chain has actually run (PRD → milestone → epics → phases).
|
|
71
|
+
</step>
|
|
72
|
+
|
|
73
|
+
<step name="greenfield_guard" priority="first-match">
|
|
74
|
+
**Block methodology inversion.**
|
|
75
|
+
|
|
76
|
+
Some routes ASSUME upstream artifacts exist. If they don't, dispatching to them inverts the chain (the autonomous-bypass pattern that produced the interpos disaster — issue #220 + #219).
|
|
77
|
+
|
|
78
|
+
Apply this guard BEFORE the routing table below:
|
|
79
|
+
|
|
80
|
+
| Intent contains... | AND state shows... | Then re-route to... | Why |
|
|
81
|
+
|--------------------|---------------------|----------------------|-----|
|
|
82
|
+
| "draft phases", "all phases", "build all phases", "groom phases", "auto mode" + "phases" | `HAS_PRD=false` | `/rihal:create-prd` first | Phases need a PRD foundation. Without one, the autonomous flow hallucinates requirements. |
|
|
83
|
+
| "execute phase", "build phase N", "run phase N" | `HAS_PHASES=false` OR PLAN.md missing for phase N | `/rihal:plan N` first (or `/rihal:create-prd` if no PRD) | Can't execute what hasn't been planned. |
|
|
84
|
+
| "sprint planning", "plan the sprint" | `HAS_EPICS=false` | `/rihal:create-epics-and-stories` first | Sprints draw stories from epics. No epics = no stories to schedule. |
|
|
85
|
+
| "create stories", "epics" | `HAS_PRD=false` | `/rihal:create-prd` first | Epics decompose a milestone. Milestone needs PRD. |
|
|
86
|
+
| "create milestones", "roadmap" | `HAS_PRD=false` | `/rihal:create-prd` first | Roadmap is derived from PRD success metrics. |
|
|
87
|
+
|
|
88
|
+
When the guard fires, print a clear message:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
⚠ Cannot {requested action}: missing prerequisite — {what's missing}.
|
|
92
|
+
|
|
93
|
+
Re-routing to: /rihal:{prerequisite-command}
|
|
94
|
+
Once that completes, re-run your original request.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Then dispatch to the prerequisite command instead of the originally-matched route.
|
|
98
|
+
|
|
99
|
+
The guard never silently rejects intent — it always either dispatches to a sensible alternative OR explicitly tells the user what flag overrides it (e.g. `--skip-prerequisites` for the rare legitimate use case).
|
|
62
100
|
</step>
|
|
63
101
|
|
|
64
102
|
<step name="route">
|
|
65
103
|
**Match intent to command.**
|
|
66
104
|
|
|
105
|
+
(Run only after greenfield_guard has cleared.)
|
|
106
|
+
|
|
67
107
|
Evaluate `$QUESTION` against these routing rules. Apply the **first matching** rule:
|
|
68
108
|
|
|
69
109
|
| If the text describes... | Route to | Why |
|
|
@@ -71,6 +111,10 @@ Evaluate `$QUESTION` against these routing rules. Apply the **first matching** r
|
|
|
71
111
|
| Starting a new project, "set up", "initialize" | `/rihal:new-project` | Needs full project initialization |
|
|
72
112
|
| Mapping or analyzing an existing codebase | `/rihal:map-codebase` | Codebase discovery |
|
|
73
113
|
| A bug, error, crash, failure, or something broken | `/rihal:debug` | Needs systematic investigation |
|
|
114
|
+
| Validate an idea, "working backwards", "press release", "PRFAQ", "is this worth building" | `/rihal:prfaq` | Stress-test concept before committing sprint capacity |
|
|
115
|
+
| Brainstorm, generate ideas, "explore options", "what could we do" | `/rihal:brainstorm` | Structured ideation before planning |
|
|
116
|
+
| Audit code quality, "review changes", "karpathy", "check my diff", "too complex" | `/rihal:karpathy-audit` | 4-principle code audit against recent diff |
|
|
117
|
+
| Walk through a change, "checkpoint", "explain this diff", "human review" | `/rihal:checkpoint-preview` | Human-in-the-loop diff walkthrough |
|
|
74
118
|
| Exploring, researching, comparing, or "how does X work" | `/rihal:research-phase` | Domain research before planning |
|
|
75
119
|
| Scope unclear, conflicting UIs/options, "which one", "better UX", "still have confusion", "how should X look", brainstorming vision | `/rihal:discuss-phase` | Decisions not yet locked — gather before planning |
|
|
76
120
|
| A complex task: refactoring, migration, multi-file architecture, system redesign | `/rihal:add-phase` | Needs a full phase with plan/build cycle |
|
|
@@ -162,7 +162,7 @@ After audit, if resume-work.md exists, prepend to Step 2:
|
|
|
162
162
|
```
|
|
163
163
|
If .rihal/DOCS-AUDIT.md exists, check for missing/stale docs:
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
<!-- DOCS-AUDIT.md is generated at runtime by rihal-tools.cjs docs-audit — not a tracked file -->
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
## Success Criteria
|
|
@@ -341,16 +341,23 @@ If verification fails:
|
|
|
341
341
|
|
|
342
342
|
**Check if node repair is enabled** (default: on):
|
|
343
343
|
```bash
|
|
344
|
-
NODE_REPAIR=$(node "
|
|
344
|
+
NODE_REPAIR=$(node ".rihal/bin/rihal-tools.cjs" config-get workflow.node_repair 2>/dev/null || echo "true")
|
|
345
345
|
```
|
|
346
346
|
|
|
347
|
-
If `NODE_REPAIR` is `true`:
|
|
347
|
+
If `NODE_REPAIR` is `true`: attempt RETRY → DECOMPOSE → PRUNE in that order
|
|
348
|
+
within a budget of `workflow.node_repair_budget` (default: 2). Track:
|
|
349
|
+
|
|
348
350
|
- FAILED_TASK: task number, name, done-criteria
|
|
349
351
|
- ERROR: expected vs actual result
|
|
350
352
|
- PLAN_CONTEXT: adjacent task names + phase goal
|
|
351
|
-
- REPAIR_BUDGET:
|
|
353
|
+
- REPAIR_BUDGET: remaining attempts
|
|
354
|
+
|
|
355
|
+
Repair strategies:
|
|
356
|
+
- **RETRY** — re-run the same task with the failure context as added input.
|
|
357
|
+
- **DECOMPOSE** — split into smaller subtasks (only if the original was L/XL).
|
|
358
|
+
- **PRUNE** — drop the task from the sprint scope and record under "Issues Encountered" in SUMMARY.
|
|
352
359
|
|
|
353
|
-
|
|
360
|
+
If the budget is exhausted without success: ESCALATE.
|
|
354
361
|
|
|
355
362
|
If `NODE_REPAIR` is `false` OR repair returns ESCALATE: STOP. Present: "Verification failed for Task [X]: [name]. Expected: [criteria]. Actual: [result]. Repair attempted: [summary of what was tried]." Options: Retry | Skip (mark incomplete) | Stop (investigate). If skipped → SUMMARY "Issues Encountered".
|
|
356
363
|
</step>
|
|
@@ -56,8 +56,14 @@ wall-clock expectation).
|
|
|
56
56
|
</execution_plan>
|
|
57
57
|
|
|
58
58
|
<three_options>
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
Check config mode first:
|
|
60
|
+
```bash
|
|
61
|
+
CONFIG_MODE=$(node .rihal/bin/rihal-tools.cjs config-get mode 2>/dev/null || echo "guided")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**If `CONFIG_MODE == "yolo"` or `$ARGUMENTS` contains `--auto`:** Skip the menu. Auto-select **A) Autonomous run** and print one line: `▶ Auto-selecting Autonomous run (yolo mode). /rihal:settings set mode guided to change.`
|
|
65
|
+
|
|
66
|
+
Otherwise, offer three modes via AskUserQuestion. Each option names the tradeoff explicitly:
|
|
61
67
|
|
|
62
68
|
**A) Autonomous run** — Spawn subagent per plan in sequence/parallel per
|
|
63
69
|
wave rules. Checkpoints still pause for user. Fastest wall-clock.
|
|
@@ -157,7 +163,7 @@ Always use the exact name from this list — do not fall back to 'general-purpos
|
|
|
157
163
|
- rihal-codebase-mapper — Maps project structure and dependencies
|
|
158
164
|
- rihal-integration-checker — Checks cross-phase integration
|
|
159
165
|
- rihal-nyquist-auditor — Validates verification coverage
|
|
160
|
-
- rihal-
|
|
166
|
+
- rihal-ux-designer — Researches UI/UX approaches
|
|
161
167
|
- rihal-ui-auditor — Reviews UI implementation quality
|
|
162
168
|
- rihal-ui-auditor — Audits UI against design requirements
|
|
163
169
|
</available_agent_types>
|
package/rihal/workflows/help.md
CHANGED
|
@@ -109,7 +109,7 @@ init → new-project → plan → execute → next → status → ship
|
|
|
109
109
|
| `/rihal:code-review-fix` | Auto-apply fixes from a code-review report. |
|
|
110
110
|
| `/rihal:verify-phase <n>` | Goal-backward audit — does the codebase deliver what the phase promised? |
|
|
111
111
|
| `/rihal:verify-work` | Conversational UAT against acceptance criteria. |
|
|
112
|
-
| `/rihal:ship` |
|
|
112
|
+
| `/rihal:ship [phase] [--draft]` | Push feature branch + open PR with auto-generated body (goal, changes, requirements, verification status). Use AFTER `/rihal:verify-phase` passes. **Not for npm publish or tagging releases.** |
|
|
113
113
|
|
|
114
114
|
## Phase & plan management
|
|
115
115
|
|
|
@@ -382,28 +382,21 @@ Auto-fix some issues: /rihal:code-review-fix {phase}
|
|
|
382
382
|
|
|
383
383
|
</process>
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
## Success Criteria
|
|
386
|
+
|
|
386
387
|
- [ ] Input parsed correctly (phase, git ref, or file override)
|
|
387
388
|
- [ ] Source files filtered from non-code files
|
|
388
389
|
- [ ] All 4 principles audited with specific rules
|
|
389
390
|
- [ ] Findings include file:line references
|
|
390
|
-
- [ ] Severity levels assigned (critical/warning/info)
|
|
391
|
+
- [ ] Severity levels assigned (critical / warning / info)
|
|
391
392
|
- [ ] Report written with summary table and details
|
|
392
393
|
- [ ] User receives actionable recommendations
|
|
393
394
|
- [ ] Report saved to phase dir if phase mode
|
|
394
|
-
</success_criteria>
|
|
395
|
-
|
|
396
|
-
## Success Criteria
|
|
397
|
-
|
|
398
|
-
- [ ] Task completed as requested
|
|
399
|
-
- [ ] Output saved or reported
|
|
400
|
-
- [ ] State updated if necessary
|
|
401
|
-
- [ ] No errors encountered
|
|
402
395
|
|
|
403
396
|
## On Error
|
|
404
397
|
|
|
405
|
-
|
|
406
|
-
-
|
|
407
|
-
-
|
|
408
|
-
-
|
|
398
|
+
- **Phase not found:** suggest `/rihal:karpathy-audit HEAD~5..HEAD` as the git-ref fallback.
|
|
399
|
+
- **No source files in diff:** report "no auditable changes in range" and STOP — do not invent findings.
|
|
400
|
+
- **karpathy-guidelines.md missing:** print "Reference doc missing. Run: npx @hanzlaa/rcode install ." and STOP.
|
|
401
|
+
- **Empty diff:** STOP gracefully, do not run principle checks against an empty input.
|
|
409
402
|
|
|
@@ -73,7 +73,13 @@ Extract from active SPRINT.md:
|
|
|
73
73
|
|
|
74
74
|
## Step 3 — Collect Blocking Constraints
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
```bash
|
|
77
|
+
CONFIG_MODE=$(node .rihal/bin/rihal-tools.cjs config-get mode 2>/dev/null || echo "guided")
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**If `CONFIG_MODE == "yolo"`:** Set `blocking_constraints = ""` and skip to Step 4.
|
|
81
|
+
|
|
82
|
+
Otherwise ask user via AskUserQuestion:
|
|
77
83
|
|
|
78
84
|
```
|
|
79
85
|
Question:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Workflow: rihal:prfaq
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Working Backwards PRFAQ challenge. Stress-test a product concept by writing the press release before building it. Produces a battle-hardened PRFAQ document + PRD distillate. Delegates to the rihal-prfaq skill for the full interview and generation protocol.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
@rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md
|
|
@@ -15,8 +15,8 @@ If `$ARGUMENTS` is empty or contains only `--help` or `-h`:
|
|
|
15
15
|
|
|
16
16
|
**Examples:**
|
|
17
17
|
```
|
|
18
|
-
/rihal:profile-user
|
|
19
|
-
/rihal:profile-user
|
|
18
|
+
/rihal:profile-user
|
|
19
|
+
/rihal:profile-user --json '{"communication":"Direct & dense","autonomy":"Autonomous","domain_depth":"Advanced","iteration_speed":"Fast"}'
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
STOP — do not proceed.
|