[rig-sampler] docs(s.*): add @example annotations to s.array, s.object, and s.record#27
Merged
pelikhan merged 1 commit intoJul 23, 2026
Conversation
Sample 08 (extract-package-scripts) uses all three helpers. Previously only s.enum and s.optional had @example in their JSDoc. Adding examples to s.array, s.object, and s.record makes the schema helpers self-documenting and helps users choose the right helper (especially s.record vs s.object). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
marked this pull request as ready for review
July 23, 2026 09:56
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.
Sample run:
08-extract-package-scriptsSample:
src/samples/08-extract-package-scripts.tsResult: ✅ Passed, 1 turn, 0 repair loops
Output schema used:
s.object({ scriptsByName: s.record(s.string), summary: s.string, relatedFiles: s.array(s.string) })What the run revealed
The sample completed cleanly in one turn with no schema validation failures. While reviewing the rendered output schema and the existing JSDoc, I noticed:
s.enumands.optionalboth have@exampleblocks that illustrate their usage.s.array,s.object, ands.record— all used in this sample — had no examples at all.The distinction between
s.object(fixed keys) ands.record(open-ended key→value map) is a common source of confusion for new users. Without an example, there's no inline guidance on when to prefer one over the other.Change
Added
@exampleJSDoc blocks tos.array,s.object, ands.recordinskills/rig/rig.ts. Also expanded thes.recordone-liner description to explicitly note "use for open-ended key→value maps" to distinguish it froms.object.The file-header compact summary lines for these three helpers were also updated to include brief usage hints.
No behaviour change — purely documentation. All 128 unit tests pass.