irahardianto/agy-perf-optimization-demo/feature-flags
Claude Code and agent skill by irahardianto/agy-perf-optimization-demo
- community
Checking that the SKILL.md file is still in the repository.
Feature flag lifecycle patterns: release flags, ops kill switches, experiment toggles, and permission gating. PRD-gated — use only when PRD or architecture explicitly requires gradual rollout, A/B testing, or kill switches.
Install
npx vskill@latest install irahardianto/agy-perf-optimization-demo/feature-flagsSKILL.md
Feature Flags Principles
[!CAUTION]Do NOT implement feature flags unless explicitly required.Feature flags add real operational complexity: flag evaluation infrastructure,lifecycle management, and a multiplicative increase in test permutations.The cost is non-trivial for solo developers or simple projects.Only introduce feature flags when the PRD or technical architecture documentexplicitly specifies one of:- Gradual / percentage rollout of a risky feature- A/B testing or experimentation- Emergency kill switches for production code paths- Feature entitlement gating by user tier or permissionIf none of these are specified, deploy code directly. Do not introduce flags speculatively.
When to Use Feature Flags
Feature flags decouple deployment from release. Code ships to production but stays dormant until the flag enables it. This is valuable for:
| Use case | Flag type | Example | |
|---|---|---|---|
| Gradual rollout | Release flag | new-checkout-flow: 0→5→25→100% | |
| Emergency kill switch | Ops flag | use-legacy-payment-provider | |
| A/B test / experiment | Experiment flag | button-color-blue-vs-green | |
| Tier / permission gating | Permission flag | pro-tier-analytics |
Infrastructure Requirements
[!IMPORTANT]The flag evaluation backend must be specified in the technical architecture documentbefore implementation begins. Do NOT choose a provider independently — ask the userwhich infrastructure to use.
| Approach | When to use | Notes | |
|---|---|---|---|
| Managed SaaS | Teams > 5, multi-environment, complex targeting | LaunchDarkly, Flagsmith, Unleash Cloud | |
| Self-hosted | Full control, no SaaS dependency | Unleash (OSS), Flagsmith (OSS) | |
| Firebase Remote Config | Mobile apps in the Firebase ecosystem | Firebase SDK required | |
| Static config (YAML / env) | Solo dev, simple on/off, single environment | Loaded at startup; no runtime targeting |
Flag configuration is infrastructure — it must be provisioned before code references it.
Flag Evaluation Rules
- Evaluate server-side for security-sensitive features (never trust the client)
- Evaluate at request boundary — never inside pure business logic functions
- Default to disabled — if the flag service is unreachable, the flag is off (fail closed)
- Wrap flag checks once — in a service method or middleware, not scattered across business logic
Pattern:
Flag Lifecycle Rules
Flags are temporary by design. Flag debt accumulates fast and becomes a maintenance burden.
- Every flag must have an owner (the team or developer responsible for its lifecycle)
- Every release flag has a maximum lifespan of 90 days
- When a release flag reaches 100% rollout, create a ticket immediately to remove it
- Ops (kill switch) flags can be permanent but must be documented as such
- Experiment flags must be removed when the experiment concludes
- Review all flags in sprint planning — any flag past its expiry date is tech debt
Testing with Feature Flags
Feature flags multiply test permutations. Keep tests tractable:
- Unit tests test each branch independently (flag on + flag off)
- Integration tests default the flag to its production-expected state (usually fully on or off)
- Do not write tests that enumerate every possible flag combination
- Use a test-only flag override mechanism (e.g.,
flags.Override(ctx, "flag", true)) — never
branch test logic on environment variables
CI/CD Checklist (Feature Flags)
- [ ] Flag infrastructure specified in technical architecture document?
- [ ] Flag backend provisioned and accessible by the application?
- [ ] Every flag has an owner and expiry date set?
- [ ] Flag evaluation is server-side for security-sensitive paths?
- [ ] Default state is
disabled(fail closed)? - [ ] Unit tests cover both flag-on and flag-off code paths?
- [ ] Removal ticket created once flag reaches 100% rollout?
Related Principles
- CI/CD Principles @.agents/skills/ci-cd/SKILL.md (deployment vs release concept)
- Architectural Patterns — Testability-First Design @architectural-pattern.md
- Core Design Principles @core-design-principles.md (YAGNI)
- Security Mandate @security-mandate.md (server-side evaluation)
- Rule Priority @.agents/rules/rule-priority.md
- Configuration Management Principles @.agents/rules/configuration-management-principles.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingflashmart-api/.agents/skills/feature-flags/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/irahardianto/agy-perf-optimization-demo/feature-flags)