feature-flag-lifecycle skill
Manages the complete lifecycle of feature flags including creation, gradual rollout, kill switch implementation, A/B testing, and cleanup.
- GitHub stars
- 16
- Files
- 1
- Last commit
- Oct 5, 2026
- License
- MIT
- Allowed tools
- —
What does the feature-flag-lifecycle skill do?
feature-flag-lifecycle manages the complete lifecycle of feature flags including creation, gradual rollout, kill switch implementation, A/B testing, and cleanup.
Summary generated from the skill's SKILL.md.
About the feature-flag-lifecycle skill
Managing the transition of new code from dark deployment to full release is the primary function of this skill. It provides a structured framework for engineers to handle the entire lifecycle of a feature flag, starting from initial creation with defined owners and expiration dates through to final code cleanup. By following a staged rollout pattern, users can expose features to increasing percentages of traffic, such as 1%, 5%, 25%, and 50%, to detect crashes, performance issues, or capacity problems before reaching 100% exposure.
Developers use this skill to implement operational controls like kill switches that allow for instant feature deactivation without requiring a new deployment. It also supports A/B testing by requiring hypotheses and statistical significance before making decisions. The skill emphasizes aggressive cleanup to prevent technical debt, mandating that launch flags be removed within 14 days of full rollout and experiment flags within 7 days of a decision. This approach ensures that flags do not become permanent obstacles in the codebase.
What an agent can do with it
- 1Execute a staged feature rolloutGuide a new feature through incremental traffic stages from internal dogfooding to 100% external exposure.
- 2Implement an emergency kill switchSet up a mechanism to instantly disable a risky feature without performing a full code deployment.
- 3Conduct controlled A/B experimentsRun a statistical experiment by defining a hypothesis and monitoring primary metrics for a required duration.
- 4Manage technical debt through cleanupIdentify and remove stale feature flags from the codebase and configuration systems after a successful launch.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the feature-flag-lifecycle skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the feature-flag-lifecycle skill in Plugin
/plugin marketplace add robisson/build-like-amazon-agent-skills /plugin install build-like-amazon@build-like-amazon
Install the feature-flag-lifecycle skill in Claude Code
~/.claude/skills/feature-flag-lifecycle/SKILL.md
$ npx degit robisson/build-like-amazon-agent-skills/skills/feature-flag-lifecycle ~/.claude/skills/feature-flag-lifecycleInstall the feature-flag-lifecycle skill in Claude Code (project)
.claude/skills/feature-flag-lifecycle/SKILL.md
$ npx degit robisson/build-like-amazon-agent-skills/skills/feature-flag-lifecycle .claude/skills/feature-flag-lifecycleInstall the feature-flag-lifecycle skill in Codex
~/.agents/skills/feature-flag-lifecycle/SKILL.md
$ npx degit robisson/build-like-amazon-agent-skills/skills/feature-flag-lifecycle ~/.agents/skills/feature-flag-lifecycleInstall the feature-flag-lifecycle skill in Gemini CLI
~/.gemini/skills/feature-flag-lifecycle/SKILL.md
$ npx degit robisson/build-like-amazon-agent-skills/skills/feature-flag-lifecycle ~/.gemini/skills/feature-flag-lifecycleInstall the feature-flag-lifecycle skill in Claude.ai
npx degit robisson/build-like-amazon-agent-skills/skills/feature-flag-lifecycle feature-flag-lifecycle && zip -r feature-flag-lifecycle.zip feature-flag-lifecycle # claude.ai → Customize → Skills → + → Create skill → Upload a skill → feature-flag-lifecycle.zip
SKILL.md
View on GitHubFeature Flag Lifecycle
Overview
Feature flags decouple deployment from release. Code ships dark (behind a flag), then is gradually exposed to increasing percentages of traffic. Every flag has a defined lifecycle: creation → gradual rollout → full rollout → cleanup. Flags that live forever become tech debt that obscures code paths and creates combinatorial testing nightmares. Kill switches provide instant off-switches for new features without requiring deployment.
When to Use
- Launching any customer-facing feature
- Deploying code that changes behavior for existing functionality
- Running A/B tests or experiments
- Providing a kill switch for risky changes
- Migrating between systems (old path vs. new path)
- Enabling features for internal testing before customer exposure
Amazon Context
Amazon treats feature flags as first-class operational controls. A feature without a kill switch is a feature you can't turn off at 3 AM when it's causing problems. The gradual rollout pattern (1% → 5% → 25% → 50% → 100%) is not arbitrary—each stage allows you to detect different classes of problems. 1% catches crashes and obvious errors. 5% catches performance issues. 25% catches capacity problems. 50% catches subtle behavioral differences. Flags that outlive their purpose are aggressively cleaned up because stale flags are a source of both confusion and incidents.
The Process
Flag Creation
- Name: Descriptive, follows naming convention (e.g.,
feature.payment.new-checkout-flow) - Owner: Individual engineer responsible for the flag's lifecycle
- Expiration date: When this flag should be removed (max 90 days for launch flags, 30 days for experiments)
- Type: Launch flag, experiment flag, ops kill switch, or permission gate
- Default state: Off (new features start dark)
- Kill switch behavior: What happens when toggled off mid-traffic (graceful degradation, not crash)
- Metrics: What metrics indicate success/failure at each rollout stage
Gradual Rollout
Stage 1: Internal (dogfooding) — 0% external
- Enable for internal users/accounts only
- Duration: 2-5 days
- Validate basic functionality with real (internal) usage
- Fix any issues found before external exposure
Stage 2: 1% of external traffic
- Duration: 24-48 hours minimum
- Watch for: crashes, exceptions, error rates, latency spikes
- Success criteria: no increase in error rate, no p99 latency degradation >10%
Stage 3: 5% of external traffic
- Duration: 48-72 hours
- Watch for: performance under slightly higher load, edge cases in diverse traffic
- Success criteria: same as Stage 2 + no customer contacts about new behavior
Stage 4: 25% of external traffic
- Duration: 3-5 days
- Watch for: capacity issues, downstream dependency strain, business metric impact
- Success criteria: business metrics neutral or positive, no capacity alarms
Stage 5: 50% of external traffic
- Duration: 5-7 days
- Watch for: A/B comparison stabilization, subtle behavioral regressions
- Success criteria: statistically significant positive or neutral business impact
Stage 6: 100% of external traffic
- Duration: 7-14 days (stabilization period)
- Confirm all metrics stable at full rollout
- Begin flag cleanup process
Kill Switches
Every feature flag serves as a kill switch:
- Toggle off must take effect within 60 seconds globally
- Toggle off must not cause errors (graceful fallback to previous behavior)
- Kill switch must work without a deployment
- Kill switch must be documented in the service runbook
- On-call must know which flags can be toggled and what effect each has
A/B Testing
When using flags for experimentation:
- Define hypothesis before creating the flag
- Define primary metric and guardrail metrics
- Calculate required sample size for statistical significance
- Run for the minimum required duration (typically 1-2 weeks)
- Do not peek and make decisions before reaching significance
- Document results regardless of outcome
- Clean up losing variants immediately after decision
Flag Cleanup
Flags MUST be removed after reaching 100% rollout + stabilization:
- Remove flag checks from code (both sides of the conditional)
- Remove flag from configuration system
- Remove flag-specific tests (keep the behavior tests)
- Update documentation to reflect the feature as permanent
- Close the flag's tracking ticket
Cleanup timeline:
- Launch flags: Remove within 14 days of reaching 100%
- Experiment flags: Remove within 7 days of decision
- Kill switches for permanent features: May remain if actively used for operational control (reviewed quarterly)
Mechanisms Over Good Intentions
| Intention | Mechanism |
|---|---|
| "I'll clean up the flag after launch" | Automated alerts when flags pass expiration date. Stale flag report in weekly operational review |
| "I'll monitor the rollout carefully" | Automated rollout gates that block progression without green metrics |
| "The kill switch will work if we need it" | Kill switch tested monthly as part of operational drills |
| "I'll define success criteria before launch" | Flag creation template requires metrics and criteria fields—pipeline blocks without them |
Common Rationalizations
| What They Say | Why It's Wrong | What To Do Instead |
|---|---|---|
| "This flag is simple, it doesn't need gradual rollout" | Simple flags gate complex behavior. You don't know what breaks until real traffic hits it | Every customer-facing flag follows the rollout stages. No exceptions. |
| "We'll clean up flags next sprint" | Next sprint never comes. Flags accumulate and interact in unexpected ways | Set expiration at creation. Automated ticket creation on expiry. Block new flags if team has >10 stale flags |
| "We can't remove this flag, someone might need it" | If it's been at 100% for 30+ days and no one has toggled it, no one needs it | Remove it. If you need the capability again, create a new flag with a new lifecycle |
| "Let's leave the flag so we can rollback" | Rollback via flag beyond 30 days means you haven't committed to the feature | Commit or revert. Long-lived flags are not a substitute for deployment rollback |
Red Flags
- Flags older than 90 days that haven't been cleaned up
- More than 20 active flags in a single service
- Flags with no owner or an owner who has left the team
- No expiration date on a launch flag
- Kill switch never tested since creation
- Jumping from 1% directly to 100% ("it looked fine at 1%")
- A/B tests running longer than 30 days without a decision
- Flag interactions not documented (Flag A + Flag B = undefined behavior)
- No monitoring specific to the flagged behavior
Verification
- Flag has an owner, expiration date, and type
- Kill switch behavior defined and tested
- Success metrics defined for each rollout stage
- Rollout follows the staged percentage plan
- Metrics monitored at each stage before progression
- A/B tests have hypothesis, required sample size, and duration
- Cleanup completed within 14 days of full rollout
- No flags past their expiration date
- Kill switch works without deployment
- Stale flag report reviewed weekly
Tenets
- Flags are temporary by default. A flag without an expiration date is tech debt waiting to happen.
- Gradual rollout catches what testing cannot. Real traffic at scale reveals problems that no test environment can replicate.
- Kill switches must work at 3 AM. If you can't turn it off without a deploy, it's not a real kill switch.
- Clean up is part of the feature work. The feature isn't done when it reaches 100%—it's done when the flag is removed.
- Flag interactions multiply complexity. Every new flag doubles the number of possible system states. Keep the active count low.
Files in this skill
1feature-flag-lifecycle skill questions
How do I install the feature-flag-lifecycle skill in Claude Code?
Run npx degit robisson/build-like-amazon-agent-skills/skills/feature-flag-lifecycle ~/.claude/skills/feature-flag-lifecycle. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the feature-flag-lifecycle skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What is the recommended gradual rollout process?
The process involves six stages: internal dogfooding, 1% external traffic, 5% external traffic, 25% external traffic, 50% external traffic, and finally 100% external traffic with a stabilization period.