|
| 1 | +--- |
| 2 | +name: ce:refresh |
| 3 | +description: "Sync reviewer personas from external Git repos into the local plugin. Reads sources from reviewer-registry.yaml, fetches .md files, and places them in agents/review/. Use when setting up the plugin for the first time, after updating your reviewer repo, or to pull in new reviewer personas." |
| 4 | +--- |
| 5 | + |
| 6 | +# Refresh Reviewers |
| 7 | + |
| 8 | +Syncs reviewer persona files from external Git repositories into the plugin's `agents/review/` directory. |
| 9 | + |
| 10 | +## Step 1: Locate plugin |
| 11 | + |
| 12 | +Find the plugin's install location in the Claude plugin cache: |
| 13 | + |
| 14 | +```bash |
| 15 | +PLUGIN_DIR=$(find "$HOME/.claude" "$HOME/.claude-"* -path "*/compound-engineering/*/agents/review" -type d 2>/dev/null | head -1 | sed 's|/agents/review$||') |
| 16 | +``` |
| 17 | + |
| 18 | +Fall back to relative path if not found (e.g., running from source repo): |
| 19 | + |
| 20 | +```bash |
| 21 | +PLUGIN_DIR="${PLUGIN_DIR:-plugins/compound-engineering}" |
| 22 | +``` |
| 23 | + |
| 24 | +## Step 2: Interactive source configuration |
| 25 | + |
| 26 | +Read the user's source config at `~/.config/compound-engineering/reviewer-sources.yaml`. If it doesn't exist, the sync script will create it on first run — skip this step and go directly to Step 3. |
| 27 | + |
| 28 | +If the file exists, parse it and present the current sources to the user like this: |
| 29 | + |
| 30 | +List the current sources, then present three options using AskUserQuestion: |
| 31 | + |
| 32 | +``` |
| 33 | +Current sources: |
| 34 | + - jsl-reviewers (JumpstartLab/ce-reviewers-jsl@main) |
| 35 | + - ce-default (JumpstartLab/ce-reviewers@main) |
| 36 | +
|
| 37 | +1. Sync now |
| 38 | +2. Edit config file |
| 39 | +3. Or type a request (e.g., "add owner/repo", "remove ce-default") |
| 40 | +``` |
| 41 | + |
| 42 | +Handle the response: |
| 43 | +- **1 / Sync now** — proceed to Step 3. |
| 44 | +- **2 / Edit config file** — open `~/.config/compound-engineering/reviewer-sources.yaml` via Bash: `${EDITOR:-$(command -v code 2>/dev/null || echo nano)} ~/.config/compound-engineering/reviewer-sources.yaml`. After the editor, re-read the file and present the menu again. |
| 45 | +- **Anything else** — interpret as a natural language request to modify the config (add a source, remove one, change a branch, add an except entry, etc.). Edit the YAML accordingly, then present the menu again. |
| 46 | + |
| 47 | +## Step 3: Sync |
| 48 | + |
| 49 | +Run the sync script: |
| 50 | + |
| 51 | +```bash |
| 52 | +bash "$PLUGIN_DIR/skills/refresh/sync-reviewers.sh" \ |
| 53 | + "$PLUGIN_DIR/skills/ce-review/references/reviewer-registry.yaml" \ |
| 54 | + "$PLUGIN_DIR/agents/review" |
| 55 | +``` |
| 56 | + |
| 57 | +## Step 4: Show results |
| 58 | + |
| 59 | +The script writes a summary to `~/.config/compound-engineering/last-refresh-summary.md`. Read that file and **output its contents to the user exactly as written**. The summary is already formatted as markdown — do not summarize, paraphrase, or reformat it. Just show it. |
| 60 | + |
| 61 | +## Source YAML Format |
| 62 | + |
| 63 | +```yaml |
| 64 | +sources: |
| 65 | + - name: my-reviewers |
| 66 | + repo: username/repo-name |
| 67 | + branch: main |
| 68 | + path: . |
| 69 | + |
| 70 | + - name: community-reviewers |
| 71 | + repo: SomeOrg/ce-reviewers |
| 72 | + except: |
| 73 | + - kieran-python-reviewer |
| 74 | +``` |
| 75 | +
|
| 76 | +| Field | Required | Default | Description | |
| 77 | +|-------|----------|---------|-------------| |
| 78 | +| `name` | yes | — | Label for this source | |
| 79 | +| `repo` | yes | — | GitHub owner/repo | |
| 80 | +| `branch` | no | `main` | Branch to fetch from | |
| 81 | +| `path` | no | `.` | Directory in the repo containing .md files | |
| 82 | +| `except` | no | `[]` | Reviewer filenames (without .md) to skip | |
| 83 | + |
| 84 | +## Conflict Resolution |
| 85 | + |
| 86 | +Sources listed first have higher priority. If two sources have a file with the same name, the first source's version is kept. |
| 87 | + |
| 88 | +## Requirements |
| 89 | + |
| 90 | +- `gh` CLI (preferred) or `git` for fetching |
| 91 | +- `python3` for YAML parsing |
0 commit comments