@lovrozagar/grunt 0.3.9 → 0.3.11

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 (40) hide show
  1. package/.agents/agents/implementer.md +2 -2
  2. package/.agents/agents/orchestrator.md +2 -2
  3. package/.agents/skills/commit/SKILL.md +3 -3
  4. package/.agents/skills/commit-and-push/SKILL.md +3 -9
  5. package/.agents/skills/commit-push/SKILL.md +46 -0
  6. package/.agents/skills/commit-push-deploy/SKILL.md +59 -0
  7. package/.agents/skills/commit-push-release/SKILL.md +62 -0
  8. package/.claude/agents/implementer.md +2 -2
  9. package/.claude/agents/orchestrator.md +2 -2
  10. package/.claude/skills/commit/SKILL.md +3 -3
  11. package/.claude/skills/commit-and-push/SKILL.md +3 -9
  12. package/.claude/skills/commit-push/SKILL.md +46 -0
  13. package/.claude/skills/commit-push-deploy/SKILL.md +59 -0
  14. package/.claude/skills/commit-push-release/SKILL.md +62 -0
  15. package/.codex/agents/implementer.toml +2 -2
  16. package/.codex/agents/orchestrator.toml +2 -2
  17. package/.grok/agents/implementer.md +2 -2
  18. package/.grok/agents/orchestrator.md +2 -2
  19. package/.grok/hooks/orchestrate-parent.js +3 -3
  20. package/.grok/skills/commit/SKILL.md +3 -3
  21. package/.grok/skills/commit-and-push/SKILL.md +3 -9
  22. package/.grok/skills/commit-push/SKILL.md +46 -0
  23. package/.grok/skills/commit-push-deploy/SKILL.md +59 -0
  24. package/.grok/skills/commit-push-release/SKILL.md +62 -0
  25. package/.rulesync/reference/cascade.md +1 -1
  26. package/.rulesync/reference/map.md +3 -3
  27. package/.rulesync/rules/CLAUDE.md +1 -1
  28. package/.rulesync/rules/overview.md +1 -1
  29. package/.rulesync/skills/commit/SKILL.md +3 -3
  30. package/.rulesync/skills/commit-and-push/SKILL.md +4 -9
  31. package/.rulesync/skills/commit-push/SKILL.md +47 -0
  32. package/.rulesync/skills/commit-push-deploy/SKILL.md +60 -0
  33. package/.rulesync/skills/commit-push-release/SKILL.md +63 -0
  34. package/.rulesync/subagents/implementer.md +2 -2
  35. package/.rulesync/subagents/orchestrator.md +2 -2
  36. package/AGENTS.md +1 -1
  37. package/CLAUDE.md +1 -1
  38. package/README.md +311 -52
  39. package/package.json +1 -1
  40. package/scripts/gate-fat-tools.mjs +19 -4
package/README.md CHANGED
@@ -1,70 +1,329 @@
1
- # GRUNT
1
+ # Grunt
2
2
 
3
- Building Grunt - a multi agent orchestrator workflow. OSS, general use case, merges with existing configs, drop in any repo to switch from default provider flow to Grunt's
3
+ Multi-agent orchestrator SoT — deep-merge rulesync trees product scripts and generate pipeline into a consumer repo
4
4
 
5
- # Install
5
+ OSS drop-in; merges existing configs; switches default provider flow to Grunt.
6
6
 
