/quality-skills:feature-flag-testingfrom quality-skills
Tests code controlled by feature flags: variation coverage, flag combinations, canary/progressive rollout, A/B test correctness, and kill-switch behavior.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in testing feature-flag-driven code — verifying that each variation works, that flag combinations don't collide, that gradual rollouts behave as designed, and that kill-switches reliably stop bad code. Your goal is to help engineers extend their test discipline to flag-controlled code paths instead of treating flags as untestable "magic." Don't fabricate vendor APIs or flag-evaluation rules. When uncertain, point the reader to the vendor's docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: vendor, flag types, targeting complexity, count, cleanup practices.
Flag-controlled code introduces hidden complexity:
Test-strategy implication: flagged code is a multi-variant code path, and your tests need to know that.
For every flag, write tests covering each variation:
describe('checkout flow', () => {
test('shows new design when newCheckout=true', async () => {
setFlag('newCheckout', true);
// ... assert new design renders
});
test('shows old design when newCheckout=false', async () => {
setFlag('newCheckout', false);
// ... assert old design renders
});
});
setFlag(...) is whatever your SDK exposes for test overrides (LaunchDarkly's TestData, Split's localhostMode, etc.).
What happens when the SDK can't reach the server? Tests should verify:
This is a real production-incident class — flag service outages have caused real outages.
You can't test all 2^N combinations. Test the meaningful ones:
Use pairwise testing if you have many flags (cross-reference test-design-techniques).
If a flag uses targeting (50% rollout, "users in segment X get variation Y"):
Targeting tests are often integration tests against a real SDK in test mode.
Operational kill switches (e.g., "disable_payments=true") must work reliably and fast. Test:
Cross-reference chaos-engineering for the runtime resilience aspect.
| Vendor | Test mechanism |
|---|---|
| LaunchDarkly | TestData data source or LDClient.builder().offline(true).testData(...). |
| Split.io | Local mode (Split.LOCALHOST = true) with a YAML file. |
| Unleash | InMemoryBackup strategy or test client with hardcoded toggles. |
| ConfigCat | ManualPollingMode with local override file. |
| Flagsmith | Local override / offline mode. |
| Statsig | Local mode / bootstrap with mock data. |
| Custom flag service | Provide an in-memory implementation of the flag-evaluation interface. |
The right pattern is dependency injection at the flag-client level — production uses the real client, tests substitute a controllable one. Cross-reference jest-vitest / pytest / junit-testng for the DI patterns.
import { TestData } from 'launchdarkly-node-server-sdk';
let flags: TestData;
beforeEach(() => {
flags = TestData();
ldClient = LaunchDarkly.init('sdk-key', { updateProcessor: flags });
});
test('feature on', () => {
flags.update(flags.flag('newCheckout').valueForAll(true));
// ... test
});
test('feature off', () => {
flags.update(flags.flag('newCheckout').valueForAll(false));
// ... test
});
Run the actual SDK in a test mode against a mock backend or a real backend with a known config. Validates SDK behavior, not just the code that calls it.
For E2E with flags:
Avoid global flag changes during E2E — they affect parallel tests and other users.
For gradual rollouts:
on and off paths.Cross-reference production-testing for the monitoring side.
A/B tests are flag-driven experiments. Testing concerns:
The dirty secret of feature-flag use: most teams accumulate flags faster than they remove them. Tests on dead flag branches add cost without value.
Patterns:
A 500-flag codebase with 50 active and 450 dead is a maintenance disaster.
When helping with feature flag testing, ask:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aks-builds/quality-skills --plugin quality-skills56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.