add-feature-flag

add-feature-flag is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 91 tokens per session (1,251 once invoked), scanned A, original, Apache-2.0.

A guide for putting application behaviour behind a feature flag, which is a switch that controls whether a feature is active. It covers safe defaults, rollout, alternate behaviour, ownership, and eventual removal.

In plain words
What is it for?
Use it for gradual rollouts, kill switches, dark launches, A/B variants, and removing old flags.
Why use it?
It lets a team deploy code without releasing it to everyone at once, and provides a way to turn a feature off when necessary.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for gradual rollouts, kill switches, dark launches, A/B variants, and removing old flags.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/add-feature-flag
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill add-feature-flag
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-feature-flag

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/add-feature-flag/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/add-feature-flag)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-feature-flag"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-feature-flag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-feature-flag

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-feature-flag"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-feature-flag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.01251
Opus 5.5 $0.00036 $0.00500
Sonnet 5.5 $0.00018 $0.00250
Haiku 4.5 $0.00009 $0.00125

Measured 16d ago against content hash ba06249a243c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-feature-flag scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/add-feature-flag/SKILL.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add a feature flag

A flag decouples deploy from release: code ships dark, is switched on deliberately, and can be switched off in seconds. Every flag is also a branch in the code that someone must test and later delete. Add it so both paths are correct, the default is safe, and its removal is already planned.

Steps

  1. Classify the flag (Pete Hodgson, "Feature Toggles"); the category sets its lifetime and how dynamic it must be:
    • release — hides unfinished or unreleased work; lives days to weeks; usually a static per-deploy value. The common case.
    • ops / kill switch — lets operators turn off a costly or risky path under load; may live long; must be changeable at runtime without a deploy.
    • experiment — A/B cohorts; decided per request/user; needs consistent bucketing.
    • permission — per-user or per-plan access; long-lived; this is product logic, so treat it as an entitlement, not a temporary flag.
  2. Use the repo's flag mechanism. A flags-service SDK, a config-driven module, env vars, a settings table. Call search_lore for naming and where flags are declared. If there is none, propose the smallest one (a typed config module with defaults, see the add-config-option skill) via request_decision before building infrastructure.
  3. Name, type and default it. A descriptive, namespaced name (checkout.new-address-form), boolean unless variants are required. Never reuse a retired flag's name: old code still reading it will wake up. The default is the SAFE state — the current behaviour — and it is also what the code does when the flag source is unreachable or the value is malformed.
  4. Declare once; decide at one point. Register the flag with owner, purpose, category and removal date. Evaluate it at the edge of the feature (the route, the component, the job entry) through one router function, and pass the decision (or the chosen implementation) inward. Scattered isEnabled() calls deep in the call stack make both testing and removal a hunt.
  5. Keep both paths correct. Old and new paths must never share half-migrated state: if the new path writes a new data shape, the old path must still read it, or the rollout needs an expand/contract migration (the add-db-migration skill). A flag may ADD a security check; it must never switch one off.
  6. Test the combinations that ship. Run the affected tests with the flag OFF (today's production) and ON (the intended release), plus an explicit test that an unset or unreadable flag yields the default. You do not need every combination of every flag — test the configurations you will actually run.
  7. Make the decision observable. Record the flag state where behaviour diverges (a structured log field or metric label) so an incident can be tied to a rollout; never log user data alongside it.
  8. Plan the removal now. The removal date in the declaration, a note in the evidence, and a follow-up the human can file. A flag that has been 100% on for weeks is dead code; the deprecate-and-remove skill retires it (delete the flag, the losing path and its tests together).

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago Changed · +30 lines ba06249a243c
  2. 19d ago First seen · 57 lines · 91 tokens per session scan A a5bc49141499

Subscribe to this mod's changes

add-feature-flag is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 91 tokens to every session and 1,251 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.

Related

Other skills, from other repositories

bulwark-brainstorm

Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.

QBall-Inc/the-bulwark · 50 tokens

plan-creation

Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.

QBall-Inc/the-bulwark · 38 tokens

anthropic-validator

Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.

QBall-Inc/the-bulwark · 40 tokens

create-subagent

Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.

QBall-Inc/the-bulwark · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens

code-review

Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.

QBall-Inc/the-bulwark · 61 tokens