@lovrozagar/grunt 0.5.2 → 0.6.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 (153) hide show
  1. package/.agents/agents/grunt.md +2 -24
  2. package/.agents/agents/orchestrator.md +5 -50
  3. package/.agents/skills/ask/SKILL.md +5 -12
  4. package/.agents/skills/auto/SKILL.md +7 -12
  5. package/.agents/skills/browser/SKILL.md +4 -8
  6. package/.agents/skills/clasp/SKILL.md +11 -0
  7. package/.agents/skills/commit/SKILL.md +3 -1
  8. package/.agents/skills/commit-push/SKILL.md +2 -0
  9. package/.agents/skills/commit-push-deploy/SKILL.md +2 -0
  10. package/.agents/skills/commit-push-release/SKILL.md +2 -0
  11. package/.agents/skills/explain/SKILL.md +7 -13
  12. package/.agents/skills/google-workspace/SKILL.md +13 -0
  13. package/.agents/skills/handoff/SKILL.md +7 -11
  14. package/.agents/skills/implement-plan/SKILL.md +5 -109
  15. package/.agents/skills/listen/SKILL.md +15 -0
  16. package/.agents/skills/pickup/SKILL.md +6 -12
  17. package/.agents/skills/speak/SKILL.md +13 -0
  18. package/.agents/skills/tmp/SKILL.md +6 -10
  19. package/.agents/skills/write-plan/SKILL.md +5 -77
  20. package/.claude/agents/grunt.md +2 -26
  21. package/.claude/agents/orchestrator.md +12 -50
  22. package/.claude/skills/ask/SKILL.md +5 -12
  23. package/.claude/skills/auto/SKILL.md +7 -12
  24. package/.claude/skills/browser/SKILL.md +4 -8
  25. package/.claude/skills/clasp/SKILL.md +11 -0
  26. package/.claude/skills/commit/SKILL.md +3 -1
  27. package/.claude/skills/commit-push/SKILL.md +2 -0
  28. package/.claude/skills/commit-push-deploy/SKILL.md +2 -0
  29. package/.claude/skills/commit-push-release/SKILL.md +2 -0
  30. package/.claude/skills/explain/SKILL.md +7 -13
  31. package/.claude/skills/google-workspace/SKILL.md +13 -0
  32. package/.claude/skills/handoff/SKILL.md +7 -11
  33. package/.claude/skills/implement-plan/SKILL.md +5 -109
  34. package/.claude/skills/listen/SKILL.md +15 -0
  35. package/.claude/skills/pickup/SKILL.md +6 -12
  36. package/.claude/skills/speak/SKILL.md +13 -0
  37. package/.claude/skills/tmp/SKILL.md +6 -10
  38. package/.claude/skills/write-plan/SKILL.md +5 -77
  39. package/.codex/agents/grunt.toml +2 -26
  40. package/.codex/agents/orchestrator.toml +4 -50
  41. package/.grok/agents/grunt.md +2 -24
  42. package/.grok/agents/orchestrator.md +4 -48
  43. package/.grok/global-settings.toml +1 -3
  44. package/.grok/hooks/orchestrate-parent.js +190 -358
  45. package/.grok/skills/ask/SKILL.md +5 -12
  46. package/.grok/skills/auto/SKILL.md +7 -12
  47. package/.grok/skills/browser/SKILL.md +4 -8
  48. package/.grok/skills/clasp/SKILL.md +11 -0
  49. package/.grok/skills/commit/SKILL.md +3 -1
  50. package/.grok/skills/commit-push/SKILL.md +2 -0
  51. package/.grok/skills/commit-push-deploy/SKILL.md +2 -0
  52. package/.grok/skills/commit-push-release/SKILL.md +2 -0
  53. package/.grok/skills/explain/SKILL.md +7 -13
  54. package/.grok/skills/google-workspace/SKILL.md +13 -0
  55. package/.grok/skills/handoff/SKILL.md +7 -11
  56. package/.grok/skills/implement-plan/SKILL.md +5 -109
  57. package/.grok/skills/listen/SKILL.md +15 -0
  58. package/.grok/skills/pickup/SKILL.md +6 -12
  59. package/.grok/skills/speak/SKILL.md +13 -0
  60. package/.grok/skills/tmp/SKILL.md +6 -10
  61. package/.grok/skills/write-plan/SKILL.md +5 -77
  62. package/.rulesync/hooks.jsonc +1 -1
  63. package/.rulesync/mcp-policy.jsonc +0 -2
  64. package/.rulesync/reference/INDEX.md +30 -20
  65. package/.rulesync/reference/browser.md +13 -6
  66. package/.rulesync/reference/cascade.md +6 -86
  67. package/.rulesync/reference/clasp.md +21 -0
  68. package/.rulesync/reference/google-workspace.md +79 -0
  69. package/.rulesync/reference/hooks.md +7 -11
  70. package/.rulesync/reference/implementation-format.md +113 -0
  71. package/.rulesync/reference/law.md +5 -3
  72. package/.rulesync/reference/listen.md +80 -0
  73. package/.rulesync/reference/map.md +39 -36
  74. package/.rulesync/reference/output.md +3 -51
  75. package/.rulesync/reference/plan-format.md +4 -2
  76. package/.rulesync/reference/refs-map.md +12 -5
  77. package/.rulesync/reference/rtk.md +3 -2
  78. package/.rulesync/reference/scope.md +37 -0
  79. package/.rulesync/reference/setup.md +27 -0
  80. package/.rulesync/reference/skills-map.md +13 -12
  81. package/.rulesync/reference/speak.md +59 -0
  82. package/.rulesync/rules/CLAUDE.md +3 -49
  83. package/.rulesync/rules/overview.md +9 -47
  84. package/.rulesync/skills/ask/SKILL.md +5 -12
  85. package/.rulesync/skills/auto/SKILL.md +5 -12
  86. package/.rulesync/skills/browser/SKILL.md +4 -8
  87. package/.rulesync/skills/clasp/SKILL.md +9 -0
  88. package/.rulesync/skills/commit/SKILL.md +3 -1
  89. package/.rulesync/skills/commit-push/SKILL.md +2 -0
  90. package/.rulesync/skills/commit-push-deploy/SKILL.md +2 -0
  91. package/.rulesync/skills/commit-push-release/SKILL.md +2 -0
  92. package/.rulesync/skills/explain/SKILL.md +7 -14
  93. package/.rulesync/skills/google-workspace/SKILL.md +11 -0
  94. package/.rulesync/skills/handoff/SKILL.md +7 -11
  95. package/.rulesync/skills/implement-plan/SKILL.md +5 -119
  96. package/.rulesync/skills/listen/SKILL.md +13 -0
  97. package/.rulesync/skills/pickup/SKILL.md +6 -12
  98. package/.rulesync/skills/speak/SKILL.md +13 -0
  99. package/.rulesync/skills/tmp/SKILL.md +6 -10
  100. package/.rulesync/skills/write-plan/SKILL.md +5 -84
  101. package/.rulesync/subagents/grunt.md +2 -24
  102. package/.rulesync/subagents/orchestrator.md +14 -59
  103. package/AGENTS.md +9 -47
  104. package/CHANGELOG.md +56 -0
  105. package/CLAUDE.md +1 -49
  106. package/README.md +88 -80
  107. package/cli/grunt.mjs +18 -2
  108. package/cli/grunt.test.ts +33 -0
  109. package/cli/init.mjs +103 -10
  110. package/cli/init.test.ts +147 -35
  111. package/cli/prompt.mjs +8 -0
  112. package/cli/prompt.test.ts +14 -0
  113. package/package.json +7 -2
  114. package/scripts/browser.mjs +98 -5
  115. package/scripts/doctor.mjs +82 -1
  116. package/scripts/emit-gemini.mjs +1 -1
  117. package/scripts/emit-mcp-policy.mjs +1 -1
  118. package/scripts/gate-fat-tools.mjs +223 -173
  119. package/scripts/google-workspace.mjs +713 -0
  120. package/scripts/grunt-job.mjs +453 -69
  121. package/scripts/listen.mjs +829 -0
  122. package/scripts/parse-need.mjs +21 -2
  123. package/scripts/persist-implementation.mjs +278 -0
  124. package/scripts/scrub-spawn-prompt.mjs +3 -50
  125. package/scripts/setup.mjs +746 -0
  126. package/scripts/speak.mjs +291 -0
  127. package/.agents/agents/implementer.md +0 -32
  128. package/.agents/agents/thinker.md +0 -29
  129. package/.agents/skills/cascade/SKILL.md +0 -28
  130. package/.agents/skills/parent/SKILL.md +0 -6
  131. package/.agents/skills/solo/SKILL.md +0 -25
  132. package/.claude/agents/implementer.md +0 -37
  133. package/.claude/agents/thinker.md +0 -36
  134. package/.claude/skills/cascade/SKILL.md +0 -28
  135. package/.claude/skills/parent/SKILL.md +0 -6
  136. package/.claude/skills/solo/SKILL.md +0 -25
  137. package/.codex/agents/implementer.toml +0 -26
  138. package/.codex/agents/thinker.toml +0 -26
  139. package/.grok/agents/implementer.md +0 -27
  140. package/.grok/agents/thinker.md +0 -27
  141. package/.grok/parent.md +0 -1
  142. package/.grok/roles/implementer.toml +0 -5
  143. package/.grok/roles/thinker.toml +0 -5
  144. package/.grok/skills/cascade/SKILL.md +0 -28
  145. package/.grok/skills/parent/SKILL.md +0 -6
  146. package/.grok/skills/solo/SKILL.md +0 -25
  147. package/.rulesync/grunt.config.jsonc +0 -7
  148. package/.rulesync/skills/cascade/SKILL.md +0 -28
  149. package/.rulesync/skills/parent/SKILL.md +0 -6
  150. package/.rulesync/skills/solo/SKILL.md +0 -25
  151. package/.rulesync/subagents/implementer.md +0 -49
  152. package/.rulesync/subagents/thinker.md +0 -49
  153. package/scripts/grunt-config.mjs +0 -50
