docs(skills): teach the real feature-flags surface, not a fake defineStack key#3311
Merged
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
os-zhuang
marked this pull request as ready for review
July 19, 2026 17:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
## Feature Flagssection ofskills/objectstack-platform/SKILL.md, which taughtdefineStack({ featureFlags: [...] })— an authoring surface that does not exist. The block was deliberately left untagged by thecheck:skill-examplesgate (#3224) because the fix was structural, not a rename.Closes #3248
What was wrong (verified against the spec)
featureFlagsis not a key onObjectStackDefinitionSchema(packages/spec/src/stack.zod.ts— none of its 42 top-level keys isfeatureFlagsorfeatures).defineStackstrict parsing silently strips unknown keys, so the example config was a no-op at runtime and TS2353 at compile time for consumers.FeatureFlagSchema[]appears in the protocol isKernelCapabilitiesSchema.features→ObjectStackCapabilities.system.features— the runtime capabilities descriptor (an introspection/read surface), never referenced by the definition schema. Feature flags have no authoring home inobjectstack.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.environment: ['production']was the wrong shape and value:FeatureFlagSchema.environmentis a scalarz.enum(['dev','staging','prod','all'])(default'all').The rewrite
FeatureFlag.create()from@objectstack/spec/kernel(compile-checked flag values) and the flags' protocol home,ObjectStackCapabilities.system.features.defineStackkey and why authoredfeatureFlags:is a silent no-op.feature_flagssettings manifest (@objectstack/service-settings,OS_FEATURE_FLAGS_*env overrides) and auth capability gates (requiresFeature→PUBLIC_AUTH_FEATURES) — explicitly distinct fromFeatureFlagSchema.<!-- os:check -->per the issue's definition of done, so the gate covers it from now on.Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_011omKdw59exYDNh3GekqFZq
Generated by Claude Code