/repo-health:flag-cleanupfrom repo-health
Use when asked to clean up, remove or retire feature flags, find stale or dead flags, or when a flag is fully rolled out or abandoned. Works with any vendor (LaunchDarkly, Unleash, Flagsmith, GrowthBook, PostHog, Statsig, Split, ConfigCat, OpenFeature, Vercel flags) or home-made flags. Inventories every flag, asks which are settled, then removes one flag at a time keeping the winning branch.
Ships in repo-health. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A settled flag is dead code with a switch on it. Remove the switch and the losing branch.
Find how this repo reads flags; grep, then read only the hits.
| Vendor | Read call |
|---|---|
| OpenFeature | getBooleanValue(, getStringValue(, useFlag( |
| LaunchDarkly | variation(, boolVariation(, useFlags(), ldClient |
| Unleash / Flagsmith / ConfigCat | isEnabled(, hasFeature(, getValue( |
| GrowthBook / PostHog | isOn(, useFeatureIsOn(, isFeatureEnabled(, useFeatureFlagEnabled( |
| Statsig / Split | checkGate(, getTreatment( |
| Vercel / home-made | flag({ key:, flags.ts, FEATURE_ env vars, config.features. |
Most repos wrap the SDK; once you find the wrapper, grep for the wrapper instead.
| Flag | Reads | Files | Default in code | Notes |
|---|
Also list flags declared but never read, and flags read but never declared.
Whether a flag is settled (100% on, or off for good) lives in the vendor, not the code. Ask the user, or read it with the vendor's CLI or API read-only if they say so. Never guess from the code default.
For the flag and its winning value:
Then tell the user to archive the flag in the vendor dashboard after this ships. Do not change vendor state yourself.
Lessons from earlier runs live in two files: ~/.claude/skill-lessons/flag-cleanup.md (any repo) and .claude/skill-lessons/flag-cleanup.md at the repo root (this repo only).
- <YYYY-MM-DD>: <do or avoid X> because <Y>. (seen: 1). When a line already says the same thing, raise its seen count and date instead of adding one. Facts about this repo go in the repo file, everything else in the user file. Keep each file under 30 lines by merging or dropping stale lessons.seen: 3: if the ashish-claude-skills source repo is open, propose the edit to plugins/repo-health/skills/flag-cleanup/SKILL.md as a diff and wait for a yes, then delete the lesson once it lands; otherwise say Lesson ready to promote: <line> in the report.Learned: <the line written | nothing>.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub ashishyd/ashish-claude-skills --plugin repo-health3 skills in this plugin
/api-driftUse when server routes and client calls may have drifted: a 404, 405 or shape error between frontend and backend, after renaming or removing an endpoint, before deleting a route, when an OpenAPI or GraphQL schema changed, or when asked to check API contracts or find dead or unused endpoints. Lists every route and every call, matches them, and reports mismatches with file:line on both sides./env-doctorUse when a project will not install, build, start or pass tests on this machine; on a first clone or onboarding; when an error smells of setup (wrong runtime version, missing tool, missing env var, port in use, service not running); or when asked to check, diagnose or doctor the environment. Read-only: compares what the repo declares with what this machine has and gives one fix per gap.