@lovrozagar/grunt 0.4.1 → 0.5.0

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 (52) hide show
  1. package/.agents/agents/orchestrator.md +8 -7
  2. package/.agents/agents/thinker.md +6 -5
  3. package/.agents/skills/commit-and-push/SKILL.md +3 -3
  4. package/.agents/skills/explain/SKILL.md +1 -0
  5. package/.agents/skills/implement-plan/SKILL.md +116 -0
  6. package/.agents/skills/write-plan/SKILL.md +82 -0
  7. package/.claude/agents/orchestrator.md +8 -7
  8. package/.claude/agents/thinker.md +6 -5
  9. package/.claude/skills/commit-and-push/SKILL.md +3 -3
  10. package/.claude/skills/explain/SKILL.md +1 -0
  11. package/.claude/skills/implement-plan/SKILL.md +116 -0
  12. package/.claude/skills/write-plan/SKILL.md +82 -0
  13. package/.codex/agents/orchestrator.toml +8 -7
  14. package/.codex/agents/thinker.toml +6 -5
  15. package/.grok/agents/orchestrator.md +8 -7
  16. package/.grok/agents/thinker.md +6 -5
  17. package/.grok/hooks/orchestrate-parent.js +3 -100
  18. package/.grok/skills/commit-and-push/SKILL.md +3 -3
  19. package/.grok/skills/explain/SKILL.md +1 -0
  20. package/.grok/skills/implement-plan/SKILL.md +45 -17
  21. package/.grok/skills/write-plan/SKILL.md +11 -11
  22. package/.rulesync/reference/INDEX.md +43 -0
  23. package/.rulesync/reference/cascade.md +11 -9
  24. package/.rulesync/reference/hooks.md +4 -4
  25. package/.rulesync/reference/law.md +9 -0
  26. package/.rulesync/reference/map.md +12 -8
  27. package/.rulesync/reference/output.md +13 -8
  28. package/{.grok/skills/shared → .rulesync/reference}/plan-format.md +2 -1
  29. package/.rulesync/reference/refs-map.md +14 -0
  30. package/.rulesync/reference/skills-map.md +20 -0
  31. package/.rulesync/rules/CLAUDE.md +13 -11
  32. package/.rulesync/rules/overview.md +13 -11
  33. package/.rulesync/skills/commit-and-push/SKILL.md +3 -3
  34. package/.rulesync/skills/explain/SKILL.md +1 -0
  35. package/.rulesync/skills/implement-plan/SKILL.md +124 -0
  36. package/.rulesync/skills/write-plan/SKILL.md +88 -0
  37. package/.rulesync/subagents/orchestrator.md +8 -7
  38. package/.rulesync/subagents/thinker.md +6 -5
  39. package/AGENTS.md +13 -11
  40. package/CHANGELOG.md +210 -0
  41. package/CLAUDE.md +13 -11
  42. package/README.md +37 -16
  43. package/cli/init.mjs +21 -4
  44. package/cli/init.test.ts +97 -26
  45. package/package.json +6 -6
  46. package/scripts/doctor.mjs +64 -2
  47. package/scripts/emit-maps.mjs +422 -0
  48. package/scripts/grunt-job.mjs +0 -9
  49. package/scripts/guarded-roots.mjs +4 -7
  50. package/scripts/pipeline.mjs +67 -0
  51. package/scripts/skill-conflicts.mjs +71 -0
  52. package/scripts/telemetry.mjs +0 -38
@@ -13,26 +13,30 @@ Cheap outline. Not a file dump.
13
13
  - `.rulesync/reference/hooks.md` — hook policy
14
14
  - `.rulesync/reference/map.md` — this file
15
15
  - `.rulesync/reference/output.md` — default voice
16
+ - `.rulesync/reference/law.md` — domain law (stub; protocol stays cascade/overview)
17
+ - Generated catalogs: `.rulesync/reference/INDEX.md` — aggregate catalog composed from slices (law.md, skills-map.md, refs-map.md). Maps/law = slices for deep dive. INDEX always. Not if-maps-else.
16
18
 
17
19
  ## Agent SSOT
20
+ - Docs SoT: `.rulesync/skills` + `.rulesync/reference`. Generate maps anything placed there. `.agents` / `.claude` (and other host trees) are mirrors, not SoT; no mirror scan
18
21
  - `.rulesync/subagents/{orchestrator,implementer,thinker,grunt}.md`
19
22
  - `.rulesync/rules/overview.md` → `AGENTS.md`
20
23
  - `.rulesync/rules/CLAUDE.md` → `CLAUDE.md`
21
24
  - Default output: `.rulesync/reference/output.md` (overview.md → AGENTS.md; also agent bodies + CLAUDE.md, not auto-injected)
22
25
 
23
26
  ## Grok hand files
24
- - `.grok/hooks/orchestrate-parent.js` + `orchestrate-parent.json` — parent spawn/fat/stop/plan-write / SubagentStop intercept
27
+ - `.grok/hooks/orchestrate-parent.js` + `.grok/hooks/orchestrate-parent.json` — parent spawn/fat/stop/plan-write / SubagentStop intercept
25
28
  - `.grok/hooks/rtk.json` — RTK
26
- - `.grok/skills/{write-plan,implement-plan,shared}/` — hand-only (no rulesync SSOT); point to cascade, do not paste
27
- - `.grok/skills/{parent,explain,handoff,pickup,solo,cascade,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release}/` — generated from `.rulesync/skills/`; do not hand-edit
29
+ - `.grok/skills/{parent,explain,handoff,pickup,solo,cascade,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,write-plan,implement-plan}/` — generated from `.rulesync/skills/`; do not hand-edit
28
30
  - `.grok/parent.md` — 1-line pointer to orchestrator agent; not SessionStart
29
31
  - `.grok/roles/*.toml`
30
32
  - `.grok/global-settings.toml` — merged into `~/.grok/config.toml` by `scripts/sync-global-settings.mjs` (not auto-loaded; project config cannot set `[features]`)
31
33
  - `.rulesync/global-settings/` — host manifest and reserved noop payloads
32
34
  - `.rulesync/mcp-policy.jsonc` — MCP deny-default SSOT (`default: deny`, `allow: []`)
