Skip to content

docs(skills): fix the broken examples and add the check that keeps them fixed - #446

Merged
LeadcodeDev merged 1 commit into
mainfrom
docs/fix-skill-examples
Sep 29, 2026
Merged

LeadcodeDev merged 1 commit into
mainfrom
docs/fix-skill-examples

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #436. Part of #438.

Seven examples in SKILL.md and rules/ no longer validated against the binary a
generating model is supposed to produce files for.

File What was wrong
chromatic-aberration.md {"type":"icon","name":"zap"} — the field is icon, and it carries the set: "lucide:zap"
shape-draw-start-and-path-morph.md shape: {"type":"path","data":…} — the schema is {"path":{"data":…}}; and its expression used t, which the evaluator rejects by name (unknown identifier \t`) — it is $t`
motion-path.md repeated the same path spelling
whip-transition.md easing ease_in_out_cubic, which does not exist
geometry-safety.md, SKILL.md positional rustmotion validate scenario.json, and a render without -f — both rejected by the CLI
gradient-quality.md a background template with no preset
dynamic-depth.md easing on float_3d, which does not take one
text-component-parity.md, SKILL.md claimed gradient_text's stops share a background's format. They do not: gradient_text names the position position, a background names it offset, and the validator refuses the other. SKILL.md's gradient_text section mentioned neither stops nor the angle convention

Item 7 (halo interpolation claims) needs no edit: #445 makes the code satisfy what
halo-shapes.md and SKILL.md already said.

The eighth item is the one that matters

every_json_example_in_the_skill_documents_still_validates extracts every fenced
json block from both documents, wraps a bare component in a minimal scenario,
and runs the real validator — schema and attribute checks — over it. 108
examples covered.

Skipped: blocks marked **BAD (several files teach by showing the wrong form
first), blocks carrying an ellipsis placeholder, and transition objects, which are
not components. Filtered out: the errors the wrapper itself causes — a missing
asset path, an animation budget measured against an invented scene length. What
remains is a genuine vocabulary error, named with its file and line:

a generating model reads these documents as the source of truth, and 1 example(s)
no longer validate:
  chromatic-aberration.md:7 — (type=icon): invalid component — would be silently
  dropped at render: missing field `icon`

A first version of the test passed while an example was deliberately broken: it
called validate_scenario only, and the error above comes from
check_component_attrs. Both run now.

Reaching the validator from an integration test needed two functions re-exported
from cli. Exporting the whole commands module instead leaked private types
through cmd_render's signature, which clippy refuses.

cargo fmt --all --check clean · cargo clippy --workspace --all-targets --features rustmotion/studio -D warnings clean.

…em fixed

Seven examples in SKILL.md and rules/ no longer validated against the
binary a generating model is supposed to produce files for:

- chromatic-aberration.md used {"type":"icon","name":"zap"}; the field
  is `icon` and it carries the set, "lucide:zap".
- shape-draw-start-and-path-morph.md used
  shape: {"type":"path","data":…}; the schema is {"path":{"data":…}}.
  Its expression example used `t`, which the evaluator rejects by name --
  it is `$t`. motion-path.md repeated the same path spelling.
- whip-transition.md used the easing ease_in_out_cubic, which does not
  exist.
- geometry-safety.md and SKILL.md showed the positional
  `rustmotion validate scenario.json` and a render without -f, both
  rejected by the CLI.
- gradient-quality.md's background template had no preset.
- dynamic-depth.md put `easing` on float_3d, which does not take one.
- text-component-parity.md said gradient_text's stops share the format
  of a background's. They do not: gradient_text names the position
  `position`, a background names it `offset`, and the validator refuses
  the other. SKILL.md's gradient_text section mentioned neither `stops`
  nor the angle convention at all.

The eighth item is the one that matters: a test extracts every fenced
json block from both documents, wraps a bare component in a minimal
scenario, and runs the real validator over it. 108 examples are covered.
Blocks marked **BAD, blocks carrying an ellipsis placeholder, and
transition objects are skipped, and the errors the wrapper itself causes
-- a missing asset path, an animation budget measured against an
invented scene length -- are filtered out, so what remains is a genuine
vocabulary error naming the file and the line.

Reaching the validator from an integration test needed two functions
re-exported from cli. Exporting the whole commands module instead leaked
private types through cmd_render's signature, which clippy refuses.

Closes #436
@LeadcodeDev LeadcodeDev added the documentation Improvements or additions to documentation label Sep 29, 2026
@LeadcodeDev LeadcodeDev self-assigned this Sep 29, 2026
@LeadcodeDev
LeadcodeDev merged commit 3942ce9 into main Sep 29, 2026
4 checks passed
@LeadcodeDev
LeadcodeDev deleted the docs/fix-skill-examples branch September 29, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation errors found while verifying the latest features

1 participant