Skip to content

[rig-sampler] docs(s.*): add @example annotations to s.array, s.object, and s.record#27

Merged
pelikhan merged 1 commit into
mainfrom
rig-sampler/08-extract-package-scripts-14d1b114445f90b1
Jul 23, 2026
Merged

[rig-sampler] docs(s.*): add @example annotations to s.array, s.object, and s.record#27
pelikhan merged 1 commit into
mainfrom
rig-sampler/08-extract-package-scripts-14d1b114445f90b1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Sample run: 08-extract-package-scripts

Sample: src/samples/08-extract-package-scripts.ts
Result: ✅ 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.enum and s.optional both have @example blocks that illustrate their usage.
  • s.array, s.object, and s.record — all used in this sample — had no examples at all.

The distinction between s.object (fixed keys) and s.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 @example JSDoc blocks to s.array, s.object, and s.record in skills/rig/rig.ts. Also expanded the s.record one-liner description to explicitly note "use for open-ended key→value maps" to distinguish it from s.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.

Generated by Daily Rig Sampler · 58 AIC · ⌖ 8.1 AIC · ⊞ 5.2K ·

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
pelikhan marked this pull request as ready for review July 23, 2026 09:56
@pelikhan
pelikhan merged commit 10453b1 into main Jul 23, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant