Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Add, roll out, promote, graduate, or remove Kandev runtime feature flags and release toggles across the backend and frontend. Use whenever a task mentions a feature flag, release toggle, staged rollout, kill switch, or graduating a flag.
.claude/skills/kdlbs-runtime-feature-flags/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 116% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -58% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -1% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 26% | 0% |
Use this checklist for temporary release toggles and risky features. It is self-contained: do not depend on the agent having read an ADR or public docs. Read apps/backend/AGENTS.md and apps/web/AGENTS.md when the change touches those subtrees.
HTTP, WebSocket, MCP, agent-tool, or background-job entry points.
disabled path preserves the existing behavior and fails closed before deriving data, writing state, dispatching work, or exposing a capability.
then profile default. An explicit environment variable locks the admin UI.
features.<camelCaseKey>,KANDEV_FEATURES_<UPPER_SNAKE_CASE>, a Go FeaturesConfig field, its JSON tag, and the matching frontend key. Never add a parallel flag map or switch.
registry. Before relying on retirement, verify that retiredRuntimeFlagIdentities and its collision/completeness test exist; if they do not, add that runtimeflags infrastructure before removing a live flag.
Update these layers in the same change:
KANDEV_FEATURES_<NAME> under features: in theroot profiles.yaml; use prod: "false", dev: "false", and e2e: "false" for a release toggle unless the task explicitly documents a test-only exception.
bool field with explicit mapstructure andjson tags to apps/backend/internal/common/config/config.go.
apps/backend/internal/runtimeflags/registry.go: key, env var, kind, label, description, stability, risk, and restart/mutability metadata. The registry definition is metadata-only; add the key/env constants and update OptionsFromConfig, ValuesFromConfig, and ApplyStatesToConfig in runtimeflags/config.go for typed config wiring.
narrow composition boundary. Do not only hide the frontend; direct callers must receive the legacy behavior or a safe rejection.
apps/web/lib/state/slices/features/types.ts. Use useFeature() for client surfaces and notFound() from the relevant server layout/page when a route subtree must be unavailable. SSR data must remain fail-closed.
and frontend surface. Run the existing registry/profile/frontend contract tests; add focused tests for normalization, route visibility, and disabled side-effect prevention where applicable.
The completeness checks require exact equality between profile keys, typed backend fields/registrations, and frontend default keys. They do not discover semantic call sites, so trace the feature's HTTP, WebSocket, MCP, agent, worker, and startup paths manually.
explicit environment variable, restart when metadata requires it, and test real workflows.
prod profile value to "true" forthe next release. Retain the registry entry and backend/frontend gates as a kill switch so operators can still disable the feature.
After the feature has proven itself as the default-on behavior, make the new behavior unconditional and remove the live flag end-to-end:
FeaturesConfig field;useFeature() checks, and route gates;coverage.
Before removing the registration, verify the append-only retiredRuntimeFlagIdentities registry and its collision/completeness test exist, then append the exact key and environment variable in registry.go:
go{key: "features.example", envVar: "KANDEV_FEATURES_EXAMPLE"},
Do not delete old runtime_flag_overrides rows as part of graduation. Unknown rows are intentionally inert, and the retired identity prevents stale operator state from reactivating a future feature. Never reuse either the key or env var.
Run the focused checks appropriate to the change:
pnpm install --frozen-lockfile from apps/ beforeany pnpm-based checks, tests, lint, or commits.
apps/backend: go test ./internal/runtimeflags ./internal/common/config ./internal/profiles;make -C apps/backend lint;apps: pnpm --filter @kandev/web test -- lib/state/slices/features/features-contract.test.ts;apps/web: pnpm run typecheck and pnpm run lint;git diff --check before handoff.Report the flag key/env identity, profile defaults, every gated entry path, disabled/enabled test evidence, restart requirements, and whether the change is still a kill switch or has been fully graduated.
Other measured skills in the registry, with their headline benchmark lift.