Hacker
kushal s
@uhjgdbewkjefn
Projects
FlagMedic: Autonomous Feature-Flag Incident Response & Safe Rollout Agent Skill
Flagsmith Experimentation HackathonNov 2026
We built FlagMedic, a reusable Flagsmith Agent Skill (SKILL.md) paired with a controlled AI incident-response backend and monitoring dashboard. When a production or staging feature breaks because of a disabled Flagsmith flag, a code-to-flag reference mismatch, or a misconfigured environment, developers normally waste critical outage time manually tracing code references, checking Flagsmith dashboards, toggling flags without verification, and risking unverified changes. FlagMedic solves this by automating the entire "Put Out the Fire" workflow end-to-end—from root-cause diagnosis to safe, human-approved remediation, automated test verification, and instant rollback protection. 2. Who would use it, and how does it work? Who uses it: Software engineers, DevOps/SRE teams, and AI coding agents (such as Claude Code or OpenAI-compatible agents) managing feature flags in production and staging environments. How it works: Preflight & Token-Efficient Discovery: Guided by .claude/skills/flagmedic/SKILL.md, the agent inspects the repository for flag references and queries the live Flagsmith environment using the Flagsmith CLI (flagsmith flag list --json) with compact JSON filtering to minimize context token usage. Root-Cause Diagnosis: It cross-references codebase flag keys against live Flagsmith states to identify whether an incident is caused by a disabled flag (payment_v2), a flag-name mismatch, or an application bug. Human-in-the-Loop Safety Gate: Before modifying any flag or file, FlagMedic generates a clear repair preview (before/after state) and blocks execution until a human explicitly approves the change. Verified Execution & Automatic Rollback: Once approved, FlagMedic applies the change via the Flagsmith CLI (flagsmith flag enable), verifies the live state in Flagsmith, runs the application's automated test suite (npm test), and automatically disables the flag (flagsmith flag disable) if tests or post-repair diagnostics fail.