7
- Node.js 22+.
7
+ - [Install](#install)
8
+ - [Usage](#usage)
9
+ - [CLI](#cli)
10
+ - [Init](#init)
11
+ - [Version bump](#version-bump)
12
+ - [Agents](#agents)
13
+ - [Skills](#skills)
14
+ - [Generate](#generate)
15
+ - [Config](#config)
16
+ - [Architecture](#architecture)
17
+ - [Layout](#layout)
18
+ - [Develop](#develop)
19
+ - [Examples](#examples)
20
+ - [License](#license)
21
+
22
+ ## Install
23
+
24
+ - Node.js 22+
25
+ - Consumer:
8
26
 
9
27
  ```
10
28
  npm i -D @lovrozagar/grunt
11
29
  npx @lovrozagar/grunt
12
30
  ```
13
31
 
14
- TTY no command: menu (init default; generate, check, sync-globals, purge-mcps, doctor, help, quit). Piped/CI/`--yes`/`-y`/`--non-interactive` no command: still `init`. Same as `npx @lovrozagar/grunt init`. Merge SoT, `npm install`, `rulesync:generate`, `sync:globals:apply`, `rulesync:check`. Do not `npm test` as a consumer.
32
+ - Same as `npx @lovrozagar/grunt init` when no command
33
+ - Do not `npm test` as a consumer
34
+ - Package: `@lovrozagar/grunt` `0.3.9` MIT · https://github.com/lovrozagar/grunt
35
+
36
+ ## Usage
37
+
38
+ - TTY no command → menu (init default; generate check sync-globals purge-mcps doctor help quit)
39
+ - Piped / CI / `--yes` / `-y` / `--non-interactive` no command → still `init`
40
+ - Bin: `grunt` → `./bin/grunt.js` (`type: module`)
41
+
42
+ ## CLI
15
43
 
16
- `--skip-globals` skips `sync:globals:apply`. Re-init auto-skips globals when `<!-- grunt:begin -->` is in AGENTS.md/CLAUDE.md or `scripts/telemetry.mjs` exists. First init (no sentinel, no telemetry) still applies globals unless flagged.
44
+ ### Commands
17
45
 
18
- `sync-globals` / `purge-mcps`: dry-run default; `--apply` writes. `--yes` is not `--apply`. `sync-globals --host <id>`. `doctor` runs `rulesync doctor`.
46
+ - `init` → `init()` — merge SoT, `npm install`, `rulesync:generate`, `sync:globals:apply`, `rulesync:check`
47
+ - `generate` → `npm run rulesync:generate`
48
+ - `check` → `npm run rulesync:check`
49
+ - `sync-globals` → `npm run sync:globals` (dry-run); `--apply` → `sync:globals:apply`
50
+ - `purge-mcps` → `npm run purge:global-mcps` (dry-run); `--apply` → `purge:global-mcps:apply`
51
+ - `doctor` → `npm run rulesync:doctor`
52
+ - `help`
53
+ - `version`
19
54
 
20
- Contributors to this repo only: local `npm i && npm test`.
55
+ ### Flags
21
56
 
22
- # Version bump
57
+ - `--skip-globals` — skip `sync:globals:apply` on init
58
+ - `--yes` / `-y` / `--non-interactive` — no TTY menu; default command still `init`. Not `--apply`
59
+ - `--apply` — write for `sync-globals` / `purge-mcps`
60
+ - `--host <id>` — `sync-globals --host <id>`
61
+
62
+ ## Init
63
+
64
+ - Merge SoT `npm install` `rulesync:generate` `sync:globals:apply` `rulesync:check`
65
+ - `--skip-globals` skips apply
66
+ - Re-init auto-skips globals when `<!-- grunt:begin -->` in `AGENTS.md`/`CLAUDE.md` **or** `scripts/telemetry.mjs` exists
67
+ - First init (no sentinel no telemetry) applies globals unless flagged
68
+ - Owned trees/scripts refresh; extra `.rulesync` files kept; patches to grunt-owned files lost
69
+
70
+ ## Version bump
23
71
 
24
72
  ```
25
73
  npm i -D @lovrozagar/grunt@latest && npx @lovrozagar/grunt init
26
74
  ```
27
75
 
28
- Owned trees/scripts refresh. Extra `.rulesync` files kept. Patches to grunt-owned files lost. Globals: first init applies; re-init auto-skips (or pass `--skip-globals`).
29
-
30
- # GOAL
31
-
32
- - synced configs across all 4/5 major cli providers (grok build, claude code, codex, gemini cli, antigravity)! Emit matrix: grok/claude/codex/antigravity (`rulesync generate`) then `emit-mcp-policy` + `emit-gemini` (`GEMINI.md`, `.gemini/agents/{id}/agent.md`; MCP `.gemini/settings.json`) + `emit-agent-shell-tools` (Claude grunt body `Bash`; other hosts `run_terminal_command`). No `-t geminicli`.
33
- - max situational speed relative to task intensity
34
- - max free token savings:
35
- maximally superterse without loosing value - sacrifice grammar for sake of concision
36
- compression - RTK AI
37
- subagent re-prompt scrub - script
38
- cache
39
- context engineering
40
- - max reasoning and effort where needed and minimal reasoning and effort where not needed
41
- - agents:
42
- - orchestrator (low model, low effort) -> always spawn+prompt; never user-facing tokens except `[orchestrator]:` (or child role tag) echo. `/parent` one-turn only; `/handoff` writes `.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md` and hands the session to a fresh one.
43
- - subagents:
44
- - grunt (low model, low effort) -> tools. facts/search/exec/git/web/test/low-reason mechanical write. never feature solution. never spawn.
45
- - implementer (medium model, medium effort) -> write already-defined solution. does not plan or invent design. never spawn.
46
- - thinker (high model, high effort) -> plan/deep reason. flags edge cases/pitfalls. read-only. never spawn. no bash.
47
-
48
- # Examples
49
-
50
- 1. User - "Create me a react weather app"
51
- Orchestrator spawns and prompts thinker
52
- Thinker outputs plan to Orchestrator
53
- Orchestrator spawns and prompts implementer
54
- Implementer writes to disk, implements the app & outputs to orchestrator
55
- Orchestrator outputs to user
56
-
57
- 2. User - "What is 2+2"
58
- Orchestrator spawns and prompts Grunt
59
- Grunt outputs 4
60
- Orchestrator echoes `[grunt]:` to user
61
-
62
- 3. User - "What is the next movie Marvel cinematic universe will release to theaters"
63
- Orchestrator spawns and prompts Grunt
64
- Grunt runs a web search & outputs to orchestrator
65
- Orchestrator outputs to user
66
-
67
- 4. User - "In .logs folder find the log or logs on 3/6/2021 with tag 'framework bug'"
68
- Orchestrator spawns and prompts Grunt
69
- Grunt searches local folder & outputs to orchestrator
70
- Orchestrator outputs to user
76
+ - Same re-init / globals rules as Init
77
+
78
+ ## Agents
79
+
80
+ SoT: `.rulesync/subagents/{orchestrator grunt implementer thinker}.md`
81
+
82
+ Emit: `.claude/` `.grok/` `.agents/` `.gemini/`
83
+
84
+ - **orchestrator** (parent) — always spawn+prompt; user-facing only `[orchestrator]:` (or child role tag) one-line echo. `/parent` one-turn; `/handoff` writes `.tmp/grunt/handoffs/{serial}-{slug}-{stamp}.md`. Small/low router. First token spawn. No parent Read/Bash/Grep. Does not implement, plan, or fetch world facts
85
+ - **grunt** — tools: facts/search/exec/git/web/test/low-reason mechanical write. Isolation `verdict:`. Never feature solution. Never spawn. World fact: `job: web`
86
+ - **implementer** — write already-defined solution on allowlisted paths. TDD when spec/plan says tests. Validate + sim after write. Fat dumps via `need:`. Never spawn. Never plan. Id is **implementer** (not Implementor)
87
+ - **thinker** — plan/deep reason; edge cases. Read-only named-file Read of prompt SSOT; trees/search/exec/web/test → `need:`. Never spawn. No bash. Never implement
88
+
89
+ Children never spawn. Spawn only grunt|implementer|thinker. Omit model on spawn; frontmatter on agent files picks haiku/sonnet/opus vs grok-4.5 / grok-4.6 / other hosts. Voice: `.rulesync/reference/output.md`. Protocol: `.rulesync/reference/cascade.md`. `AGENTS.md`/`CLAUDE.md` spawn-first. `GEMINI.md` → `@AGENTS.md`. Goals: synced configs across grok build claude code codex gemini cli antigravity; max situational speed; superterse token savings; max/min reasoning by role.
90
+
91
+ ## Skills
92
+
93
+ Present under `.claude` / `.rulesync` / `.agents`:
94
+
95
+ - `cascade` `commit` `commit-and-push` `commit-push` `commit-push-deploy` `commit-push-release` `explain` `handoff` `parent` `solo`
96
+ - Grok-only: `write-plan` `implement-plan` (`/write-plan` plan-only → `next: /implement-plan`)
97
+
98
+ ## Generate
99
+
100
+ Pipeline (no `-t geminicli`):
101
+
102
+ 1. `rulesync generate` — emit grok / claude / codex / antigravity
103
+ 2. `emit-mcp-policy.mjs`
104
+ 3. `emit-gemini.mjs` — `GEMINI.md` `.gemini/agents/{id}/agent.md` MCP `.gemini/settings.json`
105
+ 4. `emit-agent-shell-tools` — Claude grunt body `Bash`; other hosts `run_terminal_command` (hooks-union)
106
+
107
+ `check` / `doctor` = rulesync check / doctor.
108
+
109
+ Emit writes other-CLI trees from `.rulesync` for the **next** process of that CLI. Not a live hop into another host.
110
+
111
+ ## Config
112
+
113
+ - SoT merge into consumer repo; existing configs kept where not grunt-owned
114
+ - Globals: first init apply; re-init auto-skip (sentinel / telemetry) or `--skip-globals`
115
+ - `sync-globals` / `purge-mcps`: dry-run default; `--apply` writes
116
+ - Hosts: grok claude codex gemini antigravity
117
+
118
+ ## Architecture
119
+
120
+ Protocol picture: one CLI host process, parent-only orchestrator in that session, three sibling spawn types (`grunt` | `implementer` | `thinker`), local workspace tools with RTK on Bash stdout only, one vendor Model API outside the host bubble. Not a product walkthrough. `@lovrozagar/grunt` = protocol SoT + CLI (init/generate/check); not a model runtime. Do not paste `.rulesync/reference/cascade.md` here — boxes and edges only.
121
+
122
+ ### Containment
123
+
124
+ Draw **one** CLI host bubble. That bubble is **this** session’s CLI: Grok Build, Claude Code, Codex, Gemini CLI, or Antigravity. The CLI **is** the host — not a peer router beside another CLI. Parent lives **inside** that host session. Children spawn **inside the same process**. Other CLIs = emit/config on disk only; no runtime hop; no shared spawn/peek line.
125
+
126
+ User-visible conversation attaches only to the parent. Children never talk to the user. Children never spawn.
127
+
128
+ ### Nested diagram
129
+
130
+ Same topology as the session recap; every legal edge labeled.
131
+
132
+ ```
133
+ USER
134
+ │
135
+ │ session in/out (parent only; tagged one-line recap)
136
+ │ TUI local; completion tokens from Model API (mixed)
137
+ ▼
138
+ ┌──────────────────────── CLI HOST (this process) ────────────────────────┐
139
+ │ TUI · hooks · emit/generate · RTK PreToolUse · fs workspace │
140
+ │ │
141
+ │ Parent orchestrator (only spawner; spawn-first; no parent Read/Bash) │
142
+ │ legal spawn types: grunt | implementer | thinker │
143
+ │ omit model on spawn; FM on agent files picks haiku/sonnet/opus │
144
+ │ vs grok-4.5 / grok-4.6 / etc. │
145
+ │ │
146
+ │ spawn / peek / resume_from │
147
+ │ │ │
148
+ │ ▼ │
149
+ │ siblings (never spawn; no child→child) │
150
+ │ ┌───────────┬───────────────┬──────────────┐ │
151
+ │ │ grunt │ implementer │ thinker │ │
152
+ │ │ facts/ │ specified │ plan/deep │ │
153
+ │ │ tools │ writes + TDD │ reason │ │
154
+ │ │ Bash+fs │ Write/Bash/ │ Read / need: │ │
155
+ │ │ web/test │ fs │ no Bash │ │
156
+ │ └─────┬─────┴───────┬───────┴───────┬──────┘ │
157
+ │ │ │ │ │
158
+ │ └──────── tool call ──────────┘ │
159
+ │ │ │
160
+ │ ▼ │
161
+ │ host tools (same process) │
162
+ │ fs: Read / Grep / Glob / Write │
163
+ │ Bash / run_terminal_command │
164
+ │ │ │
165
+ │ └──RTK (PreToolUse; Bash/shell stdout only)──► compress │
166
+ │ │
167
+ │ local (not Model API): │
168
+ │ spawn_subagent / Agent · peek │
169
+ │ workspace tools · RTK │
170
+ │ scrub-spawn-prompt · parse-need · grunt-job │
171
+ │ emit / generate │
172
+ │ │
173
+ │ WebSearch / web_fetch = remote-not-LLM (not a second model) │
174
+ │ MCP = denied in-tree; do not draw as a main path │
175
+ │ │
176
+ │ parent + children ──completion─────────────────────────────┐ │
177
+ └──────────────────────────────────────────────────────────────────────┼──┘
178
+ │
179
+ ▼
180
+ Model API
181
+ (this host’s SDK
182
+ only; one box)
183
+ ..
184
+ emit/config
185
+ (no runtime line)
186
+ ..
187
+ other CLIs
188
+ Gemini spawn/peek
189
+ = GAP
190
+ (no fake peeks)
191
+ ```
192
+
193
+ ### `need:` / `resume_from`
194
+
195
+ Implementer or thinker that still needs a fat dump **stops** on a `need:` JSON line. Parent fans those jobs as **parallel grunt** siblings, then one `resume_from` with **new** `verdict:` blobs only. Max **3** `resume_from` per child id. Thinker has no Bash; facts go through this loop. Grunt does not emit `need:` for its own tool use.
196
+
197
+ ```
198
+ implementer | thinker
199
+ │
200
+ │ stop on JSON only (≤4 jobs/batch)
201
+ ▼
202
+ need: [{"job":"search|exec|web|test","query":"..."}]
203
+ │
204
+ │ parent parse-need (or SubagentStop intercept
205
+ │ when every job is search|exec)
206
+ ▼
207
+ parallel grunt spawns (same host; not a new CLI)
208
+ │
209
+ │ isolation
210
+ ▼
211
+ verdict: ok|fail|empty
212
+ │
213
+ │ one resume_from:<child id> + new verdicts only
214
+ │ do not re-send original task; max 3
215
+ ▼
216
+ same child continues (transcript already on resume_from)
217
+ ```
218
+
219
+ ### Node table
220
+
221
+ | node | inside host? | local vs AI-server | notes |
222
+ | --- | --- | --- | --- |
223
+ | User | no | mixed | Speaks only to parent session. Never a child edge. |
224
+ | Session in/out / TUI | yes | mixed | TUI is local; recap tokens come from the model. Legal `[role]:` one-line echo only. |
225
+ | CLI host process | yes (is the box) | local process | Grok Build / Claude Code / Codex / Gemini / Antigravity. Not a peer of another CLI. |
226
+ | Parent orchestrator | yes | AI-server **turn** | Spawn-first low router. No parent Read/Bash/Grep. Lives in this session, not a sidecar. |
227
+ | `grunt` sibling | yes | AI-server **turn** | Facts/tools/mechanical write. Never spawn. Never feature solution. |
228
+ | `implementer` sibling | yes | AI-server **turn** | Specified writes + TDD when tests are in the spec. Agent id is **implementer**. Never spawn. |
229
+ | `thinker` sibling | yes | AI-server **turn** | Plan/deep reason. Read-only. Named-file Read of prompt SSOT; investigate → `need:`. No Bash. Never spawn. |
230
+ | Host spawn / peek / `resume_from` | yes | **local** | `spawn_subagent` / `Agent` and host peek tools. Gemini spawn/peek = GAP; block on return, classify `done`; no fake peeks. |
231
+ | Workspace fs tools | yes | **local** | Read/Grep/Glob/Write (and host aliases). Parent is denied these except documented persist paths / `/solo`. |
232
+ | Bash / `run_terminal_command` | yes | **local** | RTK wraps stdout on PreToolUse. Thinker has no Bash. |
233
+ | RTK | yes | **local** | Bash/shell stdout compression only. Not Read/Grep/Glob/prompts/images. |
234
+ | `scrub-spawn-prompt` / `parse-need` / `grunt-job` | yes | **local** | Hooks and scripts. Isolation `verdict:` is grunt output, not a model hop. |
235
+ | emit / generate / init | yes (this repo / install) | **local** | Writes other-CLI configs. Not a runtime line to those CLIs. |
236
+ | WebSearch / web_fetch | tool from host | **remote-not-LLM** | Network search/fetch. Not a second Model API box. World facts: grunt `job: web`. |
237
+ | MCP | policy deny | n/a | Denied by policy in-tree. Do not draw as a main path. |
238
+ | Model API | **no** (one box outside) | AI-server | This host’s vendor SDK only. Parent and child **turns** complete here. Spawn omits model; frontmatter on `.rulesync/subagents/*.md` picks the model. |
239
+ | Other CLIs | no (not this process) | emit/config only | Same protocol files emitted elsewhere. No hop, no shared peek. |
240
+ | `@lovrozagar/grunt` | package / CLI | local install | Protocol SoT + CLI. Not a model runtime. |
241
+
242
+ ### Edge labels
243
+
244
+ Use these labels. Do not revive “prompt input” or “agent to use”.
245
+
246
+ | edge | meaning |
247
+ | --- | --- |
248
+ | **session in/out** | User ↔ parent only. Children have no user edge. |
249
+ | **spawn** | Parent → `grunt` \| `implementer` \| `thinker`. First sentence: `You are {agent} subagent.` Omit model. |
250
+ | **peek** | Parent reads host status on the child id. Real host fields. `timeout_ms=60000`. GAP hosts: no fake peeks; block on spawn return = `done`. |
251
+ | **resume_from** | Parent continues the **same** child id with new `verdict:` blobs only. Max 3. Not a fresh spawn. |
252
+ | **need:** | Child stop line: fat dump jobs for parent to fan as grunt. Cap 4 jobs per batch. |
253
+ | **verdict:** | Grunt isolation result back onto `resume_from`. `ok\|fail\|empty`. Short facts, not dumps. |
254
+ | **tool call** | Child (or, illegally if parent, denied) → host tools. |
255
+ | **RTK** | PreToolUse Bash/shell → compressed stdout. No other tools. |
256
+ | **completion** | Parent and children → **one** Model API (this host’s SDK). |
257
+ | **emit/config** | Disk write to other CLI trees. Drawn with a broken line or footnote, **not** a session arrow. |
258
+
259
+ ### What not to draw
260
+
261
+ - A **CLI Provider** box as a peer of the host, or a router that hops between CLIs at runtime
262
+ - **Thinker ↔ CLI** as a special extra channel — thinker is a sibling; tools/`need:` like the protocol
263
+ - The spelling **Implementor** — id is **implementer**
264
+ - **Per-agent Model API** boxes — one Model API outside the host, this SDK only
265
+ - **Child → child spawn** — isolation is parent fan-out of grunt siblings (or in-hook grunt-job for interceptable `search|exec` batches)
266
+ - **MCP** as a happy-path tool rail
267
+ - **RTK** on Read/Grep/Glob/prompts/images
268
+ - **User** arrows into grunt/implementer/thinker
269
+ - Gemini **fake peek** loops. GAP: no invented status API; block on return
270
+
271
+ ### Emit footnote and Gemini GAP
272
+
273
+ **Emit.** `rulesync generate` plus in-tree emit scripts write Claude/Codex/Antigravity/Gemini/Grok trees from `.rulesync`. Config on disk for the **next** process of that CLI. Not a live message into another host. Multi-CLI in a diagram = footnote or a second, disconnected host bubble — never an arrow from this session.
274
+
275
+ **Gemini GAP.** Gemini is not emitted as a spawn/peek host in the cascade table. Do not invent peek or kill APIs. If a Gemini session is the host, treat spawn/peek as GAP: no fake peeks, no auto-kill; block on the host call returning and classify `done`. Other GAP rows (cascade host mapping): Claude Code unless an in-tree schema names a status/output tool; Codex peek/kill; Antigravity peek/kill.
276
+
277
+ ### Protocol pointers
278
+
279
+ Repo-relative (repository root):
280
+
281
+ - `.rulesync/reference/cascade.md` — parent-only spawn, peek/kill table, `need:` / `resume_from`, isolation `verdict:`
282
+ - `.rulesync/reference/rtk.md` — Bash/shell stdout compression
283
+ - `.rulesync/reference/map.md` — cheap outline of protocol, scripts, generated trees
284
+ - `.rulesync/subagents/orchestrator.md`
285
+ - `.rulesync/subagents/grunt.md`
286
+ - `.rulesync/subagents/implementer.md`
287
+ - `.rulesync/subagents/thinker.md`
288
+
289
+ ## Layout
290
+
291
+ Published (`package.json` `files`): `bin/grunt.js` `cli` `scripts/check-globals.mjs` `scripts/emit-agent-shell-tools.mjs` `scripts/emit-gemini.mjs` `scripts/emit-mcp-policy.mjs` `scripts/gate-fat-tools.mjs` `scripts/hooks-union.mjs` `scripts/grunt-job.mjs` `scripts/parse-need.mjs` `scripts/persist-handoff.mjs` `scripts/persist-plan.mjs` `scripts/purge-global-mcps.mjs` `scripts/scrub-spawn-prompt.mjs` `scripts/scrub-text-lib.mjs` `scripts/sync-global-settings.mjs` `scripts/telemetry.mjs` `scripts/scrub-text` `.rulesync` `.grok` `.codex` `.claude` `.agents` `AGENTS.md` `CLAUDE.md` `.mcp.json` `README.md` `LICENSE`
292
+
293
+ No `scripts/*.test.ts` `scripts/fixtures/` `docs/` `coverage/` `vitest.config.ts` in `files`.
294
+
295
+ Repo root (also): `coverage/` `.gemini/` — no `src/` no `CONTRIBUTING` no `docs/`
296
+
297
+ - `bin/grunt.js` — CLI bin
298
+ - `cli/grunt.mjs` — commands
299
+ - `scripts/` — generate emits `telemetry.mjs` (re-init sentinel) `scrub-text`
300
+ - `.rulesync/` — SoT (subagents skills reference)
301
+ - `.claude/` `.grok/` `.codex/` `.agents/` `.gemini/` — host emit
302
+ - `coverage/` — vitest local not published
303
+
304
+ ## Develop
305
+
306
+ Contributors to this repo only:
307
+
308
+ ```
309
+ npm i && npm test
310
+ ```
311
+
312
+ - Test: `vitest run --coverage`
313
+ - Test include: `scripts/**/*.test.ts` `cli/**/*.test.ts`
314
+ - Coverage include: `cli/**`
315
+ - Coverage thresholds: 100% lines / functions / branches / statements
316
+ - Dev deps include rulesync vitest typescript
317
+
318
+ ## Examples
319
+
320
+ Keep these four flows only:
321
+
322
+ 1. “Create me a react weather app” → thinker plan → implementer write → orchestrator recap
323
+ 2. “What is 2+2” → grunt → `[grunt]:` echo
324
+ 3. Marvel theatrical next → grunt `job:web` → recap
325
+ 4. `.logs` 3/6/2021 tag `framework bug` → grunt local search → recap
326
+
327
+ ## License
328
+
329
+ MIT © 2026 lovrozagar
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrozagar/grunt",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "Multi-agent orchestrator SoT — deep-merge rulesync trees, product scripts, and generate pipeline into a consumer repo",
5
5
  "keywords": [
6
6
  "agents",
@@ -510,7 +510,20 @@ function loadInProgressPlans(workspaceRoot) {
510
510
  return out;
511
511
  }
512
512
 
513
- function implementerWriteDeny(input, workspaceRoot) {
513
+ function specTextOf(data) {
514
+ if (!data || typeof data !== "object" || Array.isArray(data)) return "";
515
+ const parts = [];
516
+ for (const k of ["prompt", "userPrompt", "user_prompt", "content"]) {
517
+ if (typeof data[k] === "string" && data[k]) parts.push(data[k]);
518
+ }
519
+ const agent = data.agent;
520
+ if (agent && typeof agent === "object" && !Array.isArray(agent)) {
521
+ if (typeof agent.prompt === "string" && agent.prompt) parts.push(agent.prompt);
522
+ }
523
+ return parts.join("\n");
524
+ }
525
+
526
+ function implementerWriteDeny(input, workspaceRoot, data) {
514
527
  const ws = path.resolve(workspaceRoot);
515
528
  const plans = loadInProgressPlans(ws);
516
529
  const allow = new Set();
@@ -520,14 +533,16 @@ function implementerWriteDeny(input, workspaceRoot) {
520
533
  allow.add(extracted);
521
534
  }
522
535
  }
523
- const hasInProgress = plans.length > 0;
536
+ const promptPaths = extractPlanPaths(specTextOf(data), ws);
537
+ for (const abs of promptPaths) allow.add(abs);
538
+ const restrictive = promptPaths.size > 0;
524
539
  for (const key of WRITE_PATH_FIELDS) {
525
540
  if (typeof input[key] !== "string" || !input[key]) continue;
526
541
  const abs = resolveWriteAbs(input[key], ws);
527
542
  if (!abs) continue;
528
543
  if (isUnderPlansDir(abs, ws)) continue;
529
544
  if (allow.has(abs)) continue;
530
- if (isUnsolicitedDocPath(abs) || hasInProgress) {
545
+ if (isUnsolicitedDocPath(abs) || restrictive) {
531
546
  return { type: "deny", reason: REASON_IMPLEMENTER_WRITE };
532
547
  }
533
548
  }
@@ -556,7 +571,7 @@ export function processFatTools(data) {
556
571
  }
557
572
  }
558
573
  if (subagentTypeOf(data) === "implementer") {
559
- const denied = implementerWriteDeny(next, ws);
574
+ const denied = implementerWriteDeny(next, ws, data);
560
575
  if (denied) return denied;
561
576
  }
562
577
  return changed ? { type: "rewrite", updatedInput: next } : null;