Skip to content

docs(skills): teach the real feature-flags surface, not a fake defineStack key - #3311

Merged
os-zhuang merged 1 commit into
mainfrom
claude/platform-feature-flags-docs-sj3rxu
Jul 19, 2026
Merged

docs(skills): teach the real feature-flags surface, not a fake defineStack key#3311
os-zhuang merged 1 commit into
mainfrom
claude/platform-feature-flags-docs-sj3rxu

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

Fixes the ## Feature Flags section of skills/objectstack-platform/SKILL.md, which taught defineStack({ featureFlags: [...] }) — an authoring surface that does not exist. The block was deliberately left untagged by the check:skill-examples gate (#3224) because the fix was structural, not a rename.

Closes#3248

What was wrong (verified against the spec)

  1. featureFlags is not a key on ObjectStackDefinitionSchema (packages/spec/src/stack.zod.ts — none of its 42 top-level keys is featureFlags or features). defineStack strict parsing silently strips unknown keys, so the example config was a no-op at runtime and TS2353 at compile time for consumers.
  2. The only place FeatureFlagSchema[] appears in the protocol is KernelCapabilitiesSchema.featuresObjectStackCapabilities.system.features — the runtime capabilities descriptor (an introspection/read surface), never referenced by the definition schema. Feature flags have no authoring home in objectstack.config.ts; nothing in the codebase produces or evaluates them at runtime (the schema's only consumers are its own unit tests). Adding a top-level authoring key was therefore deliberately not done here — that's a spec/product decision for the surface owner (per the issue), and it would ship authored-but-inert config.
  3. environment: ['production'] was the wrong shape and value: FeatureFlagSchema.environment is a scalar z.enum(['dev','staging','prod','all']) (default 'all').

The rewrite

  • Teaches the surface that actually exists: FeatureFlag.create() from @objectstack/spec/kernel (compile-checked flag values) and the flags' protocol home, ObjectStackCapabilities.system.features.
  • States explicitly that this is not a defineStack key and why authored featureFlags: is a silent no-op.
  • Points readers who want live, resolvable toggles to the real surfaces: the feature_flags settings manifest (@objectstack/service-settings, OS_FEATURE_FLAGS_* env overrides) and auth capability gates (requiresFeaturePUBLIC_AUTH_FEATURES) — explicitly distinct from FeatureFlagSchema.
  • Re-tags the block with <!-- os:check --> per the issue's definition of done, so the gate covers it from now on.

Verification

pnpm --filter @objectstack/spec build
pnpm --filter @objectstack/spec run check:skill-examples
# ✅ 20 skill examples type-check against @objectstack/spec
# (was 19 — the new block at skills/objectstack-platform/SKILL.md:1045 is now covered)

🤖 Generated with Claude Code

https://claude.ai/code/session_011omKdw59exYDNh3GekqFZq


Generated by Claude Code

…Stack key
The Feature Flags example in skills/objectstack-platform/SKILL.md authored
`defineStack({ featureFlags: [...] })` — a key that does not exist on
ObjectStackDefinitionSchema (strict parsing silently strips it; consumers
copying it hit TS2353), and `environment: ['production']` is the wrong shape
(scalar enum) and an out-of-enum value ('prod' is correct).
Rewritten against the surface that actually exists:
- `FeatureFlag.create()` from `@objectstack/spec/kernel` for compile-checked
flag values;
- the flags' one protocol home, the runtime capabilities descriptor
(`ObjectStackCapabilities.system.features`);
- an explicit warning that this is NOT a defineStack key;
- pointers to the live toggle surfaces readers may actually want (the
`feature_flags` settings manifest and `requiresFeature` auth gates).
Re-tagged the block with `<!-- os:check -->` so check:skill-examples covers
it going forward (gate passes: 20 marked examples).
Closes#3248
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011omKdw59exYDNh3GekqFZq
@vercel

vercelBot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specBuildingBuildingPreview, CommentJul 19, 2026 5:26pm

Request Review

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation size/s labels Jul 19, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 19, 2026 17:37
@os-zhuang
os-zhuang merged commit 5f33524 into mainJul 19, 2026
13 of 15 checks passed
@os-zhuang
os-zhuang deleted the claude/platform-feature-flags-docs-sj3rxu branch July 19, 2026 17:37
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(skills): platform feature-flags example teaches a non-existent authoring surface

2 participants

@os-zhuang@claude