Decide whether work needs a feature flag (any change to product behavior users can see does), then declare it, roll it out (per organization, for everyone, cloud or self-hosted), revert or kill it. Use for any user-visible behavior change, and when finishing or removing a rollout.
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Default: flag what users see. Any change to product behavior that users can see ships behind a feature, so it can be turned off without a deploy. Work users won't notice as a behavior change ships directly and is reverted with a normal revert if needed.
When a flag is warranted, it is a feature in the registry, declared before any feature code, off.
Registry: packages/features/src/flags/ (package @openwork/features), one
file per feature. Adding that file is the only edit that declares a feature;
no shared list is edited by hand, so two PRs that each add a feature do not
conflict. The rules live in
resolve.ts and are tested in resolve.test.ts
(pnpm --filter @openwork/features test).
A feature is rolled out, and reverted, along these dimensions, resolved in
this order by one function (resolveFeature) everywhere it is checked:
cloud, self_hosted). Fixed in code.config.features.<key>)./admin. No override inherits the organization setting./admin./admin without a deploy.Steps 2, 5 and 6 are set per deployment in /admin (Features page and each
organization's row) or with the admin MCP tools den_list_features,
den_set_feature_rollout and den_set_org_capability.
Every change made in /admin or by those tools (on, off, reset, kill switch,
restore) is appended to the feature_change table with who made it and when.
/admin shows the latest one on each row, e.g. "Last change: On for this
organization by Omar McAdam · 26 Oct 2026, 14:03". Deploy-time operator locks
(DEN_FEATURE_*) are not changes and are not recorded.
Member overrides are scoped to a membership, never a user globally. Pass { userId } for caller-specific checks; organization-owned background policy without a person intentionally uses only organization state. The member editor supports true/false and null to restore inheritance.
Yes, whenever the change alters product behavior that users can see, in the desktop app, Den (including organization admin screens), MCP Apps or the gateway:
These ship without a flag:
/admin: the pages we use to run the deployment (Features,
organizations, grants, plans, sandboxes, recovery) and the admin MCP tools.
Platform admin access already gates them.Not a feature either: something that only keeps older clients working
(compat shim with a removal condition), something worked out from what is
configured (derive it in code), or a setting that changes how something
works rather than whether people get it (put it in env.ts / Helm config.<area>).
If you are unsure, add a flag. When you ship without one, say in the PR why users won't see a behavior change.
Create packages/features/src/flags/new-thing.ts. The file name is the key
in kebab-case: new-thing.ts declares newThing.
import { defineFeature } from "@openwork/features/define"
export default defineFeature({
label: "New thing",
description: "What a person gets, in words they see in the product.",
category: "workbot",
added: "2026-10-26",
since: "2026-10",
author: "your-github-handle",
docs: "docs/features/new-thing/README.md",
deployments: ["cloud", "self_hosted"],
default: false,
})DEN_FEATURE_NEW_THING, the API field and stored rows./admin lists it under, one of FEATURE_CATEGORIES in packages/features/src/define.ts. Pick the one a platform admin would look under; add a group there only when none fits.YYYY-MM-DD. It never changes (since moves when the entry changes). Shown in /admin as "Added 26 Oct 2026".["cloud"] for a cloud-only feature).true./admin › Features with a link to their profile./admin › Features as Internal docs. Internal docs live in the repo's docs/ folder (e.g. docs/features/new-thing/README.md), never the published packages/docs site. Write it in the same PR:
docs/features/new-thing/new-thing.png) and referenced with a relative path. Screenshot the real app, on and off if the difference matters.Then run pnpm features:sync and commit packages/features/src/all-flags.ts
with the new file. That generated list is the only shared file a new feature
touches; if it conflicts in a merge, keep either side and run
pnpm features:sync again. To remove a feature, delete its file and run the
same command. The Helm chart in git lists no feature keys: the publish
workflow writes them into the chart it packages.
OpenAPI and SDK outputs are ignored build artifacts: CI regenerates, lints and
typechecks them from the source change. pnpm sdk:build generates them locally
when needed; use pnpm den:contract for a forced generation with disposable
local MySQL. Do not commit generated contracts.
Before shipping, answer: what happens when the kill switch is used? In-flight work, stored data, and what the person sees must survive a revert. For example, a new engine switches only when nothing is running, falls back on failure, and keeps history readable after a revert.
Only through the registry. Never read organization metadata or an environment variable to decide whether a feature is on.
await organizationFeatureEnabled(orgId, "newThing", { userId })const features = await getOrganizationFeatures(orgId, { userId })requireFeature("newThing") after orgMemberRoute(); answers 404 feature_disabled{ database: tx, lock: "share" }orgFeatureEnabled(orgContext, "newThing") (from app/(den)/_lib/den-org.ts), backed by GET /v1/org featuresGET /v1/features; a missing key means offGated UI follows DESIGN.md P4: show a locked entry point with a plain reason rather than silently removing it, when the person could act on it.
/admin › organization › Features shows, per feature, how many members have
it on, who used it in the last 7 and 30 days, and when each person last used it.
requireFeature(key) is a use.markFeatureUsed(key) (den-web app/(den)/_lib/feature-usage.ts,
desktop apps/app/src/app/lib/den.ts) at the action that actually exercises
the feature, never on render of shared chrome.markFeaturesUsed once at the chokepoint where that work happens for a member, as automation dispatch,
the Your agent wake and slack_send_as_bot do./admin › Features (/admin/feature-usage) shows the same per feature across organizations, and whether it
works. A background feature sets outcomes: true in the registry and registers one reader in
ee/apps/den-api/src/feature-outcomes/readers.ts that counts outcomes from the table it already writes (runs,
succeeded, failed, skipped by reason, delivered, per day and organization). The typecheck and
test/feature-outcomes.test.ts fail until the reader exists. Never add a usage table for this.
/admin)./admin › Features. Organizations can still be turned off one by one.default: true, then delete the entry and every check. pnpm features:check asks for a decision six months after since unless the entry is permanent.Evals turn features on per organization through the admin API:
enableOrganizationCapabilities(seed, admin, { newThing: true }) in
evals/worlds/dashboards.ts.
DEN_*_ENABLED env var for a product surface (CI rejects new ones).organization.metadata.capabilities (CI rejects it)./admin control, a /v1/org field, or a Helm line for a feature.deployments on purpose./admin-only control behind a feature.author, or a new one without an internal doc.Name the feature and its deployments under "How is this implemented?", e.g.
"Behind newThing (cloud and self-hosted, off), safe to kill: falls back to
the old flow." Link its internal doc. Run pnpm features:check before
pushing: it fails when a feature has no author, when a new feature has no
docs, or when the doc or an image it shows does not exist. Features declared
before docs were required are listed in FEATURES_WITHOUT_DOCS in
scripts/features-sync.mjs; when you add docs for one, remove it there.
different-ai/openwork
b79b984
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.