agentleFS
qyndexqyndex/claude-init/.claude/skills/flag-cleanup/SKILL.md

flag-cleanup

Skill2 starsChanged 5 months agoMITView on GitHub

Remove a feature flag from code after it's been 100% for the cleanup_after window. Greps call sites, replaces `if (flags.X)` branches with the new path, deletes the flag from the provider, archives the spec/initiative reference.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No related flags depend on this one

    line 18
  2. Distinctive:

    No incidents in the last 14 days mentioning this flag's namespace

    line 19
  3. Distinctive:

    Remove the OFF path (the old behavior) if it has no other reference

    line 28
  4. Distinctive:

    Delete any "old behavior" helper functions made dead by removal

    line 29
  5. Distinctive:

    Single PR per flag: Don't batch — the diff stays reviewable.

    line 35
  6. Distinctive:

    Don't auto-delete the flag definition: before the PR merges. The flag-provider entry is the safety net during PR review.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flag Cleanup

A 100% flag still in code is debt. This skill inlines the new path and removes the conditional.

Eligibility

A flag is cleanup-ready when ALL of:

  • Provider shows 100% for ≥ cleanup_after (per spec's Rollout section; default 30 days)
  • No related flags depend on this one
  • No incidents in the last 14 days mentioning this flag's namespace
  • Spec status is shipped

Process

  1. Verify eligibility (above checks).
  2. Find all call sites — grep for flag.name, useFlag('X'), getBooleanValue('X'), if(features.X), etc.
  3. For each call site:
    • Inline the ON path (the new behavior)
    • Remove the OFF path (the old behavior) if it has no other reference
    • Delete any "old behavior" helper functions made dead by removal
  4. Update tests — remove tests that exercise the OFF path
  5. Update the flag provider — delete the flag definition or mark archived
  6. Update spec — append cleanup note; final-status the rollout
  7. Open a PR with title chore(flags): remove flag.X — 100% since YYYY-MM-DD
  8. CI must pass — coverage and integration tests must stay green
  9. Single PR per flag. Don't batch — the diff stays reviewable.

Hard rules

  • Don't auto-delete the flag definition before the PR merges. The flag-provider entry is the safety net during PR review.
  • Don't remove "old behavior" code unless it has no callers outside this flag. Search broadly.
  • Don't merge if any test is removed. Each removed test must have a replacement that exercises the now-default path.
  • Don't combine cleanups. Each flag is a separate PR.

Output

.claude/memory/playbooks/flag-cleanup-log.md  (appended per flag)
PR: chore(flags): remove flag.checkout_v2 — 100% since 2026-09-15

Recurring scan

A nightly cron (or /cleanup extension) scans the flag-provider for flags that have been 100% for > cleanup_after, then opens cleanup tasks. Tasks are eligible for autopilot pickup.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.