Hacker
Mohammed Sharuk M S
@mohammedsharukhh
Elsewhere
Projects
Flag Janitor
Flagsmith Experimentation HackathonNov 2026
Feature flags are easy to add and nobody removes them. Flagsmith can already tell you a flag is stale, but a developer still has to find the code, delete the dead branch, test it and clean up the flag. Flag Janitor does that job. Tag a flag "stale" in Flagsmith. Flag Janitor reads the flag's production value, rewrites the code with an AST codemod (jscodeshift) that keeps the live branch and deletes the dead one (if/else, ternaries, &&/||, consts, JSX, early returns; JS/TS/JSX/TSX), runs the repo's tests, and opens one PR per flag. When the PR is merged, it checks that no file in the repo still mentions the flag (YAML/JSON/Python config included) and only then archives the flag in Flagsmith. Who uses it: any team on Flagsmith with flag debt. It plugs into a repo as a GitHub Action with a few lines of YAML, and also ships as an Agent Skill so a coding agent can run the same job with the Flagsmith CLI. Tested on real code: 240 flag removals across 75 files from 5 open-source repos (including Flagsmith's own frontend), 0 crashes, 0 invalid output. 56 automated tests plus live tests against self-hosted Flagsmith. Real PRs: https://github.com/mohammedsharukhh/flag-janitor-demo-shop/pulls?q=is%3Apr