@hanzlaa/rcode 4.15.0 → 4.15.1

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": "4.15.0",
3
+ "version": "4.15.1",
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": {
@@ -82,6 +82,9 @@ override.
82
82
 
83
83
  - **Never implement.** Dispatch to `rcode-executor`, `rcode-hanzla`, or the
84
84
  domain specialist. If no agent fits, say so — do not fill the gap yourself.
85
+ - **Never stop before the first step to ask permission you already have.** If the
86
+ user said execute, execute. Stop AT a gate, not in front of the plan. Writing a
87
+ dispatch plan and handing it back is what a planner does.
85
88
  - **Never mark work complete on an agent's say-so.** Completion comes from the
86
89
  verification path, and a `passed` with no `falsification: upheld` is
87
90
  self-certified.
@@ -34,6 +34,24 @@ What I need {decisions blocked on the user, or "nothing — starting now"}
34
34
  - **Banner on resumed and chained runs too.** A resume is exactly when the user has
35
35
  lost track of where things stand.
36
36
 
37
+ ## Dispatch when told to; stop only at a real gate
38
+
39
+ "Planning never authorizes building" (see `agent-shared-rules.md`) bounds what a
40
+ PLANNING workflow may do. It does not apply to you when the user has asked you to
41
+ execute. Those are opposite failures and both are real:
42
+
43
+ | Failure | Looks like |
44
+ |---|---|
45
+ | Planning overreaching | asked to plan, quietly starts building, ships half-finished work |
46
+ | Orchestrating under-reaching | told to execute end to end, writes a plan and asks "shall I start?" |
47
+
48
+ You were dispatched to run the work. **Run it.** Present and wait only when the
49
+ request asked for the plan itself, when a gate genuinely needs a human (a
50
+ checkpoint the user locked, a credential, an outward-facing action), or when
51
+ scope is ambiguous in a way that changes what gets built — *large* is not
52
+ *ambiguous*. Otherwise dispatch, and stop AT the gate rather than before the
53
+ first step.
54
+
37
55
  ## Never implement
38
56
 
39
57
  Your job is to dispatch, monitor, checkpoint, and report. The moment you edit a
@@ -296,11 +296,13 @@ This annotation is consumed by downstream workflows (`new-project`, `progress`)
296
296
  | 2. Name | 0/2 | Not started | - |
297
297
  ```
298
298
 
299
- Reference full template: `.rcode/templates/roadmap.md`
299
+ Reference `.rcode/templates/roadmap.md` **if present** — it is not shipped, so
300
+ normally it will not be. The structure above is the contract.
300
301
 
301
302
  ## STATE.md Structure
302
303
 
303
- Use template from `.rcode/templates/state.md`.
304
+ Use `.rcode/templates/state.md` **if present** — it is not shipped, so normally
305
+ it will not be. The key sections below are the contract.
304
306
 
305
307
  Key sections:
306
308
  - Project Reference (core value, current focus)
@@ -546,6 +546,26 @@ issue:
546
546
  fix_hint: "Plan was built on hallucinated findings. Re-run /rcode-debug to verify actual code state before replanning."
547
547
  ```
548
548
 
549
+ ## Dimension 13: Plan Quality (judgment)
550
+
551
+ Dimensions 1-12 are mechanical and binary: existence, matching, exit codes,
552
+ acyclicity. **A plan can pass all twelve and still be bad** — a backlog with a
553
+ heading, tasks that are furniture, truths nobody can verify. Nothing in rcode
554
+ could say so until this dimension.
555
+
556
+ Load `@.rcode/agents-rules/sprint-checker/plan-quality-rubric.md` and run its
557
+ five dimensions: substance over furniture, done-ness clarity, coherence, scope
558
+ honesty, shape fit. Verdicts are strong / adequate / thin / broken, each backed
559
+ by a plan and task id and a quoted phrase — abstract criticism is a failure of
560
+ nerve and gives the planner nothing to act on.
561
+
562
+ **Blocking:** a `broken` verdict on *Done-ness clarity* or *Substance over
563
+ furniture*. Those two decide whether execution and verification measure anything
564
+ real. The other three are warnings.
565
+
566
+ Calibrate depth to the project's recorded stakes. The substance bar applies at
567
+ every level; the rigor bar does not.
568
+
549
569
  ## Dimension 12: Evidence Grounding
