feature-flags

feature-flags is a skill for Claude Code from camilooscargbaptista/cto-toolkit. It costs 17 tokens per session (1,199 once invoked), scanned A, original, MIT.

A guide to feature flags, which are settings that turn code features on or off for selected users or environments. It covers gradual releases, experiments, customer-specific access, and production kill switches.

In plain words
What is it for?
Use it to plan canary or percentage rollouts, A/B tests, emergency switches, trunk-based development, and flag cleanup over time.
Why use it?
It lets teams merge and test code without releasing it to everyone, and provides a way to disable a risky feature quickly.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cto-toolkit plugin — 54 skills, 6 agents, 3 hooks shipped together

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.

agentmods
npx agentmods add skills/camilooscargbaptista/cto-toolkit/feature-flags
Any agent
npx skills add camilooscargbaptista/cto-toolkit --skill feature-flags
Clone the repo
git clone --depth 1 https://github.com/camilooscargbaptista/cto-toolkit

Made for: Claude Code.

Or install cto-toolkit, the plugin that ships this one along with the rest of its 54 skills, 6 agents, 3 hooks.

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 feature-flags

README.md
[![agentmods](https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/feature-flags.svg)](https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/feature-flags)
Your own site
<a href="https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/feature-flags"><img src="https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/feature-flags.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,199 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00017 $0.01199
Opus 5 $0.00009 $0.00600
Sonnet 5 $0.00003 $0.00240
Haiku 4.5 $0.00002 $0.00120

Measured 6d ago against content hash dbdbf54a9340, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

feature-flags 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 6d 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.

feature-flags/SKILL.md · 166 lines

How it starts

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

Feature Flags

When to Use

  • Gradual rollout of new features (canary, percentage)
  • A/B testing
  • Kill switch for risky features in production
  • Trunk-based development (merge without releasing)
  • Customer-specific feature enablement

Flag Types

Type Purpose Lifespan Example
Release Control feature rollout Short (days-weeks) ENABLE_NEW_BILLING_UI
Experiment A/B testing Medium (weeks) EXPERIMENT_CHECKOUT_V2
Ops Kill switch Permanent ENABLE_EXTERNAL_PAYMENTS
Permission Per-customer features Permanent PREMIUM_ANALYTICS

Implementation

Simple (Config-based)

// Feature flags from environment/config
const FLAGS = {
  ENABLE_NEW_BILLING: process.env.FF_NEW_BILLING === 'true',
  ENABLE_DARK_MODE: process.env.FF_DARK_MODE === 'true',
};

// Usage
if (FLAGS.ENABLE_NEW_BILLING) {
  return this.newBillingService.process(order);
} else {
  return this.legacyBillingService.process(order);
}

Advanced (Database-backed)

@Entity('feature_flags')
class FeatureFlag {
  @PrimaryColumn()
  key: string;                    // 'ENABLE_NEW_BILLING'

  @Column({ default: false })
  enabled: boolean;               // Global toggle

  @Column({ type: 'int', default: 0 })
  rollout_percentage: number;     // 0-100

  @Column({ type: 'simple-array', nullable: true })
  allowed_tenants: string[];      // Specific tenants

  @Column({ type: 'simple-array', nullable: true })
  allowed_users: string[];        // Specific users

  @Column({ type: 'timestamp', nullable: true })
  expires_at: Date;               // Auto-disable date
}

@Injectable()
export class FeatureFlagService {
  constructor(
    @InjectRepository(FeatureFlag) private repo: Repository<FeatureFlag>,
    private cache: CacheManager,
  ) {}

  async isEnabled(
    key: string,
    context: { userId?: string; tenantId?: string },
  ): Promise<boolean> {
    const flag = await this.getFlag(key);
    if (!flag || !flag.enabled) return false;

    // Check expiration
    if (flag.expires_at && flag.expires_at < new Date()) return false;

    // Check specific tenant
    if (flag.allowed_tenants?.includes(context.tenantId)) return true;

    // Check specific user
    if (flag.allowed_users?.includes(context.userId)) return true;

    // Check percentage rollout (deterministic by userId)
    if (flag.rollout_percentage > 0 && context.userId) {
      const hash = this.hashUserId(context.userId);
      return (hash % 100) < flag.rollout_percentage;
    }

    // No specific rules + globally enabled
    return flag.allowed_tenants?.length === 0 && flag.allowed_users?.length === 0;
  }

  private hashUserId(userId: string): number {
    let hash = 0;
    for (let i = 0; i < userId.length; i++) {
      hash = ((hash << 5) - hash) + userId.charCodeAt(i);
      hash |= 0;
    }
    return Math.abs(hash);
  }
}

Read the full file on GitHub · 166 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. 6d ago First seen · 166 lines · 17 tokens per session scan A dbdbf54a9340

Subscribe to this mod's changes

feature-flags is a skill published in the GitHub repository camilooscargbaptista/cto-toolkit (7 stars, last pushed 5mo ago), licensed MIT. It adds 17 tokens to every session and 1,199 once invoked, about $0.0001 per session on Opus 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-08-31.

Related

Other skills, from other repositories

feature-flags-architect

Use when adding, retiring, or auditing feature flags. Triggers on "add a flag", "ship behind a flag", "rollout plan", "kill switch", "stale flags", "flag debt", "LaunchDarkly", "GrowthBook", "Statsig", "Unleash", "Flipt", or any progressive-delivery question. Ships flag debt scanner, rollout planner, and kill-switch…

Morningstar202604/awesome-skillkit · 121 tokens

feature-flags-architect

Use when adding, retiring, or auditing feature flags. Triggers on "add a flag", "ship behind a flag", "rollout plan", "kill switch", "stale flags", "flag debt", "LaunchDarkly", "GrowthBook", "Statsig", "Unleash", "Flipt", or any progressive-delivery question. Ships flag debt scanner, rollout planner, and kill-switch…

csiddhant796-blip/claude-skills-collection · 121 tokens

Feature Flag Testing

Testing feature flag implementations including flag evaluation, gradual rollout verification, fallback behavior, and flag cleanup detection.

PramodDutta/qaskills · 24 tokens

feature-flag-strategy

Use feature flags to decouple deploy from release, then clean them up. Invoke when shipping any risky change, a gradual rollout, or a kill-switch.

orlando-japan/claude-code-setting · 37 tokens

featurevisor

Author, query, and integrate Featurevisor — Git-based feature flags, A/B experiments, and remote config. Use whenever the user mentions Featurevisor, works in a project containing featurevisor.config.js, edits files under attributes/, segments/, features/, variables/, groups/, schemas/, targets/, sets/, or tests/…

featurevisor/featurevisor · 266 tokens

project-dashboard

Build and maintain auto-refreshing project health dashboards that aggregate git activity, CRM deal status, and manual notes into a single scanable view. Uses marker-delimited auto-sections with a watchdog cron pattern.

Cody-W-Tucker/Cognitive-Assistant · 44 tokens