@hanzlaa/rcode 3.6.3 → 3.6.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzlaa/rcode",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"description": "rcode — the AI team that never forgets. Persistent memory, specialist agents, and slash commands for AI IDEs. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
|
|
5
5
|
"main": "cli/index.js",
|
|
6
6
|
"bin": {
|
package/rihal/commands/audit.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rihal-audit
|
|
3
|
-
description: Single audit entry point — asks what to audit (phase, milestone, UAT, code, fix, work, lens) and dispatches to the right subroute. Honours .rihal/config.yaml mode.
|
|
4
|
-
argument-hint: "[phase | milestone | uat | code | fix | work | lens [<1-15> | all]] [...subroute args]"
|
|
3
|
+
description: Single audit entry point — asks what to audit (plans, phase, milestone, UAT, code, fix, work, lens) and dispatches to the right subroute. Honours .rihal/config.yaml mode.
|
|
4
|
+
argument-hint: "[plans | phase | milestone | uat | code | fix | work | lens [<1-15> | all]] [--report] [...subroute args]"
|
|
5
5
|
allowed-tools: Read, Write, Bash, AskUserQuestion
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Workflow: rihal-audit plans
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Forward-looking planning integrity audit. Reads every SPRINT.md, ROADMAP.md,
|
|
5
|
+
REQUIREMENTS.md, and STATE.md in the current milestone and checks for:
|
|
6
|
+
1. Structural completeness — phases with no sprints, sprints with no tasks, tasks missing must_haves
|
|
7
|
+
2. Status consistency — STATE.md current pointers vs actual sprint/phase status
|
|
8
|
+
3. Dependency integrity — depends_on and requirements references that don't resolve
|
|
9
|
+
4. Next action recommendation — one concrete /rihal-* command to run next
|
|
10
|
+
|
|
11
|
+
Unlike /rihal-audit-milestone (backward-looking), this audit is forward-looking:
|
|
12
|
+
it checks *planned* items before they are executed.
|
|
13
|
+
</purpose>
|
|
14
|
+
|
|
15
|
+
## Step 0 — Usage check
|
|
16
|
+
|
|
17
|
+
If `$ARGUMENTS` contains `--help` or `-h`:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/rihal-audit plans [--report] [--strict]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Examples:**
|
|
24
|
+
```
|
|
25
|
+
/rihal-audit plans
|
|
26
|
+
/rihal-audit plans --report
|
|
27
|
+
/rihal-audit plans --strict
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
STOP — do not proceed.
|
|
31
|
+
|
|
32
|
+
## Step 1 — Locate planning root
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
PLANNING=".planning"
|
|
36
|
+
ROADMAP="$PLANNING/ROADMAP.md"
|
|
37
|
+
STATE="$PLANNING/STATE.md"
|
|
38
|
+
REQS="$PLANNING/REQUIREMENTS.md"
|
|
39
|
+
PHASES_DIR="$PLANNING/phases"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If `$PLANNING` does not exist:
|
|
43
|
+
```
|
|
44
|
+
⚠ No .planning/ directory found.
|
|
45
|
+
Run /rihal-new-milestone to start a milestone.
|
|
46
|
+
```
|
|
47
|
+
STOP.
|
|
48
|
+
|
|
49
|
+
If `$ROADMAP` does not exist:
|
|
50
|
+
```
|
|
51
|
+
⚠ No ROADMAP.md found at $ROADMAP.
|
|
52
|
+
Run /rihal-new-milestone to define goals.
|
|
53
|
+
```
|
|
54
|
+
STOP.
|
|
55
|
+
|
|
56
|
+
## Step 2 — Collect all sprint files
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
SPRINT_FILES=$(find "$PHASES_DIR" -name "*-SPRINT.md" | sort)
|
|
60
|
+
PHASE_DIRS=$(find "$PHASES_DIR" -mindepth 1 -maxdepth 1 -type d | sort)
|
|
61
|
+
SPRINT_COUNT=$(echo "$SPRINT_FILES" | grep -c . || echo 0)
|
|
62
|
+
PHASE_COUNT=$(echo "$PHASE_DIRS" | grep -c . || echo 0)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Read STATE.md and extract:
|
|
66
|
+
- `current_phase` — the phase ID listed as current
|
|
67
|
+
- `current_sprint` — the sprint ID listed as current (if any)
|
|
68
|
+
- `milestone` — the active milestone name
|
|
69
|
+
|
|
70
|
+
Read ROADMAP.md and extract every numbered phase entry (lines like `## Phase NN` or
|
|
71
|
+
table rows with phase IDs). Store as `$ROADMAP_PHASES`.
|
|
72
|
+
|
|
73
|
+
Read REQUIREMENTS.md (if it exists) and extract every requirement ID
|
|
74
|
+
(e.g. `HIST-1`, `AUTH-3`) from headings or definition lines. Store as `$KNOWN_REQS`.
|
|
75
|
+
|
|
76
|
+
## Step 3 — Run checks
|
|
77
|
+
|
|
78
|
+
Initialize counters: `ERRORS=0`, `WARNINGS=0`. Build a findings array.
|
|
79
|
+
|
|
80
|
+
### Check A — Structural completeness
|
|
81
|
+
|
|
82
|
+
**A1. Phase directories with no sprint file**
|
|
83
|
+
|
|
84
|
+
For each directory in `$PHASE_DIRS`:
|
|
85
|
+
- If `find "$phase_dir" -name "*-SPRINT.md" | wc -l` returns 0
|
|
86
|
+
- AND no SUMMARY.md exists in that directory (i.e. not yet completed)
|
|
87
|
+
- → WARN: `Phase {phase_id} has no SPRINT.md — run /rihal-plan to create one`
|
|
88
|
+
|
|
89
|
+
**A2. Sprint files with no tasks**
|
|
90
|
+
|
|
91
|
+
For each file in `$SPRINT_FILES`:
|
|
92
|
+
- Read the file and check if a `<tasks>` block exists
|
|
93
|
+
- If `<tasks>` block is empty (no `<task` entries inside it)
|
|
94
|
+
- → WARN: `Sprint {sprint_id} has no tasks — run /rihal-sprint-planning to add stories`
|
|
95
|
+
|
|
96
|
+
**A3. Tasks missing must_haves / acceptance criteria**
|
|
97
|
+
|
|
98
|
+
For each sprint file:
|
|
99
|
+
- Parse the YAML frontmatter block (`---` ... `---`)
|
|
100
|
+
- Check if `must_haves` key is present and non-empty
|
|
101
|
+
- If missing or empty AND the sprint status is not `completed`
|
|
102
|
+
- → WARN: `Sprint {sprint_id} missing must_haves — add acceptance criteria before executing`
|
|
103
|
+
|
|
104
|
+
**A4. ROADMAP phases with no matching directory**
|
|
105
|
+
|
|
106
|
+
For each phase ID in `$ROADMAP_PHASES`:
|
|
107
|
+
- Check if a directory matching that ID exists in `$PHASES_DIR`
|
|
108
|
+
- If not, and the phase is not marked as skipped/cancelled in ROADMAP
|
|
109
|
+
- → ERROR: `ROADMAP lists Phase {id} but no directory exists — run /rihal-add-phase {id}`
|
|
110
|
+
|
|
111
|
+
### Check B — Status consistency
|
|
112
|
+
|
|
113
|
+
**B1. STATE.md current_phase points to a non-existent or completed phase**
|
|
114
|
+
|
|
115
|
+
Read `current_phase` from STATE.md.
|
|
116
|
+
|
|
117
|
+
If the phase directory does not exist:
|
|
118
|
+
- → ERROR: `STATE.md current_phase={id} but that phase directory does not exist`
|
|
119
|
+
|
|
120
|
+
If a SUMMARY.md exists in that phase directory (meaning it was completed and closed):
|
|
121
|
+
- → WARN: `STATE.md current_phase={id} is already completed (has SUMMARY.md) — run /rihal-next to advance`
|
|
122
|
+
|
|
123
|
+
**B2. STATE.md current_sprint points to a sprint where all tasks are done**
|
|
124
|
+
|
|
125
|
+
If STATE.md has a `current_sprint` value:
|
|
126
|
+
- Find the matching SPRINT.md file
|
|
127
|
+
- Count tasks with `status: done` vs total tasks
|
|
128
|
+
- If all tasks are done and sprint status is not `completed`
|
|
129
|
+
- → WARN: `Sprint {sprint_id} all tasks done but not closed — run /rihal-verify-phase to close it`
|
|
130
|
+
|
|
131
|
+
**B3. Phase directories with a SUMMARY.md but no entry in ROADMAP as completed**
|
|
132
|
+
|
|
133
|
+
For each phase in `$PHASE_DIRS`:
|
|
134
|
+
- If SUMMARY.md exists, the phase is done
|
|
135
|
+
- Check that ROADMAP.md reflects this (status column or checkmark)
|
|
136
|
+
- If ROADMAP still shows it as active/planned
|
|
137
|
+
- → WARN: `Phase {id} has SUMMARY.md (complete) but ROADMAP shows it as active — update ROADMAP`
|
|
138
|
+
|
|
139
|
+
### Check C — Dependency integrity
|
|
140
|
+
|
|
141
|
+
**C1. depends_on references non-existent sprint**
|
|
142
|
+
|
|
143
|
+
For each sprint file:
|
|
144
|
+
- Read the `depends_on` list from the YAML frontmatter
|
|
145
|
+
- For each entry in `depends_on`, check if a SPRINT.md with that phase/sprint ID exists
|
|
146
|
+
- If not found
|
|
147
|
+
- → ERROR: `Sprint {sprint_id} depends_on {missing_id} which does not exist`
|
|
148
|
+
|
|
149
|
+
**C2. requirements references unknown requirement ID**
|
|
150
|
+
|
|
151
|
+
For each sprint file:
|
|
152
|
+
- Read the `requirements` list from YAML frontmatter
|
|
153
|
+
- For each requirement ID, check if it appears in `$KNOWN_REQS` (from REQUIREMENTS.md)
|
|
154
|
+
- If REQUIREMENTS.md exists but the ID is missing
|
|
155
|
+
- → WARN: `Sprint {sprint_id} references unknown requirement {req_id} — add it to REQUIREMENTS.md`
|
|
156
|
+
|
|
157
|
+
**C3. Wave ordering: sprint with depends_on in a later wave**
|
|
158
|
+
|
|
159
|
+
For each sprint file:
|
|
160
|
+
- Read `wave` and `depends_on` from YAML frontmatter
|
|
161
|
+
- For each dependency, find the wave of the dependency sprint
|
|
162
|
+
- If dependency wave >= current sprint's wave
|
|
163
|
+
- → ERROR: `Sprint {sprint_id} (wave {w}) depends on {dep_id} (wave {dw}) — circular or forward dependency`
|
|
164
|
+
|
|
165
|
+
## Step 4 — Build findings report
|
|
166
|
+
|
|
167
|
+
Format all findings into severity groups:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
RIHAL ► AUDIT PLANS
|
|
171
|
+
|
|
172
|
+
Scanned: {PHASE_COUNT} phases, {SPRINT_COUNT} sprints
|
|
173
|
+
Milestone: {milestone}
|
|
174
|
+
|
|
175
|
+
━━━ ERRORS ({error_count}) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
176
|
+
{each ERROR finding, prefixed with ✗}
|
|
177
|
+
|
|
178
|
+
━━━ WARNINGS ({warning_count}) ━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
179
|
+
{each WARNING finding, prefixed with ⚠}
|
|
180
|
+
|
|
181
|
+
━━━ CLEAN ({clean_count}) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
182
|
+
{each passing check, prefixed with ✓}
|
|
183
|
+
|
|
184
|
+
━━━ NEXT ACTION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
185
|
+
{recommendation — see Step 5}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
If zero errors and zero warnings:
|
|
189
|
+
```
|
|
190
|
+
✓ All planning checks passed. Plans are coherent and ready to execute.
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Step 5 — Recommend next action
|
|
194
|
+
|
|
195
|
+
Pick exactly ONE recommended next command based on highest-priority finding:
|
|
196
|
+
|
|
197
|
+
| Condition (checked in order) | Recommendation |
|
|
198
|
+
|---|---|
|
|
199
|
+
| Any ERROR from Check C (dependency) | `/rihal-plan` — fix dependency before executing |
|
|
200
|
+
| Any ERROR from Check A4 (ROADMAP phase missing) | `/rihal-add-phase {id}` — create the missing phase |
|
|
201
|
+
| Any WARN from B1 (current_phase completed) | `/rihal-next` — advance to the next phase |
|
|
202
|
+
| Any WARN from B2 (sprint all-done not closed) | `/rihal-verify-phase` — close the current sprint |
|
|
203
|
+
| Any WARN from A1 (phase with no sprint) | `/rihal-plan` — create sprint plan for the earliest unplanned phase |
|
|
204
|
+
| Any WARN from A2 (sprint no tasks) | `/rihal-sprint-planning {sprint_id}` — groom the empty sprint |
|
|
205
|
+
| Any WARN from A3 (missing must_haves) | `/rihal-create-story` — add acceptance criteria |
|
|
206
|
+
| Any WARN from C2 (unknown requirement) | edit `REQUIREMENTS.md` — define the missing requirement |
|
|
207
|
+
| No findings | `/rihal-execute` — plans are clean, execute the next sprint |
|
|
208
|
+
|
|
209
|
+
Print as:
|
|
210
|
+
```
|
|
211
|
+
► Recommended next step:
|
|
212
|
+
{command}
|
|
213
|
+
{one-line reason}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Step 6 — Save report (if --report flag)
|
|
217
|
+
|
|
218
|
+
If `--report` is in `$ARGUMENTS`, write findings to:
|
|
219
|
+
```
|
|
220
|
+
.planning/audit-plans-{YYYY-MM-DD}.md
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Format:
|
|
224
|
+
```markdown
|
|
225
|
+
# Plan Audit — {milestone}
|
|
226
|
+
|
|
227
|
+
**Date:** {ISO-DATE}
|
|
228
|
+
**Phases scanned:** {count}
|
|
229
|
+
**Sprints scanned:** {count}
|
|
230
|
+
**Errors:** {count}
|
|
231
|
+
**Warnings:** {count}
|
|
232
|
+
|
|
233
|
+
## Findings
|
|
234
|
+
|
|
235
|
+
{all findings with severity}
|
|
236
|
+
|
|
237
|
+
## Next Action
|
|
238
|
+
|
|
239
|
+
{recommendation}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Success Criteria
|
|
243
|
+
|
|
244
|
+
- [ ] Runs without modification on any project with `.planning/` + ROADMAP.md
|
|
245
|
+
- [ ] Zero false positives on phases that have SUMMARY.md (already completed)
|
|
246
|
+
- [ ] Dependency check correctly resolves phase/sprint IDs from file paths
|
|
247
|
+
- [ ] Exactly one "next action" command printed at end
|
|
248
|
+
- [ ] `--report` writes a dated file under `.planning/`
|
|
249
|
+
|
|
250
|
+
## On Error
|
|
251
|
+
|
|
252
|
+
- `.planning/` missing → prompt to run `/rihal-new-milestone`
|
|
253
|
+
- ROADMAP.md missing → prompt to run `/rihal-new-milestone`
|
|
254
|
+
- No sprint files found → report as WARNING and recommend `/rihal-plan`
|
|
255
|
+
- REQUIREMENTS.md missing → skip C2 check silently (not all projects use it)
|
package/rihal/workflows/audit.md
CHANGED
|
@@ -18,6 +18,7 @@ If `$ARGUMENTS` contains `--help` or `-h`:
|
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
/rihal-audit # interactive — asks what to audit
|
|
21
|
+
/rihal-audit plans [--report] # → audit-plans (structural + status + deps check)
|
|
21
22
|
/rihal-audit phase [<NN>] # → /rihal-verify-phase
|
|
22
23
|
/rihal-audit milestone [--strict] # → /rihal-audit-milestone (with synth fallback)
|
|
23
24
|
/rihal-audit uat # → /rihal-audit-uat
|
|
@@ -30,6 +31,8 @@ If `$ARGUMENTS` contains `--help` or `-h`:
|
|
|
30
31
|
**Examples:**
|
|
31
32
|
```
|
|
32
33
|
/rihal-audit
|
|
34
|
+
/rihal-audit plans
|
|
35
|
+
/rihal-audit plans --report
|
|
33
36
|
/rihal-audit milestone --strict
|
|
34
37
|
/rihal-audit phase 03
|
|
35
38
|
/rihal-audit lens security
|
|
@@ -45,7 +48,7 @@ DISCUSS=$($TOOL config-get workflow.discuss_mode 2>/dev/null || echo "adaptive")
|
|
|
45
48
|
```
|
|
46
49
|
|
|
47
50
|
Parse `$ARGUMENTS`:
|
|
48
|
-
- First word ∈ {phase, milestone, uat, code, fix, work, lens} → set `$TARGET`, drop it from args, jump to Step 4.
|
|
51
|
+
- First word ∈ {plans, phase, milestone, uat, code, fix, work, lens} → set `$TARGET`, drop it from args, jump to Step 4.
|
|
49
52
|
- Empty or unrecognised → continue to Step 2.
|
|
50
53
|
|
|
51
54
|
## Step 2 — Detect project state
|
|
@@ -68,7 +71,7 @@ as `(no data — skip)`.
|
|
|
68
71
|
## Step 3 — Ask user (guided mode only)
|
|
69
72
|
|
|
70
73
|
If `$MODE` is `yolo`, skip this step and pick the most relevant target
|
|
71
|
-
automatically (priority: `work` if dirty branch, else `
|
|
74
|
+
automatically (priority: `work` if dirty branch, else `plans` if PLANS>0
|
|
72
75
|
and SUMMARIES<PLANS, else `milestone` if SUMMARIES>0, else `code`).
|
|
73
76
|
|
|
74
77
|
Otherwise call AskUserQuestion:
|
|
@@ -78,13 +81,14 @@ Question:
|
|
|
78
81
|
What do you want to audit?
|
|
79
82
|
|
|
80
83
|
Options:
|
|
81
|
-
1.
|
|
82
|
-
2.
|
|
83
|
-
3.
|
|
84
|
-
4.
|
|
85
|
-
5.
|
|
86
|
-
6.
|
|
87
|
-
7.
|
|
84
|
+
1. plans — planning integrity: completeness, status, deps ({PLANS} sprints)
|
|
85
|
+
2. phase — verify a single phase against its PLAN ({PLANS} plans)
|
|
86
|
+
3. milestone — cross-phase milestone goal coverage ({SUMMARIES} summaries)
|
|
87
|
+
4. uat — outstanding UAT / verification items ({UAT_FILES} files)
|
|
88
|
+
5. code-quality — Karpathy 4-principle code review (current diff)
|
|
89
|
+
6. auto-fix — audit then auto-fix findings (uses #1–5 output)
|
|
90
|
+
7. work — verify current branch / WIP ({ON_BRANCH}, dirty={DIRTY})
|
|
91
|
+
8. lens — 15-lens methodology audit (security, perf, tests…)
|
|
88
92
|
0. cancel
|
|
89
93
|
```
|
|
90
94
|
|
|
@@ -98,6 +102,7 @@ sub-workflow.
|
|
|
98
102
|
|
|
99
103
|
| target | precondition | failure message |
|
|
100
104
|
|---|---|---|
|
|
105
|
+
| plans | `.planning/ROADMAP.md` exists | `No ROADMAP.md. Run /rihal-new-milestone first.` |
|
|
101
106
|
| phase | at least one `.planning/phases/*/PLAN.md` or `*-SPRINT.md` | `No plan file found. Run /rihal-plan first.` |
|
|
102
107
|
| milestone | ROADMAP.md exists | `No ROADMAP.md. Run /rihal-new-milestone first.` |
|
|
103
108
|
| uat | at least one UAT*.md exists | `No UAT files yet. Run /rihal-execute on a phase first.` |
|
|
@@ -140,6 +145,7 @@ Run the target's slash command, forwarding remaining args:
|
|
|
140
145
|
|
|
141
146
|
| target | dispatch |
|
|
142
147
|
|---|---|
|
|
148
|
+
| plans | execute `@.rihal/workflows/audit-plans.md` inline |
|
|
143
149
|
| phase | `/rihal-verify-phase $REST_ARGS` |
|
|
144
150
|
| milestone | `/rihal-audit-milestone $REST_ARGS` |
|
|
145
151
|
| uat | `/rihal-audit-uat $REST_ARGS` |
|