Hacker
Swift Bot Labs
@swiftbotlabs
Elsewhere
Projects
Flag Hygiene: an Agent Skill that ships A/B winners and retires dead Flagsmith flags, with a human sign-off before prod
Flagsmith Experimentation HackathonNov 2026
Feature flags are meant to be temporary, but most teams never remove them. Rollouts that finished months ago stay in the code, A/B tests end and nobody ships the winner or deletes the losing variant, and some rollouts stall halfway with Development on and Production off. Flagsmith's stale-flag tagging needs the Scale-up plan, and it stops at the tag: someone still has to find the code, delete the right branch, fix the tests and archive the flag. flagsmith-flag-hygiene is an Agent Skill (agentskills.io format) that does that whole job with the Flagsmith CLI. Any team using Flagsmith can drop it into Claude Code or another skills-compatible agent and say "clean up our stale flags and close out finished A/B tests". It: 1. Plans in one read-only command: every environment through the CLI, the code through git, and Flagsmith Experimentation's results. Each flag is STALE (same everywhere, unchanged for N days), ORPHAN (no code reads it), A/B (an experiment: shipped only with >= 95% chance to win and >= 100 users per arm, otherwise kept running), DRIFT (a stalled rollout: the person decides finish or abandon) or KEEP (permanent tag, targeting, recent change, possible dynamic key). 2. Writes a dry-run plan whose id is a hash of its content, and stops to ask. 3. Removes the dead code on a git branch with a deterministic codemod for JS/TS, Python and CI gates, keeping exactly what Flagsmith serves (for an A/B test: the winner's branch), deletes helpers left unused, runs the tests and commits. 4. Ships the winner, finishes the chosen rollout and archives the flags only after a person approves in their own terminal, after re-checking Flagsmith and the A/B result and running `flagsmith eval --test` in every environment. A rollback file is written first. Tested end to end on Flagsmith Cloud with Claude Code (real A/B tests, simulated traffic) and by 42 automated tests that drive the real CLI against a mock API. New compared with the closest public cleanup skills (PostHog's, Unleash's): the agent can't approve its own plan, the plan is hashed and re-checked against live Flagsmith and the A/B result before any write, `flagsmith eval --test` gates every environment before and after, a rollback file is written first, an A/B test is shipped only on Flagsmith's own result and never picked by the agent, and the code edits come from a deterministic codemod.