Detect stale feature flags
Overview
After you have already set cleanup expectations, stale flag detection should be handled by a reusable coding-agent skill. The agent only needs to read your cleanup rules, query FeatBit through FeatBit CLI or FeatBit MCP, search the repository for flag usage, and return a short cleanup review.
Write a stale flag review skill
By this point, the hard parts are already in place:
- Cleanup rules define when different flag types should be reviewed or removed.
- FeatBit CLI or FeatBit MCP lets the agent interact with FeatBit APIs and fetch project feature flag data.
- The remaining work is to encode your stale-flag detection logic into a small coding-agent skill, such as
.agents/feature-flag/skill.md,AGENTS.md, or another project rule file.
That skill should tell the agent to:
- Fetch FeatBit flag state, including rollout state, tags, audit history, archive state, and experiment state.
- Search the repository for each flag key and related registry entry.
- Compare FeatBit state and repository usage against your cleanup expectations.
- Classify each candidate as
remove,retain, orneeds-owner-decision. - Never archive a FeatBit flag until the deployed code no longer evaluates it.
The full pattern is already demonstrated in the stale flag review example, where a coding agent uses project rules, repository references, and FeatBit state to list stale feature flags.