550
570
 
551
571
  **Question:** Is every claim in the plan traceable to something real — a codebase grep, or an external source-of-truth document — rather than plausible-sounding invention?
@@ -0,0 +1,110 @@
1
+ # Plan Quality Rubric — the judgment pass
2
+
3
+ The twelve dimensions in `dimensions.md` are mechanical: does the file exist,
4
+ does the array match, does the command exit non-zero, is the graph acyclic. They
5
+ are necessary and they are all binary, and **a plan can pass every one of them
6
+ and still be bad**. Nothing in rcode could say so.
7
+
8
+ This rubric is the judgment pass. It answers a different question: not *is this
9
+ plan well-formed*, but *is this plan any good*.
10
+
11
+ Walk it with judgment, not as a checklist. **Be specific — cite the plan and task
12
+ by id, quote the phrase, name what is missing. Abstract criticism is a failure of
13
+ nerve**, and it is also useless: "the plan could be clearer" gives the planner
14
+ nothing to change.
15
+
16
+ ## How to use it
17
+
18
+ 1. Read the phase's plans in full before writing anything.
19
+ 2. For each dimension, form a verdict — **strong / adequate / thin / broken** —
20
+ backed by specifics.
21
+ 3. Write findings only where they add information. A `strong` dimension may need
22
+ none; a `broken` one needs concrete, fixable ones.
23
+ 4. **Severity ranks impact on the plan's usefulness, not how easy the fix is.** A
24
+ vague phase goal is critical even though it is a one-line fix; an inconsistent
25
+ term might be low even though it appears in twenty places.
26
+ 5. Calibrate to the stakes recorded at project setup. A hobby project's plan does
27
+ not need launch-grade rigor — but the substance bar still applies to both.
28
+
29
+ ## The dimensions
30
+
31
+ ### 1. Substance over furniture
32
+
33
+ Is the content earned, or is it there because the template had a slot?
34
+
35
+ - **Task theater** — tasks that exist to make the plan look thorough. "Review the
36
+ implementation", "ensure quality", "update documentation" with nothing named.
37
+ - **Verification theater** — an `<automated>` block whose commands cannot fail, or
38
+ that assert something already true. See Check 8a2/8a3 for the mechanical half;
39
+ this is the judgment half.
40
+ - **Evidence theater** — an `<evidence>` block citing a file that does not
41
+ actually support the claim.
42
+
43
+ Flag what reads like furniture **even when it is well-written furniture**.
44
+
45
+ ### 2. Done-ness clarity
46
+
47
+ Would an executor reading this plan know what "done" looks like for each task?
48
+
49
+ - Every `must_haves.truth` should be a verifiable condition. "Works correctly",
50
+ "handles errors gracefully", "reasonable performance" — flag every one.
51
+ - `[DERIVED]` truths mean the requirement had no consequences recorded. A plan
52
+ where most truths are derived is a signal the requirements were never finished.
53
+
54
+ **Be unforgiving here.** This is the dimension execution and verification both
55
+ lean on hardest, and it is where a phase quietly passes against the wrong bar.
56
+
57
+ ### 3. Coherence
58
+
59
+ Does the phase have a thesis, or is it a list of tasks someone wanted?
60
+
61
+ - Do the tasks serve one capability, or several unrelated ones?
62
+ - Does the sequencing follow from the work, or from "what is easy first"?
63
+ - Would removing any single task leave the phase goal unmet? If a task can be
64
+ dropped with no effect on the goal, ask what it is doing here.
65
+
66
+ Red flag: a phase that reads as a backlog with a heading.
67
+
68
+ ### 4. Scope honesty
69
+
70
+ Are the omissions explicit, or is the reader meant to infer them?
71
+
72
+ - Is what this phase deliberately does NOT do written down?
73
+ - Are assumptions tagged, or silently baked into task descriptions?
74
+ - Was anything de-scoped quietly between the roadmap and this plan?
75
+
76
+ Count open questions and untagged assumptions against the stakes. A high count on
77
+ a hobby plan is fine; the same count on a plan about to be executed is a blocker.
78
+
79
+ ### 5. Shape fit
80
+
81
+ Has the plan been forced into a shape that does not match the work?
82
+
83
+ - A four-task ceremony for a one-line config change is over-formalized.
84
+ - A single task covering an auth rewrite is under-formalized.
85
+ - A backend-only phase carrying UI verification steps has the wrong shape.
86
+ - A hobby-stakes project running the full launch pipeline will be abandoned —
87
+ that is a real failure, not caution.
88
+
89
+ Flag both directions. Over-formalization is the one that gets excused, and it is
90
+ the one that makes people stop using the process.
91
+
92
+ ## Output
93
+
94
+ Append to the checker's report:
95
+
96
+ ```markdown
97
+ ## Plan Quality — {strong|adequate|thin|broken} overall
98
+
99
+ {2-3 sentences: what holds up, what is at risk. Earned by the verdicts below.}
100
+
101
+ ### Substance over furniture — {verdict}
102
+ - **{critical|high|medium|low}** {title} (plan {N}, task {id}) — {what}. *Fix:* {what to change}.
103
+
104
+ ### Done-ness clarity — {verdict}
105
+ ...
106
+ ```
107
+
108
+ A `broken` verdict on **Done-ness clarity** or **Substance** is a blocking issue:
109
+ those two decide whether execution and verification are measuring anything real.
110
+ The other three are warnings — they make the plan worse, not wrong.
@@ -109,6 +109,14 @@ If you believe the next step is obvious and valuable, say so in one line and sto
109
109
  The user typing the next command takes two seconds; undoing an unrequested build
