Wrap a new backend endpoint in the TypeScript SDK (packages/sdk), or record it as skipped. Use when `just coverage` fails, or after adding an endpoint to a Rust service.
日本語の概要は準備中です。原文の説明を表示しています。
Add, read, or remove a feature flag in the web app (`defineFlag`, PostHog, `ENABLE_*` env flags, `useFeatureFlag`, `isFeatureEnabled`, `ShowFeatureFlag`) or the Rust backend (`crates/feature_flags`, config switches). Use when gating, rolling out, or killing a feature, or when asked to "flag it".
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Web registry: apps/web/src/lib/core/constant/featureFlags.ts. Backend: see
section 5. A flag is never an authorization check.
| Remote | Env-only | |
|---|---|---|
| Source of truth | PostHog in deployed envs | default, optionally overridden by env |
| Discriminator | key present | no key |
env | optional local override | optional override of default |
default | omit / undefined to fall through to PostHog | required |
| Readers | useFeatureFlag, ShowFeatureFlag, isFeatureEnabled | isFeatureEnabled only |
Most product rollouts are remote. Use env-only when there is no PostHog flag and never will be (compile-time / local kill switch).
Ask before assuming. If the user said "flag it" and did not mention PostHog, prefer remote and confirm.
Add one defineFlag next to its neighbors. Do not add ENABLE_*_FLAG /
_OVERRIDE / ENABLE_*() triples or a raw PostHog string at the call site.
key (remote): kebab-case, named after the question (enable-foo,
disable-browser-turso-cache). Export the object in matching camelCase
(enableFoo).env: the name after VITE_, e.g. 'ENABLE_FOO' → VITE_ENABLE_FOO.default: used when env is unset. On a remote flag, false is a real
override and skips PostHog. On-in-dev / on-in-local is
DEV_MODE_ENV || undefined or LOCAL_ONLY || undefined, not the boolean
itself.!isFeatureEnabled(disableX)).if (ENABLE_FOO) must be the boolean:
defineFlag({ env, default }).enabled. The object is always truthy.export const enableFoo = defineFlag({
key: 'enable-foo',
env: 'ENABLE_FOO',
default: DEV_MODE_ENV || undefined,
});
export const ENABLE_BAR = defineFlag({
env: 'ENABLE_BAR',
default: false,
}).enabled;
The PostHog MCP (in the repo's MCP config) can look up existing flags and their rollout. Don't create or change a PostHog flag without asking which project and rollout the user wants, and never change a production rollout without explicit permission.
const foo = useFeatureFlag(enableFoo); // component: foo().enabled
<ShowFeatureFlag flag={enableFoo}>{...}</ShowFeatureFlag>
isFeatureEnabled(enableFoo) // queries, helpers, env-only
A thin useXFlag wrapper around useFeatureFlag(flag) is fine when several
call sites share the same read. Compose flags in the wrapper (calendar search
requires calendar UI), not on the flag object.
useFeatureFlag / ShowFeatureFlag take a RemoteFlag. Passing an env-only
flag is a type error.
These are the mistakes past flagged launches had to fix:
isFeatureEnabled returns
false and useFeatureFlag returns { loading: true }. A cold deep link
must wait for loading to clear rather than fall back to the off path (see
block-database's load), or the page flashes or degrades.isFeatureEnabled / useFeatureFlag inside
a reactive scope, never snapshot it at mount or module load.default: true)
can no longer be turned off from PostHog; use undefined so PostHog stays in
control.crates/feature_flags (read its README.md):
construct PostHogFeatureFlags once at the composition root, load one
FlagSnapshot per authenticated user id, and read it synchronously. A failed
load returns Err; the caller decides the fallback, explicitly. The crate has
no callers yet, so the first one also wires the adapter and its config.MacroConfig bools with a default, configured in Doppler (see the config
rule), not PostHog.When a flag is fully rolled out, delete the defineFlag, every reader, and the
off path in the same change, and say which PostHog flag can be archived.
useFeatureFlag call sites unless
you are already changing that flag or were asked to.resolveFeatureFlag for new flags, a global
flags.foo map, .use() / .Show() on the object).まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Wrap a new backend endpoint in the TypeScript SDK (packages/sdk), or record it as skipped. Use when `just coverage` fails, or after adding an endpoint to a Rust service.
日本語の概要は準備中です。原文の説明を表示しています。
Add or change an in-app feature tour (a view's guided flyover) in the web app. Use when adding a tour to a view, adding or editing tour steps, pointing a step at a new control, or when a step's target needs something opened first.
日本語の概要は準備中です。原文の説明を表示しています。
Post-change checks before handing off. Works out which checks apply from the files changed (directory AGENTS.md Checks sections and matching .agents/rules), runs or verifies each, and reports pass/fail/skipped. Use before saying work is done, before pushing, or when asked to audit or verify a change.
日本語の概要は準備中です。原文の説明を表示しています。
Enforce hexagonal architecture in the Rust backend. Use before modifying crates/ or Rust services, especially inbound axum/tool/listener adapters, domain services/ports, outbound adapters, authorization, permissions, database access, or external clients.
日本語の概要は準備中です。原文の説明を表示しています。
Use when adding collaborative markdown, notes, or descriptions to a feature with collab surfaces. Covers parent entities, service entry points, authorization, content storage, and lifecycle.
日本語の概要は準備中です。原文の説明を表示しています。
Build a new AI tool end-to-end — Rust implementation, toolset wiring, infra, schema generation, and frontend UI.
日本語の概要は準備中です。原文の説明を表示しています。