@lovrozagar/grunt 0.4.2 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/agents/grunt.md +2 -1
- package/.agents/agents/implementer.md +1 -1
- package/.agents/agents/orchestrator.md +19 -13
- package/.agents/agents/thinker.md +8 -6
- package/.agents/skills/ask/SKILL.md +18 -0
- package/.agents/skills/auto/SKILL.md +18 -0
- package/.agents/skills/browser/SKILL.md +4 -3
- package/.agents/skills/cascade/SKILL.md +5 -3
- package/.agents/skills/commit-and-push/SKILL.md +3 -3
- package/.agents/skills/explain/SKILL.md +1 -0
- package/.agents/skills/handoff/SKILL.md +1 -1
- package/.agents/skills/implement-plan/SKILL.md +117 -0
- package/.agents/skills/solo/SKILL.md +5 -3
- package/.agents/skills/tmp/SKILL.md +58 -0
- package/.agents/skills/write-plan/SKILL.md +85 -0
- package/.claude/agents/grunt.md +2 -1
- package/.claude/agents/implementer.md +1 -1
- package/.claude/agents/orchestrator.md +19 -13
- package/.claude/agents/thinker.md +8 -6
- package/.claude/skills/ask/SKILL.md +18 -0
- package/.claude/skills/auto/SKILL.md +18 -0
- package/.claude/skills/browser/SKILL.md +4 -3
- package/.claude/skills/cascade/SKILL.md +5 -3
- package/.claude/skills/commit-and-push/SKILL.md +3 -3
- package/.claude/skills/explain/SKILL.md +1 -0
- package/.claude/skills/handoff/SKILL.md +1 -1
- package/.claude/skills/implement-plan/SKILL.md +117 -0
- package/.claude/skills/solo/SKILL.md +5 -3
- package/.claude/skills/tmp/SKILL.md +58 -0
- package/.claude/skills/write-plan/SKILL.md +85 -0
- package/.codex/agents/grunt.toml +2 -1
- package/.codex/agents/implementer.toml +1 -1
- package/.codex/agents/orchestrator.toml +19 -13
- package/.codex/agents/thinker.toml +8 -6
- package/.grok/agents/grunt.md +2 -1
- package/.grok/agents/implementer.md +1 -1
- package/.grok/agents/orchestrator.md +19 -13
- package/.grok/agents/thinker.md +8 -6
- package/.grok/hooks/orchestrate-parent.js +280 -62
- package/.grok/skills/ask/SKILL.md +18 -0
- package/.grok/skills/auto/SKILL.md +18 -0
- package/.grok/skills/browser/SKILL.md +4 -3
- package/.grok/skills/cascade/SKILL.md +5 -3
- package/.grok/skills/commit-and-push/SKILL.md +3 -3
- package/.grok/skills/explain/SKILL.md +1 -0
- package/.grok/skills/handoff/SKILL.md +1 -1
- package/.grok/skills/implement-plan/SKILL.md +49 -20
- package/.grok/skills/solo/SKILL.md +5 -3
- package/.grok/skills/tmp/SKILL.md +58 -0
- package/.grok/skills/write-plan/SKILL.md +17 -14
- package/.rulesync/grunt.config.jsonc +7 -0
- package/.rulesync/reference/INDEX.md +46 -0
- package/.rulesync/reference/cascade.md +19 -15
- package/.rulesync/reference/hooks.md +6 -4
- package/.rulesync/reference/law.md +9 -0
- package/.rulesync/reference/map.md +20 -10
- package/.rulesync/reference/output.md +23 -8
- package/{.grok/skills/shared → .rulesync/reference}/plan-format.md +12 -11
- package/.rulesync/reference/refs-map.md +14 -0
- package/.rulesync/reference/skills-map.md +23 -0
- package/.rulesync/rules/CLAUDE.md +22 -15
- package/.rulesync/rules/overview.md +22 -15
- package/.rulesync/skills/ask/SKILL.md +18 -0
- package/.rulesync/skills/auto/SKILL.md +18 -0
- package/.rulesync/skills/browser/SKILL.md +2 -2
- package/.rulesync/skills/cascade/SKILL.md +5 -3
- package/.rulesync/skills/commit-and-push/SKILL.md +3 -3
- package/.rulesync/skills/explain/SKILL.md +1 -0
- package/.rulesync/skills/handoff/SKILL.md +1 -1
- package/.rulesync/skills/implement-plan/SKILL.md +127 -0
- package/.rulesync/skills/solo/SKILL.md +5 -3
- package/.rulesync/skills/tmp/SKILL.md +58 -0
- package/.rulesync/skills/write-plan/SKILL.md +92 -0
- package/.rulesync/subagents/grunt.md +2 -1
- package/.rulesync/subagents/implementer.md +1 -1
- package/.rulesync/subagents/orchestrator.md +19 -13
- package/.rulesync/subagents/thinker.md +8 -6
- package/AGENTS.md +22 -15
- package/CHANGELOG.md +56 -0
- package/CLAUDE.md +22 -15
- package/README.md +27 -22
- package/cli/grunt.mjs +12 -12
- package/cli/grunt.test.ts +29 -20
- package/cli/init.mjs +135 -22
- package/cli/init.test.ts +624 -36
- package/package.json +11 -4
- package/scripts/doctor.mjs +64 -2
- package/scripts/emit-maps.mjs +422 -0
- package/scripts/gate-fat-tools.mjs +2 -2
- package/scripts/grunt-config.mjs +50 -0
- package/scripts/guarded-roots.mjs +4 -7
- package/scripts/persist-plan.mjs +17 -2
- package/scripts/persist-tmp.mjs +123 -0
- package/scripts/pipeline.mjs +67 -0
- package/scripts/scrub-spawn-prompt.mjs +1 -1
- package/scripts/skill-conflicts.mjs +71 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ask
|
|
3
|
+
description: >
|
|
4
|
+
Session leftover-gate. /ask sets leftover-gate ask for this session — leftover
|
|
5
|
+
triple wait on advise-class recaps. Not leftover y/n. Not pick 3 Tweak. Not
|
|
6
|
+
spawn-escape. /auto sets auto.
|
|
7
|
+
---
|
|
8
|
+
Session leftover-gate, not spawn-escape. Not leftover y/n. Not pick 3 Tweak.
|
|
9
|
+
|
|
10
|
+
Whole-prompt `/ask` only (`/ask foo` no-op). Persists until `/auto` or session end.
|
|
11
|
+
|
|
12
|
+
Effective leftover-gate: stamp body `auto`|`ask` > `.rulesync/grunt.config.jsonc` `leftoverGate` > `ask`. Fail-closed `ask`.
|
|
13
|
+
|
|
14
|
+
Claude/Codex/Grok: `/ask` via submit hook. If slash token equals committed config `leftoverGate`, unlink `.tmp/grunt/orchestrator-logs/auto-ask-{sid}`; else write stamp body `ask`. Requires real sid (never `default`). Agents/Antigravity: instruction-only (this skill body); cannot create stamp via `/ask`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
|
|
15
|
+
|
|
16
|
+
Ask: always-print typed leftover triple on advise-class final recap. Write-typed leftover never spawns implementer. Not leftover pick 3.
|
|
17
|
+
|
|
18
|
+
Not `/solo`. Spawn-first still. Recap tags still.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auto
|
|
3
|
+
description: >
|
|
4
|
+
Session leftover-gate. /auto sets leftover-gate auto for this session —
|
|
5
|
+
Implement-typed pick2 chains write-plan persist then implement-plan {n} and
|
|
6
|
+
skips leftover wait. Not autofix. Not spawn-escape. /ask restores ask.
|
|
7
|
+
---
|
|
8
|
+
Session leftover-gate, not spawn-escape. Not autofix. Not leftover y/n.
|
|
9
|
+
|
|
10
|
+
Whole-prompt `/auto` only (`/auto foo` no-op). Persists until `/ask` or session end.
|
|
11
|
+
|
|
12
|
+
Effective leftover-gate: stamp body `auto`|`ask` > `.rulesync/grunt.config.jsonc` `leftoverGate` > `ask`. Fail-closed `ask`.
|
|
13
|
+
|
|
14
|
+
Claude/Codex/Grok: `/auto` via submit hook. If slash token equals committed config `leftoverGate`, unlink `.tmp/grunt/orchestrator-logs/auto-ask-{sid}`; else write stamp body `auto`. Requires real sid (never `default`). Agents/Antigravity: instruction-only (this skill body); cannot create stamp via `/auto`; Stop still honors a pre-existing stamp if present. Session-scoped, never global.
|
|
15
|
+
|
|
16
|
+
effective=auto + Implement-typed: write-plan persist then implement-plan `{n}`; skip leftover triple wait. Write-typed under auto still leftover wait; never spawn implementer.
|
|
17
|
+
|
|
18
|
+
Not `/solo`. Spawn-first still. Recap tags still.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: browser
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
nav|snap|click|fill|shot|pdf|stop. Lightpanda default;
|
|
6
|
-
read. Windows → Chromium. Never MCP. Never env knobs.
|
|
4
|
+
Live URL/interact → this; not websearch. /browser or browse a URL. Call node
|
|
5
|
+
scripts/browser.mjs nav|snap|click|fill|shot|pdf|stop. Lightpanda default;
|
|
6
|
+
snap is the default read. Windows → Chromium. Never MCP. Never env knobs.
|
|
7
|
+
Never raw Playwright.
|
|
7
8
|
---
|
|
8
9
|
Zero-config. `node scripts/browser.mjs <verb>`.
|
|
9
10
|
|
|
@@ -13,14 +13,16 @@ Session mode, not one-turn. Persists until `/solo` or session end.
|
|
|
13
13
|
This session: cascade restored. You are the parent orchestrator.
|
|
14
14
|
|
|
15
15
|
- Spawn grunt|implementer|thinker.
|
|
16
|
-
- Recap tags. Recap `[orchestrator]:` `[grunt]:` `[implementer]:` `[thinker]:` `[handoff]:`.
|
|
16
|
+
- Recap tags. Recap `[orchestrator]:` `[grunt]:` `[implementer]:` `[thinker]:` `[handoff]:` `[tmp]:`.
|
|
17
17
|
- Spawn-first rule. `need:`/`verdict:` grammar.
|
|
18
18
|
- Voice unchanged: `.rulesync/reference/output.md`. `/explain` is still the voice escape.
|
|
19
19
|
|
|
20
20
|
Fat-tool caps stay on — token guards, not cascade.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Effective spawn: stamp body `solo`|`cascade` > one-release `grunt-off-{sid}` presence as solo > `.rulesync/grunt.config.jsonc` `spawnMode` > `cascade`. Fail-closed `cascade`. Unreadable/bad stamp body ignored (dual-read grunt-off else config). Never fail-closed solo.
|
|
23
|
+
|
|
24
|
+
Claude/Codex/Grok: `/cascade` via submit hook. If slash token equals committed config `spawnMode`, unlink `.tmp/grunt/orchestrator-logs/spawn-mode-{sid}`; else write stamp body `cascade`. Always unlink `grunt-off-{sid}` (new+legacy). Requires real sid (never `default`). Already matching config with no leftover grunt-off: 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
25
|
|
|
24
26
|
`/explain` is voice-only not spawn-escape. After unlink first token = spawn.
|
|
25
27
|
|
|
26
|
-
After `/solo`, or when spawn/recap/need|verdict must resume.
|
|
28
|
+
After `/solo`, or when spawn/recap/need|verdict must resume. Leftover-gate `/auto`/`/ask` is not spawn-escape.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commit-and-push
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
push". Must push.
|
|
4
|
+
Alias of commit-push (1-release stub). Use for /commit-and-push, "commit and
|
|
5
|
+
push", "commit this and push". Must push. Prefer /commit-push.
|
|
6
6
|
---
|
|
7
|
-
|
|
7
|
+
Thin alias → `.rulesync/skills/commit-push/SKILL.md`. Must push. Do not load /commit.
|
|
8
8
|
|
|
9
9
|
Protocol: `.rulesync/reference/cascade.md`. Do not paste cascade.
|
|
@@ -14,5 +14,6 @@ Four buckets (completed / in-flight / remainder / blocker). Completed work = pas
|
|
|
14
14
|
en-US unless asked. Keep need:/verdict:/plan grammar when those apply.
|
|
15
15
|
|
|
16
16
|
This skill is the only one-off escape from superterse.
|
|
17
|
+
Always-why advise recap ≠ `/explain`. `/explain` = expansion not the why path.
|
|
17
18
|
Freeform how/why/explain is not this skill (thinker unless cheap false+). Slash `/explain` only.
|
|
18
19
|
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.
|
|
@@ -80,6 +80,6 @@ Do not dump the handoff body.
|
|
|
80
80
|
|
|
81
81
|
- No spawn. One write. `/handoff` is not a mode.
|
|
82
82
|
- Never parent Read/Bash. Write handoffs dir only.
|
|
83
|
-
- Handoff ≠ plan: no Steps/Verify phases, no `.tmp/plans/` write.
|
|
83
|
+
- Handoff ≠ plan: no Steps/Verify phases, no `.tmp/grunt/plans/` write.
|
|
84
84
|
- Never rewrite or renumber an existing handoff; new session = new serial.
|
|
85
85
|
- Protocol: `.rulesync/reference/cascade.md`. Do not paste it here.
|
|
@@ -1,36 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement-plan
|
|
3
3
|
description: >
|
|
4
|
-
Implementer executes a local .tmp/plans checklist
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"execute the checklist", or "/implement-plan".
|
|
10
|
-
argument-hint: "<plan_id_serial>"
|
|
4
|
+
Implementer executes a local .tmp/grunt/plans checklist: continue, resume, or
|
|
5
|
+
pick among plans. Empty /implement-plan resumes a unique in-progress or starts
|
|
6
|
+
a unique ready plan; else lists and needs serial. Marks [x], skips completed
|
|
7
|
+
leaves. Not /implement review-loop, not /execute-plan PR DAG, not /pickup, not
|
|
8
|
+
/run-plan.
|
|
11
9
|
---
|
|
12
|
-
|
|
13
10
|
# implement-plan
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
Parent: spawn grunt to list/validate `.tmp/grunt/plans/` when the target is unknown or empty-arg; then spawn implementer with abs plan path + `{repo}/.rulesync/reference/plan-format.md` + first open leaf. Recap from implementer output only. No parent Read/Grep/Bash. Agent-agnostic (grunt then implementer). Not `/pickup` (handoffs only). Not `/run-plan`. Not `/execute-plan` (PR DAG).
|
|
13
|
+
|
|
14
|
+
Format SSOT: `.rulesync/reference/plan-format.md`.
|
|
16
15
|
|
|
17
16
|
## Invocation
|
|
18
17
|
|
|
19
|
-
`/implement-plan
|
|
18
|
+
`/implement-plan`
|
|
19
|
+
`/implement-plan {serial|path}`
|
|
20
|
+
|
|
21
|
+
Todos: `resolve` → `implement` → `verify`. One serial per run. Partial progress is ok; re-run continues. Skip `[x]`. Remaining leaves only.
|
|
22
|
+
|
|
23
|
+
## Resolve
|
|
24
|
+
|
|
25
|
+
Arg = `$ARGUMENTS` stripped. Listing/validate: spawn grunt (`job:search|exec`) on `.tmp/grunt/plans/`. Do not parent Read/Grep/Bash.
|
|
26
|
+
|
|
27
|
+
Eligible auto = valid plan-format checkbox grammar (`N [ ]` / `N.M [ ]`; not `- [ ]`; not `1. [ ]`). Invalid grammar: exclude from auto. Drop `done` (all `[x]` or FM `status: done`) from auto. Never silent latest. Never auto-pick among many.
|
|
28
|
+
|
|
29
|
+
**In-progress:** some `[x]` and remaining `[ ]`, or FM `status: in-progress` with open leaves.
|
|
30
|
+
|
|
31
|
+
**Ready / none started:** FM `ready` or all boxes `[ ]`.
|
|
32
|
+
|
|
33
|
+
**Blocked + open:** list/tag `blocked`; empty-arg never auto-runs. Explicit `{n|path}` still runs (skip `[x]`).
|
|
34
|
+
|
|
35
|
+
### Empty arg (`/implement-plan`)
|
|
36
|
+
|
|
37
|
+
Grunt lists/validates `.tmp/grunt/plans/*.md`. Then:
|
|
38
|
+
|
|
39
|
+
| condition | action |
|
|
40
|
+
|---|---|
|
|
41
|
+
| exactly 1 in-progress | resume it (implementer; skip `[x]`; start first open leaf) |
|
|
42
|
+
| exactly 1 plan total, none started (ready / all open) | start it |
|
|
43
|
+
| 0 plans (dir missing / no files) | blocker; remainder `/write-plan` |
|
|
44
|
+
| N>1 in-progress | list those (`serial name status first-open-leaf`); `need serial`. No silent latest |
|
|
45
|
+
| 0 in-progress, N>1 eligible (ready / blocked-open) | list eligible (`serial name status first-open-leaf`; tag `blocked`); `need serial` |
|
|
46
|
+
| only `done` / only invalid | blocker; remainder `/write-plan` |
|
|
20
47
|
|
|
21
|
-
|
|
48
|
+
Unique in-progress wins even if other ready/done files exist. Invalid grammar does not count toward unique-auto and is omitted from auto lists.
|
|
22
49
|
|
|
23
|
-
|
|
50
|
+
### Arg `{n|path}`
|
|
24
51
|
|
|
25
|
-
|
|
52
|
+
That file only; skip `[x]`; remaining leaves. Write-plan remainder stays `/implement-plan {n}` (that serial). Never auto-pick among many.
|
|
26
53
|
|
|
27
54
|
| input | action |
|
|
28
55
|
|---|---|
|
|
29
|
-
| empty | grunt lists `.tmp/plans/*.md` as `serial slug status`. Stop: `need serial. have: ...` |
|
|
30
56
|
| int (`1`, `0001`) | files whose leading number == that int |
|
|
31
|
-
| `{serial}-slug` or `*.md` or path | that file if under `.tmp/plans/` |
|
|
57
|
+
| `{serial}-slug` or `*.md` or path | that file if under `.tmp/grunt/plans/` |
|
|
32
58
|
| slug only (`add-auth`) | unique match `*-{slug}-*.md` or `*-{slug}.md` |
|
|
33
|
-
| `.tmp/plans` missing / no files | `no plans. /write-plan first` stop |
|
|
59
|
+
| `.tmp/grunt/plans` missing / no files | `no plans. /write-plan first` stop |
|
|
34
60
|
| 0 matches | `no plan serial={n}. have: {list}` stop |
|
|
35
61
|
| >1 matches | `ambiguous: {paths}` stop |
|
|
36
62
|
| all boxes already `[x]` / `status: done` | `[implementer]: already done path=...` **no implementer spawn** |
|
|
@@ -48,9 +74,9 @@ Prompt:
|
|
|
48
74
|
```
|
|
49
75
|
You are implementer subagent. Do not spawn.
|
|
50
76
|
|
|
51
|
-
Read {abs}/.
|
|
77
|
+
Read {abs}/.rulesync/reference/plan-format.md and the plan at {abs_plan_path}.
|
|
52
78
|
|
|
53
|
-
Implement remaining `[ ]` leaves in numeric order. Skip `[x]`.
|
|
79
|
+
Implement remaining `[ ]` leaves in numeric order. Skip `[x]`. Start at the first open leaf.
|
|
54
80
|
Write-allowlist = paths listed in this plan only. Do not add README/docs/examples unless listed in the plan. Missing path → blocker/`need:`; do not invent.
|
|
55
81
|
After each leaf: flip that line to `[x]` in the plan file (only the box).
|
|
56
82
|
When a phase's children are all `[x]`, mark the phase `[x]`.
|
|
@@ -67,7 +93,7 @@ Wait. Spawn fail → `[implementer]: failed: {err}` stop.
|
|
|
67
93
|
Recap from implementer output only. No parent Read/Grep/Bash.
|
|
68
94
|
|
|
69
95
|
```
|
|
70
|
-
[implementer]: serial={int} path=.tmp/plans/{file} status={status} done={x}/{total}
|
|
96
|
+
[implementer]: serial={int} path=.tmp/grunt/plans/{file} status={status} done={x}/{total}
|
|
71
97
|
files: {abs paths}
|
|
72
98
|
{if leftover:}
|
|
73
99
|
leftover:
|
|
@@ -78,7 +104,9 @@ leftover:
|
|
|
78
104
|
## Rules
|
|
79
105
|
|
|
80
106
|
- Skip `[x]`; only flip boxes; no renumber/rewrite leaf text.
|
|
81
|
-
- No review-fix loop. Not bundled `/implement`.
|
|
107
|
+
- No review-fix loop. Not bundled `/implement`. Implement leftover pick 1 (`Implement with verbal plan`) ≠ this skill (no `.tmp/grunt/plans`; no write-plan; no implement-plan). Bare `implement`/`implementer` → pick1 iff Implement-typed, not this skill; else recap “no implementer this remainder”.
|
|
108
|
+
- Slash `/implement-plan {n}` = disk/file run. Empty `/implement-plan` = unique-resume / unique-start / else list. Implement leftover pick 2 may invoke this sequencing without user slash (after write-plan persist; `plan=/abs/...` only). Write leftover pick 2 does not spawn implementer this turn. Always-do leftover match; leftover `2` ≠ Skill-name. Verbal leftover ≠ implement-plan.
|
|
109
|
+
- effective=auto + Implement-typed may chain this sequencing without user slash after write-plan persist (`plan=/abs/...`). Write-typed under auto: no implementer this turn; leftover wait.
|
|
82
110
|
- No auto `/write-plan` chain. Escalation → tell user to `/write-plan` a follow-up.
|
|
83
111
|
- Omit `model`. `subagent_type: implementer` only for this skill.
|
|
84
112
|
- First prompt sentence: `You are implementer subagent.`
|
|
@@ -86,3 +114,4 @@ leftover:
|
|
|
86
114
|
- Resume prompt = `You are implementer subagent.` + new verdicts only. Do not re-send the original task. Max 3 `resume_from` per child id; then report blocked/partial.
|
|
87
115
|
- Tool-call first for spawn claims.
|
|
88
116
|
- Do not re-plan. Partial = skill success (plan file is SoT).
|
|
117
|
+
- `/pickup` stays handoffs only. Do not merge.
|
|
@@ -16,8 +16,10 @@ This session: cascade suspended. You are one normal agent.
|
|
|
16
16
|
|
|
17
17
|
Fat-tool caps stay on — token guards, not cascade.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Effective spawn: stamp body `solo`|`cascade` > one-release `grunt-off-{sid}` presence as solo > `.rulesync/grunt.config.jsonc` `spawnMode` > `cascade`. Fail-closed `cascade`. Unreadable/bad stamp body ignored (dual-read grunt-off else config). Never fail-closed solo.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Claude/Codex/Grok: `/solo` via submit hook. If slash token equals committed config `spawnMode`, unlink `.tmp/grunt/orchestrator-logs/spawn-mode-{sid}`; else write stamp body `solo`. Always unlink `grunt-off-{sid}` (new+legacy). Requires real sid (never `default`). 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.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
This is the only session-wide spawn-workflow escape. /explain /parent /handoff /pickup /write-plan /implement-plan still spawn-first unless this session’s effective spawn is solo.
|
|
24
|
+
|
|
25
|
+
Spawn-escape only. Not advisory/design routing. Leftover-gate `/auto`/`/ask` is not spawn-escape.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tmp
|
|
3
|
+
description: >
|
|
4
|
+
One-off convo artifact dump under .tmp/grunt/. Use for /tmp, dump a draft,
|
|
5
|
+
save a note/email/script from this session. Not a plan, not a handoff, not
|
|
6
|
+
product source.
|
|
7
|
+
---
|
|
8
|
+
# tmp
|
|
9
|
+
|
|
10
|
+
One turn, in-parent. Parent authors from this session (email/script/note). **Do not spawn.** Write once. Recap path. Stop.
|
|
11
|
+
|
|
12
|
+
## Invocation
|
|
13
|
+
|
|
14
|
+
`/tmp [what]`
|
|
15
|
+
|
|
16
|
+
Empty `$ARGUMENTS` + no already-visible dumpable blob → `need task`. Empty + visible blob (code fence / draft) → dump that.
|
|
17
|
+
|
|
18
|
+
## When
|
|
19
|
+
|
|
20
|
+
Dump a one-off convo artifact. Not `/handoff` (no pickup no Goal/State/Next). Not `.tmp/grunt/plans/`. Not product source. Not OS `/tmp`.
|
|
21
|
+
|
|
22
|
+
## Path
|
|
23
|
+
|
|
24
|
+
`.tmp/grunt/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.{ext}`
|
|
25
|
+
|
|
26
|
+
- serial: unpadded int ≥ 1, next after existing tmp dumps (own counter; not plan/handoff serials)
|
|
27
|
+
- slug: lower, non `[a-z0-9]` → `-`, collapse, trim 50
|
|
28
|
+
- stamp: UTC `YYYYMMDDTHHMMSSZ`
|
|
29
|
+
- ext: `TMP_EXT` or explicit `.{ext}` in args; else `md`
|
|
30
|
+
|
|
31
|
+
## Write
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
TMP_NAME: <3-6 word name>
|
|
35
|
+
TMP_EXT: md
|
|
36
|
+
<artifact only>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`TMP_EXT` optional. Parent `write`s any root filename under `.tmp/grunt/` (not `plans|handoffs|browser|orchestrator-logs`). Grok `orchestrate-parent.js` runs `scripts/persist-tmp.mjs`: serial/slug/ext from `TMP_*`, strips those lines, no YAML frontmatter, rewrites path + content. Write outside that root or missing `TMP_NAME:` is denied.
|
|
40
|
+
|
|
41
|
+
Host without that hook: name the file per **Path** yourself, or pipe the body to `node scripts/persist-tmp.mjs --workspace {repo}` and use its `path`.
|
|
42
|
+
|
|
43
|
+
Never rewrite an existing dump; new serial. Artifact file content after hook = artifact only (no TMP_* lines no YAML frontmatter).
|
|
44
|
+
|
|
45
|
+
## Report
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
[tmp]: serial={int} path=.tmp/grunt/{serial}-{slug}-{stamp}.{ext}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Do not dump the body.
|
|
52
|
+
|
|
53
|
+
## Rules
|
|
54
|
+
|
|
55
|
+
- No spawn. One write. `/tmp` is not a mode. Slash `/tmp` = no leftover. Write leftover pick 1 (`Write with verbal plan`) uses this persist sequencing; recap `[tmp]:`; no implementer. No pickup.
|
|
56
|
+
- Never parent Read/Bash. Write `.tmp/grunt/` root files only.
|
|
57
|
+
- Secrets/tokens: refuse dump. Text artifacts only; no binary.
|
|
58
|
+
- Protocol: `.rulesync/reference/cascade.md`. Do not paste it here.
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: write-plan
|
|
3
3
|
description: >
|
|
4
|
-
Thinker drafts a local implementer-ready checklist plan; parent Write
|
|
5
|
-
|
|
6
|
-
for implementer, "write a plan", or /write-plan. Not a
|
|
7
|
-
|
|
8
|
-
Use when asked to "write a plan", "make a checklist plan",
|
|
9
|
-
"plan this for implementer", or "/write-plan".
|
|
10
|
-
argument-hint: "<task or context>"
|
|
4
|
+
Thinker drafts a local implementer-ready checklist plan; parent Write persists
|
|
5
|
+
.tmp/grunt/plans/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.md. Use for a numbered
|
|
6
|
+
local plan, checklist for implementer, "write a plan", or /write-plan. Not a
|
|
7
|
+
design doc or PR stack.
|
|
11
8
|
---
|
|
12
|
-
|
|
13
9
|
# write-plan
|
|
14
10
|
|
|
15
|
-
Parent orchestrates thinker then persists via Write under `.tmp/plans/`. Parent does not author the plan body.
|
|
11
|
+
Parent orchestrates thinker then persists via Write under `.tmp/grunt/plans/`. Parent does not author the plan body.
|
|
16
12
|
|
|
17
13
|
## Invocation
|
|
18
14
|
|
|
@@ -28,7 +24,7 @@ Empty `$ARGUMENTS` **and** no task in conversation → `need task` and stop. Do
|
|
|
28
24
|
|
|
29
25
|
Spawn `subagent_type: thinker`, `background: true`, omit `model`, `description: "write plan"`.
|
|
30
26
|
|
|
31
|
-
Pass `{abs}/.
|
|
27
|
+
Pass `{abs}/.rulesync/reference/plan-format.md` in the thinker prompt. If prefetch needed: spawn grunt `job:search|exec` not parent Bash.
|
|
32
28
|
|
|
33
29
|
Prompt:
|
|
34
30
|
|
|
@@ -37,7 +33,7 @@ You are thinker subagent. Read-only. Do not write files. Do not spawn.
|
|
|
37
33
|
|
|
38
34
|
Named-file Read of listed abs paths only; investigate/search/trees → `need:` (parent spawns grunt prefetch).
|
|
39
35
|
|
|
40
|
-
Read {abs}/.
|
|
36
|
+
Read {abs}/.rulesync/reference/plan-format.md. Produce a plan that matches it.
|
|
41
37
|
|
|
42
38
|
Task:
|
|
43
39
|
{full $ARGUMENTS + relevant conversation context}
|
|
@@ -58,7 +54,9 @@ Wait. Fail → `[thinker]: failed: {err}` stop.
|
|
|
58
54
|
|
|
59
55
|
## Step 2 — persist (parent Write)
|
|
60
56
|
|
|
61
|
-
No grunt spawn. Parent `write`s the thinker final message under `{repo}/.tmp/plans/` (any filename in that dir). `orchestrate-parent.js` runs `scripts/persist-plan.mjs`: serial/slug from `PLAN_NAME:` / heading, inject YAML, rewrite path+content. Deny invalid plans and any write outside `.tmp/plans/`.
|
|
57
|
+
No grunt spawn. Parent `write`s the thinker final message under `{repo}/.tmp/grunt/plans/` (any filename in that dir). Grok `orchestrate-parent.js` runs `scripts/persist-plan.mjs`: serial/slug from `PLAN_NAME:` / heading, inject YAML, rewrite path+content. Deny invalid plans and any write outside `.tmp/grunt/plans/`.
|
|
58
|
+
|
|
59
|
+
Host without that hook: name the file per `.rulesync/reference/plan-format.md` Path, or pipe the body to `node scripts/persist-plan.mjs --workspace {repo}` and use its `path`.
|
|
62
60
|
|
|
63
61
|
Report serial/path from the tool result (`updatedInput.file_path`). Fail/deny → `[write-plan]: failed: {err}` stop.
|
|
64
62
|
|
|
@@ -66,7 +64,7 @@ Report serial/path from the tool result (`updatedInput.file_path`). Fail/deny
|
|
|
66
64
|
|
|
67
65
|
```
|
|
68
66
|
[thinker]: {one-line goal}; {N} leaves
|
|
69
|
-
[write-plan]: serial={int} path=.tmp/plans/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.md
|
|
67
|
+
[write-plan]: serial={int} path=.tmp/grunt/plans/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.md
|
|
70
68
|
next: /implement-plan {int}
|
|
71
69
|
```
|
|
72
70
|
|
|
@@ -77,6 +75,11 @@ Do not dump the plan.
|
|
|
77
75
|
- Omit `model`. `subagent_type` ∈ {grunt, implementer, thinker} only (thinker for draft).
|
|
78
76
|
- First prompt sentence: `You are {agent} subagent.`
|
|
79
77
|
- Child prompt = task + abs paths + verdicts only (no pasted transcripts).
|
|
80
|
-
- Parent coordinates; parent Write under `.tmp/plans/` only; thinker never writes.
|
|
78
|
+
- Parent coordinates; parent Write under `.tmp/grunt/plans/` only; thinker never writes.
|
|
81
79
|
- Not `/design`, not `/execute-plan`, not a design doc.
|
|
82
80
|
- Tool-call first: emit `spawn_subagent` in the same turn as any spawn claim. Past tense after the tool result.
|
|
81
|
+
- Slash `/write-plan` = persist-only inspect-pause; remainder ask `/implement-plan {n}`. Not leftover pick 2.
|
|
82
|
+
- Implement leftover pick 2 (`Implement with file plan`) = this persist then implement-plan one-shot; skip inspect pause; no user slash.
|
|
83
|
+
- Write leftover pick 2 (`Write with file plan`) = this persist inspect-pause; remainder `/implement-plan {n}`; no implementer this turn.
|
|
84
|
+
- effective=auto + Implement-typed: this persist then implement-plan `{n}` (same chain as Implement leftover pick 2); skip leftover wait. Write-typed under auto still this persist inspect-pause leftover wait; never spawn implementer.
|
|
85
|
+
- Always-do leftover match; leftover `2` ≠ Skill-name invoke of this skill. Parent still no Write — this skill sequencing.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!-- Generated by emit-maps.mjs. Do not hand-edit. -->
|
|
2
|
+
|
|
3
|
+
# Law
|
|
4
|
+
|
|
5
|
+
Protocol stays cascade/overview; domain fills this.
|
|
6
|
+
|
|
7
|
+
## Skills naming
|
|
8
|
+
|
|
9
|
+
Reserved (do not reuse in consumer custom skills): `ask` `auto` `browser` `cascade` `commit` `commit-and-push` `commit-push` `commit-push-deploy` `commit-push-release` `explain` `handoff` `implement-plan` `parent` `pickup` `solo` `tmp` `write-plan`.
|
|
10
|
+
|
|
11
|
+
Override: same name → one SSOT path (`.rulesync/skills/<name>/`). Re-init force-refresh overwrites grunt-owned names; consumer extras kept. Maps `origin` badge ≠ content picker.
|
|
12
|
+
|
|
13
|
+
# Skills
|
|
14
|
+
|
|
15
|
+
| name | origin | description | task | commandPath | refs |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| ask | local | Session leftover-gate. /ask sets leftover-gate ask for this session — leftover triple wait on advise-class recaps. Not… | | | |
|
|
18
|
+
| auto | local | Session leftover-gate. /auto sets leftover-gate auto for this session — Implement-typed pick2 chains write-plan persist… | | | |
|
|
19
|
+
| browser | local | Live URL/interact → this; not websearch. /browser or browse a URL. Call node scripts/browser.mjs nav\|snap\|click\|fill\|sh… | | | |
|
|
20
|
+
| cascade | local | Session mode. /cascade exits solo and restores the grunt cascade for this session — spawn, orchestrator, recap, need\|ve… | | | |
|
|
21
|
+
| commit | local | Inspect the diff and commit with a Conventional Commits subject line. Use for /commit, "commit this", "commit these cha… | | | |
|
|
22
|
+
| commit-and-push | local | Alias of commit-push (1-release stub). Use for /commit-and-push, "commit and push", "commit this and push". Must push.… | | | |
|
|
23
|
+
| commit-push | local | Commit with a Conventional Commits subject, then push. Use for /commit-push, "commit and push", "commit this and push".… | | | |
|
|
24
|
+
| commit-push-deploy | local | Commit, push, then deploy only if allowlisted infra already exists. Use for /commit-push-deploy, "commit push deploy",… | | | |
|
|
25
|
+
| commit-push-release | local | Commit, push, bump package.json, tag vX.Y.Z, push the tag. CI publishes. Use for /commit-push-release, "commit push rel… | | | |
|
|
26
|
+
| explain | local | One-off human recap. /explain. First action = spawn grunt\|implementer\|thinker if facts/work; else recap already-visible… | | | |
|
|
27
|
+
| handoff | local | Parent writes a session handoff under .tmp/grunt/handoffs/ and tells the user to continue in a fresh session. Use for /… | | | |
|
|
28
|
+
| implement-plan | local | Implementer executes a local .tmp/grunt/plans checklist: continue, resume, or pick among plans. Empty /implement-plan r… | | | |
|
|
29
|
+
| parent | local | One-turn parent-orchestrator escape. Use for /parent. Not a session mode. | | | |
|
|
30
|
+
| pickup | local | Pick up/continue a session handoff under .tmp/grunt/handoffs/. Use for /pickup, pick up, continue handoff, serial, drag… | | | |
|
|
31
|
+
| solo | local | Session mode. /solo disables the grunt cascade for this session — one normal agent, no spawn, no orchestrator. /cascade… | | | |
|
|
32
|
+
| tmp | local | One-off convo artifact dump under .tmp/grunt/. Use for /tmp, dump a draft, save a note/email/script from this session.… | | | |
|
|
33
|
+
| write-plan | local | Thinker drafts a local implementer-ready checklist plan; parent Write persists .tmp/grunt/plans/{serial}-{slug}-{YYYYMM… | | | |
|
|
34
|
+
|
|
35
|
+
# Refs
|
|
36
|
+
|
|
37
|
+
| path | title | tags | summary |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| .rulesync/reference/browser.md | Browser | browser | Zero-config in-tree session rail. Not MCP. Not env. Not raw Playwright. |
|
|
40
|
+
| .rulesync/reference/cascade.md | Cascade | cascade | Shipped protocol: **parent-only spawn**. Only the parent **orchestrator** session calls `spawn_subagent`. Implementer a… |
|
|
41
|
+
| .rulesync/reference/hooks.md | Hooks | hooks | SessionStart: keep empty (token baseline). Do not inject context. Do not register a SessionStart hook on `../../.grok/h… |
|
|
42
|
+
| .rulesync/reference/law.md | Law | | Protocol stays cascade/overview; domain fills this. |
|
|
43
|
+
| .rulesync/reference/map.md | Map | map | Cheap outline. Not a file dump. |
|
|
44
|
+
| .rulesync/reference/output.md | Output | output | en-US unless asked. every output maximal superterse. Fragments OK. Sacrifice grammar; keep meaning. Parent and child. E… |
|
|
45
|
+
| .rulesync/reference/plan-format.md | Plan format (SSOT) | | Local implementer checklist. Not a design doc, PR stack, or DAG. |
|
|
46
|
+
| .rulesync/reference/rtk.md | RTK | rtk | Shell stdout compression. PreToolUse: Bash → `rtk <cmd>`. Not Read/Grep/Glob/prompts/images. |
|
|
@@ -10,21 +10,24 @@ Shipped protocol: **parent-only spawn**. Only the parent **orchestrator** sessio
|
|
|
10
10
|
|
|
11
11
|
Always-do lives in orchestrator/overview (do not open this file first). Peek/kill/`need:` stay here as reference.
|
|
12
12
|
⚠ / validate / sim → spawn implementer; not stop.
|
|
13
|
-
Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
|
|
14
|
-
|
|
15
|
-
Always spawn + prompt. First token = spawn. Parent Read/Bash deny expected if forgotten. Only `/solo` (
|
|
16
|
-
Create/change product files → grunt facts first; then thinker advise/plan/stop unless small/simple or prompt-is-spec → implementer. Default without detailed spec = grunt check → thinker advise/plan → stop. Advise-first stop wins until
|
|
17
|
-
Advise
|
|
18
|
-
1. Implement
|
|
19
|
-
2.
|
|
20
|
-
|
|
13
|
+
Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only. Browse tags match → prompt must include abs `.rulesync/skills/browser/SKILL.md` and `.rulesync/reference/browser.md`.
|
|
14
|
+
|
|
15
|
+
Always spawn + prompt. First token = spawn. Parent Read/Bash deny expected if forgotten. Only `/solo` (effective spawnMode solo) escapes spawn workflow. `/parent` is last-ditch hook stamp not skill-instructed Read/Bash. No try-then-spawn. No parent probe. No tiny-read/grep/list_dir/bash/grunt-job for the user. No skip-spawn.
|
|
16
|
+
Create/change product files → grunt facts first; then thinker advise/plan/stop unless small/simple or prompt-is-spec → implementer. Default without detailed spec = grunt check → thinker advise/plan → stop. Advise-first stop wins until unlock. Unlock implementer only on: Implement-typed numbered/label pick1 or pick2 or `/implement-plan {n}` or explicit implement (=pick1 iff Implement-typed). Write-typed leftover never spawns implementer. `ok`/`yes`/`y`/`continue` ≠ either pick (`continue` = write-plan file gate only). Thinker recap alone ≠ spec-ready; do not auto-implement. Conversational advise recap = stop.
|
|
17
|
+
Advise leftover: numbered pick each on own line after tagged recap (not same-line); one empty blank line immediately before leftover 1. (leftover last; not adjacent to recap/body). Always-print typed leftover triple (advise-class final recap only) unless effective leftover-gate=auto and Implement-typed (pick2 chains write-plan persist → implement-plan `{n}`; skip leftover wait). Write-typed under auto still leftover wait; never spawn implementer. One verb per recap; never jammed Implement/write. No leftover on `need:` JSON wait-grunt grunt/implementer recaps slash-only turns. Effective leftover-gate: stamp `auto-ask-{sid}` > `.rulesync/grunt.config.jsonc` `leftoverGate` > `ask`. Effective spawn: stamp `spawn-mode-{sid}` body `solo`|`cascade` > one-release `grunt-off` presence as solo > `.rulesync/grunt.config.jsonc` `spawnMode` > `cascade`. Fail-closed cascade. `/auto` `/ask` session leftover-gate, not spawn-escape.
|
|
18
|
+
1. {Implement|Write} with verbal plan
|
|
19
|
+
2. {same verb} with file plan
|
|
20
|
+
3. Tweak
|
|
21
|
+
Type Implement = in-repo product writes. Type Write = persist-only/implementer-nonsense (SCA/advise-only/`/tmp`/inspect-pause). Recap remainder still names the human gate; leftover is not `4. Contact bank`. `/handoff` stays slash not Write pick1. No omit 1/2. No frozen 4. Do not relabel 3. Parent echoes printed leftover. Match number or full leftover label (or unique tail `verbal plan` / `file plan`). Always-do leftover match printed lines; not Skill-name (`2` ≠ write-plan). Implement pick1 = spawn implementer; paste last [thinker] recap as spec (how+why; implementer must not paste why into code comments); no `.tmp/grunt/plans`; no write-plan; no implement-plan. Implement pick2 = persist `.tmp/grunt/plans/{n}` then spawn implementer `plan=/abs/...` one-shot skip pause. Write pick1 = `/tmp` persist recap/body under `.tmp/grunt/`; no implementer. Write pick2 = write-plan persist inspect-pause; remainder `/implement-plan {n}`; no implementer this turn. Parent still no Write — existing write-plan/`/tmp` path/skill sequencing. 3 / Tweak → stay advise; extra text → thinker; bare 3/Tweak = stop wait notes. Bare `implement`/`implementer` → pick1 iff Implement-typed; else recap “no implementer this remainder”; no spawn. Bare `write` → pick1 iff Write-typed; else not a match. Type-mismatch → that recap no spawn. Alias `Implementer with …` → pick1/pick2 iff Implement-typed. `/write-plan` persist-only inspect-pause; remainder ask `/implement-plan {n}`. Not leftover pick 2. `/implement-plan {n}` stays disk/file run; ≠ conversational verbal pick. Disk leftover may invoke without user slash; verbal ≠ implement-plan.
|
|
22
|
+
Owned-defect after grunt: check/see-if = grunt first. Verdict names defect in path we control (in-tree or package we publish) → writes remain → spawn thinker; not fact-stop; not implementer yet unless user already said fix / prompt-is-spec / small. Not ours → fact-stop/workaround OK; no Implement pick1. Unsure ownership → thinker. Control ≠ cwd; human-owned package still Fix {path} from consumer session; can't write → remainder `fix in {checkout path}` + ask switch. Recap `{decided}=Fix {path+bug}`; leftover always-print typed triple (Implement when in-repo writes; 3=tweak); do not relabel 3. Workaround = why rejected-alt never remainder. Grunt no leftover.
|
|
23
|
+
Never parent Write/Edit/Bash/Skill-that-writes. Child returned is not terminal if writes remain after that gate or spawn count is 0 on a pick1/pick2/`/implement-plan {n}`/spec/small file-change turn. plan/spec ready + writes remain → spawn implementer only on Implement-typed pick1/pick2 or `/implement-plan {n}`/spec/small; else recap-stop. plan-only `/write-plan` → recap + remainder `/implement-plan` (ask).
|
|
21
24
|
|
|
22
25
|
Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write.
|
|
23
26
|
1. Tools (facts / search / exec / git / web / test / low-reason mechanical write) → grunt. Facts/search → grunt, never thinker.
|
|
24
|
-
2. Write defined solution (prompt-is-spec or small/simple) → implementer. **Blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+. Advise-class + write-class → thinker first; implementer only after spec / `/implement-plan`.
|
|
25
|
-
3. Think / plan / advise / recommend / how / why / explain (ask-us; not slash `/explain`; not one-cmd/last-log/source-token) → thinker. Facts=grunt/`need:`. **No implementer this turn**. Unsure → thinker. Cheap false+: I think / terraform plan / `/implement-plan` / `/solo` / source tokens / one-cmd / how- last-log / why. Why = judgment not patch not dump; parent cannot invent why.
|
|
26
|
-
Reuse iff ALL: (1) same parent transcript already has finished `[thinker]:` (or the fact recap they’re poking); (2) user turn is advise-class again with no new path/error/snippet/name/“what about/also/now/but/instead”; (3) no implementer or grunt after that answer; no unresolved `need:`; (4) not “more/deeper/details/walk through/wrong”. Any tick fail / new session / `/pickup` / `/handoff` / compaction ate the body → spawn. Echo last `[thinker]:` recap one-line (don’t paraphrase).
|
|
27
|
-
4.
|
|
27
|
+
2. Write defined solution (prompt-is-spec or small/simple) → implementer. **Blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+. Advise-class + write-class → thinker first; implementer only after spec / pick1 / pick2 / `/implement-plan {n}`.
|
|
28
|
+
3. Think / plan / advise / recommend / how / why / explain (ask-us; not slash `/explain`; not one-cmd/last-log/source-token) → thinker. Facts=grunt/`need:`. **No implementer this turn**. Unsure → thinker. Cheap false+: I think / terraform plan / `/implement-plan` / `/solo` / source tokens / one-cmd / how- last-log / why. Why = judgment not patch not dump; parent cannot invent why; **parent cannot drop why**. Thinker recap without why = incomplete (leftover 3 / re-spawn; not silent; not invent). One re-spawn max then recap-as-is + flag.
|
|
29
|
+
Reuse iff ALL: (1) same parent transcript already has finished `[thinker]:` (or the fact recap they’re poking); (2) user turn is advise-class again with no new path/error/snippet/name/“what about/also/now/but/instead”; (3) no implementer or grunt after that answer; no unresolved `need:`; (4) not “more/deeper/details/walk through/wrong”. Any tick fail / new session / `/pickup` / `/handoff` / compaction ate the body → spawn. Echo last `[thinker]:` recap one-line (don’t paraphrase; no-strip why; no compress-to-verdict). Reuse echo: reprint last thinker’s leftover triple. Type-mismatch / bare implement on Write-typed → recap “no implementer this remainder”; ≠ spawn. Prose → `/explain` on visible child. Always-why recap ≠ `/explain`. Not grunt for parrot. Tag `[orchestrator]:` on no-spawn — don’t fake `[thinker]:`. Pitfalls: deeper→thinker; code moved invalidates; `need:` open; compaction.
|
|
30
|
+
4. Snippet / cite / "what is X" / world fact → grunt `job: web`. URL-in-a-cite ≠ browse. URL / browse / click / fill / snap / live DOM → grunt; child prompt must include abs `.rulesync/skills/browser/SKILL.md` and `.rulesync/reference/browser.md`; Read then `node scripts/browser.mjs`; Lightpanda default; never websearch that page. Never answer from memory. No `job:browse`.
|
|
28
31
|
|
|
29
32
|
Spawn only `grunt` | `implementer` | `thinker`. Omit `model`. Isolation `none` unless asked.
|
|
30
33
|
|
|
@@ -41,10 +44,11 @@ Classify `done` | `alive` | `stuck` vs prior peek: **done** (completed/failed),
|
|
|
41
44
|
Loop until done. No auto-kill. Kill only if the user asks and the host has a kill tool.
|
|
42
45
|
Final recap uses [output.md](output.md) natural buckets (completed / in-flight / remainder / blocker; omit empty). Do not redo the child's work. Exceptions: in-flight wait = `[orchestrator]: wait grunt` only; `need:` stop = JSON only; max 3 `resume_from` → blocker recap + gathered verdicts (ask).
|
|
43
46
|
|
|
44
|
-
Parent Stop (`MAX_STOP=3`): do not waive fenced/impl finals for `tools-used` stamp. Parent `end_turn` is tagged recap (advise leftover numbered pick on own lines after) or `[orchestrator]: wait grunt`. First non-empty line must match legal `[orchestrator|grunt|implementer|thinker|handoff]:`. Advise leftover numbered pick may follow the tagged recap. Siblings still run → role tag + one-line echo. In-flight wait recap is `[orchestrator]: wait grunt` only. Mid-turn stays exactly `[orchestrator]: wait grunt`. Or consume `parent-escape-{sid}` once. Else block. No `isCheap` / trivia / long definitions.
|
|
47
|
+
Parent Stop (`MAX_STOP=3`): do not waive fenced/impl finals for `tools-used` stamp. Parent `end_turn` is tagged recap (advise leftover numbered pick on own lines after one empty blank line) or `[orchestrator]: wait grunt`. First non-empty line must match legal `[orchestrator|grunt|implementer|thinker|handoff|tmp]:`. Advise leftover numbered pick may follow the tagged recap after one empty blank line (echo printed leftover; format only; hook does not map leftover numbers → skills; no leftover-label parser). Siblings still run → role tag + one-line echo. In-flight wait recap is `[orchestrator]: wait grunt` only. Mid-turn stays exactly `[orchestrator]: wait grunt`. Or consume `parent-escape-{sid}` once. Else block. No `isCheap` / trivia / long definitions.
|
|
45
48
|
`/handoff` is the other in-parent turn: context large + work unfinished → parent writes one `.tmp/grunt/handoffs/` file from its own transcript (no child sees the session), recaps `[handoff]: serial=… path=…`, tells the user to continue in a new session. No spawn, one write, not a mode.
|
|
49
|
+
`/tmp` is in-parent dump: parent writes one `.tmp/grunt/` root artifact from this session, recaps `[tmp]: serial=… path=…`. No spawn, one write, not a handoff, not a plan, no pickup.
|
|
46
50
|
`/pickup` is spawn-first pickup, not in-parent write; parent never Read. Inverse of `/handoff`.
|
|
47
|
-
`/solo`
|
|
51
|
+
`/solo` `/cascade` are session mode (not one-turn): `beforeSubmitPrompt` write-or-unlink `.tmp/grunt/orchestrator-logs/spawn-mode-{sid}` vs config (`solo`|`cascade`); slash==config unlinks; slash≠config writes body token; **always** unlink `grunt-off` (new+legacy). Effective stamp>one-release `grunt-off`>config>`cascade`. Fail-closed cascade. Unreadable/bad stamp body ignored. Every gate short-circuits while effective solo. Antigravity: skill-only, no stamp create (see hooks.md). `/auto` `/ask` session leftover-gate (not spawn-escape): stamp `.tmp/grunt/orchestrator-logs/auto-ask-{sid}` body `auto`|`ask` when slash ≠ config; slash==config unlinks. Effective stamp>config>ask. auto+Implement-typed pick2 chain skip leftover wait; Write-typed leftover wait. `/parent` is last-ditch hook stamp (not a mode, not skill-instructed Read/Bash): UserPromptSubmit writes `.tmp/grunt/orchestrator-logs/parent-escape-{sid}`; Stop consumes+unlinks once. Next Stop resumes spawn/recap rules. `/explain` is human recap after children; never parent Read; not a mode; not spawn-escape. Skills point here; do not paste this file. Never parent-Read protocol files.
|
|
48
52
|
|
|
49
53
|
Host mapping (in-tree only; do not invent peek/kill APIs). GAP rows: no fake peeks, no auto-kill.
|
|
50
54
|
|
|
@@ -86,6 +90,6 @@ Fail: first 3 error lines. ≤8 lines. No dumps, recap, HTML, JSON, full logs.
|
|
|
86
90
|
|
|
87
91
|
Implementer/thinker: fat dumps via `need:` JSON. Implementer shell via rtk; cat/rg/curl/tests without rtk → fat `need:`.
|
|
88
92
|
|
|
89
|
-
Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
|
|
93
|
+
Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only. Browse tags match → prompt must include abs `.rulesync/skills/browser/SKILL.md` and `.rulesync/reference/browser.md`.
|
|
90
94
|
|
|
91
95
|
Grok PostToolUse is observe-only. SessionStart stays empty (token baseline). See [hooks](hooks.md).
|
|
@@ -10,15 +10,17 @@ Grok PostToolUse / UserPromptSubmit / SessionStart are observe-only — do not a
|
|
|
10
10
|
|
|
11
11
|
Claude / Codex / Antigravity PreToolUse still run `../../scripts/scrub-spawn-prompt.mjs` and `../../scripts/gate-fat-tools.mjs`. Grok does not — spawn/fat rewrite is `../../.grok/hooks/orchestrate-parent.js` only. RTK stays `../../.grok/hooks/rtk.json`.
|
|
12
12
|
|
|
13
|
-
Parent Read|Write|Edit|Bash|Skill deny unless `/solo` (session) or `/parent` last-ditch stamp. Grok PreToolUse has no matcher (Read included). Skills spawn-first; do not instruct parent Read/Bash. `.tmp/plans
|
|
13
|
+
Parent Read|Write|Edit|Bash|Skill deny unless `/solo` (session) or `/parent` last-ditch stamp. Grok PreToolUse has no matcher (Read included). Skills spawn-first; do not instruct parent Read/Bash. `.tmp/grunt/plans/`, `.tmp/grunt/handoffs/`, and `.tmp/grunt/` root-file Write still persist. Parent Bash still allowed for workspace `../../scripts/grunt-job.mjs` `--job search|exec`. Children with a type skip parent-deny (fat-only). Skill allowlist without escape: `parent|explain|solo|cascade|auto|ask|handoff|tmp|pickup|write-plan|implement-plan`. Deny reason: `First action=spawn implementer|grunt|thinker. Deny expected. Only /solo this session escapes.`. Parent `end_turn` is tagged recap (advise leftover numbered pick on own lines after) or `[orchestrator]: wait grunt`. Mid-turn stays exactly `[orchestrator]: wait grunt`. Leftover-required under ask waived iff effective leftover-gate=auto.
|
|
14
14
|
|
|
15
15
|
Parent `run_terminal_command` is deny-by-default except `node` (optional leading `rtk`) invoking `{workspace}/scripts/grunt-job.mjs` with `--job search|exec` and `--query`. Optional `--path` `--glob` (repeatable) `--cwd`. Not `web|test`, not other scripts. META strips `--query` value first so `|` inside query is allowed; pipes/`&&` outside query still deny. Never `cd &&`. Exec shell-meta in query is grunt-job FALLBACK (exit 2), not a parent-bash allow. Unknown flags → FALLBACK.
|
|
16
16
|
|
|
17
|
-
SubagentStop (and child Stop with `subagentType`) intercepts a parseable `need:` whose jobs are all `search|exec` (cap 4): runs grunt-job in-hook and continues the child with concatenated `verdict:` blobs. Mixed/web/test, parse fail, FALLBACK, `stopHookActive`, or more than 3 intercepts per child session → empty stdout (allow stop; parent LLM path). Parent `write` is deny-by-default except `.tmp/plans/` (`../../scripts/persist-plan.mjs`)
|
|
17
|
+
SubagentStop (and child Stop with `subagentType`) intercepts a parseable `need:` whose jobs are all `search|exec` (cap 4): runs grunt-job in-hook and continues the child with concatenated `verdict:` blobs. Mixed/web/test, parse fail, FALLBACK, `stopHookActive`, or more than 3 intercepts per child session → empty stdout (allow stop; parent LLM path). Parent `write` is deny-by-default except `.tmp/grunt/plans/` (`../../scripts/persist-plan.mjs`), `.tmp/grunt/handoffs/` (`../../scripts/persist-handoff.mjs`), and `.tmp/grunt/` root files (`../../scripts/persist-tmp.mjs`); all validate + rewrite path/content, invalid body denies. Parent Stop (`MAX_STOP=3`): do not waive impl finals for `tools-used`. Parent `end_turn` is tagged recap (advise leftover numbered pick on own lines after) or `[orchestrator]: wait grunt`. Mid-turn stays exactly `[orchestrator]: wait grunt`. First non-empty line must match legal `[orchestrator|grunt|implementer|thinker|handoff|tmp]:`. Ask leftover-required: `[orchestrator]:` needs leftover triple (not exact wait-grunt); `[thinker]:` with >1 nonempty line needs it; `[grunt]|[implementer]|[handoff]|[tmp]:` do not. Missing triple → existing `STOP_REASONS` block. Waived iff effective leftover-gate=auto. Claude Agent launch ≠ done; in-flight host Stop → wait recap `[orchestrator]: wait grunt` only; no SendMessage. Or consume `parent-escape-{sid}` once (`/parent` last-ditch, not “use parent tools”). No `isCheap` / trivia. Stamps: `tools-used` / `stop-block` / `need-intercept` / `parent-escape` / `auto-ask` / `spawn-mode`. Skills point to cascade; do not paste protocol here.
|
|
18
18
|
|
|
19
|
-
`/solo`
|
|
19
|
+
`/solo` `/cascade` write-or-unlink `spawn-mode-{sid}` vs config (`beforeSubmitPrompt`, exact-match only). Slash==config unlinks; slash≠config writes body `solo`|`cascade`. **Always** unlink `grunt-off` (new+legacy). Sid-less: no stamp. Effective: valid stamp body `solo`|`cascade` > one-release `grunt-off` presence as solo > config `spawnMode` > `cascade`. Fail-closed cascade. Unreadable/bad stamp body ignored (dual-read `grunt-off` else config). While effective solo: PreToolUse allows parent tools (fat gate still runs) and skips the `defaultGrunt` spawn rewrite; Stop returns 0 **before** the `parent-escape` consume, so solo never burns the one-turn stamp. Session-scoped. Antigravity: skill-only, no stamp create.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
`/auto` `/ask` write `auto-ask-{sid}` body `auto`|`ask` when slash ≠ config leftoverGate; slash==config unlinks (`beforeSubmitPrompt`, exact-match only). Sid-less: no stamp. Effective: stamp > config > ask. Leftover-required waived iff effective=auto. Not spawn-escape. Antigravity: skill-only, no stamp create (same solo degrade).
|
|
22
|
+
|
|
23
|
+
rulesync canonical event is `beforeSubmitPrompt` (→ Claude/Codex `UserPromptSubmit`), not `userPromptSubmit` — an unknown key makes Zod reject the whole `.rulesync/hooks.jsonc`, emitting nothing while `--check` still reports up to date. Antigravity supports neither `beforeSubmitPrompt` nor `subagentStop`; `/solo` `/auto` `/ask` degrade there to the skill body alone.
|
|
22
24
|
|
|
23
25
|
Stop and SubagentStop timeout is 30s (grunt-job cap is 20s). PreToolUse / PostToolUse / UserPromptSubmit stay at 5s. If the intercept times out, the hook fail-opens and the child stops without verdicts.
|
|
24
26
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Law
|
|
2
|
+
|
|
3
|
+
Protocol stays cascade/overview; domain fills this.
|
|
4
|
+
|
|
5
|
+
## Skills naming
|
|
6
|
+
|
|
7
|
+
Reserved (do not reuse in consumer custom skills): `ask` `auto` `browser` `cascade` `commit` `commit-and-push` `commit-push` `commit-push-deploy` `commit-push-release` `explain` `handoff` `implement-plan` `parent` `pickup` `solo` `tmp` `write-plan`.
|
|
8
|
+
|
|
9
|
+
Override: same name → one SSOT path (`.rulesync/skills/<name>/`). Re-init force-refresh overwrites grunt-owned names; consumer extras kept. Maps `origin` badge ≠ content picker.
|