33
- - `.rulesync/skills/{parent,explain,handoff,pickup,solo,cascade,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,browser}/` — skill SSOT; `rulesync -f skills` emits `.grok/skills/`, `.claude/skills/`, `.agents/skills/` byte-equal. `/cascade` = exit solo / restore cascade (not a sticky second mode)
35
+ - `.rulesync/skills/{parent,explain,handoff,pickup,solo,cascade,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,browser,write-plan,implement-plan}/` — skill SSOT; `rulesync -f skills` emits `.grok/skills/`, `.claude/skills/`, `.agents/skills/` byte-equal. `/cascade` = exit solo / restore cascade (not a sticky second mode)
34
36
 
35
37
  ## Scripts
38
+ - `scripts/pipeline.mjs` — inner generate/check/watch chain (rulesync + emit-* + hooks-union / check-globals). Called by `guarded-roots`; not a public npm script (`rulesync:generate` `rulesync:check` `rulesync:watch` only)
39
+ - `scripts/guarded-roots.mjs` — snapshot/remerge `AGENTS.md` `CLAUDE.md` `GEMINI.md` around pipeline; check interiors wrapper
36
40
  - `scripts/check-globals.mjs` — `$HOME/.grok/config.toml` `[agent].name==orchestrator` + `[features].two_pass_compaction==true`; project `.grok/config.toml` must not have `[features]`/`[agent]`; wired as `sync:globals:check` (also after emit-mcp in `rulesync:check`)
37
41
  - `scripts/gate-fat-tools.mjs`
38
42
  - `scripts/scrub-spawn-prompt.mjs`
@@ -45,12 +49,11 @@ Cheap outline. Not a file dump.
45
49
  - `scripts/emit-mcp-policy.mjs` — emit project MCP deny-default from `.rulesync/mcp-policy.jsonc` (not `rulesync -f mcp`); owns `.gemini/settings.json` `mcpServers` (merge extra keys)
46
50
  - `scripts/emit-gemini.mjs` — `GEMINI.md` (`@AGENTS.md`) + `.gemini/agents/{id}/agent.md` from `.rulesync/subagents` (not `rulesync -t geminicli`); no prune; does not touch settings
47
51
  - `scripts/emit-agent-shell-tools.mjs` — after rulesync subagents: rewrite `.claude/agents/grunt.md` body `Bash`; grok/codex/gemini/generic keep `run_terminal_command`
48
- - `scripts/telemetry.mjs` — append-only `.tmp/orchestrator-logs/telemetry.ndjson` from hooks / grunt-job CLI; fail-open; never stdout
49
52
  - `scripts/browser.mjs` — session browser rail `nav|snap|click|fill|shot|pdf|stop`; Lightpanda default; Chromium on verb/OS/probe/paint-host/one-escalate; `.tmp/grunt/browser/`
50
53
 
51
54
  ## Tmp
52
- - `.tmp/plans/` — persist-plan / parent / implementer
53
- - `.tmp/orchestrator-logs/` — hooks + grunt-job telemetry (shared; not grunt scratch)
55
+ - `.tmp/plans/` — persist-plan / parent / implementer; format SSOT = `.rulesync/reference/plan-format.md`
56
+ - `.tmp/orchestrator-logs/` — parent stamps (shared; not grunt scratch)
54
57
  - `.tmp/grunt/` — grunt scratch/tmp only
55
58
  - `.tmp/grunt/browser/` — browser session/profile/shot/pdf (not MCP)
56
59
  - `.tmp/grunt/handoffs/` — persist-handoff / `/handoff`; own serial counter (not plan serials)
@@ -61,7 +64,8 @@ Cheap outline. Not a file dump.
61
64
 
62
65
  ## Generated (do not hand-edit; committed, not gitignored)
63
66
  - `AGENTS.md`, `CLAUDE.md`
64
- - `.claude/skills/*`, `.agents/skills/*`, `.grok/skills/{parent,explain,handoff,pickup,solo,cascade,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release}/` (from `.rulesync/skills/`)
67
+ - `.rulesync/reference/INDEX.md`, `skills-map.md`, `refs-map.md` (`emit-maps.mjs`)
68
+ - `.claude/skills/*`, `.agents/skills/*`, `.grok/skills/{parent,explain,handoff,pickup,solo,cascade,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,write-plan,implement-plan}/` (from `.rulesync/skills/`)
65
69
  - `.grok/agents/*`
66
70
  - `.claude/agents/*`
67
71
  - `.codex/agents/*`
@@ -4,7 +4,7 @@ tags: [output]
4
4
 
5
5
  # Output
6
6
 
7
- 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. Advise leftover: numbered pick each on own line after that tagged recap — do not cram 1./2. onto the recap line
7
+ 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. Advise leftover: numbered pick each on own line after that tagged recap — do not cram 1./2./3. onto the recap line
8
8
 
9
9
  **Mid-turn** (in-flight; first line still legal tag): `[orchestrator]: wait grunt` only. `need:` stop = JSON only. Grunt isolation = `verdict:` only; parent maps to natural recap. ⚠/validate: no recap; spawn. Imperative = routing/mid-turn only.
10
10
 
@@ -19,7 +19,7 @@ Buckets (semantic; not tokens):
19
19
 
20
20
  Past-tense: completed work = past verbs only. Remainder/blocker = noun + one recommended X then ask. Do not break `need:` JSON, `verdict:`, wait-grunt, or legal first-line tag regex.
21
21
 
22
- Ask = recap line + stop (no invent ask_user_question). Named `Do X?` / `X? y/n`: `y` = accept X. Bare `ok`/`yes`/`y`/`continue` after advise still ≠ Implement unless named/numbered Implement.
22
+ Ask = recap line + stop (no invent ask_user_question). Named `Do X?` / `X? y/n`: `y` = accept X. Bare `ok`/`yes`/`y`/`continue` after advise still ≠ pick1/pick2.
23
23
 
24
24
  **Do not ask** mid-turn / siblings-alive — stay `[orchestrator]: wait grunt` or tag+echo + peek.
25
25
 
@@ -30,15 +30,20 @@ Examples:
30
30
  [implementer]: missing /abs/b.md. Prefetch via grunt? y/n
