agent-audit
Audit agents spawned in the current/last run against the agent-selection taxonomy
Capture the cumulative output of a /loop arc into a single auditable retrospective document; scans the heymegabyte-claude-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/claude-skillsHow it fires
How this command gets triggered: by you, by Claude, or both.
/post-arc-retrospectiveContext preview
What this command does when you run it.
Capture the cumulative output of a /loop arc into a single auditable retrospective document; scans the heymegabyte-claude-skills plugin for modified files, categorizes by directory, counts LOC delta, extracts tool counts from MCP servers, and writes a timestamped report to
description: Capture the cumulative output of a /loop arc into a single auditable retrospective document; scans the heymegabyte-claude-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-claude-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-claude-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 | |---|---|---|
14-category autonomous product-building OS for 32+ AI coding tools. One-line prompts → deployed products.
Repo: heymegabyte/claude-skills
Audit agents spawned in the current/last run against the agent-selection taxonomy
Run the Agent Diversity Review gate and emit the result table
Meta-analyze the effectiveness of a /loop arc — per-iteration metrics, LOC delta trend, saturation detection, and a keep/lengthen/delete recommendation.
Audit the rules/ directory for missing foundational principles; output gap list with priority and justification
Validate ~/.claude/settings.json hooks block — event names, file existence, executability, matcher syntax; --fix repairs common issues
Catch Resend-class bug (isError: false on HTTP 4xx/5xx) across all MCP server tool handlers