Repository navigation
docs: document items catalogues in pattern authoring and user guides - #3114
Conversation
markscott-ms
left a comment
There was a problem hiding this comment.
Review of the docs. Two items are critical:
🔴 Critical — merge order with #3270. cli.md documents an empty anyOf answer as valid. #3270 makes this work, and it is still open. If this PR merges first, a user who passes --option-choices '{"optional-components":[]}' gets a calm validate crash on the generated architecture. Only the PR body states the merge order. Please merge #3270 first, or remove the empty-array text until it lands.
🔴 Critical — unwanted CLI release. Commit 5be24e6 uses docs(calm-ai). cli/.releaserc.json has a {type: docs, scope: calm-ai, release: patch} rule. If the branch merges without a squash, this commit publishes a CLI patch release with no code change. Squash-merge with the PR title, or reword the commit to docs: or docs(docs).
The inline comments are smaller accuracy issues in the instructions.
461718a to
330953b
Compare
Description
A pattern may declare nodes and relationships under
itemsas well asprefixItems. The documentation did not say so. The agent authoring guide describedprefixItemsin sixteen places and never mentioneditems. The user pages taught the positional model only, and no page showed anoptionsrelationship in JSON.Part of #2859. This PR does not document an empty answer to a decision. On
main,calm validatecrashes on that architecture, and #3270 is still settling which rule applies. That text follows #3270.What the user documentation gains
core-concepts/patterns.md. The pattern template offers an optional cache and message queue initems, and explainsprefixItems,minItems,itemsandmaxItemsone by one. A new section compares the three ways a pattern can say "optional", and explains theoptionsrelationship: it is the fifth relationship type, it connects nothing, and the architecture keeps the decision.working-with-calm/cli.md. A new subsection says what a choice can name.What the authoring guide gains
A worked catalogue example, a table that chooses between
prefixItemsanditemsby obligation, and five rules foritems. A decision stays inrelationships.prefixItems, andcalm generatebuilds anitemsmember only when a selected choice names it.How the examples were checked
Every result the pages state was run with the real CLI. For the core-concepts page, I extracted the JSON blocks from the page and ran them: the template generates and validates with no errors or warnings, and the template with the decision added as the text says generates and validates for no choice, one choice and both choices.
That check found one gotcha. Without
"type": "object"onrelationship-type,calm generateomits the decision from the architecture. The page says to keep it.Type of Change
No code changes.
Affected Components
cli/)calm/)calm-ai/)calm-hub/)calm-hub-ui/)calm-server/)calm-widgets/)docs/)shared/)calm-plugins/vscode/)Commit Message Format ✅
docs: document items catalogues in pattern authoring and user guidesdocs: address PR #3114 review feedbackdocs(docs): remove the empty-answer text that depends on #3270Testing
The examples were validated and generated with the CLI, as above. The Docusaurus site builds with
onBrokenLinks: 'throw'.Checklist
🤖 Generated with Claude Code