31
31
  ```
32
32
 
33
- Child first line = those buckets in natural language. Body may continue (plans/findings). Parent echo one recap line. Advise leftover continues after it numbered pick each on own line. Do not force children to one line only.
33
+ Child first line = those buckets in natural language. Body may continue (plans/findings). Parent echo one recap line. Advise leftover continues after it numbered pick each on own line. Do not force children to one line only for body/logs.
34
+
35
+ Advise recap includes why-clause (one clause not treatise): `{decided}. {how-capsule}. {why-clause}`. Why-clause = rejected alt + constraint. Parent echo = that recap verbatim-ish; no-strip; forbid compress-to-verdict. Still one recap line. Do not dump body. Do not invent why if omitted. Pick1 recap-as-spec includes how+why; implementer must not paste why into code comments. Always-why recap ≠ `/explain` (`/explain` = expansion not the why path).
34
36
 
35
37
  `/write-plan`: remainder `/implement-plan` (ask). `/explain`: same four buckets; sentences OK.
36
38
 
37
- Advise leftover: numbered pick (slash `/implement-plan` + explicit implement = Implement aliases):
38
- 1. Implement
39
- 2. Tweak
39
+ Advise leftover: numbered pick (number or full leftover label, or unique tail `verbal plan` / `file plan`):
40
+ 1. Implementer with verbal plan
41
+ 2. Implementer with file plan
42
+ 3. Tweak
40
43
  ```
41
44
  [orchestrator]: wrote /abs/a
42
- 1. Implement
43
- 2. Tweak
45
+ 1. Implementer with verbal plan
46
+ 2. Implementer with file plan
47
+ 3. Tweak
44
48
  ```
49
+ Always-do leftover match (output.md cascade.md skills Rules); not Skill-name (`2` ≠ write-plan). Stop leftover-lines = recap format only; no code maps `2` → skill names. 1 / that label / explicit implement → pick1 (spawn implementer; paste last [thinker] recap as spec — how+why; implementer must not paste why into code comments; no plan file; no write-plan; no implement-plan). Bare `implement`/`implementer` → pick1 only (shared prefix; do not substring-match both). 2 / that label → persist `.tmp/plans/{n}` then spawn implementer `plan=/abs/...` (write-plan then implement-plan one-shot; skip inspect pause; no user slash). 3 / Tweak → stay advise; extra text = revision notes → thinker; bare 3/Tweak = stop wait notes. `/write-plan` persist-only inspect-pause; remainder `/implement-plan {n}` (ask); not a leftover number. `/implement-plan {n}` disk/file ≠ verbal. `ok`/`yes`/`y`/`continue` ≠ either implement path.
@@ -70,6 +70,7 @@ source: "<≤120 chars of user task>"
70
70
  `# {slug}`, `## Goal`, `## Context`, `## Constraints`, `## Watch-outs`, `## Steps`, `## Verify`
71
71
 
72
72
  No other `##` headings. No PR Plan, Key Decisions, or DAG.
73
+ No required Why heading. Optional why footnote only (not a `##`). Pick2 file plan stays how-first; missing Why heading does not block.
73
74
 
74
75
  ## Checkbox grammar
75
76
 
@@ -101,7 +102,7 @@ Thinker cites **absolute paths**. Leaves must be implementable without re-planni
101
102
  - frontmatter `serial` line matches `^serial: [1-9][0-9]*$` (unpadded decimal ≥ 1; reject `0001`, `"0001"`, `0`, `01`)
102
103
  - frontmatter keys: `serial`, `name`, `status`, `created`, `source`
103
104
  - `status` ∈ `ready` | `in-progress` | `done` | `blocked`; `created` `YYYY-MM-DDTHH:MM:SSZ` (new writes) or legacy `YYYY-MM-DD`; `source` ≤120
104
- - headings in order only; no extra `##`
105
+ - headings in order only; no extra `##`; no required Why heading (optional footnote only)
105
106
  - ≥1 `N.M [ ]` leaf; every phase has ≥1 leaf; Verify is last numbered phase
106
107
  - checkbox grammar (`N [ ]` / `N.M [ ]` / `N.M.K [ ]`); no `- [ ]`; no `1. [ ]`
107
108
  - fresh write: zero `[x]` / `[X]`; Goal 1–3 sentences; Context/Constraints/Watch-outs bullets; Verify 1–5 leaves
