Repository navigation
docs(agents): express form behaviour in the JSON schema before form code - #1766
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Deploy preview for remote-flows ready!
Deployed with vercel-action |
Contributor
|
Deploy preview for adp-cost-calculator ready!
Deployed with vercel-action |
Contributor
📊 Coverage Report✅ Coverage increased! 🎉
Detailed BreakdownLines Coverage
Statements Coverage
Functions Coverage
Branches Coverage
✅ Coverage check passed |
jordividaller
approved these changes
Oct 28, 2026
Merged
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
Agents working on forms now get a rule to put behaviour in the JSON schema first, and only write form code when the schema can't express it.
Why
A derived value (a second invoice day that follows the first) was first built with
useEffect+setValuein the form component. It could be done entirely in the schema, which also reaches partners using the headless hook. Nothing in the agent guidance said to try the schema first.What changed
Toggle details
.agents/rules/json-schema-form-usage.md: new "Express Form Behaviour in the Schema First" section. It gives an order to try (conditionals, computed values, a derived read-onlyconst, then form code), tells agents to search for a precedent first, and lists the gotchas found while doing this (aconstfield renders as a statement and only with a description, selects submit strings,vartakes dot paths).AGENTS.md: one line under "Conventions worth knowing" pointing at the rule.Screenshots
N/A
Related Resources
Testing
N/A.
pnpm run check-formatpasses.example/app in a browser: N/A, docs only🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes to agent rules; no runtime, API, or partner-facing package behaviour is modified.
Overview
Adds agent guidance to implement form behaviour (visibility, defaults, cross-field values) in JSON Schema before reaching for
useEffect/watch/setValuein*Form.tsx, so headless hook consumers get the same behaviour..agents/rules/json-schema-form-usage.mdgets a new Express Form Behaviour in the Schema First section: a ordered checklist (conditionals →x-jsf-logiccomputed values → computed read-onlyconst+ statement → form code with PR justification), pointers to search precedents injsfEngineSituations.tsand flow schemas, and gotchas (constfields render as statements, stringoneOfvalues, JSON Logic dot paths).AGENTS.mdadds a Schema first bullet under conventions linking to that rule.Reviewed by Cursor Bugbot for commit 263c6a7. Bugbot is set up for automated code reviews on this repo. Configure here.