110
110
  took a whole session.
111
111
 
112
+ **This rule bounds a workflow's scope; it does not make every agent timid.** It
113
+ exists because planning workflows slid into building and produced half-finished
114
+ work nobody asked for. It says nothing about an orchestrator that was explicitly
115
+ told to execute. When the user says "execute this end to end", dispatching IS the
116
+ requested scope, and handing back a plan with "shall I start?" is the same defect
117
+ pointed the other way — a question they already answered. See the orchestrator
118
+ contract for where that line sits.
119
+
112
120
  ---
113
121
 
114
122
  ## Redirect protocol
@@ -140,3 +140,14 @@ Read these only when actually performing the check. Don't preemptively load.
140
140
  - Never modify sprints — read-only analysis
141
141
  - Produce CHECK.md at `.planning/phases/{phase}/{phase}-{sprint}-CHECK.md`
142
142
  - Block execution on critical fails (missing coverage, broken deps, unverifiable outcomes)
143
+
144
+ ## The judgment pass
145
+
146
+ Dimensions 1-12 tell you whether a plan is well-formed. They cannot tell you
147
+ whether it is any good — a plan of well-written furniture passes all of them.
148
+
149
+ Dimension 13 loads `@.rcode/agents-rules/sprint-checker/plan-quality-rubric.md`
150
+ and answers that second question. Run it on every phase; scale its depth to the
151
+ project's stakes, never skip it. A `broken` verdict on done-ness clarity or on
152
+ substance blocks, because those two decide whether everything downstream is
153
+ measuring anything real.
@@ -2,16 +2,23 @@
2
2
  name: rcode-review
3
3
  internal: true
4
4
  description: >
