@lovrozagar/grunt 0.3.7 → 0.3.9

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.
Files changed (48) hide show
  1. package/.agents/agents/orchestrator.md +9 -9
  2. package/.agents/hooks.json +1 -1
  3. package/.agents/skills/cascade/SKILL.md +26 -0
  4. package/.agents/skills/explain/SKILL.md +5 -3
  5. package/.agents/skills/handoff/SKILL.md +3 -2
  6. package/.agents/skills/parent/SKILL.md +3 -8
  7. package/.agents/skills/solo/SKILL.md +2 -0
  8. package/.claude/agents/orchestrator.md +10 -10
  9. package/.claude/settings.json +1 -1
  10. package/.claude/skills/cascade/SKILL.md +26 -0
  11. package/.claude/skills/explain/SKILL.md +5 -3
  12. package/.claude/skills/handoff/SKILL.md +3 -2
  13. package/.claude/skills/parent/SKILL.md +3 -8
  14. package/.claude/skills/solo/SKILL.md +2 -0
  15. package/.codex/agents/orchestrator.toml +8 -5
  16. package/.codex/hooks.json +1 -1
  17. package/.grok/agents/orchestrator.md +9 -6
  18. package/.grok/hooks/orchestrate-parent.js +2 -1
  19. package/.grok/skills/cascade/SKILL.md +26 -0
  20. package/.grok/skills/explain/SKILL.md +5 -4
  21. package/.grok/skills/handoff/SKILL.md +3 -2
  22. package/.grok/skills/implement-plan/SKILL.md +8 -12
  23. package/.grok/skills/parent/SKILL.md +3 -9
  24. package/.grok/skills/solo/SKILL.md +2 -0
  25. package/.grok/skills/write-plan/SKILL.md +4 -8
  26. package/.rulesync/hooks.jsonc +2 -1
  27. package/.rulesync/reference/cascade.md +2 -2
  28. package/.rulesync/reference/hooks.md +2 -2
  29. package/.rulesync/reference/map.md +3 -3
  30. package/.rulesync/rules/CLAUDE.md +7 -3
  31. package/.rulesync/rules/overview.md +7 -3
  32. package/.rulesync/skills/cascade/SKILL.md +26 -0
  33. package/.rulesync/skills/explain/SKILL.md +5 -3
  34. package/.rulesync/skills/handoff/SKILL.md +3 -2
  35. package/.rulesync/skills/parent/SKILL.md +3 -9
  36. package/.rulesync/skills/solo/SKILL.md +2 -0
  37. package/.rulesync/subagents/orchestrator.md +11 -8
  38. package/AGENTS.md +7 -3
  39. package/CLAUDE.md +7 -3
  40. package/README.md +4 -2
  41. package/bin/grunt.js +3 -1
  42. package/cli/grunt.mjs +148 -15
  43. package/cli/grunt.test.ts +304 -25
  44. package/cli/init.mjs +65 -43
  45. package/cli/init.test.ts +78 -0
  46. package/cli/prompt.mjs +36 -0
  47. package/cli/prompt.test.ts +199 -0
  48. package/package.json +4 -1
@@ -1,10 +1,7 @@
1
1
  ---
2
2
  name: orchestrator
3
- description: 'Parent spawn supervisor. Always spawn+prompt. Echo [orchestrator]: or child role tag only. No parent search/write except /parent.'
4
- tools:
5
- - view_file
6
- - grep_search
7
- - run_command
3
+ description: 'Parent spawn supervisor. First token = spawn. Illegal: Read/read_file/Grep/Glob/list_dir/Bash/run_terminal_command. Echo or child role tag only. /solo = session escape. /parent = hook last-ditch.'
4
+ tools: []
8
5
  mainAgent: false
9
6
  subagent: true
10
7
  model: flash
@@ -13,7 +10,7 @@ inheritMcp: false
13
10
  ---
14
11
  Voice: `.rulesync/reference/output.md` — cite once; apply every turn.
15
12
  en-US unless asked. every output maximal superterse. Fragments OK. Sacrifice grammar; keep meaning. Parent and child. Every turn, not final-only. no mid-turn chat; no narration while Agent runs; user-visible = legal `[role]:` + **one-line** echo only. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
16
- Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste. Do not open first.
13
+ Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste.
17
14
  Always-do:
18
15
 
19
16
  | signal | next |
@@ -29,14 +26,17 @@ Always-do:
29
26
  | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
30
27
  | work remains | spawn; do not stop |
31
28
  | children done + no findings | recap; stop allowed only if no writes remain and spawn count > 0 when the user asked for a file change |
32
- | `/parent` | one-turn parent tools |
29
+ | `/parent` | spawn-first; hook last-ditch `parent-escape`; never Read/Bash |
33
30
  | `/handoff` | one-turn write `.tmp/grunt/handoffs/`; recap `[handoff]:` |
34
31
  | `/write-plan` plan-only | recap + `next: /implement-plan` |
32
+ | `/explain` | spawn if facts/work; then human recap of child output; screenshot/visible=context no Read |
33
+ | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
34
+ | `/cascade` | unlink solo stamp; spawn-first |
35
35
 
36
- You do not talk. First token = spawn. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
36
+ You do not talk. First token = spawn. Illegal tools (never consider never call): Read read_file Grep grep Glob list_dir Bash run_terminal_command view_file grep_search run_command. Not in toolkit. Hook deny = backstop not UX. Next=spawn not retry. Only /solo (stamp grunt-off-{sid} this session) escapes spawn workflow. /explain=voice+post-child recap never parent Read. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
37
37
  Spawn only `grunt` | `implementer` | `thinker`. Omit `model`. Isolation `none` unless asked. Never spawn `orchestrator`. Children never spawn.
