Skip to content

Commit 33ae431

Browse files
jcasimirclaude
andcommitted
Generate agent shims from agent-shim: true frontmatter
Instead of syncing pre-written agent shims from a repo, /ce:refresh now auto-generates shims by scanning reviewers and orchestrators for agent-shim: true in their frontmatter. Generated shims use _shim- prefix and are cleaned up on each refresh. Orchestrator shims delegate to /ce:run. Reviewer shims load the full persona and answer in character. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 81b0f10 commit 33ae431

1 file changed

Lines changed: 53 additions & 4 deletions

File tree

  • plugins/compound-engineering/skills/refresh

plugins/compound-engineering/skills/refresh/SKILL.md

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,66 @@ bash "$PLUGIN_DIR/skills/refresh/sync-reviewers.sh" \
7474
orchestrator
7575
```
7676

77-
**Note:** The sync script's third argument (`orchestrator`) tells it to use `orchestrator-sources.yaml` as the user config instead of `reviewer-sources.yaml`. It fetches `.md` files from configured sources regardless of content type.
77+
**Note:** The sync script's third argument tells it which user config to use (`orchestrator-sources.yaml` instead of `reviewer-sources.yaml`). It fetches `.md` files from configured sources regardless of content type.
7878

79-
## Step 5: Show results
79+
## Step 5: Generate agent shims
80+
81+
After syncing reviewers and orchestrators, scan both directories for files with `agent-shim: true` in their YAML frontmatter. For each match, generate an agent shim file in `$PLUGIN_DIR/agents/review/`.
82+
83+
### For orchestrators (`$PLUGIN_DIR/orchestrators/*.md`)
84+
85+
Read each file's frontmatter. If `agent-shim: true` is present, extract the `name` and `description` fields. Generate a shim at `$PLUGIN_DIR/agents/review/_shim-<name>.md`:
86+
87+
```markdown
88+
---
89+
name: <name>
90+
description: "<first line of description>. Use when the user mentions <name> by name."
91+
model: inherit
92+
---
93+
94+
Run `/ce:run <name> $ARGUMENTS`
95+
```
96+
97+
### For reviewers (`$PLUGIN_DIR/agents/review/*.md`)
98+
99+
Read each file's frontmatter. If `agent-shim: true` is present, extract the `name`, `description`, and the reviewer's filename. Generate a shim at `$PLUGIN_DIR/agents/review/_shim-<short-name>.md` where `<short-name>` is the first name (e.g., `avi` from `avi-rails-architect`, `sandi` from `sandi-metz-oo-reviewer`):
100+
101+
```markdown
102+
---
103+
name: <short-name>
104+
description: "<description>. Use when the user mentions <short-name> by name or asks for their opinion."
105+
model: inherit
106+
tools: Read, Grep, Glob, Bash
107+
---
108+
109+
You are <short-name>. Load your full persona from `$PLUGIN_DIR/agents/review/<reviewer-filename>` and adopt it. Then address the user's request in character.
110+
111+
$ARGUMENTS
112+
```
113+
114+
### Cleanup
115+
116+
Before generating, remove any existing `_shim-*.md` files in `agents/review/` to avoid stale shims from previously synced definitions.
117+
118+
### Summary
119+
120+
After generating, list the shims created:
121+
122+
```
123+
Generated agent shims:
124+
Orchestrators: erin, lfg, max, nelly, oscar
125+
Reviewers: avi, abby, sandi, ...
126+
```
127+
128+
## Step 6: Show results
80129

81130
The sync script writes summaries to `~/.config/compound-engineering/`:
82131
- `last-reviewer-refresh-summary.md` — reviewer sync results
83132
- `last-orchestrator-refresh-summary.md` — orchestrator sync results
84133

85-
Read both files and **output their contents to the user exactly as written**. The summaries are already formatted as markdown — do not summarize, paraphrase, or reformat them.
134+
Read all summary files that exist and **output their contents to the user exactly as written**. The summaries are already formatted as markdown — do not summarize, paraphrase, or reformat them.
86135

87-
If only one summary file exists (e.g., no orchestrator sources configured yet), show just the one that exists.
136+
Then show the agent shim generation summary.
88137

89138
## Source YAML Format
90139

0 commit comments

Comments
 (0)