add-feature-flaglisted
Install: claude install-skill tmj-90/gaffer
# Add a feature flag
A flag decouples deploy from release: code ships dark, is switched on deliberately, and
can be switched off in seconds. Every flag is also a branch in the code that someone must
test and later delete. Add it so both paths are correct, the default is safe, and its
removal is already planned.
## Steps
1. **Classify the flag** (Pete Hodgson, "Feature Toggles"); the category sets its
lifetime and how dynamic it must be:
- **release** — hides unfinished or unreleased work; lives days to weeks; usually a
static per-deploy value. The common case.
- **ops / kill switch** — lets operators turn off a costly or risky path under load;
may live long; must be changeable at runtime without a deploy.
- **experiment** — A/B cohorts; decided per request/user; needs consistent bucketing.
- **permission** — per-user or per-plan access; long-lived; this is product logic, so
treat it as an entitlement, not a temporary flag.
2. **Use the repo's flag mechanism.** A flags-service SDK, a config-driven module, env
vars, a settings table. Call `search_lore` for naming and where flags are declared. If
there is none, propose the smallest one (a typed config module with defaults, see the
`add-config-option` skill) via `request_decision` before building infrastructure.
3. **Name, type and default it.** A descriptive, namespaced name
(`checkout.new-address-form`), boolean unless variants are required. Never reuse a
retired flag's name: old