adopt
Bootstrap an existing repo for ForgeDock — triage open issues, apply labels, suggest a starter milestone, and identify first…
Track command sizes, detect bloat, compare against baselines and thresholds
> /plugin marketplace add RapierCraftStudios/ForgeDock > /plugin install forgedock@forgedock
How it fires
How this command gets triggered: by you, by Claude, or both.
/forge-statsContext preview
What this command does when you run it.
Track command sizes, detect bloat, compare against baselines and thresholds
user-invocable: false description: Track command sizes, detect bloat, compare against baselines and thresholds argument-hint: "[diff | baseline | full | cost]" install: internal
<!-- SPDX-FileCopyrightText: Copyright (c) RapierCraft Studios --> <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
**Input**: $ARGUMENTS (default: `diff`; modes: `diff`, `baseline`, `full`, `cost`)
Tracks the size of every Forge command file over time. Detects bloat by comparing current sizes against the git-tracked baseline and per-command thresholds.
Read project home from `forge.yaml` before running any mode:
CONFIG_FILE="${FORGE_CONFIG:-forge.yaml}"
FORGE_HOME=$(yq e '.paths.root' "$CONFIG_FILE")
echo "Forge home: $FORGE_HOME"**FORGE_HOME**: `$FORGE_HOME` (set from `forge.yaml` → `paths.root`)
---
Commands are classified by role. Each role has a max line count — beyond this, the prompt is too large for Sonnet to reliably follow all instructions.
| Role | Max Lines | Rationale | |------|-----------|-----------| | Orchestrator (work-on, orchestrate, review-pr) | 800 | Delegates to sub-agents; needs full pipeline logic | | Agent catalog (review-pr-agents, review-pr-staging) | 1000 | Reference file read on demand, not fed whole to one agent | | Specialist (milestone, analytics, sync-ecosystem, validate, etc.) | 400 | Single-purpose or multi-subcommand; Sonnet attention degrades past this | | Utility (cleanup, forge-stats) | 250 | Simple tasks; should stay lean | | Sub-file (quality-gate, pipeline-health) | 350 | Invoked by parent; shares context budget |
**Current overages (v1.1.0 baseline):**
---
`scripts/check-spec-size.sh` (job `spec-size-budget` in `check-commands.yml`, PRs only) enforces a budget that is independent of the line-count `.baselines`; the baseline is refreshed on release via `/forge-stats baseline`. It compares bytes against the PR base:
---
Compare current line counts against the last git commit. Shows what grew and what shrank.
cd "$FORGE_HOME"
echo "=== Forge Command Sizes — $(date +%Y-%m-%d) ==="
echo ""
printf "%-35s %6s %6s %6s %s\n" "Command" "Now" "Prev" "Delta" "Status"
printf "%-35s %6s %6s %6s %s\n" "-------" "---" "----" "-----" "------"
for cmd in commands/*.md; do
name=$(basename "$cmd")
current=$(wc -l < "$cmd")
# Get line count from last commit
previous=$(git show HEAD:"$cmd" 2>/dev/null | wc -l || echo 0)
delta=$((current - previous))
# Determine threshold based on filename
case "$name" in
work-on.md|orchestrate.md|review-pr.md) threshold=800 ;;
review-pr-agents.md|review-pr-staging.md) threshold=1000 ;;
cleanup.md|forge-stats.md) threshold=250 ;;
quality-gate.md|pipeline-health.md) threshold=350 ;;
*) threshold=400 ;;
esac
# Status
if [ "$current" -gt "$threshold" ]; then
overage=$(( (current - threshold) * 100 / threshold ))
status="⚠ ${overage}% over (max ${threshold})"
else
headroom=$(( (threshold - current) * 100 / threshold ))
status="OK (${headroom}% headroom)"
fi
# Delta formatting
if [ "$delta" -gt 0 ]; then
delta_str="+${delta}"
elif [ "$delta" -eq 0 ]; then
delta_str="="
else
delta_str="${delta}"
fi
printf "%-35s %6d %6d %6s %s\n" "$name" "$current" "$previous" "$delta_str" "$status"
done
echo ""
echo "Total: $(wc -l commands/*.md | tail -1 | awk '{print $(1)}') lines across $(ls commands/*.md | wc -l) commands"**After running, flag any command where:** 1. Delta > +50 lines in a single commit → "Significant growth — review if this is necessary" 2. Current > threshold → "Over limit — consider splitting into sub-files or rewriting" 3. Total across all commands > 10,000 lines → "Pipeline total is growing — review for consolidation"
---
Record the current sizes as the new baseline. Run this after a deliberate refactor or rewrite.
cd "$FORGE_HOME"
echo "# Forge Command Baselines — $(date +%Y-%m-%d)" > .baselines
echo "# Auto-generated by /forge-stats baseline" >> .baselines
echo "" >> .baselines
for cmd in commands/*.md; do
name=$(basename "$cmd")
lines=$(wc -l < "$cmd")
echo "${name}:${lines}" >> .baselines
done
git add .baselines
git commit -s -m "stats: update command baselines — $(date +%Y-%m-%d)"---
Full analysis with git history trend. Shows how each command has grown over time.
cd "
ForgeDock — autonomous AI dev pipeline for Claude Code. GitHub as agent memory: issue in, PR out.
Bootstrap an existing repo for ForgeDock — triage open issues, apply labels, suggest a starter milestone, and identify first…
Pull production analytics from GSC, Bing Webmaster, Clarity, Umami, Cloudflare, Stripe, and GA4 — generate insights and create…
Audit agent outputs from an orchestration run — timeline analysis, stall detection, active vs idle time breakdown
Trace a production issue or pipeline failure end-to-end through GitHub artifacts, then file a detailed improvement issue to the…
Autonomous deploy loop — runs until zero open issues remain. Detects pipeline state and resumes from any position. Fully…
Guided idea-to-backlog setup for a brand-new project — interview, defaults, doubts, spike doc, validated orchestrate-ready backlog