Skip to content

Open-source skills for designing and reviewing software with AI agents

fix(claude): limit synthesizer writes to the requested report (#267)

Yash Dayani9f619528da51
diff --git a/.claude-plugin/agents/synthesizer.md b/.claude-plugin/agents/synthesizer.md
index a04ada9..ece4c26 100644
--- a/.claude-plugin/agents/synthesizer.md
+++ b/.claude-plugin/agents/synthesizer.md
@@ -11,6 +11,12 @@ Read `${CLAUDE_PLUGIN_ROOT}/agents/synthesizer.md` before acting.
Follow that canonical persona's instructions. This adapter defines your Claude
tool restrictions: spawn reviewers with the Agent tool using the plugin's
registered reviewer types (for example `egm:egm-zoom-out`), read files, and
-write the consolidated report. You cannot run shell commands or use MCP
-connectors. Resolve bundled personas and standards against
-`${CLAUDE_PLUGIN_ROOT}` and pass absolute paths to each reviewer.
+write the consolidated report. Write only the report or brief your task asks
+for, in the working directory or the folder an `EGM artifact directory:` line
+in your task or agent instructions names. If that line comes from agent
+instructions and its path, as written, is outside the working directory, use
+the working directory and say so in your completion message, unless your task
+names that folder. Do not create or change any other file, including the
+document under review. You cannot run shell commands or use MCP connectors.
+Resolve bundled personas and standards against `${CLAUDE_PLUGIN_ROOT}` and pass
+absolute paths to each reviewer.
diff --git a/distributions/claude/.claude-plugin/agents/synthesizer.md b/distributions/claude/.claude-plugin/agents/synthesizer.md
index a04ada9..ece4c26 100644
--- a/distributions/claude/.claude-plugin/agents/synthesizer.md
+++ b/distributions/claude/.claude-plugin/agents/synthesizer.md
@@ -11,6 +11,12 @@ Read `${CLAUDE_PLUGIN_ROOT}/agents/synthesizer.md` before acting.
Follow that canonical persona's instructions. This adapter defines your Claude
tool restrictions: spawn reviewers with the Agent tool using the plugin's
registered reviewer types (for example `egm:egm-zoom-out`), read files, and
-write the consolidated report. You cannot run shell commands or use MCP
-connectors. Resolve bundled personas and standards against
-`${CLAUDE_PLUGIN_ROOT}` and pass absolute paths to each reviewer.
+write the consolidated report. Write only the report or brief your task asks
+for, in the working directory or the folder an `EGM artifact directory:` line
+in your task or agent instructions names. If that line comes from agent
+instructions and its path, as written, is outside the working directory, use
+the working directory and say so in your completion message, unless your task
+names that folder. Do not create or change any other file, including the
+document under review. You cannot run shell commands or use MCP connectors.
+Resolve bundled personas and standards against `${CLAUDE_PLUGIN_ROOT}` and pass
+absolute paths to each reviewer.
diff --git a/distributions/claude/docs/claude.md b/distributions/claude/docs/claude.md
index 30cb9a1..acf89a2 100644
--- a/distributions/claude/docs/claude.md
+++ b/distributions/claude/docs/claude.md
@@ -141,6 +141,15 @@ Reviewers cannot edit files or run shell commands, and no persistent `memory`
is configured. The synthesizer adapter declares
`tools: [Agent, Read, Grep, Glob, Write]` so it can spawn reviewers and write
reports but cannot run shell commands or use the session's MCP connectors.
+A plugin subagent's `tools` field cannot restrict Write to specific paths, and
+Claude Code ignores `hooks` and `permissionMode` in plugin subagents. The
+adapter's rule to write only the requested report or brief is therefore an
+instruction, not a host-enforced limit. Writes still follow the session's
+permission rules. When you spawn `egm:egm-synthesizer`, name the artifact
+directory you are using in its task. Otherwise it never sees a line from the
+user's prompt, and it drops a folder outside the working directory that only
+agent instructions name. It has no shell, so it checks that path as written and
+does not follow symbolic links.
The bootstrap orchestrator adapter allows only `Agent`, `Bash`, `Read`, `Grep`,
`Glob`, `Write`, and `Edit` for local discovery and documentation. It routes
workers to the bootstrap `SKILL.md` so they return the JSON `subtree_index`
diff --git a/docs/claude.md b/docs/claude.md
index 30cb9a1..acf89a2 100644
--- a/docs/claude.md
+++ b/docs/claude.md
@@ -141,6 +141,15 @@ Reviewers cannot edit files or run shell commands, and no persistent `memory`
is configured. The synthesizer adapter declares
`tools: [Agent, Read, Grep, Glob, Write]` so it can spawn reviewers and write
reports but cannot run shell commands or use the session's MCP connectors.
+A plugin subagent's `tools` field cannot restrict Write to specific paths, and
+Claude Code ignores `hooks` and `permissionMode` in plugin subagents. The
+adapter's rule to write only the requested report or brief is therefore an
+instruction, not a host-enforced limit. Writes still follow the session's
+permission rules. When you spawn `egm:egm-synthesizer`, name the artifact
+directory you are using in its task. Otherwise it never sees a line from the
+user's prompt, and it drops a folder outside the working directory that only
+agent instructions name. It has no shell, so it checks that path as written and
+does not follow symbolic links.
The bootstrap orchestrator adapter allows only `Agent`, `Bash`, `Read`, `Grep`,
`Glob`, `Write`, and `Edit` for local discovery and documentation. It routes
workers to the bootstrap `SKILL.md` so they return the JSON `subtree_index`
diff --git a/tests/unit/test_harnesses.py b/tests/unit/test_harnesses.py
index 0883b1e..51e68af 100644
--- a/tests/unit/test_harnesses.py
+++ b/tests/unit/test_harnesses.py
@@ -153,7 +153,14 @@ def test_claude_synthesizer_adapter_is_tool_restricted() -> None:
assert set(config["tools"]) == {"Agent", "Read", "Grep", "Glob", "Write"}
assert config["model"] == "inherit"
assert "memory" not in config
- assert "${CLAUDE_PLUGIN_ROOT}/agents/synthesizer.md" in adapter.read_text()
+ text = " ".join(adapter.read_text(encoding="utf-8").split())
+ assert "${CLAUDE_PLUGIN_ROOT}/agents/synthesizer.md" in text
+ assert "Write only the report or brief your task asks for" in text
+ assert "Do not create or change any other file" in text
+ assert ("use the working directory and say so in your completion message, "
+ "unless your task names that folder") in text
+ guide = " ".join((ROOT / "docs/claude.md").read_text(encoding="utf-8").split())
+ assert "name the artifact directory you are using in its task" in guide
canonical = frontmatter(ROOT / "agents/synthesizer.md")
assert canonical["name"] == config["name"]
assert "tools" not in canonical