@@ -7,79 +7,82 @@ tags: [map]
7
7
  Cheap outline. Not a file dump.
8
8
 
9
9
  ## Protocol
10
- - `.rulesync/reference/cascade.md` — spawn / need / resume
10
+ - `.rulesync/reference/cascade.md` — session agent tools; grunt-job first; spawn grunt when cheaper
11
11
  - `.rulesync/reference/rtk.md` — shell compression
12
- - `.rulesync/reference/browser.md` — Lightpanda-first session CLI (`nav|snap|click|fill|shot|pdf|stop`); not MCP
12
+ - `.rulesync/reference/browser.md` — Lightpanda-first session CLI (`nav|snap|click|fill|scroll|wait|hover|select|shot|pdf|stop`); not MCP
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/scope.md` — size gate; research → suggest → wait → `/write-plan` → `/implement-plan`
16
17
  - `.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.
18
+ - 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
18
19
 
19
20
  ## Agent SSOT
20
21
  - Docs SoT: `.rulesync/skills` + `.rulesync/reference`. Generate maps anything placed there. `.agents` / `.claude` (and other host trees) are mirrors, not SoT; no mirror scan
21
- - `.rulesync/subagents/{orchestrator,implementer,thinker,grunt}.md`
22
+ - `.rulesync/subagents/{orchestrator,grunt}.md`
22
23
  - `.rulesync/rules/overview.md` → `AGENTS.md`
23
24
  - `.rulesync/rules/CLAUDE.md` → `CLAUDE.md`
24
25
  - Default output: `.rulesync/reference/output.md` (overview.md → AGENTS.md; also agent bodies + CLAUDE.md, not auto-injected)
25
26
 
26
27
  ## Grok hand files
27
- - `.grok/hooks/orchestrate-parent.js` + `.grok/hooks/orchestrate-parent.json` — parent spawn/fat/stop/plan-write / SubagentStop intercept
28
+ - `.grok/hooks/orchestrate-parent.js` + `.grok/hooks/orchestrate-parent.json` — spawn/fat/stop/persist / SubagentStop intercept / session receipt
29
+ - Init/upgrade prune (cumulative): retired skills `parent` `solo` `cascade`; agents `implementer` `thinker` (host files + `.grok/roles/{name}.toml` + `.gemini/agents/{name}/`); scripts `telemetry.mjs` `grunt-config.mjs`; `.grok/parent.md`; `.grok/skills/shared`; `.rulesync/grunt.config.jsonc` plus local overlay and example; reserved skill dirs this package no longer ships
28
30
  - `.grok/hooks/rtk.json` — RTK
29
- - `.grok/skills/{parent,explain,handoff,pickup,solo,cascade,auto,ask,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,write-plan,implement-plan}/` — generated from `.rulesync/skills/`; do not hand-edit
30
- - `.grok/parent.md` — 1-line pointer to orchestrator agent; not SessionStart
31
- - `.grok/roles/*.toml`
31
+ - `.grok/skills/` — generated from `.rulesync/skills/`; do not hand-edit
32
32
  - `.grok/global-settings.toml` — merged into `~/.grok/config.toml` by `scripts/sync-global-settings.mjs` (not auto-loaded; project config cannot set `[features]`)
33
33
  - `.rulesync/global-settings/` — host manifest and reserved noop payloads
34
34
  - `.rulesync/mcp-policy.jsonc` — MCP deny-default SSOT (`default: deny`, `allow: []`)