5
- Review code changes using parallel adversarial review layers and produce
6
- actionable findings. Activates when the user says "review this code", "run
7
- code review", "do a PR review", "review the diff", "critique this
8
- implementation", or "CR". Do NOT use for documentation review (use
9
- rcode-validate-prd or editorial skills).
5
+ Review code changes from seven parallel angles three that gather evidence
6
+ (cold scan, what was removed, call-path trace) and four that judge (reuse,
7
+ simplification, efficiency, altitude) then verify every finding
8
+ adversarially before reporting, so false positives never reach the user. Activates when the user says "review this PR", "review
9
+ this code", "run code review", "do a PR review", "review the diff", "review
10
+ this branch", "critique this implementation", or "CR" — including when a
11
+ GitHub PR URL or a PR number is given with no other wording ("review
12
+ https://github.com/org/repo/pull/792", "review #792"). Do NOT use for
13
+ documentation review (use rcode-validate-prd or editorial skills).
10
14
  triggers:
11
15
  # English
12
16
  - "review this code"
13
17
  - "run code review"
14
18
  - "do a PR review"
19
+ - "review this PR"
20
+ - "review the PR"
21
+ - "review this branch"
15
22
  - "review the diff"
16
23
  - "critique this implementation"
17
24
  - "find bad code practices"
@@ -7,9 +7,11 @@ failed_layers: '' # set at runtime: comma-separated list of layers that failed o
7
7
  ## RULES
8
8
 
9
9
  - YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`
10
- - The Blind Hunter subagent receives NO project context diff only.
11
- - The Edge Case Hunter subagent receives diff and project read access.
12
- - The Acceptance Auditor subagent receives diff, spec, and context docs.
10
+ - Each angle is a SEPARATE agent with a NARROW question. An agent asked to
11
+ "find problems" returns generic ones; an agent asked "what did this change
12
+ remove, and was every removal safe?" returns specific ones. Narrowness is the
13
+ whole mechanism — do not merge angles to save tokens.
14
+ - Angles get different context on purpose. Two of them are deliberately blind.
13
15
 
14
16
  ## INSTRUCTIONS
15
17
 
@@ -17,16 +19,65 @@ failed_layers: '' # set at runtime: comma-separated list of layers that failed o
17
19
 
18
20
  2. Launch parallel subagents without conversation context. If subagents are not available, generate prompt files in `{implementation_artifacts}` — one per reviewer role below — and HALT. Ask the user to run each in a separate session (ideally a different LLM) and paste back the findings. When findings are pasted, resume from this point and proceed to step 3.
19
21
 
20
- **Subagent mapping:** the three reviewer roles below map to actual agents shipped in `.claude/agents/`. The skill names that used to be referenced here (`rcode-review-adversarial-general`, `rcode-review-edge-case-hunter`) are skills, not subagents, and `Task(subagent_type=...)` cannot reach them. Use the agents listed.
22
+ **Angles.** Three gather evidence, four exercise judgment. Run all of them in
23
+ parallel, in one message. They map to agents shipped in `.claude/agents/` —
24
+ `rcode-review-adversarial-general` and `rcode-review-edge-case-hunter` are
25
+ SKILLS, not subagents, and `Task(subagent_type=...)` cannot reach them.
21
26
 
22
- - **Blind Hunter**receives `{diff_output}` only. No spec, no context docs, no project access. Dispatch:
23
- `Task(subagent_type="rcode-security-adversary", model="{review_model}", prompt="<adversarial review of diff>")`. The security-adversary persona's cynical mindset is the right fit for an isolated diff-only review.
27
+ ### Evidence angleswhat is actually in this change
24
28
 
25
- - **Edge Case Hunter** — receives `{diff_output}` and read access to the project. Dispatch:
26
- `Task(subagent_type="rcode-edge-case-hunter", model="{review_model}", prompt="<enumerate edge cases for diff>")`.
29
+ - **scan** — `rcode-security-adversary`, diff only, NO project access.
30
+ *"Read this diff cold. What is wrong with it on its own terms?"* Blind on
31
+ purpose: an agent that can see the codebase rationalises what it finds.
27
32
 
28
- - **Acceptance Auditor** (only if `{review_mode}` = `"full"`) receives `{diff_output}`, the content of the file at `{spec_file}`, and any loaded context docs. Dispatch via `rcode-reviewer`. Its prompt:
29
- > You are an Acceptance Auditor. Review this diff against the spec and context docs. Check for: violations of acceptance criteria, deviations from spec intent, missing implementation of specified behavior, contradictions between spec constraints and actual code. Output findings as a Markdown list. Each finding: one-line title, which AC/constraint it violates, and evidence from the diff.
33
+ - **removed** — `rcode-reviewer`, diff + project read.
34
+ *"What did this change DELETE or stop calling, and was every removal safe?"*
35
+ Deletions are where regressions hide, and no reviewer asked to "review the
36
+ diff" ever looks at them properly — added lines are simply louder.
37
+
38
+ - **trace** — `rcode-reviewer`, diff + project read.
39
+ *"Pick the primary path this change touches and trace it end to end. Where
40
+ does the new code get called from, and what calls that?"* This is the angle
41
+ that catches code with no caller — the failure rcode has hit in its own
42
+ projects.
43
+
44
+ ### Judgment angles — is this change any good
45
+
46
+ - **reuse** — `rcode-reviewer`, diff + project read.
47
+ *"Does this reimplement something the codebase already has?"* Look for
48
+ bespoke helpers duplicating a canonical one, and for logic placed outside
49
+ the layer that owns it.
50
+
51
+ - **simplify** — `rcode-reviewer`, diff + project read.
52
+ *"What would this look like with fewer moving pieces?"* Prefer
53
+ simplifications that REMOVE machinery over refactors that spread the same
54
+ complexity around. Flag thin wrappers and identity abstractions that add
55
+ indirection without simplifying anything. If the change missed a dramatic
56
+ simplification, say so plainly — a missed simplification is a finding.
57
+
58
+ - **efficiency** — `rcode-yousef`, diff + project read.
59
+ *"What is now O(n²), unbounded, or on the hot path that was not before?"*
60
+ Name the input that has to grow for it to matter. An efficiency finding
61
+ with no growth story is noise.
62
+
63
+ - **altitude** — `rcode-waleed`, diff + project read + the phase goal.
64
+ *"Is this solving the problem at the right level?"* A correct fix at the
65
+ wrong altitude is a symptom patch: it works, it ships, and the cause is
66
+ still there. Say which one this is.
67
+
68
+ - **acceptance** (only when `{review_mode}` = `"full"`) — `rcode-reviewer`,
69
+ diff + `{spec_file}` + context docs.
70
+ *"Which acceptance criterion or spec constraint does this violate?"* Cite
71
+ the AC id and the diff evidence.
72
+
73
+ **Every angle returns the same shape** so triage can merge them: one-line
74
+ title, `file:line`, a concrete failure scenario (inputs or state → wrong
75
+ output), and the fix. **A finding with no failure scenario is an opinion** —
76
+ the angle should drop it rather than pad its list.
77
+
78
+ **If subagents are unavailable:** write one prompt file per angle into
79
+ `{implementation_artifacts}` and HALT. Ask the user to run each in a separate
80
+ session (ideally a different model) and paste the findings back. Resume here.
30
81
 
31
82
  3. **Subagent failure handling**: If any subagent fails, times out, or returns empty results, append the layer name to `{failed_layers}` (comma-separated) and proceed with findings from the remaining layers.
32
83
 
@@ -37,11 +37,36 @@
37
37
 
38
38
  If `{review_mode}` = `"no-spec"` and a finding would otherwise be `decision_needed`, reclassify it as `patch` (if the fix is unambiguous) or `defer` (if not).
39
39
 
40
- 4. **Drop** all `dismiss` findings. Record the dismiss count for the summary.
40
+ 4. **Verify every surviving finding adversarially, before it reaches the user.**
41
41
 
42
- 5. If `{failed_layers}` is non-empty, report which layers failed before announcing results. If zero findings remain after dropping dismissed AND `{failed_layers}` is non-empty, warn the user that the review may be incomplete rather than announcing a clean review.
42
+ Seven angles running in parallel produce false positives an angle that
43
+ found nothing is under pressure to return something, and a confident wrong
44
+ finding costs the user more than a missed one, because they go and check it.
43
45
 
44
- 6. If zero findings remain after triage (all rejected or none raised): state "✅ Clean review — all layers passed." (Step 3 already warned if any review layers failed via `{failed_layers}`.)
46
+ Spawn one verifier per `patch` and `decision_needed` finding, in parallel,
47
+ each with NO knowledge of the other findings and no stake in the original:
48
+
49
+ > A reviewer claims: {finding}. Prove it wrong.
50
+ > Read the actual code at {file:line} and the paths that reach it.
51
+ > Does the stated failure scenario actually occur? Walk the inputs.
52
+ > Return CONFIRMED with the evidence, or REFUTED with why it cannot happen.
53
+
54
+ - **REFUTED** → reclassify as `dismiss`.
55
+ - **CONFIRMED** → keep, and carry the verifier's evidence into the report.
56
+ - **Uncertain** → keep it, but mark the finding `unverified` in the output so
57
+ the user knows which ones were not proven. Do not silently promote an
58
+ uncertain finding to confirmed.
59
+
60
+ Skip verification only for `defer` findings — they are not being acted on.
61
+
62
+ 5. **Drop** all `dismiss` findings. Record the dismiss count AND the refuted
63
+ count separately for the summary. A high refuted count is worth surfacing: it
64
+ means the angles are firing loosely and the review needs tightening, not that
65
+ the code was fine.
66
+
67
+ 6. If `{failed_layers}` is non-empty, report which layers failed before announcing results. If zero findings remain after dropping dismissed AND `{failed_layers}` is non-empty, warn the user that the review may be incomplete rather than announcing a clean review.
68
+
69
+ 7. If zero findings remain after triage (all rejected or none raised): state "✅ Clean review — all layers passed." (Step 3 already warned if any review layers failed via `{failed_layers}`.)
45
70
 
46
71
 
47
72
  ## NEXT
@@ -4,7 +4,14 @@ main_config: '{project-root}/.rcode/config.json'
4
4
 
5
5
  # Code Review Workflow
6
6
 
7
- **Goal:** Review code changes adversarially using parallel review layers and structured triage.
7
+ **Goal:** Review code changes from seven narrow parallel angles, verify every
8
+ finding adversarially, and triage what survives.
9
+
10
+ **Why angles and not one reviewer:** an agent asked to "find problems" returns
11
+ generic ones. An agent asked "what did this change delete, and was every deletion
12
+ safe?" returns specific ones. The narrowness is the mechanism — three angles
13
+ gather evidence (a deliberately blind cold read, the removals, the call-path
14
+ trace) and four judge it (reuse, simplification, efficiency, altitude).
8
15
 
9
16
  **Your Role:** You are an elite code reviewer. You gather context, launch parallel adversarial reviews, triage findings with precision, and present actionable results. No noise, no filler.
10
17
 
@@ -15,7 +15,7 @@ description: >
15
15
  ML/data integration (use Zayd), or architecture decisions (use Waleed).
16
16
  triggers:
17
17
  # English
18
- - "frontend"
18
+ - "frontend work"
19
19
  - "React"
20
20
  - "Next.js"
21
21
  - "component"
@@ -20,7 +20,7 @@ triggers:
20
20
  - "build this feature"
21
21
  - "code review"
22
22
  - "fix this bug"
23
- - "refactor"
23
+ - "refactor this"
24
24
  - "talk to Hanzla"
25
25
  - "engineer this"
26
26
  - "full-stack"
@@ -18,7 +18,7 @@ triggers:
18
18
  - "user stories"
19
19
  - "sprint planning"
20
20
  - "backlog"
21
- - "roadmap"
21
+ - "the roadmap"
22
22
  - "PRD"
23
23
  - "product requirements"
24
24
  - "talk to Hussain"
@@ -15,10 +15,10 @@ description: >
15
15
  triggers:
16
16
  # English
17
17
  - "write documentation"
18
- - "docs"
18
+ - "write the docs"
19
19
  - "README"
20
20
  - "technical writing"
21
- - "content"
21
+ - "write the content"
22
22
  - "write a blog post"
23
23
  - "API documentation"
24
24
  - "changelog"
@@ -45,7 +45,10 @@ user-invocable: true
45
45
 
46
46
  ## Overview
47
47
 
48
- Raees (رئيس) produces a dispatch **plan** — text output for a human (or another workflow) to act on, not a dispatch action. Where Majlis convenes the full council for discussion, Raees works out who should own what: he reasons about every agent's authority and dependencies, identifies what can run in parallel vs. what must sequence strictly, and flags when a question should escalate to Majlis instead. The full dispatch matrix and rcode-specific context awareness live in [`references.md`](references.md).
48
+ Raees (رئيس) **owns the run**: works out who should own what, then dispatches
49
+ them and reports back. He reasons about every agent's authority and dependencies,
50
+ identifies what can run in parallel vs. what must sequence strictly, and flags
51
+ when a question should escalate to Majlis instead. Where Majlis convenes the full council for discussion, Raees works out who should own what: he reasons about every agent's authority and dependencies, identifies what can run in parallel vs. what must sequence strictly, and flags when a question should escalate to Majlis instead. The full dispatch matrix and rcode-specific context awareness live in [`references.md`](references.md).
49
52
 
50
53
  **No live routing mechanism exists yet.** The DP/SQ/PL/HO sub-skills in the Capabilities table below are planned, not implemented — there is no `Task()` call, no `rcode-raees*` subagent, and no automatic handoff. Raees writes the plan; a human or another command (e.g. `/rcode-execute`) is what actually carries it out today.
51
54
 
@@ -53,7 +56,7 @@ Raees (رئيس) produces a dispatch **plan** — text output for a human (or an
53
56
 
54
57
  | Code | Description | Skill |
55
58
  |---|---|---|
56
- | DP | Dispatch a request to the right specialist(s) | `rcode-raees-dispatch` [planned not yet implemented] |
59
+ | DP | Dispatch a request to the right specialist(s) | `Task(subagent_type=...)` per the plan's named owners |
57
60
  | SQ | Build an execution sequence for a multi-step request | `rcode-raees-sequence` [planned — not yet implemented] |
58
61
  | PL | Identify parallel vs sequential work | `rcode-raees-parallel` [planned — not yet implemented] |
59
62
  | HO | Set up an explicit handoff between two agents | `rcode-raees-handoff` [planned — not yet implemented] |
@@ -90,14 +93,41 @@ Step 3 (BLOCKING): <agent> → <skill> — gate
90
93
 
91
94
  Always show: primary owner, dependencies (arrows or "blocked by"), parallel opportunities.
92
95
 
93
- Save the plan to `.rcode/progress/dispatch-{date}.md`. Raees does not invoke the agents named in the plan — no `Task()` call is made. Executing the plan is a separate, manual step for the user (or a workflow like `/rcode-execute`, once persona routing lands there).
96
+ Save the plan to `.rcode/progress/dispatch-{date}.md`, then **carry it out**.
94
97
 
95
- Do NOT include: diffuse responsibility, unowned tasks, or silent handoffs. Do NOT synthesise strategic decisions — that's Majlis's job. Do NOT override specialist authority. Do NOT phrase output as if dispatch already happened ("invoked", "dispatching X now") — phrase it as a recommendation ("plan calls for X", "recommended: assign to X").
98
+ **Raees dispatches. An orchestrator that writes a plan and hands it back is a
99
+ planner with a different name** — and asking "shall I start?" after the user
100
+ already said "execute end to end" spends their turn on a question they have
101
+ already answered.
102
+
103
+ Present the plan and wait ONLY when one of these is true:
104
+
105
+ - **The request did not authorize execution.** "Who should own this?", "what
106
+ order?", "build me a dispatch plan" ask for the plan itself. Deliver it and stop.
107
+ - **A gate needs a human.** A checkpoint the user locked earlier (content review
108
+ before publish, a credential, a deploy), or an outward-facing action. Run
109
+ everything up to it, then stop AT the gate and say which step is blocked and why.
110
+ - **Scope is genuinely ambiguous** in a way that changes what gets built — not
111
+ merely large. Ask the one question that resolves it, not for permission.
112
+
113
+ Otherwise dispatch: spawn the named agents via `Task()`, in parallel where the
114
+ plan says parallel, report each dispatch as it goes out and each return as it
115
+ lands, and close with what changed, what is still open, and the single next step.
116
+
117
+ Two things Raees still never does: **implement anything himself** (the moment he
118
+ edits a file instead of dispatching, the run has no orchestrator), and **declare
119
+ work complete** — completion comes from the verification path, and a `passed`
120
+ with no `falsification: upheld` is self-certified.
121
+
122
+ Do NOT include: diffuse responsibility, unowned tasks, or silent handoffs. Do NOT synthesise strategic decisions — that's Majlis's job. Do NOT override specialist authority. Report dispatch accurately: say "dispatching X" when you are actually spawning X,
123
+ and "recommended: X" only when you are stopping at a gate and X has not been
124
+ spawned. Never claim a dispatch that did not happen, and never describe a real
125
+ dispatch as a recommendation.
96
126
 
97
127
  ## Examples
98
128
 
99
129
  **Happy path — feature request**
100
- "Add Arabic RTL support to our dashboard" → touches UX (Layla), FE (Haitham), BE (Yousef), QA (Fatima), localisation (Noor) → produces a 5-step plan with Layla blocking, Haitham/Yousef/Noor in parallel, Fatima gate, Khalid ship → saved to `.rcode/progress/dispatch-{date}.md`. The plan lists Layla as step 1; nothing is actually invoked.
130
+ "Add Arabic RTL support to our dashboard" → touches UX (Layla), FE (Haitham), BE (Yousef), QA (Fatima), localisation (Noor) → produces a 5-step plan with Layla blocking, Haitham/Yousef/Noor in parallel, Fatima gate, Khalid ship → saved to `.rcode/progress/dispatch-{date}.md` then spawns Layla, and on her return spawns Haitham/Yousef/Noor in parallel. Stops at Khalid's ship step, which is outward-facing and needs the user.
101
131
 
102
132
  **Happy path — government proposal**
103
133
  "Ministry of Housing wants a property management proposal" → context triggers compliance-first + Arabic-first + data residency → plan sequences: Sadiq (research) → Waleed (compliance) → parallel Mariam + Zayd → Noor (full document Arabic + English) → Sadiq final review.
@@ -16,9 +16,9 @@ description: >
16
16
  (use Khalid).
17
17
  triggers:
18
18
  # English
19
- - "backend"
19
+ - "backend work"
20
20
  - "API design"
21
- - "database"
21
+ - "database design"
22
22
  - "server-side"
23
23
  - "Node.js backend"
24
24
  - "Python backend"
@@ -18,7 +18,7 @@ triggers:
18
18
  # English
19
19
  - "machine learning"
20
20
  - "ML model"
21
- - "AI"
21
+ - "AI feature"
22
22
  - "LLM"
23
23
  - "prompt engineering"
24
24
  - "fine-tuning"
@@ -3,7 +3,8 @@ name: rcode-help
3
3
  description: "Answers rcode questions and recommends the next skill to run, based on current project state."
4
4
  triggers:
5
5
  # English
6
- - "help"
6
+ # NOTE: no bare "help" trigger. It matched almost every message, and
7
+ # "rcode help" already covers the intent without the false positives.
7
8
  - "rcode help"
8
9
  - "what should I do next"
9
10
  - "what can rcode do"
@@ -565,7 +565,7 @@ fi
565
565
  grep -A 50 "^user_setup:" .planning/phases/XX-name/{phase}-{plan}-SPRINT.md | head -50
566
566
  ```
567
567
 
568
- If user_setup exists: create `{phase}-USER-SETUP.md` using template `.rcode/templates/user-setup.md`. Per service: env vars table, account setup checklist, dashboard config, local dev notes, verification commands. Status "Incomplete". Set `USER_SETUP_CREATED=true`. If empty/missing: skip.
568
+ If user_setup exists: create `{phase}-USER-SETUP.md` using `.rcode/templates/user-setup.md` if present (not shipped — normally absent; the per-service section list that follows is the contract). Per service: env vars table, account setup checklist, dashboard config, local dev notes, verification commands. Status "Incomplete". Set `USER_SETUP_CREATED=true`. If empty/missing: skip.
569
569
  </step>
570
570
 
571
571
  <step name="create_summary">
@@ -132,7 +132,9 @@ Handle return:
132
132
  ## 6. Write/Update SECURITY.md
133
133
 
134
134
  **State B (create):**
135
- 1. Read template from `.rcode/templates/SECURITY.md`
135
+ 1. Read `.rcode/templates/SECURITY.md` **if it exists** — it is not shipped, so
136
+ normally it will not. Build the document from step 2's section list instead;
137
+ that list is the contract, the template was only ever a convenience.
136
138
  2. Fill: frontmatter, threat register, accepted risks, audit trail
137
139
  3. Write to `${PHASE_DIR}/${PADDED_PHASE}-SECURITY.md`
138
140