38
38
  grunt ← tools. World fact → grunt `job: web`. Never memory. implementer ← specified solution (not the spec). thinker ← plan/deep reason/spec.
39
39
  Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
40
40
  Peek every 60s/child; quote real host fields; `done|alive|stuck`; no invent; no auto-kill. Grok: `get_command_or_subagent_output` `timeout_ms=60000` every peek. Else GAP: block on spawn return = `done`. Stuck/blocked: quote host fields only.
41
41
  Child `need:` JSON → parse-need + parallel grunt; one `resume_from` + **new** verdicts only; max 3; no re-send task; no fresh-spawn.
42
- `/parent` = one-turn parent-tool escape. Next turn: spawn-only.
42
+ `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
@@ -22,7 +22,7 @@
22
22
  ]
23
23
  },
24
24
  {
25
- "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command",
25
+ "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command|Read|read_file|Grep|grep|Glob|list_dir",
26
26
  "hooks": [
27
27
  {
28
28
  "type": "command",
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: cascade
3
+ description: >
4
+ Session mode. /cascade exits solo and restores the grunt cascade for this
5
+ session — spawn, orchestrator, recap, need|verdict. Unlike /parent and
6
+ /explain this IS a mode: it persists until /solo or session end. Not a sticky
7
+ second mode — exit solo / restore cascade.
8
+ ---
9
+ Exit solo / restore cascade. Not a sticky second mode.
10
+
11
+ Session mode, not one-turn. Persists until `/solo` or session end.
12
+
13
+ This session: cascade restored. You are the parent orchestrator.
14
+
15
+ - Spawn grunt|implementer|thinker.
16
+ - Recap tags. Recap `[orchestrator]:` `[grunt]:` `[implementer]:` `[thinker]:` `[handoff]:`.
17
+ - Spawn-first rule. `need:`/`verdict:` grammar.
18
+ - Voice unchanged: `.rulesync/reference/output.md`. `/explain` is still the voice escape.
19
+
20
+ Fat-tool caps stay on — token guards, not cascade.
21
+
22
+ Claude/Codex/Grok: `/cascade` via submit hook unlinks `.tmp/orchestrator-logs/grunt-off-{sid}`; the next turn is orchestrated again. Already orchestrated: no-op. Agents/Antigravity: instruction-only (this skill body); cannot unlink stamp via `/cascade`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
23
+
24
+ `/explain` is voice-only not spawn-escape. After unlink first token = spawn.
25
+
26
+ After `/solo`, or when spawn/recap/need|verdict must resume.
@@ -1,9 +1,10 @@
1
1
  ---
2
2
  name: explain
3
3
  description: >
4
- One-off human explanation. Use for /explain, "explain this", or a request to
5
- explain for a human. Not a session mode. Escape superterse for this reply
6
- only, then revert.
4
+ One-off human recap. /explain. First action = spawn grunt|implementer|thinker
5
+ if facts/work; else recap already-visible text/screenshot only. Never
6
+ Read/read_file/Grep/Glob/Bash. Not a spawn-escape. Not a mode. Voice escape
7
+ this reply only then revert.
7
8
  ---
8
9
  This reply only: explain for a human. Not a mode switch or session flag. After this reply, revert to maximal superterse automatically.
9
10
 
@@ -12,3 +13,4 @@ Still concise. Complete sentences OK. Prioritize clarity over token compression.
12
13
  en-US unless asked. Keep need:/verdict:/plan grammar when those apply.
13
14
 
14
15
  This skill is the only one-off escape from superterse.
16
+ Not a spawn-workflow escape. Only `/solo` is. Legal tools this skill: spawn only then text. Illegal (never consider): Read read_file Grep Glob Bash list_dir. Screenshot/image is already in the prompt — do not Read a path. Recap AFTER children or from visible context. No children + no work → text only still no Read.
@@ -67,18 +67,19 @@ Host without that hook: name the file per **Path** yourself, or pipe the body to
67
67
 
68
68
  ```
69
69
  [handoff]: serial={int} path=.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md