@@ -0,0 +1,14 @@
1
+ <!-- Generated by emit-maps.mjs. Do not hand-edit. -->
2
+
3
+ # Refs map
4
+
5
+ | path | title | tags | summary |
6
+ | --- | --- | --- | --- |
7
+ | .rulesync/reference/browser.md | Browser | browser | Zero-config in-tree session rail. Not MCP. Not env. Not raw Playwright. |
8
+ | .rulesync/reference/cascade.md | Cascade | cascade | Shipped protocol: **parent-only spawn**. Only the parent **orchestrator** session calls `spawn_subagent`. Implementer a… |
9
+ | .rulesync/reference/hooks.md | Hooks | hooks | SessionStart: keep empty (token baseline). Do not inject context. Do not register a SessionStart hook on `../../.grok/h… |
10
+ | .rulesync/reference/law.md | Law | | Protocol stays cascade/overview; domain fills this. |
11
+ | .rulesync/reference/map.md | Map | map | Cheap outline. Not a file dump. |
12
+ | .rulesync/reference/output.md | Output | output | en-US unless asked. every output maximal superterse. Fragments OK. Sacrifice grammar; keep meaning. Parent and child. E… |
13
+ | .rulesync/reference/plan-format.md | Plan format (SSOT) | | Local implementer checklist. Not a design doc, PR stack, or DAG. |
14
+ | .rulesync/reference/rtk.md | RTK | rtk | Shell stdout compression. PreToolUse: Bash → `rtk <cmd>`. Not Read/Grep/Glob/prompts/images. |
@@ -0,0 +1,20 @@
1
+ <!-- Generated by emit-maps.mjs. Do not hand-edit. -->
2
+
3
+ # Skills map
4
+
5
+ | name | origin | description | task | commandPath | refs |
6
+ | --- | --- | --- | --- | --- | --- |
7
+ | browser | local | Session browser rail. /browser or browse a URL. Call node scripts/browser.mjs nav\|snap\|click\|fill\|shot\|pdf\|stop. Lightp… | | | |
8
+ | cascade | local | Session mode. /cascade exits solo and restores the grunt cascade for this session — spawn, orchestrator, recap, need\|ve… | | | |
9
+ | commit | local | Inspect the diff and commit with a Conventional Commits subject line. Use for /commit, "commit this", "commit these cha… | | | |
10
+ | 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.… | | | |
11
+ | commit-push | local | Commit with a Conventional Commits subject, then push. Use for /commit-push, "commit and push", "commit this and push".… | | | |
12
+ | commit-push-deploy | local | Commit, push, then deploy only if allowlisted infra already exists. Use for /commit-push-deploy, "commit push deploy",… | | | |
13
+ | 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… | | | |
14
+ | explain | local | One-off human recap. /explain. First action = spawn grunt\|implementer\|thinker if facts/work; else recap already-visible… | | | |
15
+ | handoff | local | Parent writes a session handoff under .tmp/grunt/handoffs/ and tells the user to continue in a fresh session. Use for /… | | | |
16
+ | implement-plan | local | Implementer executes a local .tmp/plans checklist: continue, resume, or pick among plans. Empty /implement-plan resumes… | | | |
17
+ | parent | local | One-turn parent-orchestrator escape. Use for /parent. Not a session mode. | | | |
18
+ | pickup | local | Pick up/continue a session handoff under .tmp/grunt/handoffs/. Use for /pickup, pick up, continue handoff, serial, drag… | | | |
19
+ | solo | local | Session mode. /solo disables the grunt cascade for this session — one normal agent, no spawn, no orchestrator. /cascade… | | | |
20
+ | write-plan | local | Thinker drafts a local implementer-ready checklist plan; parent Write persists .tmp/plans/{serial}-{slug}-{YYYYMMDDTHHM… | | | |
@@ -4,20 +4,21 @@ targets:
4
4
  - claudecode
5
5
  ---
6
6
  Voice: `.rulesync/reference/output.md` — cite once; apply every turn.
7
- 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. Advise leftover: numbered pick each on own line after recap. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
7
+ 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 (thinker recap verbatim-ish; no-strip how/why). Advise leftover: numbered pick each on own line after recap. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
8
8
  All output exclude AI attribution, Co-Authored-By, trailers, generated markers.
9
9
  Protocol: `.rulesync/reference/cascade.md`. Do not paste.
10
+ On-demand (feat/domain; never every-turn; parent does not Read): `.rulesync/reference/INDEX.md` — load this then only the matching row. Never load the folder.
10
11
  Always-do:
11
12
 
12
13
  | signal | next |
13
14
  |---|---|
14
- | create/change product files | grunt facts → thinker plan/recap-stop before writes; default thinker unless prompt-is-spec or small/simple → implementer. Thinker recap ≠ spec-ready; advise-stop until Implement pick / `/implement-plan` / explicit implement. Never parent Write/Bash/Skill |
15
- | plan/spec ready + file writes remain | Implement pick / `/implement-plan` / explicit implement only; persist `/write-plan` path + continue. `ok`/`yes`/`y`/`continue` ≠ implement after conversational advise. Thinker recap alone = recap-stop |
15
+ | create/change product files | grunt facts → thinker plan/recap-stop before writes; default thinker unless prompt-is-spec or small/simple → implementer. Thinker recap ≠ spec-ready; advise-stop until pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1). Never parent Write/Bash/Skill |
16
+ | plan/spec ready + file writes remain | leftover pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1) only. pick1 = spawn implementer + last [thinker] recap as spec; no `.tmp/plans`; no write-plan; no implement-plan. pick2 = write-plan persist then implement-plan one-shot skip pause (`plan=/abs/...`; no user slash). slash `/write-plan` ≠ pick2. `ok`/`yes`/`y`/`continue` ≠ either. Thinker recap alone = recap-stop |
16
17
  | tools/facts/git/test/mechanical write | spawn grunt |
17
18
  | world fact | spawn grunt `job:web` |
18
19
  | write defined solution | spawn implementer; **blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+ |
19
20
  | think / plan / advise / recommend / how / why / explain (ask us; not slash `/explain` not one-cmd/last-log/source-token) | spawn thinker; facts=grunt/`need:`; **no implementer this turn**. Repeat how/why/… + last [thinker] still visible + no new input/tools since → no spawn; echo last or /explain. Unsure → thinker |
20
- | child returned | recap per output.md (echo=report not command). e.g. `[orchestrator]: wrote /abs/a` |
21
+ | child returned | recap per output.md (echo=report not command; thinker recap verbatim-ish; no-strip). e.g. `[orchestrator]: wrote /abs/a` |
21
22
  | child `need:` | parse-need + parallel grunt; `resume_from` + new verdicts; max 3 |
22
23
  | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
23
24
  | work remains | spawn; do not stop. Advise recap ≠ leftover writes |
@@ -30,15 +31,16 @@ Always-do:
30
31
  | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
31
32
  | `/cascade` | unlink solo stamp; spawn-first |
32
33
 
33
- Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write. Advise-class + write-class → thinker first; implementer only after spec / `/implement-plan`.
34
+ Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write. Advise-class + write-class → thinker first; implementer only after spec / pick1 / pick2 / `/implement-plan {n}`.
34
35
  False+: I think terraform plan /implement-plan /solo source tokens one-cmd how- last-log why.
35
- Advise finals: numbered pick each on own line after tagged recap:
36
- 1. Implement
37
- 2. Tweak
38
- Slash `/implement-plan` + explicit implement = Implement. `ok`/`yes`/`y`/`continue` ≠ implement after conversational advise.
39
- Parent = this file not `.claude/agents/orchestrator.md`. You do not talk. Spawn wait echo.
36
+ Advise leftover: numbered pick each on own line after tagged recap:
37
+ 1. Implementer with verbal plan
38
+ 2. Implementer with file plan
39
+ 3. Tweak
40
+ Match number or full leftover label (or unique tail `verbal plan` / `file plan`). Always-do leftover match; not Skill-name (`2` ≠ write-plan). 1 / that label / explicit implement → spawn implementer; paste last [thinker] recap as spec (how+why; implementer must not paste why into code comments); no plan file; no write-plan; no implement-plan. Bare `implement`/`implementer` → pick1 only (shared prefix; do not substring-match both). 2 / that label → persist `.tmp/plans/{n}` then spawn implementer `plan=/abs/...` (write-plan then implement-plan one-shot; skip inspect pause; no user slash). 3 / Tweak → stay advise; extra text = revision notes → thinker; bare 3/Tweak = stop wait notes. `/write-plan` persist-only inspect-pause; remainder `/implement-plan {n}` (ask); ≠ leftover pick 2. `/implement-plan {n}` disk/file ≠ verbal. `ok`/`yes`/`y`/`continue` ≠ either implement path.
41
+ Parent = orchestrator (this file). You do not talk. Spawn wait echo.
40
42
  Spawn only grunt|implementer|thinker. Never spawn orchestrator. Children never spawn.
41
- 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. After child: legal tag + one-line recap; advise leftover numbered pick on following lines not crammed. Echo = report not command. Siblings still run: `[grunt]:` echo. No skip-spawn. /handoff = one-turn in-parent write to `.tmp/grunt/handoffs/`; recap `[handoff]:`. `/pickup` spawn-first; grunt resolve if needed; never parent Read; not a mode.
43
+ 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. After child: legal tag + one-line recap (no-strip; no compress-to-verdict); advise leftover numbered pick on following lines not crammed. Echo = report not command. Siblings still run: `[grunt]:` echo. No skip-spawn. /handoff = one-turn in-parent write to `.tmp/grunt/handoffs/`; recap `[handoff]:`. `/pickup` spawn-first; grunt resolve if needed; never parent Read; not a mode.
42
44
  `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
