@hanzlaa/rcode 3.4.4 → 3.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CONTRIBUTING.md +63 -1
- package/README.md +9 -4
- package/cli/generate-command-skills.cjs +21 -9
- package/cli/index.js +0 -0
- package/cli/install.js +126 -7
- package/cli/lib/manifest.cjs +1 -1
- package/cli/uninstall.js +8 -0
- package/dist/rcode.js +1279 -2004
- package/package.json +16 -17
- package/rihal/agents/rihal-ahmed.md +2 -1
- package/rihal/agents/rihal-code-fixer.md +46 -0
- package/rihal/agents/rihal-code-reviewer.md +46 -1
- package/rihal/agents/rihal-deviation-analyzer.md +1 -0
- package/rihal/agents/rihal-docs-auditor.md +106 -1
- package/rihal/agents/rihal-edge-case-hunter.md +47 -1
- package/rihal/agents/rihal-executor.md +1 -1
- package/rihal/agents/rihal-khalid.md +40 -1
- package/rihal/agents/rihal-layla.md +2 -1
- package/rihal/agents/rihal-nasser.md +2 -1
- package/rihal/agents/rihal-noor.md +3 -2
- package/rihal/agents/rihal-nyquist-auditor.md +1 -1
- package/rihal/agents/rihal-phase-researcher.md +46 -1
- package/rihal/agents/rihal-planner.md +1 -1
- package/rihal/agents/rihal-profiler.md +45 -2
- package/rihal/agents/rihal-project-researcher.md +47 -0
- package/rihal/agents/rihal-remediation-planner.md +45 -0
- package/rihal/agents/rihal-roadmapper.md +46 -0
- package/rihal/agents/rihal-security-adversary.md +46 -1
- package/rihal/agents/rihal-security-auditor.md +45 -1
- package/rihal/agents/rihal-ui-auditor.md +44 -1
- package/rihal/agents/rihal-ux-designer.md +41 -1
- package/rihal/agents/rihal-zahra.md +2 -1
- package/rihal/agents/rihal-zayd.md +2 -1
- package/rihal/bin/lib/config.cjs +13 -1
- package/rihal/bin/lib/council-panel.cjs +185 -23
- package/rihal/bin/lib/roadmap.cjs +27 -2
- package/rihal/bin/rihal-tools.cjs +1837 -99
- package/rihal/commands/audit.md +2 -2
- package/rihal/commands/capture.md +12 -0
- package/rihal/commands/diagnose-issues.md +18 -0
- package/rihal/commands/discuss-phase-power.md +18 -0
- package/rihal/commands/feature-drift.md +18 -0
- package/rihal/commands/karpathy-audit.md +18 -0
- package/rihal/commands/lens-audit.md +70 -0
- package/rihal/commands/new-project-research.md +18 -0
- package/rihal/commands/new-project-roadmap.md +18 -0
- package/rihal/commands/phase.md +11 -0
- package/rihal/references/continuation-format.md +3 -3
- package/rihal/references/output-format.md +79 -0
- package/rihal/references/revision-loop.md +1 -1
- package/rihal/references/verb-dictionary.md +85 -28
- package/rihal/skills/actions/1-analysis/rihal-prfaq/SKILL.md +1 -1
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/SKILL.md +12 -2
- package/rihal/skills/actions/2-plan/rihal-create-epics-and-stories/steps/step-04-final-validation.md +12 -0
- package/rihal/skills/actions/2-plan/rihal-create-prd/SKILL.md +12 -2
- package/rihal/skills/actions/2-plan/rihal-create-story/SKILL.md +12 -2
- package/rihal/skills/actions/4-implementation/rihal-browser-verify/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-checkpoint-preview/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-ci/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-code-review/SKILL.md +16 -4
- package/rihal/skills/actions/4-implementation/rihal-debug/SKILL.md +14 -1
- package/rihal/skills/actions/4-implementation/rihal-git-flow/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-harden/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-incremental/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-migrate/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-perf/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-prove-it/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-scaffold-project/steps/step-01-target.md +6 -0
- package/rihal/skills/actions/4-implementation/rihal-source-truth/SKILL.md +1 -1
- package/rihal/skills/actions/4-implementation/rihal-sprint-planning/SKILL.md +14 -3
- package/rihal/skills/actions/4-implementation/rihal-trim/SKILL.md +1 -1
- package/rihal/skills/agents/ahmed-hassani-director/SKILL.md +15 -1
- package/rihal/skills/agents/dalil-scout/SKILL.md +14 -2
- package/rihal/skills/agents/fatima-qa/SKILL.md +16 -1
- package/rihal/skills/agents/haitham-frontend/SKILL.md +13 -1
- package/rihal/skills/agents/hanzla-engineer/SKILL.md +13 -1
- package/rihal/skills/agents/hussain-pm/SKILL.md +16 -1
- package/rihal/skills/agents/hussain-sm/SKILL.md +14 -1
- package/rihal/skills/agents/layla-designer/SKILL.md +13 -1
- package/rihal/skills/agents/majlis-council/SKILL.md +16 -1
- package/rihal/skills/agents/mariam-marketing/SKILL.md +14 -1
- package/rihal/skills/agents/nasser-eng-manager/SKILL.md +16 -1
- package/rihal/skills/agents/noor-writer/SKILL.md +15 -1
- package/rihal/skills/agents/raees-orchestrator/SKILL.md +15 -1
- package/rihal/skills/agents/rihal-cross-platform-auditor/SKILL.md +162 -0
- package/rihal/skills/agents/rihal-dep-auditor/SKILL.md +151 -0
- package/rihal/skills/agents/rihal-deviation-analyzer/SKILL.md +78 -0
- package/rihal/skills/agents/rihal-i18n-auditor/SKILL.md +152 -0
- package/rihal/skills/agents/rihal-observability-auditor/SKILL.md +156 -0
- package/rihal/skills/agents/sadiq-analyst/SKILL.md +12 -2
- package/rihal/skills/agents/waleed-architect/SKILL.md +12 -2
- package/rihal/skills/agents/yousef-backend/SKILL.md +12 -2
- package/rihal/skills/agents/zahra-branding/SKILL.md +15 -1
- package/rihal/skills/agents/zayd-ml/SKILL.md +13 -1
- package/rihal/skills/core/rihal-advanced-elicitation/SKILL.md +2 -2
- package/rihal/skills/core/rihal-auth-audit/SKILL.md +1 -1
- package/rihal/skills/core/rihal-brainstorming/SKILL.md +13 -2
- package/rihal/skills/core/rihal-client-gate/SKILL.md +1 -1
- package/rihal/skills/core/rihal-clone-website/SKILL.md +11 -1
- package/rihal/skills/core/rihal-deploy-unify/SKILL.md +1 -1
- package/rihal/skills/core/rihal-distillator/SKILL.md +2 -2
- package/rihal/skills/core/rihal-editorial-review-prose/SKILL.md +1 -1
- package/rihal/skills/core/rihal-editorial-review-structure/SKILL.md +2 -2
- package/rihal/skills/core/rihal-help/SKILL.md +18 -1
- package/rihal/skills/core/rihal-incident-record/SKILL.md +1 -1
- package/rihal/skills/core/rihal-index-docs/SKILL.md +1 -1
- package/rihal/skills/core/rihal-memory-audit/SKILL.md +18 -1
- package/rihal/skills/core/rihal-memory-init/SKILL.md +13 -1
- package/rihal/skills/core/rihal-memory-update/SKILL.md +13 -1
- package/rihal/skills/core/rihal-mvp-graduate/SKILL.md +1 -1
- package/rihal/skills/core/rihal-ocr-consistency/SKILL.md +1 -1
- package/rihal/skills/core/rihal-rebrand/SKILL.md +1 -1
- package/rihal/skills/core/rihal-review-adversarial-general/SKILL.md +1 -1
- package/rihal/skills/core/rihal-review-edge-case-hunter/SKILL.md +17 -1
- package/rihal/skills/core/rihal-shard-doc/SKILL.md +1 -1
- package/rihal/skills/core/rihal-theme-system/SKILL.md +1 -1
- package/rihal/team.yaml +0 -7
- package/rihal/templates/RESEARCH.md +84 -0
- package/rihal/templates/VALIDATION.md +45 -0
- package/rihal/templates/memory/INDEX.md +1 -0
- package/rihal/templates/memory/project/design-system.md +128 -0
- package/rihal/templates/summary.md +33 -3
- package/rihal/workflows/add-tests.md +1 -1
- package/rihal/workflows/add-todo.md +6 -0
- package/rihal/workflows/analyze-dependencies.md +6 -0
- package/rihal/workflows/audit-fix.md +12 -0
- package/rihal/workflows/audit-milestone.md +2 -2
- package/rihal/workflows/audit.md +23 -14
- package/rihal/workflows/autonomous-smart-discuss.md +247 -0
- package/rihal/workflows/autonomous.md +54 -267
- package/rihal/workflows/capture.md +60 -0
- package/rihal/workflows/chain.md +1 -1
- package/rihal/workflows/code-review-fix.md +6 -3
- package/rihal/workflows/code-review.md +34 -10
- package/rihal/workflows/complete-milestone.md +17 -8
- package/rihal/workflows/correct-course.md +6 -0
- package/rihal/workflows/council.md +37 -23
- package/rihal/workflows/create-architecture.md +31 -0
- package/rihal/workflows/create-epics-and-stories.md +7 -1
- package/rihal/workflows/create-prd.md +25 -0
- package/rihal/workflows/dashboard.md +1 -1
- package/rihal/workflows/debug.md +8 -0
- package/rihal/workflows/decisions.md +1 -1
- package/rihal/workflows/diff.md +6 -0
- package/rihal/workflows/discuss-phase-discuss-areas.md +271 -0
- package/rihal/workflows/discuss-phase.md +27 -266
- package/rihal/workflows/do.md +51 -12
- package/rihal/workflows/docs-update.md +3 -0
- package/rihal/workflows/document-project.md +7 -1
- package/rihal/workflows/edit-prd.md +31 -0
- package/rihal/workflows/enable-hooks.md +1 -1
- package/rihal/workflows/execute-regression-gates.md +131 -0
- package/rihal/workflows/execute-sprint.md +31 -2
- package/rihal/workflows/execute-verify-phase-goal.md +136 -0
- package/rihal/workflows/execute-waves.md +404 -0
- package/rihal/workflows/execute.md +101 -642
- package/rihal/workflows/feature-drift.md +243 -0
- package/rihal/workflows/forensics.md +10 -2
- package/rihal/workflows/health.md +65 -16
- package/rihal/workflows/help.md +36 -9
- package/rihal/workflows/import.md +17 -3
- package/rihal/workflows/init.md +20 -10
- package/rihal/workflows/install.md +2 -10
- package/rihal/workflows/lens-audit.md +689 -0
- package/rihal/workflows/map-codebase.md +7 -1
- package/rihal/workflows/memory-audit.md +67 -5
- package/rihal/workflows/memory-distill.md +10 -0
- package/rihal/workflows/memory-init.md +4 -0
- package/rihal/workflows/memory-update.md +4 -0
- package/rihal/workflows/new-milestone.md +7 -1
- package/rihal/workflows/new-project-create-roadmap.md +176 -0
- package/rihal/workflows/new-project-define-requirements.md +160 -0
- package/rihal/workflows/new-project-research-decision.md +247 -0
- package/rihal/workflows/new-project.md +3 -557
- package/rihal/workflows/note.md +1 -1
- package/rihal/workflows/phase.md +54 -0
- package/rihal/workflows/plan-milestone-gaps.md +1 -1
- package/rihal/workflows/plan-prd-express.md +108 -0
- package/rihal/workflows/plan-research-validation.md +313 -0
- package/rihal/workflows/plan-spawn-planner.md +204 -0
- package/rihal/workflows/plan.md +91 -532
- package/rihal/workflows/plant-seed.md +1 -1
- package/rihal/workflows/pr-branch.md +1 -1
- package/rihal/workflows/profile-user.md +1 -1
- package/rihal/workflows/quick.md +3 -3
- package/rihal/workflows/remove-phase.md +6 -1
- package/rihal/workflows/remove-workspace.md +6 -0
- package/rihal/workflows/rerun.md +1 -1
- package/rihal/workflows/research-phase.md +4 -2
- package/rihal/workflows/resume-work.md +8 -3
- package/rihal/workflows/retrospective.md +31 -0
- package/rihal/workflows/review-adversarial.md +12 -0
- package/rihal/workflows/review.md +6 -0
- package/rihal/workflows/scaffold-project.md +31 -0
- package/rihal/workflows/scan.md +10 -0
- package/rihal/workflows/secure-phase.md +15 -2
- package/rihal/workflows/session-report.md +32 -7
- package/rihal/workflows/ship.md +7 -2
- package/rihal/workflows/show.md +6 -0
- package/rihal/workflows/sprint-status.md +4 -4
- package/rihal/workflows/status.md +2 -2
- package/rihal/workflows/ui-phase.md +1 -1
- package/rihal/workflows/undo.md +2 -3
- package/rihal/workflows/update.md +2 -2
- package/rihal/workflows/validate-phase.md +1 -1
- package/rihal/workflows/validate-prd.md +31 -0
- package/rihal/workflows/verify-phase.md +38 -5
- package/rihal/workflows/verify-work.md +25 -11
- package/rihal/workflows/workstream.md +20 -8
- package/server/lib/html/client.js +13 -63
- package/server/lib/html/shell.js +0 -1
- package/server/lib/scanner.js +33 -2
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# Workflow: rihal-feature-drift
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Detect drift between PRD, epics, stories, and code. Report severity-tagged
|
|
5
|
+
findings; optionally fix trivial items in-place via opt-in `--fix` flag.
|
|
6
|
+
|
|
7
|
+
Closes the gap between feature-documentation layers that no other rihal tool
|
|
8
|
+
spans (`docs-update` covers project docs, `correct-course` covers PRD-vs-code
|
|
9
|
+
only, `memory-audit` reports but doesn't fix). Mirrors the writer+verifier
|
|
10
|
+
loop pattern established by `docs-update`.
|
|
11
|
+
</purpose>
|
|
12
|
+
|
|
13
|
+
<required_reading>
|
|
14
|
+
@.rihal/references/output-format.md
|
|
15
|
+
</required_reading>
|
|
16
|
+
|
|
17
|
+
<process>
|
|
18
|
+
|
|
19
|
+
<step name="parse_args">
|
|
20
|
+
Extract from $ARGUMENTS:
|
|
21
|
+
- `--fix` flag — opt-in auto-fix for trivial items only (severity allowlist enforced in code)
|
|
22
|
+
- `--quick` flag — fast-mode for hooks (Phase 8). Skips deep verifier loop, runs the auditor scan only. Target runtime <2s. **QUICK_MODE always implies report-only — never patches even if `--fix` is also passed.**
|
|
23
|
+
- `--scope <phase|project>` — phase scope reads phase-local docs; project scope reads root docs
|
|
24
|
+
- `--mode <feature|phase-status>` — drift dimension. `feature` (default) compares PRD↔epics↔stories↔code. `phase-status` (Phase 8 / #461) compares ROADMAP claim against shipping reality (SUMMARY.md presence, SPRINT.md presence, git log).
|
|
25
|
+
- Optional positional phase number (only required when scope=phase)
|
|
26
|
+
|
|
27
|
+
Default scope: project (root `.planning/PRD.md`, `.planning/epics/`, `.planning/stories/`). Default mode: feature.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
FIX_MODE=false
|
|
31
|
+
QUICK_MODE=false
|
|
32
|
+
MODE="feature"
|
|
33
|
+
|
|
34
|
+
if [[ "$ARGUMENTS" =~ (^|[[:space:]])--fix($|[[:space:]]) ]]; then
|
|
35
|
+
FIX_MODE=true
|
|
36
|
+
fi
|
|
37
|
+
if [[ "$ARGUMENTS" =~ (^|[[:space:]])--quick($|[[:space:]]) ]]; then
|
|
38
|
+
QUICK_MODE=true
|
|
39
|
+
# Safety: --quick forces report-only regardless of --fix.
|
|
40
|
+
# Hooks must never auto-modify files.
|
|
41
|
+
FIX_MODE=false
|
|
42
|
+
fi
|
|
43
|
+
if [[ "$ARGUMENTS" =~ --mode[[:space:]]+(feature|phase-status) ]]; then
|
|
44
|
+
MODE="${BASH_REMATCH[1]}"
|
|
45
|
+
fi
|
|
46
|
+
if [[ "$ARGUMENTS" =~ --mode=(feature|phase-status) ]]; then
|
|
47
|
+
MODE="${BASH_REMATCH[1]}"
|
|
48
|
+
fi
|
|
49
|
+
```
|
|
50
|
+
</step>
|
|
51
|
+
|
|
52
|
+
<step name="load_artifacts">
|
|
53
|
+
Locate and read the layers that exist; track which layers are absent.
|
|
54
|
+
|
|
55
|
+
For project scope:
|
|
56
|
+
- PRD: `.planning/PRD.md` (or `.planning/REQUIREMENTS.md` as fallback)
|
|
57
|
+
- Epics: `.planning/epics/*.md`
|
|
58
|
+
- Stories: `.planning/stories/*.md`
|
|
59
|
+
- Code surface: `src/`, `lib/`, `packages/`, `app/` (best-effort directory discovery)
|
|
60
|
+
|
|
61
|
+
For phase scope (phase number passed):
|
|
62
|
+
- PRD: `.planning/phases/{N}-*/PRD.md` (or per-phase REQUIREMENTS.md)
|
|
63
|
+
- Epics: `.planning/phases/{N}-*/epics/*.md`
|
|
64
|
+
- Stories: `.planning/phases/{N}-*/stories/*.md`
|
|
65
|
+
- Code surface: same as project scope, plus any phase-specific `files_modified` from prior SPRINT.md
|
|
66
|
+
|
|
67
|
+
For each missing artifact, log a warning to stdout and continue. This is
|
|
68
|
+
**fail-open with notice** per Phase 6 D-3: never block scanning when an
|
|
69
|
+
upstream layer is absent — report partial scope clearly.
|
|
70
|
+
|
|
71
|
+
Track `present_layers[]` (subset of `["prd","epics","stories","code"]`).
|
|
72
|
+
</step>
|
|
73
|
+
|
|
74
|
+
<step name="scan_drift">
|
|
75
|
+
**If `MODE=feature` (default):**
|
|
76
|
+
|
|
77
|
+
Spawn `rihal-docs-auditor` with `--mode=feature-drift`. Pass:
|
|
78
|
+
- artifact contents (from previous step)
|
|
79
|
+
- `present_layers[]` so the auditor doesn't claim drift between absent layers
|
|
80
|
+
- code surface paths
|
|
81
|
+
|
|
82
|
+
Auditor returns structured JSON:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"drift": [
|
|
87
|
+
{
|
|
88
|
+
"id": "drift-001",
|
|
89
|
+
"severity": "trivial|minor|major|critical",
|
|
90
|
+
"layer_a": "prd|epics|stories|code",
|
|
91
|
+
"layer_b": "prd|epics|stories|code",
|
|
92
|
+
"claim_a": "<text from layer_a>",
|
|
93
|
+
"claim_b": "<text from layer_b>",
|
|
94
|
+
"file": "<path>",
|
|
95
|
+
"line": <number-or-null>,
|
|
96
|
+
"fix_hint": "<exact replacement string when severity=trivial; otherwise null>"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"layers_skipped": ["..."]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**If `MODE=phase-status` (Phase 8 / #461):**
|
|
104
|
+
|
|
105
|
+
Spawn `rihal-docs-auditor` with `--mode=phase-status`. Pass:
|
|
106
|
+
- `roadmap_phases[]` — output of `node rihal/bin/rihal-tools.cjs roadmap list-phases` (post-#464 fix)
|
|
107
|
+
- `phase_dirs[]` — output of `node rihal/bin/rihal-tools.cjs init phase-op N` for each phase number, OR a direct walk of `.planning/phases/*` that captures: dir name, presence of `*-SUMMARY.md`, `*-SPRINT.md`, `*-PLAN.md`, `*-CONTEXT.md`, `*-RESEARCH.md`, `*-VERIFICATION.md`
|
|
108
|
+
- For each phase, the most recent commit hash that touches files in `${phase_dir}/` (used as a freshness signal)
|
|
109
|
+
|
|
110
|
+
Auditor returns structured JSON:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"drift": [
|
|
115
|
+
{
|
|
116
|
+
"id": "phase-status-drift-001",
|
|
117
|
+
"severity": "trivial|partial|major",
|
|
118
|
+
"phase_number": "<N>",
|
|
119
|
+
"claimed_status": "Complete|Active|Planned",
|
|
120
|
+
"shipping_signals": {
|
|
121
|
+
"has_summary": true,
|
|
122
|
+
"has_sprint": true,
|
|
123
|
+
"last_commit_iso": "<YYYY-MM-DD>",
|
|
124
|
+
"phase_dir_present": true
|
|
125
|
+
},
|
|
126
|
+
"evidence": "<one-line summary of why this is drift>",
|
|
127
|
+
"fix_hint": "<for trivial: exact ROADMAP edit (e.g., add ✓ marker); for partial/major: null>"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Severity rules (HARD, enforced in this workflow not delegated):**
|
|
134
|
+
- `trivial` — missing `✓` marker on heading even though Status says Complete; or missing date on Status: Complete line. `fix_hint` carries the exact insertion.
|
|
135
|
+
- `partial` — N of M acceptance items shipped per phase ROADMAP entry; status doesn't reflect partial state. `fix_hint` is null — humans must decide whether to flip status or update acceptance.
|
|
136
|
+
- `major` — entirely-incorrect status. Examples: Status: Complete with NO SUMMARY.md and NO commits on phase scope; Status: Planned but ALL acceptance items shipped (the Phase 4 case from this session). `fix_hint` always null — humans must decide.
|
|
137
|
+
|
|
138
|
+
Parse the JSON. If parsing fails or the `drift` field is absent, treat the auditor's response as a malfunction and abort with a clear error pointing the user at the agent definition.
|
|
139
|
+
</step>
|
|
140
|
+
|
|
141
|
+
<step name="severity_classify">
|
|
142
|
+
Hard allowlist for `--fix` mode — enforced in code, not by agent discretion.
|
|
143
|
+
|
|
144
|
+
Trivial only:
|
|
145
|
+
- typo correction (single-word misspelling, lowercase/uppercase letter case)
|
|
146
|
+
- stale ISO date (e.g., "2024-12-31" when current date is later)
|
|
147
|
+
- broken relative path (e.g., docs reference `./foo.md` but file moved)
|
|
148
|
+
- factually-wrong-and-mechanically-correctable values (e.g., "API returns JSON" when code returns YAML — only when `fix_hint` carries the exact replacement)
|
|
149
|
+
|
|
150
|
+
Anything else (minor / major / critical) is **report-only** — never patched
|
|
151
|
+
even if `--fix` is set. This is the safety promise of D-2; do not weaken it.
|
|
152
|
+
</step>
|
|
153
|
+
|
|
154
|
+
<step name="report_or_fix">
|
|
155
|
+
**If `FIX_MODE=false`:**
|
|
156
|
+
|
|
157
|
+
Determine output path:
|
|
158
|
+
- Inside a phase context: `${phase_dir}/DRIFT.md`
|
|
159
|
+
- Otherwise: `.planning/audits/feature-drift-${ISO-date}.md`
|
|
160
|
+
|
|
161
|
+
Write the report grouped by severity (critical / major / minor / trivial),
|
|
162
|
+
each section listing the findings with: layer pair, claim mismatch, file:line.
|
|
163
|
+
Print summary: `{N} drift findings — {trivial}/{minor}/{major}/{critical}`.
|
|
164
|
+
|
|
165
|
+
**Phase ID convention for "proposed phase" / "Phase candidate" columns.**
|
|
166
|
+
If the report includes a column suggesting where a finding should land
|
|
167
|
+
(e.g. for downstream `/rihal-plan-milestone-gaps`), use the project's
|
|
168
|
+
real numeric phase numbering — never invent English-letter labels like
|
|
169
|
+
`P-NEW-AI-1` or `P-FIX-N`. Resolve the next free integer with:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
HIGHEST=$(node ".rihal/bin/rihal-tools.cjs" phases list --pick "directories[-1]" 2>/dev/null || echo "")
|
|
173
|
+
# Extract leading number; next candidate = N + 1, N + 2, ...
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Or for a related cluster of findings, propose decimals under the most
|
|
177
|
+
relevant existing phase (e.g. 14.1, 14.2) — the CLI auto-resolves the
|
|
178
|
+
next free `parent.M` via `phase add --decimal <parent>` (#477 item C).
|
|
179
|
+
|
|
180
|
+
This convention follows the `feedback-no-leading-zeros` rule from the
|
|
181
|
+
Memory Bank: phase 6 not 06, phase 14.1 not 14-01, never letter-prefixed
|
|
182
|
+
ad-hoc IDs.
|
|
183
|
+
|
|
184
|
+
**If `FIX_MODE=true`:**
|
|
185
|
+
|
|
186
|
+
Bounded fix loop, max 3 passes:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
pass = 0
|
|
190
|
+
while pass < 3:
|
|
191
|
+
pass += 1
|
|
192
|
+
trivial_findings = drift.filter(d => d.severity == "trivial")
|
|
193
|
+
if trivial_findings is empty: break
|
|
194
|
+
|
|
195
|
+
for each trivial finding:
|
|
196
|
+
spawn rihal-noor (writer) with the fix_hint payload
|
|
197
|
+
after the writer returns, run:
|
|
198
|
+
git add <file>
|
|
199
|
+
git commit -m "fix(drift): <what was stale> → <what's true now>"
|
|
200
|
+
|
|
201
|
+
re-run scan_drift (the auditor) to detect any new drift surfaced by the fixes
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
For findings with severity > trivial: add to the report only; never patch.
|
|
205
|
+
|
|
206
|
+
After the loop, write the final report (same path as report-only mode), and
|
|
207
|
+
print: `Fixed {N} trivial drifts across {N} commits. Report: {path}`.
|
|
208
|
+
</step>
|
|
209
|
+
|
|
210
|
+
<step name="commit">
|
|
211
|
+
If `--fix` produced commits, those were already atomic per fix — no further
|
|
212
|
+
work is needed.
|
|
213
|
+
|
|
214
|
+
The report file itself is committed only when `commit_docs` is true:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
COMMIT_DOCS=$(node ".rihal/bin/rihal-tools.cjs" config-get commit_docs 2>/dev/null || echo "false")
|
|
218
|
+
if [[ "$COMMIT_DOCS" == "true" ]]; then
|
|
219
|
+
git add "${REPORT_PATH}"
|
|
220
|
+
git commit -m "docs(drift): scan ${ISO_DATE}"
|
|
221
|
+
fi
|
|
222
|
+
```
|
|
223
|
+
</step>
|
|
224
|
+
|
|
225
|
+
</process>
|
|
226
|
+
|
|
227
|
+
<guardrails>
|
|
228
|
+
- NEVER patch items above trivial severity, even if user passes a `--force` flag (don't even accept --force here)
|
|
229
|
+
- NEVER spawn parallel writer agents — drift fixes must be sequential to avoid conflicting edits to the same file
|
|
230
|
+
- Bounded fix loop: max 3 passes. If trivial findings remain after 3 passes, abort the loop and report them as unresolvable
|
|
231
|
+
- If `layers_skipped` is non-empty, the report MUST clearly state which drift could not be detected (so the absence of findings doesn't read as "no drift exists")
|
|
232
|
+
- The hard severity allowlist (trivial only for --fix) is enforced in this workflow's code path, not delegated to the agent. Do not move the check into the agent.
|
|
233
|
+
- **`--quick` and `--fix` interaction (Phase 8):** when `QUICK_MODE=true`, `FIX_MODE` is forced to false in parse_args. Hooks must never auto-modify files. If a user explicitly invokes `feature-drift --quick --fix`, the workflow runs in report-only and prints a notice that `--fix` was suppressed by `--quick`. Do not weaken this rule.
|
|
234
|
+
- **`--mode=phase-status` (Phase 8 / #461):** detector reads ROADMAP.md `**Status:**` lines and compares against shipping signals (SUMMARY.md, SPRINT.md, git log on phase scope). Severity rules: trivial = missing ✓ marker; partial = N of M acceptance items shipped; major = entirely-incorrect-status (e.g., Complete with no SUMMARY, Planned with all artifacts shipped). `--fix` patches only the trivial tier (✓ marker addition + missing date). NEVER auto-flip Active→Complete or Planned→Complete — those are decisions, not corrections.
|
|
235
|
+
</guardrails>
|
|
236
|
+
|
|
237
|
+
<success_criteria>
|
|
238
|
+
- [ ] DRIFT.md (or `audits/feature-drift-{ISO}.md`) written with severity-grouped sections
|
|
239
|
+
- [ ] When `--fix` set: only trivial items patched, each as atomic commit with `fix(drift):` message prefix
|
|
240
|
+
- [ ] When layers missing: report clearly states limited scope (`layers_skipped` block prominent)
|
|
241
|
+
- [ ] Bounded loop terminates within 3 passes
|
|
242
|
+
- [ ] Report-only mode (no `--fix`) preserves zero file modifications outside the report itself
|
|
243
|
+
</success_criteria>
|
|
@@ -54,7 +54,7 @@ Store as `$FAILED_EXECS`.
|
|
|
54
54
|
Scan `.planning/` directory for:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
find .planning/ -name "SPRINT.md" -type f
|
|
57
|
+
find .planning/ -maxdepth 5 -name "SPRINT.md" -type f | head -50
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
For each SPRINT.md found, check if a corresponding SUMMARY.md exists:
|
|
@@ -157,7 +157,7 @@ To continue:
|
|
|
157
157
|
|
|
158
158
|
**If no incomplete work found:**
|
|
159
159
|
```
|
|
160
|
-
|
|
160
|
+
✓ No incomplete executions detected. All phases complete or active.
|
|
161
161
|
```
|
|
162
162
|
|
|
163
163
|
## Step 8 — Print full diagnostic report
|
|
@@ -199,3 +199,11 @@ If arguments are invalid, missing files, or subagent fails:
|
|
|
199
199
|
- Check that required files exist
|
|
200
200
|
- Retry with clearer arguments or report the specific error to the user
|
|
201
201
|
|
|
202
|
+
|
|
203
|
+
## ▶ Next Up
|
|
204
|
+
|
|
205
|
+
After reviewing the diagnostic report, pick your recovery path:
|
|
206
|
+
|
|
207
|
+
- **Phase stuck mid-execution:** `/rihal-resume-work`
|
|
208
|
+
- **Phase planned but not executed:** `/rihal-execute {phase-number}`
|
|
209
|
+
- **No incomplete work found:** `/rihal-progress` — view current state
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Workflow: rihal-health
|
|
2
2
|
|
|
3
3
|
<purpose>
|
|
4
|
-
Run
|
|
4
|
+
Run 9-point health check: 6 installation checks + 3 project-state checks. Each check is pass/fail. Summary at the end.
|
|
5
5
|
</purpose>
|
|
6
6
|
|
|
7
7
|
|
|
@@ -35,7 +35,7 @@ test -d .rihal && test -w .rihal
|
|
|
35
35
|
|
|
36
36
|
**Output on pass:**
|
|
37
37
|
```
|
|
38
|
-
|
|
38
|
+
✓ PASS — .rihal/ directory exists and is writable
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
**Output on fail:**
|
|
@@ -59,7 +59,7 @@ Verify:
|
|
|
59
59
|
|
|
60
60
|
**Output on pass:**
|
|
61
61
|
```
|
|
62
|
-
|
|
62
|
+
✓ PASS — files-manifest.csv is valid (N files tracked)
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
**Output on fail:**
|
|
@@ -81,7 +81,7 @@ Detect drift: files that exist but hash doesn't match.
|
|
|
81
81
|
|
|
82
82
|
**Output on pass:**
|
|
83
83
|
```
|
|
84
|
-
|
|
84
|
+
✓ PASS — All files match manifest (no drift detected)
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
**Output on fail (drift found):**
|
|
@@ -113,7 +113,7 @@ Parse as JSON. Verify top-level keys present:
|
|
|
113
113
|
|
|
114
114
|
**Output on pass:**
|
|
115
115
|
```
|
|
116
|
-
|
|
116
|
+
✓ PASS — state.json is valid and initialized
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
**Output on fail:**
|
|
@@ -136,7 +136,7 @@ Verify:
|
|
|
136
136
|
|
|
137
137
|
**Output on pass:**
|
|
138
138
|
```
|
|
139
|
-
|
|
139
|
+
✓ PASS — agent-manifest.csv is valid (N agents installed)
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
**Output on fail:**
|
|
@@ -155,7 +155,7 @@ node .rihal/bin/rihal-tools.cjs version
|
|
|
155
155
|
|
|
156
156
|
**Output on pass:**
|
|
157
157
|
```
|
|
158
|
-
|
|
158
|
+
✓ PASS — rihal-tools.cjs is executable and responsive
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
**Output on fail:**
|
|
@@ -163,26 +163,69 @@ node .rihal/bin/rihal-tools.cjs version
|
|
|
163
163
|
❌ FAIL — rihal-tools.cjs is missing or broken. Run: /rihal-update to repair
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
## Step 6 —
|
|
166
|
+
## Step 6 — Project state health checks (3 checks)
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
Run these after installation checks. Skip if `.rihal/state.json` doesn't exist.
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
**Check 7 — state.json phase count matches ROADMAP.md**
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
```bash
|
|
173
|
+
ROADMAP_PHASES=$(grep -c '^## Phase\|^### Phase\|^- Phase' .planning/ROADMAP.md 2>/dev/null || echo 0)
|
|
174
|
+
STATE_PHASES=$(node .rihal/bin/rihal-tools.cjs state read 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(len(d.get('phases',[])) if d else 0)" 2>/dev/null || echo 0)
|
|
173
175
|
```
|
|
174
|
-
|
|
176
|
+
|
|
177
|
+
If counts match: `✓ PASS — {N} phases in ROADMAP.md and state.json are in sync`
|
|
178
|
+
If they differ: `⚠ WARN — ROADMAP.md has ${ROADMAP_PHASES} phases, state.json has ${STATE_PHASES}. Run: /rihal-status to investigate`
|
|
179
|
+
|
|
180
|
+
**Check 8 — current phase has a SPRINT.md or CONTEXT.md**
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
CURRENT=$(node .rihal/bin/rihal-tools.cjs state read 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('current_phase',''))" 2>/dev/null)
|
|
184
|
+
find .planning/phases/*${CURRENT}* -name "*-SPRINT.md" -o -name "*-CONTEXT.md" 2>/dev/null | head -1
|
|
175
185
|
```
|
|
176
186
|
|
|
177
|
-
If
|
|
187
|
+
If current_phase is null or empty: skip this check (not started).
|
|
188
|
+
If file found: `✓ PASS — current phase ${CURRENT} has planning artifacts`
|
|
189
|
+
If no file: `⚠ WARN — current phase ${CURRENT} has no SPRINT.md or CONTEXT.md. Run: /rihal-plan ${CURRENT}`
|
|
190
|
+
|
|
191
|
+
**Check 9 — no phantom-complete phases (ROADMAP says complete but no artifacts)**
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
node .rihal/bin/rihal-tools.cjs state snapshot 2>/dev/null | python3 -c "
|
|
195
|
+
import json,sys
|
|
196
|
+
d=json.load(sys.stdin)
|
|
197
|
+
insights = d.get('insights', [])
|
|
198
|
+
phantom = [i for i in insights if i.get('kind') == 'phantom-complete']
|
|
199
|
+
print(len(phantom))
|
|
200
|
+
" 2>/dev/null || echo 0
|
|
178
201
|
```
|
|
179
|
-
|
|
180
|
-
|
|
202
|
+
|
|
203
|
+
If 0 phantoms: `✓ PASS — no phantom-complete phases detected`
|
|
204
|
+
If any: `⚠ WARN — {N} phantom-complete phase(s) detected. Run: /rihal-audit to inspect`
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Step 7 — Count results and print final summary
|
|
209
|
+
|
|
210
|
+
**Action:** Count all pass/fail/warn results and display overall status.
|
|
211
|
+
|
|
212
|
+
Total: `{N}/9 checks passed`
|
|
213
|
+
|
|
214
|
+
If all 9 pass:
|
|
215
|
+
```
|
|
216
|
+
✓ All systems nominal — rihal is healthy
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
If fewer than 9 pass:
|
|
220
|
+
```
|
|
221
|
+
⚠ {N}/9 checks passed — {M} issue(s) found
|
|
222
|
+
Run: /rihal-update to repair installation issues
|
|
223
|
+
Run: /rihal-status for project-state issues
|
|
181
224
|
```
|
|
182
225
|
|
|
183
226
|
## Success Criteria
|
|
184
227
|
|
|
185
|
-
- [ ] All
|
|
228
|
+
- [ ] All 9 checks executed (skip state checks if no state.json)
|
|
186
229
|
- [ ] Each check result printed clearly
|
|
187
230
|
- [ ] Final summary shows pass/fail count
|
|
188
231
|
- [ ] Repair instructions shown if any checks fail
|
|
@@ -192,3 +235,9 @@ Run: /rihal-update to repair
|
|
|
192
235
|
- **Directory not readable:** Print error and suggest filesystem check
|
|
193
236
|
- **CSV parsing fails:** Print error and suggest re-running update
|
|
194
237
|
- **JSON corruption:** Print error and suggest state.json reset
|
|
238
|
+
|
|
239
|
+
## ▶ Next Up
|
|
240
|
+
|
|
241
|
+
- **Issues found:** `/rihal-forensics` — deep diagnostic on specific failures
|
|
242
|
+
- **Ready to continue:** `/rihal-do` — interactive router guides next step
|
|
243
|
+
- **Fix specific phase:** `/rihal-correct-course {phase}` — targeted correction
|
package/rihal/workflows/help.md
CHANGED
|
@@ -37,6 +37,15 @@ Output the matching `<tier-N>` block below verbatim. For `all`, output all three
|
|
|
37
37
|
> **Rihal** is council-driven project automation built for solo agentic work in Claude Code.
|
|
38
38
|
> Tier 1 is everything you need to ship a small project end-to-end. **8 commands.**
|
|
39
39
|
|
|
40
|
+
## Not installed yet?
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx @hanzlaa/rcode install # install into current project
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Run this once from your project root. Then open a new Claude Code session and use the commands below.
|
|
47
|
+
Need help? See `docs/getting-started.md` or run `/rihal-help` after install.
|
|
48
|
+
|
|
40
49
|
## The loop
|
|
41
50
|
|
|
42
51
|
```
|
|
@@ -116,20 +125,22 @@ init → new-project → plan → execute → next → status → ship
|
|
|
116
125
|
| Command | When to use |
|
|
117
126
|
|---------|-------------|
|
|
118
127
|
| `/rihal-show <id>` | Print a phase or plan in full with execution status. |
|
|
119
|
-
| `/rihal-
|
|
120
|
-
| `/rihal-
|
|
121
|
-
| `/rihal-
|
|
128
|
+
| `/rihal-phase <name> [--insert \| --remove]` | **Unified phase CRUD.** Default: append next integer phase. `--insert <parent>` slots a decimal phase. `--remove <id>` deletes an unstarted future phase. |
|
|
129
|
+
| `/rihal-add-phase <name>` | Alias for `/rihal-phase <name>`. |
|
|
130
|
+
| `/rihal-insert-phase <after> <name>` | Alias for `/rihal-phase --insert <after> <name>`. |
|
|
131
|
+
| `/rihal-remove-phase <n>` | Alias for `/rihal-phase --remove <n>`. |
|
|
122
132
|
| `/rihal-quick [flags]` | Small ad-hoc tasks with Rihal guarantees but skip optional agents. Flags: `--discuss`, `--research`, `--full`. |
|
|
123
|
-
| `/rihal-fast "<task>"` | Trivial inline task — typo, gitignore tweak, etc. No subagents, ≤3 file edits. |
|
|
133
|
+
| `/rihal-fast "<task>"` | Trivial inline task — typo, gitignore tweak, etc. No subagents, ≤3 file edits. *Not yet implemented (#482-B).* |
|
|
124
134
|
|
|
125
135
|
## Capture & session continuity
|
|
126
136
|
|
|
127
137
|
| Command | When to use |
|
|
128
138
|
|---------|-------------|
|
|
129
|
-
| `/rihal-
|
|
130
|
-
| `/rihal-add-todo [desc]` |
|
|
131
|
-
| `/rihal-
|
|
132
|
-
| `/rihal-plant-seed "<idea>"` |
|
|
139
|
+
| `/rihal-capture "<text>" [--note \| --seed \| --list]` | **Unified capture.** Default: todo. `--note` for passive observation. `--seed` for forward-looking idea with trigger conditions. `--list` to show pending todos. |
|
|
140
|
+
| `/rihal-add-todo [desc]` | Alias for `/rihal-capture` (default mode). |
|
|
141
|
+
| `/rihal-note "<text>"` | Alias for `/rihal-capture --note`. |
|
|
142
|
+
| `/rihal-plant-seed "<idea>"` | Alias for `/rihal-capture --seed`. |
|
|
143
|
+
| `/rihal-check-todos [area]` | Alias for `/rihal-capture --list`. |
|
|
133
144
|
| `/rihal-resume-work` | Restore project context after a break. |
|
|
134
145
|
| `/rihal-pause-work` | Create HANDOFF.json and continue-here.md before stopping mid-phase. |
|
|
135
146
|
| `/rihal-session-report` | Work summary, decisions, open blockers from this session. |
|
|
@@ -175,6 +186,10 @@ init → new-project → plan → execute → next → status → ship
|
|
|
175
186
|
| `/rihal-audit-uat` | Cross-phase audit of all outstanding UAT items. |
|
|
176
187
|
| `/rihal-audit-fix` | Autonomous audit-to-fix pipeline — find, classify, fix, test, commit. |
|
|
177
188
|
| `/rihal-code-review --karpathy` | Audit recent code against Karpathy's 4 LLM coding principles. |
|
|
189
|
+
| `/rihal-karpathy-audit` | Full Karpathy engineering principles audit across the codebase. |
|
|
190
|
+
| `/rihal-check-implementation-readiness` | Verify a feature is fully ready to implement before writing code. |
|
|
191
|
+
| `/rihal-review-edge-case-hunter` | Hunt for edge cases and boundary conditions before execution. |
|
|
192
|
+
| `/rihal-diagnose-issues` | Triage and diagnose systemic issues before a debug session. |
|
|
178
193
|
| `/rihal-ui-phase <n>` | Generate UI design contract (UI-SPEC.md) for frontend phases. |
|
|
179
194
|
| `/rihal-ui-review` | Retroactive 6-pillar visual audit of completed UI work. |
|
|
180
195
|
| `/rihal-code-review --attack` | Hostile-perspective report — vulnerabilities, race conditions, abuse. |
|
|
@@ -186,6 +201,7 @@ init → new-project → plan → execute → next → status → ship
|
|
|
186
201
|
| Command | Use |
|
|
187
202
|
|---------|-----|
|
|
188
203
|
| `/rihal-discuss-phase --power` | Bulk question generation with async UI for context-heavy phases. |
|
|
204
|
+
| `/rihal-discuss-phase-power` | Standalone deep-dive phase discussion with full research + assumptions. |
|
|
189
205
|
| `/rihal-chain <preset> <topic>` | Sequential agent pipeline (research → scope → build), typed artifacts. |
|
|
190
206
|
| `/rihal-brainstorm` | Guided brainstorming — pick a method, generate ideas systematically. |
|
|
191
207
|
| `/rihal-why <decision>` | Explain reasoning behind a decision, classification, or panel pick. |
|
|
@@ -201,7 +217,7 @@ init → new-project → plan → execute → next → status → ship
|
|
|
201
217
|
| `/rihal-install <module>` | Install a Rihal capability bundle into the project. |
|
|
202
218
|
| `/rihal-enable-hooks` | Install optional Rihal hooks into `.claude/settings.json`. |
|
|
203
219
|
| `/rihal-scaffold-project` | Scaffold a new project from the official Rihal template. |
|
|
204
|
-
| `/rihal-bootstrap` | Bootstrap repo with Vercel-linked resources and integrations. |
|
|
220
|
+
| `/rihal-bootstrap` | Bootstrap repo with Vercel-linked resources and integrations. *Not yet implemented (#481).* |
|
|
205
221
|
|
|
206
222
|
## Story-level epics workflow
|
|
207
223
|
|
|
@@ -226,6 +242,17 @@ init → new-project → plan → execute → next → status → ship
|
|
|
226
242
|
| `/rihal-notify-test` | Verify Slack/Discord/MS Teams webhook wiring — posts a test message. |
|
|
227
243
|
| `/rihal-from-template <type>` | Seed .planning/ from a starter template (saas-b2b, api-backend, mobile-app). |
|
|
228
244
|
| `/rihal-retrospective` | Run an epic retrospective and produce owned action items. |
|
|
245
|
+
| `/rihal-new-project-research` | Research subcommand — deep research before new project roadmap creation. |
|
|
246
|
+
| `/rihal-new-project-roadmap` | Roadmap subcommand — generate phase roadmap from new project research. |
|
|
247
|
+
|
|
248
|
+
## Memory
|
|
249
|
+
|
|
250
|
+
| Command | Use |
|
|
251
|
+
|---------|-----|
|
|
252
|
+
| `/rihal-memory-init` | Initialize the memory bank for a project (first-time setup). |
|
|
253
|
+
| `/rihal-memory-update` | Update a specific memory entry with new information. |
|
|
254
|
+
| `/rihal-memory-audit` | Audit all memory files for staleness and coverage gaps. |
|
|
255
|
+
| `/rihal-memory-distill` | Distill verbose memory into concise, LLM-friendly summaries. |
|
|
229
256
|
|
|
230
257
|
## Operational / rare
|
|
231
258
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Import Workflow
|
|
2
2
|
|
|
3
|
+
<purpose>
|
|
4
|
+
External plan ingestion with conflict detection and agent delegation. Imports an externally-authored plan, detects conflicts against existing project decisions, writes SPRINT.md, and validates via rihal-sprint-checker.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
3
7
|
External plan ingestion with conflict detection and agent delegation.
|
|
4
8
|
|
|
5
9
|
- **--from**: Import external plan → conflict detection → write SPRINT.md → validate via rihal-sprint-checker
|
|
@@ -97,7 +101,7 @@ Load project context for conflict detection:
|
|
|
97
101
|
**If REQUIREMENTS.md does not exist:** skip requirement conflict checks and continue.
|
|
98
102
|
4. Glob for all CONTEXT.md files across phase directories:
|
|
99
103
|
```bash
|
|
100
|
-
find .planning/phases/ -name "*-CONTEXT.md" -o -name "CONTEXT.md" 2>/dev/null
|
|
104
|
+
find .planning/phases/ -name "*-CONTEXT.md" -o -name "CONTEXT.md" 2>/dev/null | sort | tail -5
|
|
101
105
|
```
|
|
102
106
|
Read each CONTEXT.md found — extract locked decisions (any decision in a `<decisions>` block)
|
|
103
107
|
|
|
@@ -243,12 +247,22 @@ Task({
|
|
|
243
247
|
})
|
|
244
248
|
```
|
|
245
249
|
|
|
246
|
-
If the
|
|
250
|
+
**If the Task() call itself fails** (subagent could not start, tool error, or unexpected exception):
|
|
251
|
+
|
|
252
|
+
Display:
|
|
253
|
+
```
|
|
254
|
+
⚠ Sprint-checker could not run (subagent error). The plan file was written but validation was skipped.
|
|
255
|
+
You can validate manually later with: /rihal-discuss fatima review .planning/phases/{phase}/{plan}-SPRINT.md
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Proceed to plan_finalize — do NOT abort the import over a validator failure.
|
|
259
|
+
|
|
260
|
+
**If the checker returns errors:**
|
|
247
261
|
- Display the errors to the user
|
|
248
262
|
- Ask the user to resolve issues before the plan is considered imported
|
|
249
263
|
- Do not delete the written file — the user can fix and re-validate manually
|
|
250
264
|
|
|
251
|
-
If the checker returns clean
|
|
265
|
+
**If the checker returns clean:**
|
|
252
266
|
- Display: "Plan validation passed"
|
|
253
267
|
|
|
254
268
|
</step>
|
package/rihal/workflows/init.md
CHANGED
|
@@ -69,18 +69,28 @@ Print one-line state summary:
|
|
|
69
69
|
|
|
70
70
|
If `state === "returning"` and `--reset` not passed:
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
✓ Rihal is already configured here.
|
|
72
|
+
- If `rihla-present: yes` — print the standard returning message and STOP:
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
/rihal-status — see the dashboard
|
|
78
|
-
/rihal-next — suggested next action
|
|
74
|
+
```
|
|
75
|
+
✓ Rihal is already configured here.
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
What next?
|
|
78
|
+
/rihal-resume-work — pick up where you left off
|
|
79
|
+
/rihal-status — see the dashboard
|
|
80
|
+
/rihal-next — suggested next action
|
|
81
|
+
|
|
82
|
+
Or run with --reset to reconfigure.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- If `rihla-present: no` — RIHLA.md is missing from a partial prior init. Do NOT stop. Print a recovery notice and continue to Steps 4 and 4b to write the missing baseline:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
✓ Rihal is already configured here.
|
|
89
|
+
|
|
90
|
+
RIHLA.md baseline is missing — completing the scan step now...
|
|
91
|
+
```
|
|
82
92
|
|
|
83
|
-
|
|
93
|
+
Skip Steps 2 and 3 (config already exists). Jump directly to Step 4.
|
|
84
94
|
|
|
85
95
|
## Step 2 — Ask the questions
|
|
86
96
|
|
|
@@ -336,5 +346,5 @@ Silent if state tools fail.
|
|
|
336
346
|
- **AskUserQuestion unavailable:** fall back to reading defaults from env / existing config and skip the interactive step.
|
|
337
347
|
- **config.yaml write fails:** print permission error and stop.
|
|
338
348
|
- **git not installed:** skip git detection, still proceed.
|
|
339
|
-
- **rihal-tools.cjs not found:** this command requires the installer to have run — point user to `install
|
|
349
|
+
- **rihal-tools.cjs not found:** this command requires the installer to have run — point user to `npx @hanzlaa/rcode install`.
|
|
340
350
|
- **Existing RIHLA.md without `--reset`:** do NOT overwrite; note it in Step 4 output.
|
|
@@ -47,21 +47,13 @@ And stop.
|
|
|
47
47
|
The installer needs to be called with the `--module` flag. Detect the rihal-code package location:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
|
|
51
|
-
if [ -f ./cli/install-v2.js ]; then
|
|
52
|
-
node ./cli/install-v2.js . --module {name} --force --yes
|
|
53
|
-
elif [ -f "$(npm root -g)/@hanzlaa/rcode/cli/install-v2.js" ]; then
|
|
54
|
-
node "$(npm root -g)/@hanzlaa/rcode/cli/install-v2.js" . --module {name} --force --yes
|
|
55
|
-
else
|
|
56
|
-
echo "Cannot find rihal-code package. Install it globally or run from the repo."
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
50
|
+
npx @hanzlaa/rcode install --module {name} --force --yes
|
|
59
51
|
```
|
|
60
52
|
|
|
61
53
|
## Step 4 — Print summary
|
|
62
54
|
|
|
63
55
|
```
|
|
64
|
-
|
|
56
|
+
✓ Module installed: {name}
|
|
65
57
|
{description from module manifest}
|
|
66
58
|
|
|
67
59
|
New commands available:
|