hermes

Put a change behind a feature flag

Wraps new behaviour behind a feature flag with a safe default, a kill switch, tests for both paths and a cleanup ticket. Use when shipping a risky change incrementally.

context

A flag is only a safety net if turning it off really restores the old behaviour, and only cheap if it is removed once the rollout ends. Flags go wrong when the default is the new code, when an outage of the flag service flips everyone to the untested path, when the check is scattered across a dozen if statements that drift apart, when a schema change makes the old path impossible, or when nobody owns the removal and the flag lives for years.

task

Put this change behind a feature flag:

Flag system: (with the default, use the flag system the repo already has; if it has none, use an environment variable read through the existing config layer).

  1. Find how the repo already defines, names, reads and tests flags. Follow that exactly, including the naming convention.
  2. Classify the flag (release toggle, ops kill switch, experiment or permission) and choose its lifetime from that.
  3. The default and every failure mode, such as the flag service being unreachable or the flag missing, must evaluate to the old behaviour.
  4. Evaluate the flag once per request or unit of work, at the highest sensible point, and branch there. Do not scatter checks through the call tree or evaluate inside hot loops. Pass the decision down if deeper code needs it. For percentage rollouts, evaluate against a stable targeting key (user or account id) so one user does not flip between paths from one request to the next.
  5. Keep both paths complete and independently correct. If the change touches persisted data or a schema, make sure both paths can read what the other writes (expand then contract). If they cannot, say so plainly: a flag cannot protect that part.
  6. Record which path ran, using the project's logging or metrics conventions, so the rollout can be watched.
  7. Tests: the old path with the flag off, the new path with the flag on, and the old path when flag evaluation fails. Reuse the existing test helpers for overriding flags.
  8. Run the tests.
constraints
  • Do not change the old path's behaviour, even to tidy it.
  • Do not use a flag to gate a security fix; say so if the change is one.
  • Targeting rules (percentages, user segments) only if the flag system supports them; do not build your own.
  • Do only what was asked. If you notice something else worth changing, mention it in one line at the end instead of changing it.
  • Keep the change as small as it can be while still being correct.
  • Before saying the work is done, run the check that proves it (tests, build, type check or the command the user gave) and report the real result.
  • If you could not run a check, say so plainly and say which one.
output format

Flag

| Name | Type | Default | Evaluated at | Failure behaviour | Suggested expiry |

Changes

One line per file.

Tests

One line per test: which path and condition.

Rollout and kill switch

Numbered steps to enable gradually, the signals to watch, and exactly how to turn it off without a deploy (or a warning if the chosen system needs a deploy).

Cleanup ticket

Ready to paste: title, owner placeholder, due date placeholder, every code location to delete, and the tests to remove or keep.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Implementation
level
Intermediate
depth
Specific
made for
Software engineer, Full-stack engineer, Tech lead / staff engineer
needs
repo-read, file-write, shell
risk
runs-commands
version
v1.0.0 · incubating
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install add-feature-flag --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill add-feature-flag -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

more in implementation

All of Implementation
PromptImplementation

Build a feature

Builds a feature from an idea rather than a full spec, asking the few questions that change the design, proposing a small plan, then implementing and testing it. Start here for new features.

build-a-feature
PersonaImplementation

Backend engineer

Acts as a backend engineer focused on correct data handling, clear API contracts, explicit failure modes and services that are easy to operate. Use as a builder or reviewer persona for server code.

backend-engineer
PersonaImplementation

Frontend engineer

Acts as a frontend engineer who balances UX, accessibility, performance and maintainable components, and checks work in a real browser. Use to build or review web UI.

frontend-engineer
PersonaImplementation

Game developer

Acts as a game developer who prototypes fast, tunes game feel through playtesting, keeps every system inside the frame budget and scopes ruthlessly to ship. Use for gameplay code in any engine.

game-developer
PromptImplementation

Implement transactional email

Implements transactional email with templates, a provider integration, retries, bounce and complaint handling, and deliverability settings. Use when an app must send receipts, resets or alerts.

implement-transactional-email
PromptImplementation

Integrate payments

Implements a payment integration with the provider's official SDK, covering checkout, webhooks, idempotency, refunds and reconciliation. Use when adding one-time payments or subscriptions.

integrate-payments