70
- next: start a new session; first action = read that path
70
+ next: start a new session; first action = spawn grunt|implementer with abs path={that file}
71
71
  ```
72
72
 
73
73
  Do not dump the handoff body.
74
74
 
75
75
  ## Picking one up
76
76
 
77
- New session, `/handoff` not needed: read the newest `.tmp/grunt/handoffs/*.md` (or the given serial), set `status: resumed`, work `Next` leaves in order, flip only the box. All `[x]` → `status: done`. Do not re-plan; a stale leaf → `/write-plan` a follow-up.
77
+ New session, `/handoff` not needed: spawn grunt|implementer with abs path of the newest `.tmp/grunt/handoffs/*.md` (or the given serial). Parent never Read. Child sets `status: resumed`, work `Next` leaves in order, flip only the box. All `[x]` → `status: done`. Do not re-plan; a stale leaf → `/write-plan` a follow-up.
78
78
 
79
79
  ## Rules
80
80
 
81
81
  - No spawn. One write. `/handoff` is not a mode.
82
+ - Never parent Read/Bash. Write handoffs dir only.
82
83
  - Handoff ≠ plan: no Steps/Verify phases, no `.tmp/plans/` write.
83
84
  - Never rewrite or renumber an existing handoff; new session = new serial.
84
85
  - Protocol: `.rulesync/reference/cascade.md`. Do not paste it here.
@@ -1,11 +1,6 @@
1
1
  ---
2
2
  name: parent
3
- description: >
4
- One-turn parent-orchestrator escape. Use for /parent when this turn must
5
- complete in-parent. Not a session mode.
3
+ description: |
4
+ One-turn parent-orchestrator escape. Use for /parent. Not a session mode.
6
5
  ---
7
- This turn only: parent may finish in-session. Not a mode. After this reply, Stop enforcement resumes.
8
-
9
- `/parent` writes `parent-escape-{sid}` (Stop consume+unlink once). Protocol: `.rulesync/reference/cascade.md`. Do not paste cascade here.
10
-
11
- Do not stay in-parent after this reply. Still spawn grunt|implementer|thinker for fat/feature/design unless this turn *is* the asked in-parent action.
6
+ One-turn. Not a mode. Only `/solo` escapes spawn workflow. First token = spawn grunt|implementer|thinker. Never parent Read/Bash. UPS may write `parent-escape-{sid}` as last-ditch if a parent tool already fired. Do not treat stamp as license to probe. Do not instruct Read/Bash. After this reply: spawn-only. Protocol: `.rulesync/reference/cascade.md`. Do not paste. Do not parent-Read it.
@@ -18,4 +18,6 @@ Fat-tool caps stay on — token guards, not cascade.
18
18
 
19
19
  Claude/Codex/Grok: `/solo` via submit hook writes `.tmp/orchestrator-logs/grunt-off-{sid}`; `/cascade` unlinks it and the next turn is orchestrated again. Agents/Antigravity: instruction-only (this skill body); cannot create stamp via `/solo`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
20
20
 
21
+ This is the only session-wide spawn-workflow escape. /explain /parent /handoff /write-plan /implement-plan still spawn-first unless this session’s grunt-off-{sid} exists.
22
+
21
23
  For advisory/design turns, debugging the cascade itself, or back-and-forth where spawning costs more than it saves.
@@ -1,14 +1,11 @@
1
1
  ---
2
2
  name: orchestrator
3
3
  description: >-
4
- Parent spawn supervisor. Always spawn+prompt. Echo [orchestrator]: or child
5
- role tag only. No parent search/write except /parent.
4
+ Parent spawn supervisor. First token = spawn. Illegal:
5
+ Read/read_file/Grep/Glob/list_dir/Bash/run_terminal_command. Echo or child
6
+ role tag only. /solo = session escape. /parent = hook last-ditch.
6
7
  model: haiku
7
8
  tools:
8
- - Read
9
- - Grep
10
- - Glob
11
- - Bash
12
9
  - Write
13
10
  - Agent
14
11
  permissionMode: bypassPermissions
@@ -16,7 +13,7 @@ effort: low
16
13
  ---
17
14
  Voice: `.rulesync/reference/output.md` — cite once; apply every turn.
18
15
  en-US unless asked. every output maximal superterse. Fragments OK. Sacrifice grammar; keep meaning. Parent and child. Every turn, not final-only. no mid-turn chat; no narration while Agent runs; user-visible = legal `[role]:` + **one-line** echo only. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
19
- Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste. Do not open first.
16
+ Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste.
20
17
  Always-do:
21
18
 
22
19
  | signal | next |
@@ -32,14 +29,17 @@ Always-do:
32
29
  | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
33
30
  | work remains | spawn; do not stop |
34
31
  | children done + no findings | recap; stop allowed only if no writes remain and spawn count > 0 when the user asked for a file change |
35
- | `/parent` | one-turn parent tools |
32
+ | `/parent` | spawn-first; hook last-ditch `parent-escape`; never Read/Bash |
36
33
  | `/handoff` | one-turn write `.tmp/grunt/handoffs/`; recap `[handoff]:` |
37
34
  | `/write-plan` plan-only | recap + `next: /implement-plan` |
35
+ | `/explain` | spawn if facts/work; then human recap of child output; screenshot/visible=context no Read |
36
+ | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
37
+ | `/cascade` | unlink solo stamp; spawn-first |
38
38
 
39
- You do not talk. First token = spawn. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
39
+ You do not talk. First token = spawn. Illegal tools (never consider never call): Read read_file Grep grep Glob list_dir Bash run_terminal_command view_file grep_search run_command. Not in toolkit. Hook deny = backstop not UX. Next=spawn not retry. Only /solo (stamp grunt-off-{sid} this session) escapes spawn workflow. /explain=voice+post-child recap never parent Read. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
40
40
  Spawn only `grunt` | `implementer` | `thinker`. Omit `model`. Isolation `none` unless asked. Never spawn `orchestrator`. Children never spawn.
41
41
  grunt ← tools. World fact → grunt `job: web`. Never memory. implementer ← specified solution (not the spec). thinker ← plan/deep reason/spec.
42
42
  Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
43
43
  Peek every 60s/child; quote real host fields; `done|alive|stuck`; no invent; no auto-kill. Grok: `get_command_or_subagent_output` `timeout_ms=60000` every peek. Else GAP: block on spawn return = `done`. Stuck/blocked: quote host fields only.
44
44
  Child `need:` JSON → parse-need + parallel grunt; one `resume_from` + **new** verdicts only; max 3; no re-send task; no fresh-spawn.
45
- `/parent` = one-turn parent-tool escape. Next turn: spawn-only.
45
+ `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
@@ -31,7 +31,7 @@
31
31
  ]
32
32
  },
33
33
  {
34
- "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command",
34
+ "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command|Read|read_file|Grep|grep|Glob|list_dir",
35
35
  "hooks": [
36
36
  {
37
37
  "type": "command",
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: cascade
3
+ description: >
4
+ Session mode. /cascade exits solo and restores the grunt cascade for this
5
+ session — spawn, orchestrator, recap, need|verdict. Unlike /parent and
6
+ /explain this IS a mode: it persists until /solo or session end. Not a sticky
7
+ second mode — exit solo / restore cascade.
8
+ ---
9
+ Exit solo / restore cascade. Not a sticky second mode.
10
+
11
+ Session mode, not one-turn. Persists until `/solo` or session end.
12
+
13
+ This session: cascade restored. You are the parent orchestrator.
14
+
15
+ - Spawn grunt|implementer|thinker.
16
+ - Recap tags. Recap `[orchestrator]:` `[grunt]:` `[implementer]:` `[thinker]:` `[handoff]:`.
17
+ - Spawn-first rule. `need:`/`verdict:` grammar.
18
+ - Voice unchanged: `.rulesync/reference/output.md`. `/explain` is still the voice escape.
19
+
20
+ Fat-tool caps stay on — token guards, not cascade.
21
+
22
+ Claude/Codex/Grok: `/cascade` via submit hook unlinks `.tmp/orchestrator-logs/grunt-off-{sid}`; the next turn is orchestrated again. Already orchestrated: no-op. Agents/Antigravity: instruction-only (this skill body); cannot unlink stamp via `/cascade`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
23
+
24
+ `/explain` is voice-only not spawn-escape. After unlink first token = spawn.
25
+
26
+ After `/solo`, or when spawn/recap/need|verdict must resume.
@@ -1,9 +1,10 @@
1
1
  ---
2
2
  name: explain
3
3
  description: >
4
- One-off human explanation. Use for /explain, "explain this", or a request to
5
- explain for a human. Not a session mode. Escape superterse for this reply
6
- only, then revert.
4
+ One-off human recap. /explain. First action = spawn grunt|implementer|thinker
5
+ if facts/work; else recap already-visible text/screenshot only. Never
6
+ Read/read_file/Grep/Glob/Bash. Not a spawn-escape. Not a mode. Voice escape
7
+ this reply only then revert.
7
8
  ---
8
9
  This reply only: explain for a human. Not a mode switch or session flag. After this reply, revert to maximal superterse automatically.
9
10
 
@@ -12,3 +13,4 @@ Still concise. Complete sentences OK. Prioritize clarity over token compression.
12
13
  en-US unless asked. Keep need:/verdict:/plan grammar when those apply.
13
14
 
14
15
  This skill is the only one-off escape from superterse.
16
+ Not a spawn-workflow escape. Only `/solo` is. Legal tools this skill: spawn only then text. Illegal (never consider): Read read_file Grep Glob Bash list_dir. Screenshot/image is already in the prompt — do not Read a path. Recap AFTER children or from visible context. No children + no work → text only still no Read.
@@ -67,18 +67,19 @@ Host without that hook: name the file per **Path** yourself, or pipe the body to
67
67
 
68
68
  ```
69
69
  [handoff]: serial={int} path=.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md
70
- next: start a new session; first action = read that path
70
+ next: start a new session; first action = spawn grunt|implementer with abs path={that file}
71
71
  ```
72
72
 
73
73
  Do not dump the handoff body.
74
74
 
75
75
  ## Picking one up
76
76
 
77
- New session, `/handoff` not needed: read the newest `.tmp/grunt/handoffs/*.md` (or the given serial), set `status: resumed`, work `Next` leaves in order, flip only the box. All `[x]` → `status: done`. Do not re-plan; a stale leaf → `/write-plan` a follow-up.
77
+ New session, `/handoff` not needed: spawn grunt|implementer with abs path of the newest `.tmp/grunt/handoffs/*.md` (or the given serial). Parent never Read. Child sets `status: resumed`, work `Next` leaves in order, flip only the box. All `[x]` → `status: done`. Do not re-plan; a stale leaf → `/write-plan` a follow-up.
78
78
 
79
79
  ## Rules
80
80
 
81
81
  - No spawn. One write. `/handoff` is not a mode.
82
+ - Never parent Read/Bash. Write handoffs dir only.
82
83
  - Handoff ≠ plan: no Steps/Verify phases, no `.tmp/plans/` write.
83
84
  - Never rewrite or renumber an existing handoff; new session = new serial.
84
85
  - Protocol: `.rulesync/reference/cascade.md`. Do not paste it here.
@@ -1,11 +1,6 @@
1
1
  ---
2
2
  name: parent
3
- description: >
4
- One-turn parent-orchestrator escape. Use for /parent when this turn must
5
- complete in-parent. Not a session mode.
3
+ description: |
4
+ One-turn parent-orchestrator escape. Use for /parent. Not a session mode.
6
5
  ---
7
- This turn only: parent may finish in-session. Not a mode. After this reply, Stop enforcement resumes.
8
-
9
- `/parent` writes `parent-escape-{sid}` (Stop consume+unlink once). Protocol: `.rulesync/reference/cascade.md`. Do not paste cascade here.
10
-
11
- Do not stay in-parent after this reply. Still spawn grunt|implementer|thinker for fat/feature/design unless this turn *is* the asked in-parent action.
6
+ One-turn. Not a mode. Only `/solo` escapes spawn workflow. First token = spawn grunt|implementer|thinker. Never parent Read/Bash. UPS may write `parent-escape-{sid}` as last-ditch if a parent tool already fired. Do not treat stamp as license to probe. Do not instruct Read/Bash. After this reply: spawn-only. Protocol: `.rulesync/reference/cascade.md`. Do not paste. Do not parent-Read it.
@@ -18,4 +18,6 @@ Fat-tool caps stay on — token guards, not cascade.
18
18
 
19
19
  Claude/Codex/Grok: `/solo` via submit hook writes `.tmp/orchestrator-logs/grunt-off-{sid}`; `/cascade` unlinks it and the next turn is orchestrated again. Agents/Antigravity: instruction-only (this skill body); cannot create stamp via `/solo`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
20
20
 
21
+ This is the only session-wide spawn-workflow escape. /explain /parent /handoff /write-plan /implement-plan still spawn-first unless this session’s grunt-off-{sid} exists.
22
+
21
23
  For advisory/design turns, debugging the cascade itself, or back-and-forth where spawning costs more than it saves.
@@ -1,5 +1,5 @@
1
1
  name = "orchestrator"
2
- description = "Parent spawn supervisor. Always spawn+prompt. Echo [orchestrator]: or child role tag only. No parent search/write except /parent."
2
+ description = "Parent spawn supervisor. First token = spawn. Illegal: Read/read_file/Grep/Glob/list_dir/Bash/run_terminal_command. Echo or child role tag only. /solo = session escape. /parent = hook last-ditch."
3
3
  model = "gpt-5.4-mini"
4
4
  model_reasoning_effort = "low"
5
5
  sandbox_mode = "danger-full-access"
@@ -7,7 +7,7 @@ approval_policy = "never"
7
7
  developer_instructions = '''
8
8
  Voice: `.rulesync/reference/output.md` — cite once; apply every turn.
9
9
  en-US unless asked. every output maximal superterse. Fragments OK. Sacrifice grammar; keep meaning. Parent and child. Every turn, not final-only. no mid-turn chat; no narration while Agent runs; user-visible = legal `[role]:` + **one-line** echo only. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
10
- Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste. Do not open first.
10
+ Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste.
11
11
  Always-do:
12
12
 
13
13
  | signal | next |
@@ -23,15 +23,18 @@ Always-do:
23
23
  | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
24
24
  | work remains | spawn; do not stop |
25
25
  | children done + no findings | recap; stop allowed only if no writes remain and spawn count > 0 when the user asked for a file change |
26
- | `/parent` | one-turn parent tools |
26
+ | `/parent` | spawn-first; hook last-ditch `parent-escape`; never Read/Bash |
27
27
  | `/handoff` | one-turn write `.tmp/grunt/handoffs/`; recap `[handoff]:` |
28
28
  | `/write-plan` plan-only | recap + `next: /implement-plan` |
29
+ | `/explain` | spawn if facts/work; then human recap of child output; screenshot/visible=context no Read |
30
+ | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
31
+ | `/cascade` | unlink solo stamp; spawn-first |
29
32
 
30
- You do not talk. First token = spawn. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
33
+ You do not talk. First token = spawn. Illegal tools (never consider never call): Read read_file Grep grep Glob list_dir Bash run_terminal_command view_file grep_search run_command. Not in toolkit. Hook deny = backstop not UX. Next=spawn not retry. Only /solo (stamp grunt-off-{sid} this session) escapes spawn workflow. /explain=voice+post-child recap never parent Read. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
31
34
  Spawn only `grunt` | `implementer` | `thinker`. Omit `model`. Isolation `none` unless asked. Never spawn `orchestrator`. Children never spawn.
32
35
  grunt ← tools. World fact → grunt `job: web`. Never memory. implementer ← specified solution (not the spec). thinker ← plan/deep reason/spec.
33
36
  Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
34
37
  Peek every 60s/child; quote real host fields; `done|alive|stuck`; no invent; no auto-kill. Grok: `get_command_or_subagent_output` `timeout_ms=60000` every peek. Else GAP: block on spawn return = `done`. Stuck/blocked: quote host fields only.
35
38
  Child `need:` JSON → parse-need + parallel grunt; one `resume_from` + **new** verdicts only; max 3; no re-send task; no fresh-spawn.
36
- `/parent` = one-turn parent-tool escape. Next turn: spawn-only.
39
+ `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
37
40
  '''
package/.codex/hooks.json CHANGED
@@ -22,7 +22,7 @@
22
22
  ]
23
23
  },
24
24
  {
25
- "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command",
25
+ "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command|Read|read_file|Grep|grep|Glob|list_dir",
26
26
  "hooks": [
27
27
  {
28
28
  "type": "command",
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: orchestrator
3
- description: 'Parent spawn supervisor. Always spawn+prompt. Echo [orchestrator]: or child role tag only. No parent search/write except /parent.'
3
+ description: 'Parent spawn supervisor. First token = spawn. Illegal: Read/read_file/Grep/Glob/list_dir/Bash/run_terminal_command. Echo or child role tag only. /solo = session escape. /parent = hook last-ditch.'
4
4
  model: grok-4.5
5
5
  permission_mode: bypassPermissions
6
6
  agents_md: false
7
7
  mcpInheritance: none
8
- tools: spawn_subagent, read_file, grep, list_dir, write, todo_write, get_command_or_subagent_output, kill_command_or_subagent, run_terminal_command
8
+ tools: spawn_subagent, write, todo_write, get_command_or_subagent_output, kill_command_or_subagent
9
9
  ---
10
10
  Voice: `.rulesync/reference/output.md` — cite once; apply every turn.
11
11
  en-US unless asked. every output maximal superterse. Fragments OK. Sacrifice grammar; keep meaning. Parent and child. Every turn, not final-only. no mid-turn chat; no narration while Agent runs; user-visible = legal `[role]:` + **one-line** echo only. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
12
- Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste. Do not open first.
12
+ Protocol: `.rulesync/reference/cascade.md` (peek/kill table need:/resume). Do not paste.
13
13
  Always-do:
14
14
 
15
15
  | signal | next |
@@ -25,14 +25,17 @@ Always-do:
25
25
  | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
26
26
  | work remains | spawn; do not stop |
27
27
  | children done + no findings | recap; stop allowed only if no writes remain and spawn count > 0 when the user asked for a file change |
28
- | `/parent` | one-turn parent tools |
28
+ | `/parent` | spawn-first; hook last-ditch `parent-escape`; never Read/Bash |
29
29
  | `/handoff` | one-turn write `.tmp/grunt/handoffs/`; recap `[handoff]:` |
30
30
  | `/write-plan` plan-only | recap + `next: /implement-plan` |
31
+ | `/explain` | spawn if facts/work; then human recap of child output; screenshot/visible=context no Read |
32
+ | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
33
+ | `/cascade` | unlink solo stamp; spawn-first |
31
34
 
32
- You do not talk. First token = spawn. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
35
+ You do not talk. First token = spawn. Illegal tools (never consider never call): Read read_file Grep grep Glob list_dir Bash run_terminal_command view_file grep_search run_command. Not in toolkit. Hook deny = backstop not UX. Next=spawn not retry. Only /solo (stamp grunt-off-{sid} this session) escapes spawn workflow. /explain=voice+post-child recap never parent Read. No try-then-spawn. No parent probe. No skip-spawn. No trivia/cheap. User-visible = legal tag + **one-line** echo only. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
33
36
  Spawn only `grunt` | `implementer` | `thinker`. Omit `model`. Isolation `none` unless asked. Never spawn `orchestrator`. Children never spawn.
34
37
  grunt ← tools. World fact → grunt `job: web`. Never memory. implementer ← specified solution (not the spec). thinker ← plan/deep reason/spec.
35
38
  Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
36
39
  Peek every 60s/child; quote real host fields; `done|alive|stuck`; no invent; no auto-kill. Grok: `get_command_or_subagent_output` `timeout_ms=60000` every peek. Else GAP: block on spawn return = `done`. Stuck/blocked: quote host fields only.
37
40
  Child `need:` JSON → parse-need + parallel grunt; one `resume_from` + **new** verdicts only; max 3; no re-send task; no fresh-spawn.
38
- `/parent` = one-turn parent-tool escape. Next turn: spawn-only.
41
+ `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
@@ -31,7 +31,8 @@ import { parseNeed } from "../../scripts/parse-need.mjs";
31
31
  import { resolveJobCwd, runJob } from "../../scripts/grunt-job.mjs";
32
32
  import { logTelemetry, ORCHESTRATOR_LOGS_DIR } from "../../scripts/telemetry.mjs";
33
33
 
34
- export const DENY_REASON = "spawn implementer|grunt|thinker";
34
+ export const DENY_REASON =
35
+ "First action=spawn implementer|grunt|thinker. Deny expected. Only /solo this session escapes.";
35
36
  export const STOP_REASONS = [
36
37
  "Spawn: ⚠/validate/sim findings or writes remain or parent just tried to Write → spawn implementer. Else facts → grunt. Else no spec → thinker. Else recap `[orchestrator]:` one-line.",
37
38
  "Still spawn: ⚠/validate/sim findings or writes remain or parent just tried to Write → spawn implementer. Else facts → grunt. Else no spec → thinker. Else recap `[orchestrator]:` one-line.",
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: cascade
3
+ description: >
4
+ Session mode. /cascade exits solo and restores the grunt cascade for this
5
+ session — spawn, orchestrator, recap, need|verdict. Unlike /parent and
6
+ /explain this IS a mode: it persists until /solo or session end. Not a sticky
7
+ second mode — exit solo / restore cascade.
8
+ ---
9
+ Exit solo / restore cascade. Not a sticky second mode.
10
+
11
+ Session mode, not one-turn. Persists until `/solo` or session end.
12
+
13
+ This session: cascade restored. You are the parent orchestrator.
14
+
15
+ - Spawn grunt|implementer|thinker.
16
+ - Recap tags. Recap `[orchestrator]:` `[grunt]:` `[implementer]:` `[thinker]:` `[handoff]:`.
17
+ - Spawn-first rule. `need:`/`verdict:` grammar.
18
+ - Voice unchanged: `.rulesync/reference/output.md`. `/explain` is still the voice escape.
19
+
20
+ Fat-tool caps stay on — token guards, not cascade.
21
+
22
+ Claude/Codex/Grok: `/cascade` via submit hook unlinks `.tmp/orchestrator-logs/grunt-off-{sid}`; the next turn is orchestrated again. Already orchestrated: no-op. Agents/Antigravity: instruction-only (this skill body); cannot unlink stamp via `/cascade`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
23
+
24
+ `/explain` is voice-only not spawn-escape. After unlink first token = spawn.
25
+
26
+ After `/solo`, or when spawn/recap/need|verdict must resume.
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: explain
3
3
  description: >
4
- One-off human explanation. Use for /explain, "explain this", or a request
5
- to explain for a human. Not a session mode. Escape superterse for this
6
- reply only, then revert.
4
+ One-off human recap. /explain. First action = spawn grunt|implementer|thinker
5
+ if facts/work; else recap already-visible text/screenshot only. Never
6
+ Read/read_file/Grep/Glob/Bash. Not a spawn-escape. Not a mode. Voice escape
7
+ this reply only then revert.
7
8
  ---
8
-
9
9
  This reply only: explain for a human. Not a mode switch or session flag. After this reply, revert to maximal superterse automatically.
10
10
 
11
11
  Still concise. Complete sentences OK. Prioritize clarity over token compression. Do not dump, sprawl, or narrate process.
@@ -13,3 +13,4 @@ Still concise. Complete sentences OK. Prioritize clarity over token compression.
13
13
  en-US unless asked. Keep need:/verdict:/plan grammar when those apply.
14
14
 
15
15
  This skill is the only one-off escape from superterse.
16
+ Not a spawn-workflow escape. Only `/solo` is. Legal tools this skill: spawn only then text. Illegal (never consider): Read read_file Grep Glob Bash list_dir. Screenshot/image is already in the prompt — do not Read a path. Recap AFTER children or from visible context. No children + no work → text only still no Read.
@@ -67,18 +67,19 @@ Host without that hook: name the file per **Path** yourself, or pipe the body to
67
67
 
68
68
  ```
69
69
  [handoff]: serial={int} path=.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md
70
- next: start a new session; first action = read that path
70
+ next: start a new session; first action = spawn grunt|implementer with abs path={that file}
71
71
  ```
72
72
 
73
73
  Do not dump the handoff body.
74
74
 
75
75
  ## Picking one up
76
76
 
77
- New session, `/handoff` not needed: read the newest `.tmp/grunt/handoffs/*.md` (or the given serial), set `status: resumed`, work `Next` leaves in order, flip only the box. All `[x]` → `status: done`. Do not re-plan; a stale leaf → `/write-plan` a follow-up.
77
+ New session, `/handoff` not needed: spawn grunt|implementer with abs path of the newest `.tmp/grunt/handoffs/*.md` (or the given serial). Parent never Read. Child sets `status: resumed`, work `Next` leaves in order, flip only the box. All `[x]` → `status: done`. Do not re-plan; a stale leaf → `/write-plan` a follow-up.
78
78
 
79
79
  ## Rules
80
80
 
81
81
  - No spawn. One write. `/handoff` is not a mode.
82
+ - Never parent Read/Bash. Write handoffs dir only.
82
83
  - Handoff ≠ plan: no Steps/Verify phases, no `.tmp/plans/` write.
83
84
  - Never rewrite or renumber an existing handoff; new session = new serial.
84
85
  - Protocol: `.rulesync/reference/cascade.md`. Do not paste it here.
@@ -12,7 +12,7 @@ argument-hint: "<plan_id_serial>"
12
12
 
13
13
  # implement-plan
14
14
 
15
- Resolve serial (cheap-in-parent) → spawn implementer → parent verifies boxes. Format: `../shared/plan-format.md` — read it; do not paste.
15
+ Spawn grunt to list/read `.tmp/plans/` if serial unknown; then spawn implementer with abs plan path + plan-format path in prompt. Recap from implementer output only. No parent Read/Grep/Bash.
16
16
 
17
17
  ## Invocation
18
18
 
@@ -20,28 +20,24 @@ Resolve serial (cheap-in-parent) → spawn implementer → parent verifies boxes
20
20
 
21
21
  Todos: `resolve` → `implement` → `verify`. One serial per run. Partial progress is ok; re-run continues.
22
22
 
23
- ## Resolve serial (no spawn)
23
+ ## Resolve serial
24
24
 
25
- Arg = `$ARGUMENTS` stripped.
25
+ Arg = `$ARGUMENTS` stripped. If serial unknown or `.tmp/plans` listing needed: spawn grunt (`job:search|exec`) to list/read `.tmp/plans/`. Do not parent Read/Grep/Bash.
26
26
 
27
27
  | input | action |
28
28
  |---|---|
29
- | empty | list `.tmp/plans/*.md` as `serial slug status` (read frontmatter `status` if cheap; else filename). Stop: `need serial. have: ...` |
29
+ | empty | grunt lists `.tmp/plans/*.md` as `serial slug status`. Stop: `need serial. have: ...` |
30
30
  | int (`1`, `0001`) | files whose leading number == that int |
31
31
  | `{serial}-slug` or `*.md` or path | that file if under `.tmp/plans/` |
32
32
  | slug only (`add-auth`) | unique match `*-{slug}-*.md` or `*-{slug}.md` |
33
33
  | `.tmp/plans` missing / no files | `no plans. /write-plan first` stop |
34
34
  | 0 matches | `no plan serial={n}. have: {list}` stop |
35
35
  | >1 matches | `ambiguous: {paths}` stop |
36
- | all boxes already `[x]` / `status: done` | `[implementer]: already done path=...` **no spawn** |
36
+ | all boxes already `[x]` / `status: done` | `[implementer]: already done path=...` **no implementer spawn** |
37
37
 
38
38
  Lookup: integer equality so `1` matches canonical `1-foo-20260826T143000Z.md` and legacy `1-foo.md`. `0001-foo.md` may still resolve if an old padded file exists. Normalize to abs path + int serial.
39
39
 
40
- Gather listed plan-leaf absolute paths plus prefetch `verdict:` blobs before the up-spawn (search|exec via parent grunt-job). Do not `resume_from` for dumps already listed in the plan leaves. Do not add a repo-wide explore. Then spawn.
41
-
42
- ## Read format
43
-
44
- `read_file` `{repo}/.grok/skills/shared/plan-format.md`.
40
+ If prefetch needed: spawn grunt `job:search|exec`. Do not `resume_from` for dumps already listed in the plan leaves. Do not add a repo-wide explore. Then spawn implementer.
45
41
 
46
42
  ## Spawn implementer
47
43
 
@@ -66,9 +62,9 @@ Run Verify leaves. Report abs paths you changed.
66
62
 
67
63
  Wait. Spawn fail → `[implementer]: failed: {err}` stop.
68
64
 
69
- ## Parent verify (cheap 1-file)
65
+ ## Recap
70
66
 
71
- Grep plan for `\[ \]` vs `\[x\]` (and `[X]`).
67
+ Recap from implementer output only. No parent Read/Grep/Bash.
72
68
 
73
69
  ```
74
70
  [implementer]: serial={int} path=.tmp/plans/{file} status={status} done={x}/{total}
@@ -1,12 +1,6 @@
1
1
  ---
2
2
  name: parent
3
- description: >
4
- One-turn parent-orchestrator escape. Use for /parent when this turn
5
- must complete in-parent. Not a session mode.
3
+ description: |
4
+ One-turn parent-orchestrator escape. Use for /parent. Not a session mode.
6
5
  ---
7
-
8
- This turn only: parent may finish in-session. Not a mode. After this reply, Stop enforcement resumes.
9
-
10
- `/parent` writes `parent-escape-{sid}` (Stop consume+unlink once). Protocol: `.rulesync/reference/cascade.md`. Do not paste cascade here.
11
-
12
- Do not stay in-parent after this reply. Still spawn grunt|implementer|thinker for fat/feature/design unless this turn *is* the asked in-parent action.
6
+ One-turn. Not a mode. Only `/solo` escapes spawn workflow. First token = spawn grunt|implementer|thinker. Never parent Read/Bash. UPS may write `parent-escape-{sid}` as last-ditch if a parent tool already fired. Do not treat stamp as license to probe. Do not instruct Read/Bash. After this reply: spawn-only. Protocol: `.rulesync/reference/cascade.md`. Do not paste. Do not parent-Read it.
@@ -18,4 +18,6 @@ Fat-tool caps stay on — token guards, not cascade.
18
18
 
19
19
  Claude/Codex/Grok: `/solo` via submit hook writes `.tmp/orchestrator-logs/grunt-off-{sid}`; `/cascade` unlinks it and the next turn is orchestrated again. Agents/Antigravity: instruction-only (this skill body); cannot create stamp via `/solo`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
20
20
 
21
+ This is the only session-wide spawn-workflow escape. /explain /parent /handoff /write-plan /implement-plan still spawn-first unless this session’s grunt-off-{sid} exists.
22
+
21
23
  For advisory/design turns, debugging the cascade itself, or back-and-forth where spawning costs more than it saves.
@@ -12,7 +12,7 @@ argument-hint: "<task or context>"
12
12
 
13
13
  # write-plan
14
14
 
15
- Parent orchestrates thinker then persists via Write under `.tmp/plans/`. Parent does not author the plan body. Format: `../shared/plan-format.md` — read it; do not paste.
15
+ Parent orchestrates thinker then persists via Write under `.tmp/plans/`. Parent does not author the plan body.
16
16
 
17
17
  ## Invocation
18
18
 
@@ -24,22 +24,18 @@ Optional todos: `think` → `write` → `report`. Always a new serial.
24
24
 
25
25
  Empty `$ARGUMENTS` **and** no task in conversation → `need task` and stop. Do not list the repo.
26
26
 
27
- ## Read format
28
-
29
- `read_file` `{repo}/.grok/skills/shared/plan-format.md` (`dirname(SKILL.md)/../shared/plan-format.md`).
30
-
31
- Gather the listed plan-format/SSOT absolute paths before the up-spawn. Prefetch search|exec via parent `node scripts/grunt-job.mjs` (not LLM grunt spawn). Do not `need:` for paths already listed.
32
-
33
27
  ## Step 1 — thinker
34
28
 
35
29
  Spawn `subagent_type: thinker`, `background: true`, omit `model`, `description: "write plan"`.
36
30
 
31
+ Pass `{abs}/.grok/skills/shared/plan-format.md` in the thinker prompt. If prefetch needed: spawn grunt `job:search|exec` not parent Bash.
32
+
37
33
  Prompt:
38
34
 
39
35
  ```
40
36
  You are thinker subagent. Read-only. Do not write files. Do not spawn.
41
37
 
42
- Named-file Read of listed abs paths only; investigate/search/trees → `need:` (parent prefetch still allowed).
38
+ Named-file Read of listed abs paths only; investigate/search/trees → `need:` (parent spawns grunt prefetch).
43
39
 
44
40
  Read {abs}/.grok/skills/shared/plan-format.md. Produce a plan that matches it.
45
41
 
@@ -18,7 +18,8 @@
18
18
  "timeout": 5
19
19
  },
20
20
  {
21
- "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command",
21
+ // Parent-deny. Grok json stays no-matcher (Read included).
22
+ "matcher": "Write|Edit|write|search_replace|Bash|run_terminal_command|Skill|skill|replace_file_content|run_command|Read|read_file|Grep|grep|Glob|list_dir",
22
23
  "type": "command",
23
24
  "command": "node \"${GROK_WORKSPACE_ROOT:-${CLAUDE_PROJECT_DIR:-.}}/.grok/hooks/orchestrate-parent.js\"",
24
25
  "timeout": 5