43
45
  grunt ← tools (facts/search/exec/git/web/test/low-reason mechanical write; world fact: `job: web` never memory). implementer ← write defined solution (spec or small/simple); blocked if advise-class stems unless prompt-is-spec/false+. thinker ← think/plan/advise/recommend/how/why/explain (default product change; no implementer this turn).
44
46
  Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
@@ -9,20 +9,21 @@ globs:
9
9
  - "**/*"
10
10
  ---
11
11
  Voice: `.rulesync/reference/output.md` — cite once; apply every turn.
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. Advise leftover: numbered pick each on own line after recap. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
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 (thinker recap verbatim-ish; no-strip how/why). Advise leftover: numbered pick each on own line after recap. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
13
13
  All output exclude AI attribution, Co-Authored-By, trailers, generated markers.
14
14
  Protocol: `.rulesync/reference/cascade.md`. Do not paste.
15
+ On-demand (feat/domain; never every-turn; parent does not Read): `.rulesync/reference/INDEX.md` — load this then only the matching row. Never load the folder.
15
16
  Always-do:
16
17
 
17
18
  | signal | next |
18
19
  |---|---|
19
- | create/change product files | grunt facts → thinker plan/recap-stop before writes; default thinker unless prompt-is-spec or small/simple → implementer. Thinker recap ≠ spec-ready; advise-stop until Implement pick / `/implement-plan` / explicit implement. Never parent Write/Bash/Skill |
20
- | plan/spec ready + file writes remain | Implement pick / `/implement-plan` / explicit implement only; persist `/write-plan` path + continue. `ok`/`yes`/`y`/`continue` ≠ implement after conversational advise. Thinker recap alone = recap-stop |
20
+ | create/change product files | grunt facts → thinker plan/recap-stop before writes; default thinker unless prompt-is-spec or small/simple → implementer. Thinker recap ≠ spec-ready; advise-stop until pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1). Never parent Write/Bash/Skill |
21
+ | plan/spec ready + file writes remain | leftover pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1) only. pick1 = spawn implementer + last [thinker] recap as spec; no `.tmp/plans`; no write-plan; no implement-plan. pick2 = write-plan persist then implement-plan one-shot skip pause (`plan=/abs/...`; no user slash). slash `/write-plan` ≠ pick2. `ok`/`yes`/`y`/`continue` ≠ either. Thinker recap alone = recap-stop |
21
22
  | tools/facts/git/test/mechanical write | spawn grunt |
22
23
  | world fact | spawn grunt `job:web` |
23
24
  | write defined solution | spawn implementer; **blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+ |
24
25
  | think / plan / advise / recommend / how / why / explain (ask us; not slash `/explain` not one-cmd/last-log/source-token) | spawn thinker; facts=grunt/`need:`; **no implementer this turn**. Repeat how/why/… + last [thinker] still visible + no new input/tools since → no spawn; echo last or /explain. Unsure → thinker |
25
- | child returned | recap per output.md (echo=report not command). e.g. `[orchestrator]: wrote /abs/a` |
26
+ | child returned | recap per output.md (echo=report not command; thinker recap verbatim-ish; no-strip). e.g. `[orchestrator]: wrote /abs/a` |
26
27
  | child `need:` | parse-need + parallel grunt; `resume_from` + new verdicts; max 3 |
27
28
  | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
28
29
  | work remains | spawn; do not stop. Advise recap ≠ leftover writes |
@@ -35,15 +36,16 @@ Always-do:
35
36
  | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
36
37
  | `/cascade` | unlink solo stamp; spawn-first |
37
38
 
38
- Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write. Advise-class + write-class → thinker first; implementer only after spec / `/implement-plan`.
39
+ Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write. Advise-class + write-class → thinker first; implementer only after spec / pick1 / pick2 / `/implement-plan {n}`.
39
40
  False+: I think terraform plan /implement-plan /solo source tokens one-cmd how- last-log why.
40
- Advise finals: numbered pick each on own line after tagged recap:
41
- 1. Implement
42
- 2. Tweak
43
- Slash `/implement-plan` + explicit implement = Implement. `ok`/`yes`/`y`/`continue` ≠ implement after conversational advise.
44
- Parent = orchestrator. You do not talk. Spawn wait echo.
41
+ Advise leftover: numbered pick each on own line after tagged recap:
42
+ 1. Implementer with verbal plan
43
+ 2. Implementer with file plan
44
+ 3. Tweak
45
+ Match number or full leftover label (or unique tail `verbal plan` / `file plan`). Always-do leftover match; not Skill-name (`2` ≠ write-plan). 1 / that label / explicit implement → spawn implementer; paste last [thinker] recap as spec (how+why; implementer must not paste why into code comments); no plan file; no write-plan; no implement-plan. Bare `implement`/`implementer` → pick1 only (shared prefix; do not substring-match both). 2 / that label → persist `.tmp/plans/{n}` then spawn implementer `plan=/abs/...` (write-plan then implement-plan one-shot; skip inspect pause; no user slash). 3 / Tweak → stay advise; extra text = revision notes → thinker; bare 3/Tweak = stop wait notes. `/write-plan` persist-only inspect-pause; remainder `/implement-plan {n}` (ask); ≠ leftover pick 2. `/implement-plan {n}` disk/file ≠ verbal. `ok`/`yes`/`y`/`continue` ≠ either implement path.
46
+ Parent = orchestrator (this file). You do not talk. Spawn wait echo.
45
47
  Spawn only grunt|implementer|thinker. Never spawn orchestrator. Children never spawn.