35
- - `.rulesync/grunt.config.jsonc` — leftover-gate + spawnMode SSOT (`version` `1`, `leftoverGate` `ask`|`auto` committed default `ask`, `spawnMode` `solo`|`cascade` committed default `cascade` never `solo`). Effective spawn: stamp `spawn-mode-{sid}` > one-release `grunt-off` > config > `cascade`. Fail-closed cascade. Keys independent.
36
- - `.rulesync/skills/{parent,explain,handoff,pickup,solo,cascade,auto,ask,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). `/auto` `/ask` = session leftover-gate (not spawn-escape)
35
+ - `.rulesync/skills/{ask,auto,browser,clasp,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,explain,google-workspace,handoff,implement-plan,listen,pickup,speak,tmp,write-plan}/` — skill SSOT; `rulesync -f skills` emits host mirrors byte-equal
37
36
 
38
37
  ## Scripts
39
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)
40
39
  - `scripts/guarded-roots.mjs` — snapshot/remerge `AGENTS.md` `CLAUDE.md` `GEMINI.md` around pipeline; check interiors wrapper
41
- - `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`)
40
+ - `scripts/check-globals.mjs` — `$HOME/.grok/config.toml` `[agent].name==orchestrator` + `[features].two_pass_compaction==true`
42
41
  - `scripts/gate-fat-tools.mjs`
43
42
  - `scripts/scrub-spawn-prompt.mjs`
44
43
  - `scripts/grunt-job.mjs` — flags `--job` `--query` `--path` `--glob` (repeatable) `--cwd`; regex in `--query` OK; never `cd &&`; unknown flags / exec shell-meta → FALLBACK
45
44
  - `scripts/parse-need.mjs`
46
- - `scripts/persist-handoff.mjs` — `.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md`; `HANDOFF_NAME:` → slug; H2 `Goal|State|Context|Next|Watch-outs`; `status` `open|resumed|done`
47
- - `scripts/persist-tmp.mjs` — `.tmp/grunt/{serial}-{slug}-{stamp}.{ext}` root files; `TMP_NAME:` / `TMP_EXT:`; own serial; skip reserved dirs
45
+ - `scripts/persist-handoff.mjs` — `.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md`
46
+ - `scripts/persist-tmp.mjs` — `.tmp/grunt/{serial}-{slug}-{stamp}.{ext}` root files
48
47
  - `scripts/persist-plan.mjs`
49
- - `scripts/sync-global-settings.mjs` — dry-run-by-default merge of `.grok/global-settings.toml` into `$HOME/.grok/config.toml`; manifest in `.rulesync/global-settings/`; `skipKeyPattern` skips MCP; never copies project MCP into `$HOME/.grok`
50
- - `scripts/purge-global-mcps.mjs` — dry-run-by-default purge of stubborn global MCP sources (`$HOME/.grok/config.toml` plugins + `disabled_mcp_servers`, `$HOME/.cursor/mcp.json` `MCP_DOCKER`); `--apply` writes; never project MCP
51
- - `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)
52
- - `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
53
- - `scripts/emit-agent-shell-tools.mjs` — after rulesync subagents: rewrite `.claude/agents/grunt.md` body `Bash`; grok/codex/gemini/generic keep `run_terminal_command`
54
- - `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/`
55
- - `scripts/grunt-config.mjs` — `loadLeftoverGate(workspaceRoot)` fail-closed `ask`; `loadSpawnMode(workspaceRoot)` fail-closed `cascade`; keys independent
48
+ - `scripts/persist-implementation.mjs` — `.tmp/grunt/implementations/{serial}-{slug}-{stamp}.md`
49
+ - `scripts/sync-global-settings.mjs`
50
+ - `scripts/purge-global-mcps.mjs`
51
+ - `scripts/emit-mcp-policy.mjs`
52
+ - `scripts/emit-gemini.mjs`
53
+ - `scripts/emit-agent-shell-tools.mjs`
54
+ - `scripts/browser.mjs` — session browser rail
55
+ - `scripts/google-workspace.mjs` — Sheets Docs Slides Calendar Gmail Drive
56
+ - `scripts/speak.mjs` — TTS
57
+ - `scripts/listen.mjs` — STT
58
+ - `scripts/setup.mjs` — handheld speak / listen / google-workspace / browser (`~/.grunt/`)
59
+ - `scripts/doctor.mjs` — unified prereqs; optional google-workspace (`oauth` `tokens` `adc` `clasprc`), speak, clasp, ffmpeg, whisper-cli
56
60
 
57
61
  ## Tmp
58
- - `.tmp/grunt/plans/` — persist-plan / parent / implementer; format SSOT = `.rulesync/reference/plan-format.md`
59
- - `.tmp/grunt/orchestrator-logs/` — parent stamps
60
- - `.tmp/grunt/` — grunt scratch + `/tmp` dumps `{serial}-{slug}-{stamp}.{ext}` at root (not nested `tmp/`)
62
+ - `.tmp/grunt/plans/` — persist-plan; format SSOT = `.rulesync/reference/plan-format.md`
63
+ - `.tmp/grunt/implementations/` — persist-implementation; format SSOT = `.rulesync/reference/implementation-format.md`
64
+ - `.tmp/grunt/orchestrator-logs/` — need-intercept, session-gate, stop-block stamps
65
+ - `.tmp/grunt/` — scratch + `/tmp` dumps `{serial}-{slug}-{stamp}.{ext}` at root (not nested `tmp/`)
61
66
  - `.tmp/grunt/browser/` — browser session/profile/shot/pdf (not MCP)
62
- - `.tmp/grunt/handoffs/` — persist-handoff / `/handoff`; own serial counter (not plan serials)
63
-
64
- ## Stamps (`.tmp/grunt/orchestrator-logs/`)
65
- - `tools-used` / `stop-block` / `need-intercept` / `parent-escape` / `auto-ask` / `spawn-mode` — Stop does not waive impl finals for `tools-used`; `/parent` writes `parent-escape-{sid}` once
66
- - `spawn-mode-{sid}` — spawn session stamp. Body `solo`|`cascade`. Slash==config unlinks. Sid-less: no stamp. Unreadable/bad body ignored (dual-read `grunt-off` else config → cascade). `/solo` `/cascade` always unlink `grunt-off`
67
- - `grunt-off-{sid}` — one-release dual-read as solo when spawn-mode stamp missing or body not exact `solo`|`cascade`. `/solo` `/cascade` always unlink. Requires a real sid (never the `default` fallback). Do not write new `grunt-off`
68
- - `auto-ask-{sid}` — leftover-gate session stamp. Body `auto`|`ask`. Slash==config unlinks. Sid-less: no stamp. Unreadable/bad body ignored (fall through config → ask). Not spawn-escape.
67
+ - `.tmp/grunt/handoffs/` — persist-handoff / `/handoff`
68
+ - `.tmp/grunt/stash/` — grunt-job / snap overflow
69
+ - `.tmp/grunt/sessions/{sid}/` — wrote/read/receipt
70
+ - `.tmp/grunt/speak/` — TTS mp3
71
+ - `.tmp/grunt/listen/` — STT wav + `latest.txt`
69
72
 
70
73
  ## Generated (do not hand-edit; committed, not gitignored)
71
74
  - `AGENTS.md`, `CLAUDE.md`
72
75
  - `.rulesync/reference/INDEX.md`, `skills-map.md`, `refs-map.md` (`emit-maps.mjs`)
73
- - `.claude/skills/*`, `.agents/skills/*`, `.grok/skills/{parent,explain,handoff,pickup,solo,cascade,auto,ask,commit,commit-and-push,commit-push,commit-push-deploy,commit-push-release,write-plan,implement-plan}/` (from `.rulesync/skills/`)
76
+ - `.claude/skills/*`, `.agents/skills/*`, `.grok/skills/*` (from `.rulesync/skills/`)
74
77
  - `.grok/agents/*`
75
78
  - `.claude/agents/*`
76
79
  - `.codex/agents/*`
77
80
  - `.agents/agents/*`
78
81
  - `.grok/config.toml` — project MCP `[[permissions]]` + `[plugins] deny_default`; no `[features]`
79
82
  - `.mcp.json` — `mcpServers` from policy allow only
80
- - `.claude/settings.json` MCP keys (`enableAllProjectMcpServers`, `enabledMcpjsonServers`, `permissions.deny` `mcp__*`); Agent denies/hooks stay
81
- - `.codex/config.toml` `mcp_servers` (absent when allow empty); keep `[agents] max_depth`
82
- - `.agents/mcp_config.json` — `mcpServers` from policy allow only
83
+ - `.claude/settings.json` MCP keys; Agent denies/hooks stay
84
+ - `.codex/config.toml` `mcp_servers` (absent when allow empty)
85
+ - `.agents/mcp_config.json`
83
86
  - `GEMINI.md` — `@AGENTS.md` pointer (`emit-gemini.mjs`)
84
- - `.gemini/agents/{orchestrator,implementer,thinker,grunt}/agent.md` — `name` `description` `model` only (`emit-gemini.mjs`)
85
- - `.gemini/settings.json` — `mcpServers` from policy allow only (`emit-mcp-policy.mjs`; extra keys preserved)
87
+ - `.gemini/agents/{orchestrator,grunt}/agent.md`
88
+ - `.gemini/settings.json` — `mcpServers` from policy allow only
@@ -4,56 +4,8 @@ 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; one empty blank line immediately before leftover 1. (leftover last; not adjacent to recap/body) — do not cram 1./2./3. onto the recap line
7
+ en-US unless asked. Concise complete sentences with natural grammar. Skip filler and fluff.
8
8
 
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.
9
+ Completed work uses past verbs and paths. If more work remains, say what. Ask in English when a choice is real. `/auto` asks on blockers; `/ask` asks after each step.
10
10
 
11
- **Final recap** (children done / child return; omit empty buckets): natural language. No literal `done:` `in_progress:` `left:` `blocked:` tokens. No `|` key join.
12
-
13
- Buckets (semantic; not tokens):
14
-
15
- - completed — work landed; past verbs + abs paths
16
- - in-flight — siblings/peek still live; host state not past
17
- - remainder — more work; noun + one recommended X then ask
18
- - blocker — cannot continue; noun + one recommended X then ask
19
-
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
-
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
-
24
- **Do not ask** mid-turn / siblings-alive — stay `[orchestrator]: wait grunt` or tag+echo + peek.
25
-
26
- Examples:
27
- ```
28
- [orchestrator]: wrote /abs/a.md
29
- [orchestrator]: wrote /abs/a.md. Spawn implementer on /abs/b.md? y/n
30
- [implementer]: missing /abs/b.md. Prefetch via grunt? y/n
31
- ```
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: one empty blank line then 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).
36
-
37
- `/write-plan`: remainder `/implement-plan` (ask). `/explain`: same four buckets; sentences OK.
38
-
39
- Advise leftover: numbered pick (number or full leftover label, or unique tail `verbal plan` / `file plan`). Always-print typed leftover triple (advise-class final recap only) unless effective leftover-gate=auto and Implement-typed (pick2 chain skip leftover wait). Else always-print typed triple on advise-class final recap. Write-typed under auto still leftover wait. One verb per recap; never jammed `Implement/write`. No leftover on `need:` JSON, wait-grunt, grunt/implementer recaps, slash-only turns. Leftover ⊆ remainder kinds.
40
- 1. {Implement|Write} with verbal plan
41
- 2. {same verb} with file plan
42
- 3. Tweak
43
- Type Implement — how-capsule = in-repo product writes (code tests `.rulesync/` CLAUDE/AGENTS skills). Product docs in-tree = Implement. Type Write — persist-only or implementer-nonsense: `.tmp/grunt/plans` inspect-pause `/tmp` artifact advise-only how/why with no product writes do-not-code external-human (SCA/bank/credentials). Recap remainder still names the human gate; leftover is not `4. Contact bank`. `/handoff` stays slash not Write pick1. Print all three every advise-class final recap. No omit 1/2. No frozen 4. Do not relabel 3.
44
- ```
45
- [orchestrator]: wrote /abs/a
46
-
47
- 1. Implement with verbal plan
48
- 2. Implement with file plan
49
- 3. Tweak
50
- ```
51
- ```
52
- [orchestrator]: advise-only how. Remainder persist note.
53
-
54
- 1. Write with verbal plan
55
- 2. Write with file plan
56
- 3. Tweak
57
- ```
58
- Parent echoes printed leftover lines. Reuse echo: reprint last thinker’s leftover triple. Always-do leftover match printed lines (output.md cascade.md skills Rules); not Skill-name (`2` ≠ write-plan). Stop leftover-lines = recap format only; no code maps leftover numbers → skills; no leftover-label parser. `1` / full label / unique tail `verbal plan` → pick1. `2` / full / `file plan` → pick2. `3` / `Tweak` → stay advise; extra text = revision notes → 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 verbal plan` / `Implementer with file plan` → pick1/pick2 iff Implement-typed. 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/...` (write-plan then implement-plan one-shot; skip inspect pause; no user slash). Write pick1 = `/tmp` sequencing: persist recap/body under `.tmp/grunt/`; no implementer. Write pick2 = write-plan sequencing only: thinker draft + persist `.tmp/grunt/plans/{n}`; stop inspect-pause; remainder ask `/implement-plan {n}`; no implementer this turn. `/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 pick.
59
- Owned-defect recap: `Fix {owned path}`. Leftover always-print typed triple (Implement when in-repo writes). Do not relabel 3 to the bug. Workaround in why-clause not remainder.
11
+ Grunt-job stdout is a sentence plus up to 6 dash facts, cap 8 lines, optional `stash=` receipt.
@@ -1,6 +1,6 @@
1
1
  # Plan format (SSOT)
2
2
 
3
- Local implementer checklist. Not a design doc, PR stack, or DAG.
3
+ Local session checklist. Not a design doc, PR stack, or DAG.
4
4
 
5
5
  ## Path
6
6
 
@@ -81,7 +81,7 @@ No required Why heading. Optional why footnote only (not a `##`). Pick2 file pla
81
81
  - Fresh plans: all `[ ]`, never `[x]`
82
82
  - Marking done: only flip the box. No renumber, delete, or rewrite leaf text
83
83
  - Depth 2 default (`N` phase + `N.M` leaf). 3rd level only if a leaf would itself be a mini-plan
84
- - Every phase `N` has ≥1 leaf `N.M`. Implementer **executes leaves**. Roll up: all children `[x]` ⇒ parent `[x]`
84
+ - Every phase `N` has ≥1 leaf `N.M`. The session agent **executes leaves**. Roll up: all children `[x]` ⇒ parent `[x]`
85
85
  - Verify = last numbered phase, same grammar
86
86
  - Done plan: every checkbox `[x]`, `status: done`
87
87
 
@@ -94,6 +94,8 @@ No required Why heading. Optional why footnote only (not a `##`). Pick2 file pla
94
94
  | Steps | bulk of the file; each leaf = one coherent edit or one file-level action |
95
95
  | Verify | 1–5 runnable leaves (cmd or observable) |
96
96
 
97
+ Tests live in Steps (not a new heading). New behavior or a bug: a failing test leaf before the impl leaf. Other behavior change: a test leaf immediately after the impl leaf. Docs, rename-only, config-only, generated: no test leaf. Verify is the end gate (project cmd or named subset), not a substitute for those leaves. Do not re-run the whole suite after every leaf unless it is cheap.
98
+
97
99
  Thinker cites **absolute paths**. Leaves must be implementable without re-planning. Product fork → pick the narrowest default, state it under Constraints, still emit steps.
98
100
 
99
101
  ## Validation checklist
@@ -4,11 +4,18 @@
4
4
 
5
5
  | path | title | tags | summary |
6
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… |
7
+ | .rulesync/reference/browser.md | Browser | browser | Zero-config in-tree session rail. Not MCP. Not env. Not raw Playwright. Lightpanda first; swap to Chromium when blocked. |
8
+ | .rulesync/reference/cascade.md | Protocol | cascade | The session agent has tools. Fat Read/Grep/Bash dumps are rewritten to `scripts/grunt-job.mjs` (squeez + stash). Isolat… |
9
+ | .rulesync/reference/clasp.md | Clasp | clasp | Low-level Apps Script CLI. Optional. Doctor reports it. |
10
+ | .rulesync/reference/google-workspace.md | google-workspace | google-workspace | Create and edit Google Sheets, Docs, Slides, Calendar events, and Gmail from the session. |
9
11
  | .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. |
12
+ | .rulesync/reference/implementation-format.md | Implementation format (SSOT) | | Local session journal for `/implement-plan`. Not a plan, handoff, or git commit. |
13
+ | .rulesync/reference/law.md | Law | | Protocol stays overview; domain fills this. |
14
+ | .rulesync/reference/listen.md | Listen | listen | Speech-to-text from the session. Input only. Not TTS. Not a live voice agent. Not MCP. |
11
15
  | .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. |
16
+ | .rulesync/reference/output.md | Output | output | en-US unless asked. Concise complete sentences with natural grammar. Skip filler and fluff. |
17
+ | .rulesync/reference/plan-format.md | Plan format (SSOT) | | Local session checklist. Not a design doc, PR stack, or DAG. |
14
18
  | .rulesync/reference/rtk.md | RTK | rtk | Shell stdout compression. PreToolUse: Bash → `rtk <cmd>`. Not Read/Grep/Glob/prompts/images. |
19
+ | .rulesync/reference/scope.md | Scope | scope | Default: do the work. Escalate only when it is not a straight shot. This file is the size-gate SSOT. |
20
+ | .rulesync/reference/setup.md | Setup | setup | Handheld machine setup for optional integrations. Any OS. Secrets stay in `~/.grunt/` (Windows `%USERPROFILE%\.grunt`).… |
21
+ | .rulesync/reference/speak.md | Speak | speak | Text-to-speech from the session. Output only. Not STT. Not a mic. Not MCP. Speech-to-text is `/listen`: `.rulesync/refe… |
@@ -6,17 +6,18 @@ tags: [rtk]
6
6
 
7
7
  Shell stdout compression. PreToolUse: Bash → `rtk <cmd>`. Not Read/Grep/Glob/prompts/images.
8
8
 
9
- Grok PostToolUse is observe-only — do not attempt output scrub; compress via RTK / spawn / isolation verdict only.
9
+ Grok PostToolUse is observe-only — do not attempt output scrub; compress via RTK / spawn / isolation facts only.
10
10
 
11
11
  ## Commands
12
12
 
13
- ls · tree · read · smart · git · gh · glab · aws · psql · pnpm · err · test · json · deps · env · find · diff · log · dotnet · docker · kubectl · oc · summary · grep · rg · init · wget · wc · gain · cc-economics · config · jest · vitest · prisma · tsc · next · lint · prettier · format · playwright · lightpanda · cargo · npm · npx · curl · discover · session · telemetry · learn · run · proxy · pipe · trust · untrust · verify · ruff · pytest · mypy · rake · rubocop · rspec · pip · go · gt · golangci-lint · gradlew · mvn · hook-audit · rewrite · hook · help
13
+ ls · tree · read · smart · git · gh · glab · clasp · aws · psql · pnpm · err · test · json · deps · env · find · diff · log · dotnet · docker · kubectl · oc · summary · grep · rg · init · wget · wc · gain · cc-economics · config · jest · vitest · prisma · tsc · next · lint · prettier · format · playwright · lightpanda · cargo · npm · npx · curl · discover · session · telemetry · learn · run · proxy · pipe · trust · untrust · verify · ruff · pytest · mypy · rake · rubocop · rspec · pip · go · gt · golangci-lint · gradlew · mvn · hook-audit · rewrite · hook · help
14
14
 
15
15
  **git:** diff · log · status · show · add · commit · push · pull · branch · fetch · stash (list show pop apply drop push) · worktree
16
16
  **cargo:** build · test · clippy · check · install · nextest
17
17
  **go:** test · build · vet
18
18
  **docker:** ps · images · logs · compose (ps logs build)
19
19
  **gh:** pr · issue · run · repo
20
+ **clasp:** login · logout · create · clone · pull · push · status · open · run · deploy · logs · setting
20
21
 
21
22
  Flags: `-v`/`-vv`/`-vvv` · `--ultra-compact` · `--skip-env` · `-h` · `-V`
22
23
 
@@ -0,0 +1,37 @@
1
+ ---
2
+ tags: [scope]
3
+ ---
4
+
5
+ # Scope
6
+
7
+ Default: do the work. Escalate only when it is not a straight shot. This file is the size-gate SSOT.
8
+
9
+ ## Gate
10
+
11
+ Straight shot: one obvious path, the user named the edit, or a follow-up on work already agreed. Do it. Do not run this file as a ritual.
12
+
13
+ Not a straight shot: ambiguous goal, two or more valid approaches, cross-cutting, or hard to undo — or the user asked to plan.
14
+
15
+ Skip the loop: questions, lookups, one-file named edits, "just do it", commits.
16
+
17
+ `/ask` is not this loop. `/ask` pauses after each execution step. This loop pauses until the approach is agreed. `/auto` already treats a real choice as a blocker; "which approach?" is that blocker.
18
+
19
+ ## Research
20
+
21
+ Read and search until you can pick an approach. Enough to choose, not a literature review. Fat notes go under `.tmp/grunt/` (`/tmp` if they must persist). Do not add `## Research` to a plan.
22
+
23
+ ## Suggest
24
+
25
+ 5–10 lines: approach, why, rejected alternative, one open question. Not a fake plan. Do not `/write-plan` in the same turn.
26
+
27
+ ## Wait
28
+
29
+ Stop. One real question. Feedback → research if needed → suggest again. Repeat until the approach is agreed.
30
+
31
+ ## Plan
32
+
33
+ After agreement only: `/write-plan`. Format: `.rulesync/reference/plan-format.md`. Distill facts into Context, Constraints, Watch-outs. Leaves are the work. Report serial. Stop unless the user said plan and do it.
34
+
35
+ ## Implement
36
+
37
+ `/implement-plan` in a separate turn, or the same turn only if the user said plan and do it. Skip `[x]`. Write-allowlist = paths listed in the plan. Do not skip test leaves. Journal: `.rulesync/reference/implementation-format.md` under `.tmp/grunt/implementations/` (create on start; not for straight shots). Straight-shot behavior change: run the nearest existing test if the repo has one. Bugfix: repro first. Do not scaffold a test file on a straight shot unless it is a bug.
@@ -0,0 +1,27 @@
1
+ ---
2
+ tags: [setup]
3
+ ---
4
+
5
+ # Setup
6
+
7
+ Handheld machine setup for optional integrations. Any OS. Secrets stay in `~/.grunt/` (Windows `%USERPROFILE%\.grunt`). Not git. Env still wins over the file.
8
+
9
+ ```
10
+ npm exec grunt setup
11
+ node scripts/setup.mjs
12
+ node scripts/setup.mjs speak
13
+ node scripts/setup.mjs listen
14
+ node scripts/setup.mjs google-workspace
15
+ node scripts/setup.mjs browser
16
+ ```
17
+
18
+ TTY: menu with ok/missing. Already ok asks redo (`--redo` skips the ask). Missing bins: print the OS command (never run it), then re-check PATH. Ends with a four-line status. Non-TTY needs flags (keys / `--creds`). Doctor never installs bins; setup never installs bins either.
19
+
20
+ | target | what it writes | flags |
21
+ | --- | --- | --- |
22
+ | speak | `~/.grunt/speak.json` | `--elevenlabs-key` `--openai-key` `--provider` `--skip-verify` |
23
+ | listen | same file (`openai` / `listen`) plus `~/.grunt/whisper/` | `--openai-key` `--device` `--skip-download` |
24
+ | google-workspace | Desktop OAuth JSON + tokens under `~/.grunt/` | `--creds PATH` `--account NAME` `--project ID` |
25
+ | browser | nothing (print Lightpanda / Chromium hints; both required except win32 Chromium-only) | |
26
+
27
+ Do not invent keys. If the session is not a TTY, tell the user to run `grunt setup` in their terminal. This spec is enough. Do not read https://github.com/lovrozagar/grunt#readme unless this file is missing.
@@ -4,20 +4,21 @@
4
4
 
5
5
  | name | origin | description | task | commandPath | refs |
6
6
  | --- | --- | --- | --- | --- | --- |
7
- | ask | local | Session leftover-gate. /ask sets leftover-gate ask for this session — leftover triple wait on advise-class recaps. Not… | | | |
8
- | auto | local | Session leftover-gate. /auto sets leftover-gate auto for this session — Implement-typed pick2 chains write-plan persist… | | | |
9
- | browser | local | Live URL/interact → this; not websearch. /browser or browse a URL. Call node scripts/browser.mjs nav\|snap\|click\|fill\|sh… | | | |
10
- | cascade | local | Session mode. /cascade exits solo and restores the grunt cascade for this session — spawn, orchestrator, recap, need\|ve… | | | |
7
+ | ask | local | Session flag. Finish one step, recap, then ask before the next. | | | |
8
+ | auto | local | Session flag. Default. Work the task through. Ask on blockers instead of monkey-patching. | | | |
9
+ | browser | local | Browse via node scripts/browser.mjs (Lightpanda). App e2e uses Playwright. | | | |
10
+ | clasp | local | Low-level Apps Script CLI. Prefer /google-workspace for sheet, doc, meeting, mail. | | | |
11
11
  | commit | local | Inspect the diff and commit with a Conventional Commits subject line. Use for /commit, "commit this", "commit these cha… | | | |
12
12
  | 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.… | | | |
13
13
  | commit-push | local | Commit with a Conventional Commits subject, then push. Use for /commit-push, "commit and push", "commit this and push".… | | | |
14
14
  | commit-push-deploy | local | Commit, push, then deploy only if allowlisted infra already exists. Use for /commit-push-deploy, "commit push deploy",… | | | |
15
15
  | 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… | | | |
16
- | explain | local | One-off human recap. /explain. First action = spawn grunt\|implementer\|thinker if facts/work; else recap already-visible… | | | |
17
- | handoff | local | Parent writes a session handoff under .tmp/grunt/handoffs/ and tells the user to continue in a fresh session. Use for /… | | | |
18
- | implement-plan | local | Implementer executes a local .tmp/grunt/plans checklist: continue, resume, or pick among plans. Empty /implement-plan r… | | | |
19
- | parent | local | One-turn parent-orchestrator escape. Use for /parent. Not a session mode. | | | |
20
- | pickup | local | Pick up/continue a session handoff under .tmp/grunt/handoffs/. Use for /pickup, pick up, continue handoff, serial, drag… | | | |
21
- | solo | local | Session mode. /solo disables the grunt cascade for this session — one normal agent, no spawn, no orchestrator. /cascade… | | | |
22
- | tmp | local | One-off convo artifact dump under .tmp/grunt/. Use for /tmp, dump a draft, save a note/email/script from this session.… | | | |
23
- | write-plan | local | Thinker drafts a local implementer-ready checklist plan; parent Write persists .tmp/grunt/plans/{serial}-{slug}-{YYYYMM… | | | |
16
+ | explain | local | Longer human recap this reply only. | | | |
17
+ | google-workspace | local | Google Sheets, Docs, Slides, Calendar, Gmail via node scripts/google-workspace.mjs. | | | |
18
+ | handoff | local | Write a session handoff under .tmp/grunt/handoffs/. Continue with /pickup. | | | |
19
+ | implement-plan | local | Execute remaining leaves in a .tmp/grunt/plans checklist. Skip [x]. | | | |
20
+ | listen | local | Speech-to-text via node scripts/listen.mjs (ffmpeg mic + local whisper.cpp, OpenAI fallback). Input only. | | | |
21
+ | pickup | local | Continue a handoff under .tmp/grunt/handoffs/. | | | |
22
+ | speak | local | Text-to-speech via node scripts/speak.mjs (ElevenLabs or OpenAI). Output only. | | | |
23
+ | tmp | local | Dump a one-off convo artifact under .tmp/grunt/. | | | |
24
+ | write-plan | local | Write a local checklist under .tmp/grunt/plans/. Then /implement-plan {n}. | | | |
@@ -0,0 +1,59 @@
1
+ ---
2
+ tags: [speak]
3
+ ---
4
+
5
+ # Speak
6
+
7
+ Text-to-speech from the session. Output only. Not STT. Not a mic. Not MCP. Speech-to-text is `/listen`: `.rulesync/reference/listen.md` and `node scripts/listen.mjs`.
8
+
9
+ ```
10
+ node scripts/speak.mjs whoami
11
+ node scripts/speak.mjs voices [--provider elevenlabs|openai]
12
+ node scripts/speak.mjs say --text "hello" [--provider elevenlabs|openai] [--voice ID] [--out path] [--play]
13
+ ```
14
+
15
+ `say` writes an mp3 under `.tmp/grunt/speak/` (or `--out`) and prints the path. `--play` is local `afplay` (mac) or `ffplay`.
16
+
17
+ ## Auth
18
+
19
+ Handheld (any OS): `node scripts/setup.mjs speak` or `npm exec grunt setup` → speak. Opens the key page, hides the paste, writes `~/.grunt/speak.json`, verifies. Non-TTY: `--elevenlabs-key` / `--openai-key`.
20
+
21
+ If a key is missing or rejected, the CLI prints `setup: node scripts/setup.mjs speak` and exits 1. Agents should show that line, not a stack or JSON. Do not invent a key.
22
+
23
+ One key is enough. Never commit it.
24
+
25
+ | | env | file |
26
+ | --- | --- | --- |
27
+ | ElevenLabs | `ELEVENLABS_API_KEY` | `elevenlabs.apiKey` |
28
+ | OpenAI | `OPENAI_API_KEY` | `openai.apiKey` |
29
+ | Force provider | `SPEAK_PROVIDER` | `provider` |
30
+
31
+ `~/.grunt/speak.json` (chmod 600):
32
+
33
+ ```json
34
+ {
35
+ "provider": "elevenlabs",
36
+ "elevenlabs": {
37
+ "apiKey": "sk_…",
38
+ "voiceId": "JBFqnCBsd6RMkjVDRZzb",
39
+ "modelId": "eleven_multilingual_v2"
40
+ },
41
+ "openai": {
42
+ "apiKey": "sk-…",
43
+ "voice": "coral",
44
+ "model": "gpt-4o-mini-tts"
45
+ }
46
+ }
47
+ ```
48
+
49
+ Env wins over the file. Default provider is `SPEAK_PROVIDER` else the first configured key (elevenlabs, then openai).
50
+
51
+ ## Defaults
52
+
53
+ - ElevenLabs voice: George `JBFqnCBsd6RMkjVDRZzb`. Model: `eleven_multilingual_v2`.
54
+ - OpenAI voice: `coral`. Model: `gpt-4o-mini-tts`.
55
+ - Format: mp3.
56
+
57
+ Create an ElevenLabs key at https://elevenlabs.io/app/settings/api-keys. OpenAI at https://platform.openai.com/api-keys.
58
+
59
+ Doctor reports speak as optional: `ok` when a key or `~/.grunt/speak.json` exists, else `missing (optional)`. It prints the provider name, not the secret.
@@ -2,53 +2,7 @@
2
2
  root: true
3
3
  targets:
4
4
  - claudecode
5
+ globs:
6
+ - "**/*"
5
7
  ---
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 (thinker recap verbatim-ish; no-strip how/why). Advise leftover: one empty blank line after recap/body then numbered pick each on own line. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
8
- All output exclude AI attribution, Co-Authored-By, trailers, generated markers.
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.
11
- Always-do:
12
-
13
- | signal | next |
14
- |---|---|
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 iff Implement-typed). Never parent Write/Bash/Skill |
16
- | plan/spec ready + file writes remain | leftover pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1 iff Implement-typed) only. Implement pick1 = spawn implementer + last [thinker] recap as spec; no `.tmp/grunt/plans`; no write-plan; no implement-plan. Implement pick2 = persist `.tmp/grunt/plans/{n}` then implementer `plan=/abs/...` one-shot skip pause. effective=auto + Implement-typed: pick2 chains write-plan persist → implement-plan `{n}`; skip leftover wait. Write pick1 = `/tmp` persist recap; no implementer. Write pick2 = write-plan persist inspect-pause; remainder `/implement-plan {n}`; no implementer. slash `/write-plan` ≠ leftover 2. `ok`/`yes`/`y`/`continue` ≠ either. Thinker recap alone = recap-stop |
17
- | tools/facts/git/test/mechanical write | spawn grunt |
18
- | snippet / cite / "what is X" | spawn grunt `job:web`. URL-in-a-cite ≠ browse |
19
- | URL / browse / click / fill / snap / live DOM | spawn 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 |
20
- | world fact | spawn grunt `job:web` |
21
- | write defined solution | spawn implementer; **blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+ |
22
- | 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 |
23
- | child returned | recap per output.md (echo=report not command; thinker recap verbatim-ish; no-strip). e.g. `[orchestrator]: wrote /abs/a` |
24
- | child `need:` | parse-need + parallel grunt; `resume_from` + new verdicts; max 3 |
25
- | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
26
- | work remains | spawn; do not stop. Advise recap ≠ leftover writes |
27
- | children done + no findings | recap; advise-first stop wins. Else stop only if no writes remain and spawn count > 0 when the user asked for a file change |
28
- | `/parent` | spawn-first; hook last-ditch `parent-escape`; never Read/Bash |
29
- | `/handoff` | one-turn write `.tmp/grunt/handoffs/`; recap `[handoff]:` |
30
- | `/tmp` | one-turn write `.tmp/grunt/`; recap `[tmp]:` |
31
- | `/pickup` | spawn-first; grunt resolve if needed; never parent Read; not a mode |
32
- | `/write-plan` plan-only | recap; remainder `/implement-plan` (ask). effective=auto + Implement-typed → persist then implement-plan `{n}` skip leftover wait; Write-typed still inspect-pause leftover wait |
33
- | `/explain` | spawn if facts/work; then human recap of child output; screenshot/visible=context no Read |
34
- | `/solo` | session escape; stamp spawn-mode-{sid} iff slash≠config; always unlink grunt-off; else spawn-first |
35
- | `/cascade` | restore cascade; stamp spawn-mode-{sid} iff slash≠config; always unlink grunt-off; spawn-first |
36
- | `/auto` | session leftover-gate auto; stamp auto-ask-{sid} iff slash≠config; not spawn-escape; not autofix |
37
- | `/ask` | session leftover-gate ask; stamp auto-ask-{sid} iff slash≠config; not leftover y/n; not pick 3 |
38
-
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}`.
40
- False+: I think terraform plan /implement-plan /solo source tokens one-cmd how- last-log why.
41
- Advise leftover: numbered pick each on own line after tagged recap; 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). One verb per recap; never jammed Implement/write. No leftover on `need:` JSON wait-grunt grunt/implementer recaps slash-only turns.
42
- 1. {Implement|Write} with verbal plan
43
- 2. {same verb} with file plan
44
- 3. Tweak
45
- 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. 3 / Tweak → stay advise; extra text = revision notes → 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 `/implement-plan {n}` (ask); ≠ leftover pick 2. `/implement-plan {n}` disk/file ≠ verbal. `ok`/`yes`/`y`/`continue` ≠ either pick.
46
- Parent = orchestrator (this file). You do not talk. Spawn wait echo.
47
- Spawn only grunt|implementer|thinker. Never spawn orchestrator. Children never spawn.
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 spawn-mode-{sid} iff slash≠config; unlink grunt-off) 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 printed leftover; always-print typed triple). Echo = report not command. Siblings still run: `[grunt]:` echo. No skip-spawn. /handoff = one-turn in-parent write to `.tmp/grunt/handoffs/`; recap `[handoff]:`. `/tmp` = one-turn in-parent write to `.tmp/grunt/`; recap `[tmp]:`. `/pickup` spawn-first; grunt resolve if needed; never parent Read; not a mode.
49
- `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
50
- grunt ← tools (facts/search/exec/git/web/test/low-reason mechanical write; snippet/cite/"what is X": `job: web`; URL/browse/click/fill/snap/live DOM: paste skill+browser.md abs paths, never websearch that page; 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).
51
- 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`.
52
- Peek every 60s/child; quote real host fields; `done|alive|stuck`; no invent; no auto-kill. `timeout_ms=60000` every peek. GAP: block on spawn return = `done`. Stuck/blocked: quote host fields only.
53
- `need:` JSON → parse-need + parallel grunt; one `resume_from` + new verdicts; max 3; no re-send task; no fresh-spawn.
54
- Child: this file does not apply; your agent file gates you. Never spawn.
8
+ @AGENTS.md
@@ -8,52 +8,14 @@ targets:
8
8
  globs:
9
9
  - "**/*"
10
10
  ---
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 (thinker recap verbatim-ish; no-strip how/why). Advise leftover: one empty blank line after recap/body then numbered pick each on own line. Zero user-visible tokens before spawn/peek. In-flight host Stop → only `[orchestrator]: wait grunt`.
13
- All output exclude AI attribution, Co-Authored-By, trailers, generated markers.
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.
16
- Always-do:
11
+ You are the session agent. Do the work. Use en-US unless asked. Write concise complete sentences with natural grammar. Skip filler and fluff. Ship optimal solutions only; rewrite if not. Flag blockers. Do not monkey-patch. Keep all work free of AI attribution, Co-Authored-By, trailers, and generated markers.
17
12
 
18
- | signal | next |
19
- |---|---|
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 iff Implement-typed). Never parent Write/Bash/Skill |
21
- | plan/spec ready + file writes remain | leftover pick1/pick2 / `/implement-plan {n}` / explicit implement (=pick1 iff Implement-typed) only. Implement pick1 = spawn implementer + last [thinker] recap as spec; no `.tmp/grunt/plans`; no write-plan; no implement-plan. Implement pick2 = persist `.tmp/grunt/plans/{n}` then implementer `plan=/abs/...` one-shot skip pause. effective=auto + Implement-typed: pick2 chains write-plan persist → implement-plan `{n}`; skip leftover wait. Write pick1 = `/tmp` persist recap; no implementer. Write pick2 = write-plan persist inspect-pause; remainder `/implement-plan {n}`; no implementer. slash `/write-plan` ≠ leftover 2. `ok`/`yes`/`y`/`continue` ≠ either. Thinker recap alone = recap-stop |
22
- | tools/facts/git/test/mechanical write | spawn grunt |
23
- | snippet / cite / "what is X" | spawn grunt `job:web`. URL-in-a-cite ≠ browse |
24
- | URL / browse / click / fill / snap / live DOM | spawn 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 |
25
- | world fact | spawn grunt `job:web` |
26
- | write defined solution | spawn implementer; **blocked if advise-class stems present** unless prompt-is-spec / obvious comment-spec false+ |
27
- | 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 |
28
- | child returned | recap per output.md (echo=report not command; thinker recap verbatim-ish; no-strip). e.g. `[orchestrator]: wrote /abs/a` |
29
- | child `need:` | parse-need + parallel grunt; `resume_from` + new verdicts; max 3 |
30
- | ⚠ / validate / sim | spawn implementer with findings; do not recap; spawn; no parent-edit |
31
- | work remains | spawn; do not stop. Advise recap ≠ leftover writes |
32
- | children done + no findings | recap; advise-first stop wins. Else stop only if no writes remain and spawn count > 0 when the user asked for a file change |
33
- | `/parent` | spawn-first; hook last-ditch `parent-escape`; never Read/Bash |
34
- | `/handoff` | one-turn write `.tmp/grunt/handoffs/`; recap `[handoff]:` |
35
- | `/tmp` | one-turn write `.tmp/grunt/`; recap `[tmp]:` |
36
- | `/pickup` | spawn-first; grunt resolve if needed; never parent Read; not a mode |
37
- | `/write-plan` plan-only | recap; remainder `/implement-plan` (ask). effective=auto + Implement-typed → persist then implement-plan `{n}` skip leftover wait; Write-typed still inspect-pause leftover wait |
38
- | `/explain` | spawn if facts/work; then human recap of child output; screenshot/visible=context no Read |
39
- | `/solo` | session escape; stamp spawn-mode-{sid} iff slash≠config; always unlink grunt-off; else spawn-first |
40
- | `/cascade` | restore cascade; stamp spawn-mode-{sid} iff slash≠config; always unlink grunt-off; spawn-first |
41
- | `/auto` | session leftover-gate auto; stamp auto-ask-{sid} iff slash≠config; not spawn-escape; not autofix |
42
- | `/ask` | session leftover-gate ask; stamp auto-ask-{sid} iff slash≠config; not leftover y/n; not pick 3 |
13
+ Size first. Straight shot: do it. Else read `.rulesync/reference/scope.md`.
14
+ Default `/auto`: keep going; ask on blockers. `/ask`: one step, then ask.
43
15
 
44
- 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}`.
45
- False+: I think terraform plan /implement-plan /solo source tokens one-cmd how- last-log why.
46
- Advise leftover: numbered pick each on own line after tagged recap; 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). One verb per recap; never jammed Implement/write. No leftover on `need:` JSON wait-grunt grunt/implementer recaps slash-only turns.
47
- 1. {Implement|Write} with verbal plan
48
- 2. {same verb} with file plan
49
- 3. Tweak
50
- 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. 3 / Tweak → stay advise; extra text = revision notes → 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 `/implement-plan {n}` (ask); ≠ leftover pick 2. `/implement-plan {n}` disk/file ≠ verbal. `ok`/`yes`/`y`/`continue` ≠ either pick.
51
- Parent = orchestrator (this file). You do not talk. Spawn wait echo.
52
- Spawn only grunt|implementer|thinker. Never spawn orchestrator. Children never spawn.
53
- 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 spawn-mode-{sid} iff slash≠config; unlink grunt-off) 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 printed leftover; always-print typed triple). Echo = report not command. Siblings still run: `[grunt]:` echo. No skip-spawn. /handoff = one-turn in-parent write to `.tmp/grunt/handoffs/`; recap `[handoff]:`. `/tmp` = one-turn in-parent write to `.tmp/grunt/`; recap `[tmp]:`. `/pickup` spawn-first; grunt resolve if needed; never parent Read; not a mode.
54
- `/parent` hook last-ditch only. Skills spawn-first. Only `/solo` escapes spawn workflow.
55
- grunt ← tools (facts/search/exec/git/web/test/low-reason mechanical write; snippet/cite/"what is X": `job: web`; URL/browse/click/fill/snap/live DOM: paste skill+browser.md abs paths, never websearch that page; 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).
56
- 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`.
57
- Peek every 60s/child; quote real host fields; `done|alive|stuck`; no invent; no auto-kill. `timeout_ms=60000` every peek. GAP: block on spawn return = `done`. Stuck/blocked: quote host fields only.
58
- `need:` JSON → parse-need + parallel grunt; one `resume_from` + new verdicts; max 3; no re-send task; no fresh-spawn.
59
- Child: this file does not apply; your agent file gates you. Never spawn.
16
+ Read `.rulesync/reference/INDEX.md` once. When a row matches the work, read that reference in full.
17
+
18
+ Large dumps are compressed (search, test logs, snaps). Scratch and dumps live in `.tmp/grunt/` (gitignored). After a write, recap the path; edit with an offset slice when you need lines.
19
+ Fat dumps: `node scripts/grunt-job.mjs --job search|exec|slice|fetch|test` first; spawn grunt only when the dump needs judgment.
20
+
21
+ Browse with `node scripts/browser.mjs`. Lightpanda first; the rail swaps to Chromium when Lightpanda is blocked, empty, or client-rendered. Do not stop and say you cannot. App e2e is `playwright test`.