feature-flag-test-harness
БесплатноБез исполняемых скриптовНе проверенUse when a feature behind a flag must be tested both on and off, or several flags interact. Runs the same suite under the minimum set of flag combinations…
от testland★ 18 звёзд на GitHubОб этом скилле
feature-flag-test-harness
Overview
A test that hits the production flag service is non-deterministic by definition - the answer depends on whoever toggled the flag last. And a test that asks "did we test the feature with the flag off?" needs both runs side by side.
This skill builds a harness that:
- Replaces the production OpenFeature provider with an in-memory provider the test owns (openfeature-providers).
- Enumerates the relevant flag combinations (not the full 2^N cartesian product - the long tail isn't worth running).
- Runs the suite once per combination, as a separate CI shard.
- Aggregates results into a matrix the reviewer can read.
The skill's reference architecture targets OpenFeature because it standardizes the SDK across LaunchDarkly, Flagsmith, ConfigCat, self-hosted, etc. - the harness works identically against any provider (openfeature-overview).
When to use
- A new feature lives behind a release toggle and the team needs to verify both code paths (toggle off = old behavior unchanged; toggle on = new behavior correct).
- An experiment toggle has multiple variants (A / B / control) and each needs an integration-test pass.
- An ops toggle (kill switch / degradation flag) needs a "service fails open" pass.
- The flag set already exists in OpenFeature, LaunchDarkly, Flagsmith, ConfigCat, GrowthBook, or any SDK with an in-memory / test provider.
If the team has only one or two flags and a flat "always on for
test" config works, this skill is overkill - set the test
environment's flag values once in setup and stop there.
How to use
- Classify each flag by Hodgson category (Step 1) and mark which flag pairs actually interact.
- Enumerate the minimum cover - single-flag variants plus the declared interaction tuples, never the full 2^N product.
- Wire the OpenFeature in-memory provider so the suite never hits the production flag service - see references/provider-wiring.md.
- Generate the combination matrix and run one CI shard per combination - see references/matrix-and-ci.md.
- Keep
fail-fast: falseon the matrix so every failing combination surfaces in one run, not just the first. - Aggregate each shard's JUnit XML into a per-combination pass/fail matrix the reviewer reads at a glance.
- Split cadence: PR runs only combinations whose flags touch changed files; nightly runs the full matrix.
Step 1 - Classify each flag (Hodgson taxonomy)
Per feature-toggles, flags fall into four categories with different test needs:
| Category | Lifespan | Dynamism | Test combinations needed |
|---|---|---|---|
| Release toggle | Days - weeks | Static at deploy | OFF (current) and ON (new behavior). 2 runs. |
| Experiment toggle | Days - weeks | Per-request dynamic | One run per variant (A / B / control). |
| Ops toggle | Long-lived | Per-request dynamic | ON (normal) and OFF (degraded / kill). |
| Permissioning toggle | Years | Per-request dynamic | One run per relevant user cohort. |
For experiment and permissioning toggles, the harness simulates each cohort by seeding the EvaluationContext (feature-toggles).
Don't run all 2^N combinations. Author marks the interactions worth testing:
# tests/flag-matrix.yaml
flags:
new_checkout: { kind: release, test: [off, on] }
promo_codes: { kind: release, test: [off, on] }
ranking_experiment: { kind: experiment, variants: [control, treatment_a, treatment_b] }
payment_kill_switch: { kind: ops, test: [on, off] } # off = degraded
interactions:
# The author asserts these flag pairs interact; run their combinations explicitly.
- [new_checkout, promo_codes]
# Ranking experiment doesn't interact with checkout; don't bloat the matrix.
The harness enumerates every flag's variants individually plus the listed interaction tuples, never the full 2^N product. See the Worked example for the run count this schema yields.
Provider wiring, matrix generation, CI
Wire the in-memory provider so the suite reads flag values from
FLAGS_JSON instead of the production service (Node shown; Python and
Java variants in the reference):
// tests/harness/flag-harness.ts
import { OpenFeature, InMemoryProvider } from '@openfeature/server-sdk';
export function withFlags(flags: Record<string, unknown>) {
return OpenFeature.setProviderAndWait(new InMemoryProvider(
Object.fromEntries(Object.entries(flags).map(([k, v])
Установить feature-flag-test-harness в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл feature-flag-test-harness?
Use when a feature behind a flag must be tested both on and off, or several flags interact. Runs the same suite under the minimum set of flag combinations with an OpenFeature in-memory provider, as labeled CI matrix shards, and reports results per combination.
Как установить скилл feature-flag-test-harness?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл feature-flag-test-harness запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic