claude-skills/commands/flag-cleanup.md
Claude 5e67efdf58
ci: check Codex, Gemini, Hermes and Vibe installs and mirror drift
- Gate G13 (scripts/check_harness_mirrors.py): regenerate the .codex,
  .gemini, .vibe and .hermes mirrors from scratch in a temp copy and fail on
  any difference in link names, link targets or index bytes. --fix rewrites
  them, replacing hand-run syncs.
- harness-compat.yml + scripts/check_harness_installs.py: install the real
  Codex, Gemini CLI, Hermes Agent and Mistral Vibe CLIs (pinned on PRs, latest
  weekly), run the documented install path into an empty HOME and fail unless
  the harness itself lists every installed skill. Offline listings only, no
  model calls or API keys.
- Fix: Codex skipped 6 single-skill plugins because their installed folder
  held .claude-plugin/; the Codex installers now drop it.
- Fix: Gemini skipped 8 command entries without a frontmatter name; added.
- Regenerated 6 Vibe/Hermes links that a fresh sync points at the bundle copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8KYFHtMEP35nSKLy8fRkj
2026-11-03 16:41:48 +00:00

1.8 KiB

name description
flag-cleanup Run the quarterly feature-flag cleanup workflow on the current repo

/flag-cleanup

Run the full feature-flag cleanup workflow:

  1. Scan for stale flags (older than 90 days, used in ≤2 places)
  2. For each candidate, identify the introducing PR/issue and current owner
  3. Generate a removal plan grouped by owner
  4. Run kill-switch audit against the flag-doc registry
  5. Output a markdown report ready to share with the team

Usage

/flag-cleanup
/flag-cleanup --max-age-days 60
/flag-cleanup --flag-doc runbooks/flags.md

Implementation

This command dispatches to the feature-flags-architect skill:

SKILL=engineering/feature-flags-architect/skills/feature-flags-architect

# Step 1: scan for debt
python "$SKILL/scripts/flag_debt_scanner.py" --repo . --max-age-days "${MAX_AGE_DAYS:-90}" --format json > .flag-debt.json

# Step 2: audit kill switches
python "$SKILL/scripts/kill_switch_audit.py" --repo . --flag-doc "${FLAG_DOC:-docs/feature-flags.md}" --format json > .kill-switch-audit.json

# Step 3: synthesize a markdown report
# (Claude reads both JSON files, groups by owner, drafts the cleanup plan)

Output

A markdown report with:

  • Stale flag candidates grouped by owner, with introducing commit links
  • Undocumented flags that fail the kill-switch audit
  • Incomplete documentation (missing fields per flag)
  • Suggested removal PRs — one per owner

Pre-conditions

  • Run from a git repository with the source code committed
  • A flag-doc registry exists (default: docs/feature-flags.md)
  • The feature-flags-architect skill is installed

Post-conditions

  • .flag-debt.json and .kill-switch-audit.json written to repo root (ignored via .gitignore)
  • Markdown report streamed to terminal
  • Recommended next step printed (which removal PR to start with)