docs(skill): react-tier component prop contract (AI authors props, not guesses)#2477
Merged
Conversation
… not guesses) Defines + generates the contract for the components injected into kind:'react' page source: a single source-of-truth JSON (contracts/react-blocks.contract.json) listing each block's props — name, type, kind (data/controlled/callback), required, description — and a generator (build-ref.mjs) that emits the AI-facing reference (references/react-blocks.md). The objectstack-ui SKILL now points the build agent at it: 'do not guess props — read the contract'. Phase 1 covers the core blocks (ObjectForm, ListView, ObjectGrid, ObjectMasterDetailForm, ObjectChart, Block) accurately from the real registry inputs + component callback/controlled types. data props mirror the registry inputs (the html-tier contract); controlled/callback are the React surface. Follow-up: more blocks + an os build prop-validation gate (phase 2).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| const contract = JSON.parse(readFileSync(join(here, 'react-blocks.contract.json'), 'utf8')); | ||
| const out = join(here, '..', 'references', 'react-blocks.md'); | ||
|
|
||
| const esc = (s) => String(s).replace(/\|/g, '\\|'); |
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.
Answers the gap: when AI writes a
kind:'react'page, does it know each component's params? Now yes — from a generated contract, not by guessing.skills/objectstack-ui/contracts/react-blocks.contract.json— per-block props with name, type,kind(data/controlled/callback), required, description.contracts/build-ref.mjs→references/react-blocks.md(the AI-facing reference).Phase 1 covers ObjectForm / ListView / ObjectGrid / ObjectMasterDetailForm / ObjectChart / Block, authored accurately from the real registry
inputs+ the components' callback/controlled types.dataprops mirror the registry inputs (the html-tier contract);controlled/callbackare the React interaction surface. Follow-up: more blocks + anos buildprop-validation gate (phase 2).🤖 Generated with Claude Code