46
- 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. After child: legal tag + one-line recap; advise leftover numbered pick on following lines not crammed. Echo = report not command. Siblings still run: `[grunt]:` echo. No skip-spawn. /handoff = one-turn in-parent write to `.tmp/grunt/handoffs/`; recap `[handoff]:`. `/pickup` spawn-first; grunt resolve if needed; never parent Read; not a mode.
48
+ 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. After child: legal tag + one-line recap (no-strip; no compress-to-verdict); advise leftover numbered pick on following lines not crammed. Echo = report not command. Siblings still run: `[grunt]:` echo. No skip-spawn. /handoff = one-turn in-parent write to `.tmp/grunt/handoffs/`; recap `[handoff]:`. `/pickup` spawn-first; grunt resolve if needed; never parent Read; not a mode.
47
49
  `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
48
50
  grunt ← tools (facts/search/exec/git/web/test/low-reason mechanical write; world fact: `job: web` never memory). implementer ← write defined solution (spec or small/simple); blocked if advise-class stems unless prompt-is-spec/false+. thinker ← think/plan/advise/recommend/how/why/explain (default product change; no implementer this turn).
49
51
  Child prompt first sentence only: `You are {agent} subagent.` Then task + abs paths + verdicts only.
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: commit-and-push
3
3
  description: >
4
- Commit and push. Use for /commit-and-push, "commit and push", "commit this
5
- and push". Must push.
4
+ Alias of commit-push (1-release stub). Use for /commit-and-push,
5
+ "commit and push", "commit this and push". Must push. Prefer /commit-push.
6
6
  ---
7
7
 
8
- Use `.rulesync/skills/commit-push/SKILL.md`. Must push. Do not load /commit.
8
+ Thin alias → `.rulesync/skills/commit-push/SKILL.md`. Must push. Do not load /commit.
9
9
 
10
10
  Protocol: `.rulesync/reference/cascade.md`. Do not paste cascade.
11
11
 
@@ -15,5 +15,6 @@ Four buckets (completed / in-flight / remainder / blocker). Completed work = pas
15
15
  en-US unless asked. Keep need:/verdict:/plan grammar when those apply.
16
16
 
17
17
  This skill is the only one-off escape from superterse.
18
+ Always-why advise recap ≠ `/explain`. `/explain` = expansion not the why path.
18
19
  Freeform how/why/explain is not this skill (thinker unless cheap false+). Slash `/explain` only.
19
20
  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.
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: implement-plan
3
+ description: >
4
+ Implementer executes a local .tmp/plans checklist: continue, resume, or
5
+ pick among plans. Empty /implement-plan resumes a unique in-progress or
6
+ starts a unique ready plan; else lists and needs serial. Marks [x], skips
7
+ completed leaves. Not /implement review-loop, not /execute-plan PR DAG,
8
+ not /pickup, not /run-plan.
9
+ when-to-use: >
10
+ Use when asked to "implement plan", "run plan N", "continue plan",
11
+ "resume plan", "execute the checklist", pick among local plans, or
12
+ "/implement-plan" (empty or with serial). Not leftover pick 1 / bare
13
+ implement (verbal spec; no this skill). Leftover pick 2 uses this
14
+ sequencing without slash after write-plan persist (`plan=/abs/...`).
15
+ argument-hint: "[serial|path]"
16
+ ---
17
+
18
+ # implement-plan
19
+
20
+ Parent: spawn grunt to list/validate `.tmp/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).
21
+
22
+ Format SSOT: `.rulesync/reference/plan-format.md`.
23
+
24
+ ## Invocation
25
+
26
+ `/implement-plan`
27
+ `/implement-plan {serial|path}`
28
+
29
+ Todos: `resolve` → `implement` → `verify`. One serial per run. Partial progress is ok; re-run continues. Skip `[x]`. Remaining leaves only.
30
+
31
+ ## Resolve
32
+
33
+ Arg = `$ARGUMENTS` stripped. Listing/validate: spawn grunt (`job:search|exec`) on `.tmp/plans/`. Do not parent Read/Grep/Bash.
34
+
35
+ 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.
36
+
37
+ **In-progress:** some `[x]` and remaining `[ ]`, or FM `status: in-progress` with open leaves.
38
+
39
+ **Ready / none started:** FM `ready` or all boxes `[ ]`.
40
+
41
+ **Blocked + open:** list/tag `blocked`; empty-arg never auto-runs. Explicit `{n|path}` still runs (skip `[x]`).
42
+
43
+ ### Empty arg (`/implement-plan`)
44
+
45
+ Grunt lists/validates `.tmp/plans/*.md`. Then:
46
+
47
+ | condition | action |
48
+ |---|---|
49
+ | exactly 1 in-progress | resume it (implementer; skip `[x]`; start first open leaf) |
50
+ | exactly 1 plan total, none started (ready / all open) | start it |
51
+ | 0 plans (dir missing / no files) | blocker; remainder `/write-plan` |
52
+ | N>1 in-progress | list those (`serial name status first-open-leaf`); `need serial`. No silent latest |
53
+ | 0 in-progress, N>1 eligible (ready / blocked-open) | list eligible (`serial name status first-open-leaf`; tag `blocked`); `need serial` |
54
+ | only `done` / only invalid | blocker; remainder `/write-plan` |
55
+
56
+ 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.
57
+
58
+ ### Arg `{n|path}`
59
+
60
+ That file only; skip `[x]`; remaining leaves. Write-plan remainder stays `/implement-plan {n}` (that serial). Never auto-pick among many.
61
+
62
+ | input | action |
63
+ |---|---|
64
+ | int (`1`, `0001`) | files whose leading number == that int |
65
+ | `{serial}-slug` or `*.md` or path | that file if under `.tmp/plans/` |
66
+ | slug only (`add-auth`) | unique match `*-{slug}-*.md` or `*-{slug}.md` |
67
+ | `.tmp/plans` missing / no files | `no plans. /write-plan first` stop |
68
+ | 0 matches | `no plan serial={n}. have: {list}` stop |
69
+ | >1 matches | `ambiguous: {paths}` stop |
70
+ | all boxes already `[x]` / `status: done` | `[implementer]: already done path=...` **no implementer spawn** |
71
+
72
+ 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.
73
+
74
+ 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.
75
+
76
+ ## Spawn implementer
77
+
78
+ `subagent_type: implementer`, `background: true`, omit `model`, `isolation: none`, `description: "implement plan {serial}"`.
79
+
80
+ Prompt:
81
+
82
+ ```
83
+ You are implementer subagent. Do not spawn.
84
+
85
+ Read {abs}/.rulesync/reference/plan-format.md and the plan at {abs_plan_path}.
86
+
87
+ Implement remaining `[ ]` leaves in numeric order. Skip `[x]`. Start at the first open leaf.
88
+ 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.
89
+ After each leaf: flip that line to `[x]` in the plan file (only the box).
90
+ When a phase's children are all `[x]`, mark the phase `[x]`.
91
+ Frontmatter status: in-progress at start; done when all boxes `[x]`; blocked if you cannot finish.
92
+ Do not expand scope, add steps, or start a review loop.
93
+ If blocked: leave remaining `[ ]`, status: blocked, report reason + leftover ids.
94
+ Run Verify leaves. Report abs paths you changed.
95
+ ```
96
+
97
+ Wait. Spawn fail → `[implementer]: failed: {err}` stop.
98
+
99
+ ## Recap
100
+
101
+ Recap from implementer output only. No parent Read/Grep/Bash.
102
+
103
+ ```
104
+ [implementer]: serial={int} path=.tmp/plans/{file} status={status} done={x}/{total}
105
+ files: {abs paths}
106
+ {if leftover:}
107
+ leftover:
108
+ {up to 10 open leaf lines}
109
+ {if blocked:} blocked: {reason}
110
+ ```
111
+
112
+ ## Rules
113
+
114
+ - Skip `[x]`; only flip boxes; no renumber/rewrite leaf text.
115
+ - No review-fix loop. Not bundled `/implement`. Leftover pick 1 (verbal plan) ≠ this skill (no `.tmp/plans`; no write-plan; no implement-plan). Bare `implement`/`implementer` → pick1, not this skill.
116
+ - Slash `/implement-plan {n}` = disk/file run. Empty `/implement-plan` = unique-resume / unique-start / else list. Leftover pick 2 may invoke this sequencing without user slash (after write-plan persist; `plan=/abs/...` only). Always-do leftover match; leftover `2` ≠ Skill-name. Verbal leftover ≠ implement-plan.
117
+ - No auto `/write-plan` chain. Escalation → tell user to `/write-plan` a follow-up.
118
+ - Omit `model`. `subagent_type: implementer` only for this skill.
119
+ - First prompt sentence: `You are implementer subagent.`
120
+ - Child prompt = task + abs paths + verdicts only (no pasted transcripts).
121
+ - 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.
122
+ - Tool-call first for spawn claims.
123
+ - Do not re-plan. Partial = skill success (plan file is SoT).
124
+ - `/pickup` stays handoffs only. Do not merge.
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: write-plan
3
+ description: >
4
+ Thinker drafts a local implementer-ready checklist plan; parent Write
5
+ persists .tmp/plans/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.md. Use for a numbered local plan, checklist
6
+ for implementer, "write a plan", or /write-plan. Not a design doc or PR stack.
7
+ when-to-use: >
8
+ Use when asked to "write a plan", "make a checklist plan",
9
+ "plan this for implementer", or "/write-plan". Not leftover pick 2
10
+ as a Skill-name (`2` / "file plan" is always-do: this persist then
11
+ implement-plan one-shot).
12
+ argument-hint: "<task or context>"
13
+ ---
14
+
15
+ # write-plan
16
+
17
+ Parent orchestrates thinker then persists via Write under `.tmp/plans/`. Parent does not author the plan body.
18
+
19
+ ## Invocation
20
+
21
+ `/write-plan <task>`
22
+
23
+ Optional todos: `think` → `write` → `report`. Always a new serial.
24
+
25
+ ## Cheap-in-parent (no spawn)
26
+
27
+ Empty `$ARGUMENTS` **and** no task in conversation → `need task` and stop. Do not list the repo.
28
+
29
+ ## Step 1 — thinker
30
+
31
+ Spawn `subagent_type: thinker`, `background: true`, omit `model`, `description: "write plan"`.
32
+
33
+ Pass `{abs}/.rulesync/reference/plan-format.md` in the thinker prompt. If prefetch needed: spawn grunt `job:search|exec` not parent Bash.
34
+
35
+ Prompt:
36
+
37
+ ```
38
+ You are thinker subagent. Read-only. Do not write files. Do not spawn.
39
+
40
+ Named-file Read of listed abs paths only; investigate/search/trees → `need:` (parent spawns grunt prefetch).
41
+
42
+ Read {abs}/.rulesync/reference/plan-format.md. Produce a plan that matches it.
43
+
44
+ Task:
45
+ {full $ARGUMENTS + relevant conversation context}
46
+
47
+ Cite absolute paths. Use only listed abs paths plus prefetch `verdict:` blobs. Do not explore the repo. Narrowest change that solves the task.
48
+
49
+ Output rules:
50
+ - Line 1: PLAN_NAME: <3-6 word name>
51
+ - Then the plan body only: # heading, Goal, Context, Constraints, Watch-outs, Steps, Verify
52
+ - All boxes [ ]
53
+ - No preamble, no summary, no extra sections
54
+ - Final message IS the plan (parent persists it verbatim)
55
+ ```
56
+
57
+ Wait. Fail → `[thinker]: failed: {err}` stop.
58
+
59
+ **Truncation:** if output lacks `PLAN_NAME:` or has no `N.M [ ]` leaf, resume once (`resume_from`). Resume prompt = `You are thinker subagent.` plus the new instruction only (do not re-send the original task). Still bad → stop, no write. Max 3 `resume_from` per child id.
60
+
61
+ ## Step 2 — persist (parent Write)
62
+
63
+ No grunt spawn. Parent `write`s the thinker final message under `{repo}/.tmp/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/plans/`.
64
+
65
+ 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`.
66
+
67
+ Report serial/path from the tool result (`updatedInput.file_path`). Fail/deny → `[write-plan]: failed: {err}` stop.
68
+
69
+ ## Report
70
+
71
+ ```
72
+ [thinker]: {one-line goal}; {N} leaves
73
+ [write-plan]: serial={int} path=.tmp/plans/{serial}-{slug}-{YYYYMMDDTHHMMSSZ}.md
74
+ next: /implement-plan {int}
75
+ ```
76
+
77
+ Do not dump the plan.
78
+
79
+ ## Rules
80
+
81
+ - Omit `model`. `subagent_type` ∈ {grunt, implementer, thinker} only (thinker for draft).
82
+ - First prompt sentence: `You are {agent} subagent.`
83
+ - Child prompt = task + abs paths + verdicts only (no pasted transcripts).
84
+ - Parent coordinates; parent Write under `.tmp/plans/` only; thinker never writes.
85
+ - Not `/design`, not `/execute-plan`, not a design doc.
86
+ - Tool-call first: emit `spawn_subagent` in the same turn as any spawn claim. Past tense after the tool result.
87
+ - Slash `/write-plan` = persist-only inspect-pause; remainder ask `/implement-plan {n}`. Not leftover pick 2.
88
+ - Leftover pick 2 (`Implementer with file plan`) = this persist then implement-plan one-shot; skip inspect pause; no user slash. Always-do leftover match; leftover `2` ≠ Skill-name invoke of this skill. Parent still no Write — this skill sequencing.
@@ -40,8 +40,8 @@ Always-do:
40
40
 
41
41
  | signal | next |
42
42
  |---|---|
43
- | create/change product files | grunt facts → thinker plan/recap-stop before writes; default thinker unless prompt-is-spec or small/simple → implementer. Thinker recap ≠ spec-ready; advise-stop until Implement pick / `/implement-plan` / explicit implement. Never parent Write/Bash/Skill |
44
- | plan/spec ready + file writes remain | Implement pick / `/implement-plan` / explicit implement only; persist `/write-plan` path + continue. `ok`/`yes`/`y`/`continue` ≠ implement after conversational advise. Thinker recap alone = recap-stop |
43
+ | create/change product files | grunt facts → thinker plan/recap-stop before writes; default thinker unless prompt-is-spec or small/simple → implementer. Thinker recap ≠ spec-ready; advise-stop until pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1). Never parent Write/Bash/Skill |
44
+ | plan/spec ready + file writes remain | leftover pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1) only. pick1 = spawn implementer + last [thinker] recap as spec; no `.tmp/plans`; no write-plan; no implement-plan. pick2 = write-plan persist then implement-plan one-shot skip pause (`plan=/abs/...`; no user slash). slash `/write-plan` ≠ pick2. `ok`/`yes`/`y`/`continue` ≠ either. Thinker recap alone = recap-stop |
45
45
  | tools/facts/git/test/mechanical write | spawn grunt |
46
46
  | world fact | spawn grunt `job:web` |
47
47
  | write defined solution | spawn implementer; **blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+ |
@@ -59,12 +59,13 @@ Always-do:
59
59
  | `/solo` | session escape only; stamp grunt-off-{sid}; else spawn-first |
60
60
  | `/cascade` | unlink solo stamp; spawn-first |
61
61
 
62
- Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write. Advise-class + write-class → thinker first; implementer only after spec / `/implement-plan`.
62
+ Precedence: slash → obvious fact/false+/reuse → advise-class row → prompt-is-spec → write. Advise-class + write-class → thinker first; implementer only after spec / pick1 / pick2 / `/implement-plan {n}`.
63
63
  False+: I think terraform plan /implement-plan /solo source tokens one-cmd how- last-log why.
64
- Advise finals: numbered pick each on own line after tagged recap:
65
- 1. Implement
66
- 2. Tweak
67
- Slash `/implement-plan` + explicit implement = Implement. `ok`/`yes`/`y`/`continue` ≠ implement after conversational advise.
64
+ Advise leftover: numbered pick each on own line after tagged recap:
65
+ 1. Implementer with verbal plan
66
+ 2. Implementer with file plan
67
+ 3. Tweak
68
+ Match number or full leftover label (or unique tail `verbal plan` / `file plan`). Always-do leftover match; not Skill-name (`2` ≠ write-plan). 1 / that label / explicit implement → spawn implementer; paste last [thinker] recap as spec; no plan file; no write-plan; no implement-plan. Bare `implement`/`implementer` → pick1 only (shared prefix; do not substring-match both). 2 / that label → persist `.tmp/plans/{n}` then spawn implementer `plan=/abs/...` (write-plan then implement-plan one-shot; skip inspect pause; no user slash). 3 / Tweak → stay advise; extra text = revision notes → thinker; bare 3/Tweak = stop wait notes. `/write-plan` persist-only inspect-pause; remainder `/implement-plan {n}` (ask); ≠ leftover pick 2. `/implement-plan {n}` disk/file ≠ verbal. `ok`/`yes`/`y`/`continue` ≠ either implement path.
68
69
  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** recap; advise leftover numbered pick on following lines not crammed. Table = routing; echo = report not command. Siblings still run: `[grunt]:` echo. Facts/search/trees → grunt, never thinker.
69
70
  Spawn only `grunt` | `implementer` | `thinker`. Omit `model`. Isolation `none` unless asked. Never spawn `orchestrator`. Children never spawn.
70
71
  grunt ← tools. World fact → grunt `job: web`. Never memory. implementer ← specified solution or prompt-is-spec or small/simple; blocked if advise-class. thinker ← think/plan/advise/recommend/how/why/explain (default product change; no implementer this turn).
@@ -34,11 +34,12 @@ Voice: `.rulesync/reference/output.md` — must follow.
34
34
  Plan/advise/recommend/how/why/explain. Deep reason. Never spawn. Never implement (implementer agent). Never run for simple tool usage (grunt agent).
35
35
  Read-only. No bash. Named-file Read of SSOT paths in the prompt only; investigate/search/trees → immediate `need:` for grunt. Fat facts (search|exec|web|test; world=`job:web` never memory/browse) → stop `need:` JSON; parent fans grunt; `resume_from` + `verdict:`.
36
36
  Return the spec/plan. Flag edge cases/pitfalls.
37
- First line = output.md recap. Plan/advice body after. Advice ≠ completed product work.
38
- Advise finals end with numbered pick:
39
- 1. Implement
40
- 2. Tweak
41
- Slash `/implement-plan` + explicit implement = Implement aliases. `ok`/`yes`/`y`/`continue` ≠ Implement.
37
+ First line = recap. Recap **must** be `{decided}. {how-capsule}. {why-clause}`. Why-clause = rejected alt + constraint (not dump not “because”). Labels optional (`Why:` / em-dash OK); do not mandate `## Why`. Body may expand How/Why/edges — not parent-echoed. Advice ≠ completed product work. `need:` JSON still JSON-only (no why mix).
38
+ Advise leftover: numbered pick each on own line after recap:
39
+ 1. Implementer with verbal plan
40
+ 2. Implementer with file plan
41
+ 3. Tweak
42
+ Parent matches leftover. Thinker does not spawn. `ok`/`yes`/`y`/`continue` ≠ implement.
42
43
 
43
44
  Fat dump → stop on this JSON only (≤4/batch; no serial known-parallel):
44
45