@hanzlaa/rcode 3.6.5 → 3.6.7
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/cli/generate-command-skills.cjs +25 -3
- package/package.json +1 -1
- package/rihal/skills/actions/4-implementation/rihal-dev-story/SKILL.md +30 -2
- package/rihal/skills/actions/4-implementation/rihal-dev-story/workflow.md +74 -0
- package/rihal/workflows/plan-spawn-planner.md +44 -0
- package/server/dashboard.js +1 -1
- package/server/orchestrator.js +8 -2
|
@@ -231,7 +231,29 @@ function main(packageRoot, targetSkillsDir, version, options = {}) {
|
|
|
231
231
|
generated++;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
// Cleanup stale stubs: generated stubs whose command was removed from
|
|
235
|
+
// SIDEBAR_COMMANDS still block the corresponding ~/.claude/commands/ file
|
|
236
|
+
// in Claude Code 2.x (skill with user-invocable:false overrides the command).
|
|
237
|
+
// Delete any generated stub for a command no longer in the curated set.
|
|
238
|
+
let cleaned = 0;
|
|
239
|
+
try {
|
|
240
|
+
for (const entry of fs.readdirSync(targetSkillsDir)) {
|
|
241
|
+
if (!entry.startsWith('rihal-')) continue;
|
|
242
|
+
const cmdName = entry.replace(/^rihal-/, '');
|
|
243
|
+
if (SIDEBAR_COMMANDS.has(cmdName)) continue; // still wanted — leave it
|
|
244
|
+
if (realSkills.has(entry)) continue; // real skill — never touch
|
|
245
|
+
const skillFile = path.join(targetSkillsDir, entry, 'SKILL.md');
|
|
246
|
+
if (!fs.existsSync(skillFile)) continue;
|
|
247
|
+
const text = fs.readFileSync(skillFile, 'utf8');
|
|
248
|
+
// Only remove stubs that were auto-generated from a command file.
|
|
249
|
+
if (!/^generated:\s*true/m.test(text)) continue;
|
|
250
|
+
if (!/^source:\s*rihal\/commands\//m.test(text)) continue;
|
|
251
|
+
fs.rmSync(path.join(targetSkillsDir, entry), { recursive: true, force: true });
|
|
252
|
+
cleaned++;
|
|
253
|
+
}
|
|
254
|
+
} catch { /* non-fatal */ }
|
|
255
|
+
|
|
256
|
+
return { generated, skipped, cleaned };
|
|
235
257
|
}
|
|
236
258
|
|
|
237
259
|
if (require.main === module) {
|
|
@@ -240,8 +262,8 @@ if (require.main === module) {
|
|
|
240
262
|
console.error('Usage: generate-command-skills.cjs <package-root> <target-skills-dir> [version]');
|
|
241
263
|
process.exit(2);
|
|
242
264
|
}
|
|
243
|
-
const { generated, skipped } = main(packageRoot, targetSkillsDir, version);
|
|
244
|
-
console.log(`✓ ${generated} sidebar skill stub${generated === 1 ? '' : 's'} generated, ${skipped} skipped
|
|
265
|
+
const { generated, skipped, cleaned } = main(packageRoot, targetSkillsDir, version);
|
|
266
|
+
console.log(`✓ ${generated} sidebar skill stub${generated === 1 ? '' : 's'} generated, ${skipped} skipped, ${cleaned} stale stubs cleaned`);
|
|
245
267
|
}
|
|
246
268
|
|
|
247
269
|
module.exports = { main, SIDEBAR_COMMANDS };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzlaa/rcode",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.7",
|
|
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": {
|
|
@@ -32,15 +32,39 @@ Follow the instructions in ./workflow.md.
|
|
|
32
32
|
- Reads story file first; executes tasks in order
|
|
33
33
|
- Marks tasks [x] only when implementation AND tests pass
|
|
34
34
|
- Updates story's File List and Dev Agent Record sections
|
|
35
|
-
-
|
|
35
|
+
- Runs two-stage automated review before marking complete: spec compliance → code quality
|
|
36
|
+
- Reports: "Story complete. N tasks done. Tests: PASS (X). Files: [list]. Reviews: SPEC ✅ QUALITY ✅"
|
|
36
37
|
- Do NOT invent scope beyond the story
|
|
37
38
|
- Do NOT commit with red tests
|
|
38
39
|
|
|
40
|
+
## Review Protocol
|
|
41
|
+
|
|
42
|
+
After all tasks complete, dispatches two fresh reviewer subagents before handing off to human review:
|
|
43
|
+
|
|
44
|
+
**Stage 1 — Spec Compliance:** Confirms every AC is implemented, nothing extra was built. Repeats until COMPLIANT.
|
|
45
|
+
|
|
46
|
+
**Stage 2 — Code Quality:** Reviews naming, error handling, test depth, security, maintainability. Fixes High-severity issues; logs Medium issues for human reviewer. Repeats until APPROVED/APPROVED_WITH_NOTES.
|
|
47
|
+
|
|
48
|
+
## Model Selection
|
|
49
|
+
|
|
50
|
+
When dispatching reviewer subagents or sub-tasks:
|
|
51
|
+
- Mechanical tasks (isolated, clear spec, 1-2 files) → cheapest/fastest model
|
|
52
|
+
- Integration tasks (multi-file, pattern matching) → standard model
|
|
53
|
+
- Architecture, design, or review tasks → most capable model
|
|
54
|
+
|
|
55
|
+
## Implementer Status Protocol
|
|
56
|
+
|
|
57
|
+
When running as a subagent implementer, report one of:
|
|
58
|
+
- **DONE** — all requirements met, tests pass
|
|
59
|
+
- **DONE_WITH_CONCERNS** — complete but flagging doubts about correctness or scope
|
|
60
|
+
- **NEEDS_CONTEXT** — cannot proceed without specific missing information
|
|
61
|
+
- **BLOCKED** — cannot complete; caller must restructure or escalate
|
|
62
|
+
|
|
39
63
|
## Examples
|
|
40
64
|
|
|
41
65
|
### Happy Path
|
|
42
66
|
**Input:** "dev this story: .rihal/phases/phase-02/stories/story-005.md"
|
|
43
|
-
**Expected behavior:** Read story, execute tasks in order, write tests, run suite after each task, mark checkboxes, update File List.
|
|
67
|
+
**Expected behavior:** Read story, execute tasks in order, write tests, run suite after each task, mark checkboxes, update File List. After all tasks: dispatch spec compliance reviewer, dispatch code quality reviewer, mark as "review".
|
|
44
68
|
|
|
45
69
|
### Edge Case: Missing Story
|
|
46
70
|
**Input:** "dev the login story" (story file doesn't exist)
|
|
@@ -49,3 +73,7 @@ Follow the instructions in ./workflow.md.
|
|
|
49
73
|
### Edge Case: Red Tests Mid-Execution
|
|
50
74
|
**Input:** (task 2 breaks a test from task 1)
|
|
51
75
|
**Expected behavior:** STOP. Report regression. Fix before continuing.
|
|
76
|
+
|
|
77
|
+
### Edge Case: Spec Compliance Fails Review
|
|
78
|
+
**Input:** Implementation complete but reviewer finds missing AC
|
|
79
|
+
**Expected behavior:** Fix the gap, re-run tests, re-dispatch spec compliance reviewer. Do not proceed to code quality review until spec compliance passes.
|
|
@@ -263,6 +263,21 @@ Load config from `{project-root}/.rihal/config.json` and resolve:
|
|
|
263
263
|
<step n="5" goal="Implement task following red-green-refactor cycle">
|
|
264
264
|
<critical>FOLLOW THE STORY FILE TASKS/SUBTASKS SEQUENCE EXACTLY AS WRITTEN - NO DEVIATION</critical>
|
|
265
265
|
|
|
266
|
+
<!-- Model selection guidance — applies when dispatching sub-tasks to subagents -->
|
|
267
|
+
<model_selection>
|
|
268
|
+
Mechanical tasks (isolated function, clear spec, 1-2 files) → use cheapest/fastest model
|
|
269
|
+
Integration tasks (multi-file coordination, pattern matching) → use standard model
|
|
270
|
+
Architecture, design, or review tasks → use most capable model
|
|
271
|
+
</model_selection>
|
|
272
|
+
|
|
273
|
+
<!-- Implementer status protocol — use when completing tasks as a subagent -->
|
|
274
|
+
<status_protocol>
|
|
275
|
+
DONE: All requirements met, tests pass, committed.
|
|
276
|
+
DONE_WITH_CONCERNS: Complete but flagging doubts — describe the concern. Caller decides before review.
|
|
277
|
+
NEEDS_CONTEXT: Cannot proceed without missing information — specify exactly what is needed.
|
|
278
|
+
BLOCKED: Cannot complete despite context — describe the blocker. Caller must restructure or escalate.
|
|
279
|
+
</status_protocol>
|
|
280
|
+
|
|
266
281
|
<action>Review the current task/subtask from the story file - this is your authoritative implementation guide</action>
|
|
267
282
|
<action>Plan implementation following red-green-refactor cycle</action>
|
|
268
283
|
|
|
@@ -410,6 +425,65 @@ Load config from `{project-root}/.rihal/config.json` and resolve:
|
|
|
410
425
|
<action if="definition-of-done validation fails">HALT - Address DoD failures before completing</action>
|
|
411
426
|
</step>
|
|
412
427
|
|
|
428
|
+
<step n="9.5" goal="Two-stage automated review: spec compliance then code quality">
|
|
429
|
+
<critical>Both stages must pass before the story is marked complete. Never skip either stage. Spec compliance must pass before starting code quality review.</critical>
|
|
430
|
+
|
|
431
|
+
<output>🔍 **Two-Stage Review** — verifying before handing off to human review</output>
|
|
432
|
+
|
|
433
|
+
<!-- STAGE 1: Spec Compliance -->
|
|
434
|
+
<output>
|
|
435
|
+
━━━ Stage 1: Spec Compliance Review ━━━
|
|
436
|
+
</output>
|
|
437
|
+
<action>Spawn a fresh spec-compliance reviewer subagent. Provide it:
|
|
438
|
+
- Full story file contents (especially Acceptance Criteria and Tasks sections)
|
|
439
|
+
- List of all modified files from the File List section
|
|
440
|
+
- Brief: "Review that every AC is satisfied in the code. Flag anything built outside spec. Flag any AC with no corresponding implementation."
|
|
441
|
+
</action>
|
|
442
|
+
|
|
443
|
+
<action>Reviewer reports one of: COMPLIANT | NON_COMPLIANT (with specific gaps listed)</action>
|
|
444
|
+
|
|
445
|
+
<check if="spec compliance reviewer reports NON_COMPLIANT">
|
|
446
|
+
<action>Fix each gap: implement missing ACs, remove any out-of-spec additions</action>
|
|
447
|
+
<action>Re-run tests to confirm fixes pass</action>
|
|
448
|
+
<action>Re-dispatch spec compliance reviewer with the same prompt</action>
|
|
449
|
+
<action>Repeat until COMPLIANT</action>
|
|
450
|
+
</check>
|
|
451
|
+
|
|
452
|
+
<output>✅ Stage 1 passed — implementation is spec-compliant</output>
|
|
453
|
+
|
|
454
|
+
<!-- STAGE 2: Code Quality Review -->
|
|
455
|
+
<output>
|
|
456
|
+
━━━ Stage 2: Code Quality Review ━━━
|
|
457
|
+
</output>
|
|
458
|
+
<action>Spawn a fresh code quality reviewer subagent. Provide it:
|
|
459
|
+
- All modified files (from File List)
|
|
460
|
+
- Story title and ACs (context for what was being built)
|
|
461
|
+
- Project coding standards (contents of CLAUDE.md or project-context.md if available)
|
|
462
|
+
- Brief: "Review code quality: naming conventions, error handling, test coverage depth, security, performance, maintainability. Severity: High (must fix) | Medium (should fix) | Low (note only)."
|
|
463
|
+
</action>
|
|
464
|
+
|
|
465
|
+
<action>Reviewer reports one of: APPROVED | APPROVED_WITH_NOTES | CHANGES_REQUIRED (severity breakdown)</action>
|
|
466
|
+
|
|
467
|
+
<check if="code quality reviewer reports CHANGES_REQUIRED (High severity issues)">
|
|
468
|
+
<action>Fix all High-severity issues</action>
|
|
469
|
+
<action>Re-run tests to confirm fixes pass</action>
|
|
470
|
+
<action>Re-dispatch code quality reviewer with the same prompt</action>
|
|
471
|
+
<action>Repeat until APPROVED or APPROVED_WITH_NOTES</action>
|
|
472
|
+
</check>
|
|
473
|
+
|
|
474
|
+
<check if="Medium-severity issues exist">
|
|
475
|
+
<action>Fix Medium-severity issues when the fix is straightforward and low-risk</action>
|
|
476
|
+
<action>Log unfixed Medium issues in Dev Agent Record → Completion Notes for human reviewer awareness</action>
|
|
477
|
+
</check>
|
|
478
|
+
|
|
479
|
+
<output>✅ Stage 2 passed — code quality verified</output>
|
|
480
|
+
|
|
481
|
+
<output>
|
|
482
|
+
✅ **Two-stage review complete** — story is spec-compliant and quality-approved.
|
|
483
|
+
Ready for human review.
|
|
484
|
+
</output>
|
|
485
|
+
</step>
|
|
486
|
+
|
|
413
487
|
<step n="10" goal="Completion communication and user support">
|
|
414
488
|
<action>Execute the enhanced definition-of-done checklist using the validation framework</action>
|
|
415
489
|
<action>Prepare a concise summary in Dev Agent Record → Completion Notes</action>
|
|
@@ -114,6 +114,37 @@ Output consumed by /rihal-execute. Plans need:
|
|
|
114
114
|
</downstream_consumer>
|
|
115
115
|
|
|
116
116
|
<deep_work_rules>
|
|
117
|
+
## File Structure Map (REQUIRED — before task decomposition)
|
|
118
|
+
|
|
119
|
+
Before writing any task, produce a file structure map listing every file this plan will create or modify:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
FILES_TO_CREATE:
|
|
123
|
+
- exact/path/to/new/file.ts — responsibility: [one sentence]
|
|
124
|
+
FILES_TO_MODIFY:
|
|
125
|
+
- exact/path/to/existing.ts — what changes: [one sentence]
|
|
126
|
+
FILES_FOR_TESTS:
|
|
127
|
+
- tests/exact/path/test.ts — tests for: [one sentence]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Rules:
|
|
131
|
+
- Each file has one clear responsibility — if you can't describe it in one sentence, split the file
|
|
132
|
+
- Files that change together should live together (split by responsibility, not layer)
|
|
133
|
+
- This map is what informs task decomposition — each task should produce self-contained changes
|
|
134
|
+
- In existing codebases: follow established patterns; only restructure files if a file is genuinely unwieldy and the split is included as its own task
|
|
135
|
+
|
|
136
|
+
## No-Placeholders Rule (HARD BLOCKER)
|
|
137
|
+
|
|
138
|
+
Every step must contain the actual content the executor needs. These are **plan failures** — never write them:
|
|
139
|
+
- "TBD", "TODO", "implement later", "fill in details"
|
|
140
|
+
- "Add appropriate error handling" / "add validation" / "handle edge cases" (without code)
|
|
141
|
+
- "Write tests for the above" (without actual test code)
|
|
142
|
+
- "Similar to Task N" — copy the code; executor may read tasks out of order
|
|
143
|
+
- Steps that describe what to do without showing how (code blocks required for code steps)
|
|
144
|
+
- References to types, functions, or methods not yet defined in any task in this plan
|
|
145
|
+
|
|
146
|
+
If a step would require TBD content, either: (a) do the research now and fill it in, or (b) split into a research task that outputs a decision, followed by an implementation task that consumes it.
|
|
147
|
+
|
|
117
148
|
## Anti-Shallow Execution Rules (MANDATORY)
|
|
118
149
|
|
|
119
150
|
Every task MUST include these fields — they are NOT optional:
|
|
@@ -185,6 +216,8 @@ Every task MUST include these fields — they are NOT optional:
|
|
|
185
216
|
</deep_work_rules>
|
|
186
217
|
|
|
187
218
|
<quality_gate>
|
|
219
|
+
- [ ] File structure map written before first task (files_to_create / files_to_modify / files_for_tests)
|
|
220
|
+
- [ ] No placeholder patterns: no TBD/TODO/implement-later, no "similar to Task N", no code steps without code
|
|
188
221
|
- [ ] SPRINT.md files created in phase directory
|
|
189
222
|
- [ ] Each plan has valid frontmatter including `files_modified:` array aggregating all `<files>` paths across tasks (consumed by execute.md intra-wave overlap checker)
|
|
190
223
|
- [ ] Tasks are specific and actionable
|
|
@@ -195,10 +228,21 @@ Every task MUST include these fields — they are NOT optional:
|
|
|
195
228
|
- [ ] Every task has `<done>` with a single observable acceptance sentence (Dimension 2 requirement)
|
|
196
229
|
- [ ] Every `<action>` contains concrete values (no "align X with Y" without specifying what)
|
|
197
230
|
- [ ] Tasks extending existing code have `<interfaces>` with relevant signatures
|
|
231
|
+
- [ ] Type/name consistency: function names, types, and method signatures match across all tasks (no rename drift)
|
|
198
232
|
- [ ] Dependencies correctly identified
|
|
199
233
|
- [ ] Waves assigned for parallel execution
|
|
200
234
|
- [ ] must_haves derived from phase goal
|
|
201
235
|
</quality_gate>
|
|
236
|
+
|
|
237
|
+
<self_review>
|
|
238
|
+
After writing the complete plan, review the spec with fresh eyes before handing off:
|
|
239
|
+
|
|
240
|
+
1. **Spec coverage** — skim each requirement in the phase goal / CONTEXT.md decisions. Can you point to a task that implements it? List any gaps; add tasks if needed.
|
|
241
|
+
2. **Placeholder scan** — search the plan for the no-placeholder patterns listed above. Fix any found inline.
|
|
242
|
+
3. **Type consistency** — check that function names, types, and method signatures used in later tasks match what earlier tasks define. A method called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
|
|
243
|
+
|
|
244
|
+
Fix issues inline. No sub-agent needed — this is a quick self-check before the sprint-checker runs.
|
|
245
|
+
</self_review>
|
|
202
246
|
```
|
|
203
247
|
|
|
204
248
|
```
|
package/server/dashboard.js
CHANGED
|
@@ -205,7 +205,7 @@ function spawnOrchestrator() {
|
|
|
205
205
|
try {
|
|
206
206
|
_orchProc = spawn(process.execPath, [ORCH_BIN], {
|
|
207
207
|
cwd: path.join(__dirname, '..'),
|
|
208
|
-
env: { ...process.env, ORCH_TOKEN },
|
|
208
|
+
env: { ...process.env, ORCH_TOKEN, RIHAL_DIR, PROJECT_ROOT },
|
|
209
209
|
stdio: 'pipe',
|
|
210
210
|
});
|
|
211
211
|
_orchProc.stdout.on('data', chunk => {
|
package/server/orchestrator.js
CHANGED
|
@@ -40,8 +40,14 @@ try { pty = require('@lydell/node-pty'); } catch { /* handled in handleRun */ }
|
|
|
40
40
|
let WebSocketServer = null;
|
|
41
41
|
try { ({ WebSocketServer } = require('ws')); } catch { /* handled at boot */ }
|
|
42
42
|
|
|
43
|
-
const PORT
|
|
44
|
-
|
|
43
|
+
const PORT = parseInt(process.env.ORCH_PORT || '7718', 10);
|
|
44
|
+
// Use the project root passed by the dashboard (RIHAL_DIR → parent, or explicit
|
|
45
|
+
// PROJECT_ROOT env var). Fall back to cwd so standalone orchestrator runs work.
|
|
46
|
+
// NEVER use __dirname-relative path — that resolves to the npm package dir when
|
|
47
|
+
// rcode is installed globally, not the user's actual project.
|
|
48
|
+
const PROJECT_ROOT = process.env.PROJECT_ROOT
|
|
49
|
+
|| (process.env.RIHAL_DIR ? path.dirname(process.env.RIHAL_DIR) : null)
|
|
50
|
+
|| process.cwd();
|
|
45
51
|
const CLAUDE_BIN = process.env.CLAUDE_BIN || 'claude';
|
|
46
52
|
|
|
47
53
|
// Per-session auth token — see authed(). The dashboard passes ORCH_TOKEN in
|