agent-diversity-review
CommandRun the Agent Diversity Review gate and emit the result table
Capture the cumulative output of a /loop arc into a single auditable retrospective document; scans the heymegabyte-agent-skills plugin for modified files, categorizes by directory, counts LOC delta, extracts tool counts from MCP servers, and writes a timestamped report to
> /plugin marketplace add heymegabyte/agent-skills
description: Capture the cumulative output of a /loop arc into a single auditable retrospective document; scans the heymegabyte-agent-skills plugin for modified files, categorizes by directory, counts LOC delta, extracts tool counts from MCP servers, and writes a timestamped report to retrospectives/ argument-hint: [--since=<git-ref>] allowed-tools: Bash, Read, Write, Glob
Produce a complete, auditable retrospective for a completed loop arc. Scans `~/.claude/plugins/heymegabyte-agent-skills/` for files changed since the given git ref, categorizes output by directory, counts new/modified files and LOC delta, extracts MCP tool counts, rule descriptions, and command descriptions from frontmatter, then writes a timestamped markdown report.
Read the raw argument string.
for a stored start commit written by `CronCreate`; use it if present.
PLUGIN_DIR="$HOME/.claude/plugins/heymegabyte-agent-skills"
SINCE_REF="${ARGS#--since=}"
[ "$SINCE_REF" = "$ARGS" ] && SINCE_REF="" # no flag found
if [ -z "$SINCE_REF" ]; then
STORED="$PLUGIN_DIR/retrospectives/.last-arc-start"
[ -f "$STORED" ] && SINCE_REF=$(cat "$STORED")
fi
[ -z "$SINCE_REF" ] && SINCE_REF="HEAD~50"Run inside the plugin directory. Capture both Added (`A`) and Modified (`M`) files separately.
cd "$PLUGIN_DIR" NEW_FILES=$(git diff --name-only --diff-filter=A "$SINCE_REF" HEAD -- . 2>/dev/null) MODIFIED_FILES=$(git diff --name-only --diff-filter=M "$SINCE_REF" HEAD -- . 2>/dev/null) ALL_CHANGED=$(git diff --name-only "$SINCE_REF" HEAD -- . 2>/dev/null) LOC_DELTA=$(git diff --stat "$SINCE_REF" HEAD -- . 2>/dev/null | tail -1)
If the git diff fails (e.g., shallow clone or no commits), fall back to `find . -newer retrospectives/.last-arc-start -not -path '*/.git/*' -not -path '*/node_modules/*'`.
Iterate `$ALL_CHANGED` and bucket each path into one of these categories. Use the first matching rule (longest prefix wins):
| Category | Path prefix | |---|---| | Rules | `rules/` | | Commands | `commands/` | | Agents | `agents/` | | Hooks | `~/.claude/hooks/` or `hooks/` | | MCP Servers | `mcp-servers/` | | Template Utils | `template/utils/` or `template/evals/` | | Numbered Skills | `17-*/`, `18-*/`, `19-*/` (and higher) | | Core Skills | `[0-9][0-9]-*/` | | Bin / Scripts | `bin/` or `scripts/` | | Marketplace | `marketplace-submissions/` | | Config/Meta | `settings.json`, `package.json`, `*.yml`, `*.json` at root | | Packs | `_packs/` | | Other | everything else |
For each category track:
For each directory under `mcp-servers/*/mcp-server/src/index.ts`:
for mcp in "$PLUGIN_DIR/mcp-servers"/*/mcp-server/src/index.ts; do name=$(echo "$mcp" | sed 's|.*/mcp-servers/||' | sed 's|/mcp-server/src/index.ts||') tool_count=$(grep -c 'inputSchema' "$mcp" 2>/dev/null || echo 0) echo "$name: $tool_count" done
Also check for a `.mcp-prune-rules.json` alongside to note original vs pruned counts: `original_count` vs current `tool_count`.
For each new rule file in `rules/`:
for f in $NEW_RULE_FILES; do name=$(grep '^name:' "$PLUGIN_DIR/rules/$f" 2>/dev/null | head -1 | sed 's/name: //' | tr -d '"') h1=$(grep '^# ' "$PLUGIN_DIR/rules/$f" 2>/dev/null | head -1 | sed 's/^# //') echo "- **$h1** \`rules/$f\`" done
Fall back to the filename stem if no `name:` frontmatter found.
For each new command file in `commands/`:
for f in $NEW_CMD_FILES; do desc=$(grep '^description:' "$PLUGIN_DIR/commands/$f" 2>/dev/null | head -1 | sed 's/^description: *//' | tr -d '"') [ -z "$desc" ] && desc=$(grep '^# /' "$PLUGIN_DIR/commands/$f" | head -1 | sed 's/^# //') echo "- \`/$( basename $f .md )\` — $desc" done
Aggregate across all categories:
Apply this heuristic to surface the single most impactful change:
1. If a new MCP server was added → "New `<name>` MCP server: `N` tools" 2. If a forge template or forge command was added/modified → "forge `--target` capability upgraded" 3. If a rule with `priority: 1` was added → name that rule 4. If a command that enables a whole workflow was added → name that command 5. Otherwise → the category with the highest new-file count
Write one sentence: "Highest-leverage delta: `<noun>` — `<one-line what this unlocks>`"
For each new MCP server: one bullet — "Call `<API name>` tools directly from Claude without leaving the IDE" For each new numbered skill (≥17): one bullet — "Invoke skill `/<skill-name>` for `<domain>` workflows" For each new command: one bullet from its description For each new hook: one bullet on what behavior it automates
Cap at 12 bullets total; pick highest-leverage entries.
Output path: `$PLUGIN_DIR/retrospectives/arc-$(date +%Y-%m-%dT%H%M%S).md`
Report structure:
# Arc Retrospective — <date> **Ref range:** `<SINCE_REF>..HEAD` **Generated:** <ISO timestamp> ## Totals | Category | New | Modified | Notes | |---|---|---|---|
Agent Skills — agent-neutral autonomous product-building OS for 32+ AI coding tools. 23 skill categories · 28 agents · 149 reference docs · 37 platform variants. One-line prompts → deployed products on Cloudflare Workers.
Run the Agent Diversity Review gate and emit the result table
Report the Claude control-plane environment (auth mode, tooling, connectors, resolved target). Fires when you need to confirm the…
Bring ANY repo into compliance with the shared Claude control plane so Claude Code on the web can run /ship autonomously.
Reconcile the Cloudflare agent fabric: official skills, API MCP, MCP Portal candidates, AI Search, Secrets Store, Dynamic Routes,…
Scaffold a new spawnable specialist agent def and register it in the agent taxonomy
Audit whether user-visible changes in the current session have matching CHANGELOG.md entries; report MISSING with suggested…
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.