/be:feature-flagsfrom Backend Skills
Runtime feature flags stored in the database — release, ops and experiment flags (never permissions or plan gates), a typed registry with a coded default per flag, one evaluation ladder on the server, last-known values then defaults when the store can't be read, two cache tiers with a stated propagation bound, flags resolved behind Suspense into a provider, a 404 for a switched-off route, audited changes, owners and removal dates against flag debt, and scheduled windows. Use when adding, flipping, scheduling or retiring a flag.
Ships in Backend 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.
A flag is a switch an operator flips while the system runs, without a deploy. Every flag has a coded default that keeps the app working as it does today, and the system only departs from it when it has positively read a live answer: when in doubt, behave as before.
Before applying this skill, read the project's root AGENTS.md, the AGENTS.md closest to the files in question, and any doc they link for this skill's topic. Names, values and choices — budgets, tiers, tokens, voice, paths — come from those files, never from this skill.
The four kinds of toggle from Pete Hodgson's article on martinfowler.com, and where each lives here:
| Kind | Lives | Example |
|---|---|---|
| Release — temporary | this skill | a new dashboard, off until it's ready |
| Ops — long-lived | this skill | a kill switch that sheds an expensive feature |
| Experiment — temporary | this skill, or a vendor | an A/B test, with bucketing and exposure logged |
| Permission — per account | not a flag | roles → access-control; plans → plan-entitlements |
access-control), and what an account's plan includes is an entitlement (plan-entitlements).env). Don't put config in a flag to skip a deploy, and never a secret.Every flag code reads is in one registry with its kind and default, and the name union derives from it, so a typo is a compile error rather than a flag that quietly serves its default forever:
export const FEATURE_FLAGS = {
NEW_DASHBOARD: { kind: "release", default: false },
SEARCH_ENABLED: { kind: "ops", default: true }, // a kill switch: on unless an operator turns it off
} as const satisfies Record<string, { kind: FlagKind; default: boolean }>;
export type FeatureFlagName = keyof typeof FEATURE_FLAGS;
The default is what the app does today. A release flag defaults off (the new path isn't live); an ops flag guarding a working feature defaults on, so losing the store never switches the product off.
Names are UPPER_SNAKE_CASE, validated and never renamed — a rename orphans every code reference.
A new flag is two steps in one change: add it to the registry, then create its record through the admin API — the same route an operator uses, so the audit entry and cache invalidation happen. A seed script calls that API with create-if-missing; it never writes the store directly or overwrites what an operator set.
enabled, status (draft · published), targeting (an empty list means everyone), startsAt/endsAt, archivedAt, plus owner and, for release and experiment flags, a removeBy date.draft and off. status says whether the flag may be read publicly at all; enabled says whether it's on. A draft can be created, referenced in code and reviewed before anyone outside can see it.One function, evaluateFlag(name, context) (and a batch form), is the only read path. It never throws, and it answers:
enabled is off → false.true; the caller in the target → true; otherwise, or with no context to match → false.access-control).redis) in front of the store, the whole catalogue under one key, so an invalidation is one delete.redis).<Suspense>, in the route group's layout, never the root layout — a per-request context (the caller's country) makes the read dynamic. The catalogue itself is cached with a tag that every flag change expires (nextjs); the resolver is deduplicated per request.POST sub-route — publish, unpublish, archive, unarchive, enable, disable — each with its own permission verb (admin.feature-flag.update and the like) and audit entry recording who, when, and the value before and after (api-architecture, access-control). Rate-limited like any write.removeBy date, set when it's created; a scheduled check lists flags past their date, or fully on for weeks, and the owner removes them.testing).startsAt/endsAt is reconciled by the cron tick (api-architecture): it compares enabled with what the window implies and flips only when they differ, with an audit entry and a cache clear — idempotent, so a missed tick heals on the next.A worked example — the registry, the ladder and the provider — is in references/example.md.
<Suspense>; audit every change; give temporary flags an owner and a removal date; test both branches.The cache tier redis · the kill switch for the whole product maintenance-mode · permissions access-control · plan limits plan-entitlements · sub-routes, audit and the cron tick api-architecture · caching and Suspense nextjs · deploy-time config env · the store firestore · tests testing.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin beOther plugins' skills for the same job
22 skills in this plugin
/access-controlAccess control for a Next.js API on Firebase — roles, relationships and attributes (RBAC, ReBAC, ABAC) behind permission verbs and one pure can(); guards as the only gate, 404 before 403; tenant scoping; invitations; escalation limits; two-person approval and access reviews; stale claims; API-key scopes; share links and passcodes; where plan and flag checks sit; UI gates that only hide; and tests. Use when adding a permission, role, guarded route, API key, share link, or a control only some people see./access-control-auditManually invoked. Access-control audit — guards on every route and Server Action (BFLA), 404 before 403 and tenant scoping (BOLA), allowlisted writes and projected reads (BOPLA), verbs never role names, roles that add up, escalation and invitations, claims and revocation, sessions and sign-in, API keys and share links, the plan and flag order, UI gates, data rules and the tests. Verifies each finding and writes a prioritised report./api-architectureHow an API route is built in a Next.js API — the fixed order of rate limit, authorise, validate, delegate, audit, respond; thin routes over services; the response envelope and typed errors; caching headers; concurrent edits; long-running work; cursor pagination and allowlisted sorts; resource paths, versions, deprecation and state-transition sub-routes; and what every new route ships with. Cron, webhooks and audit logs are references. Use when adding, changing or reviewing a route handler or the API layer's structure.