mix petal.gen.skill_snapshot (petal_components v4.16.1)

Copy Markdown View Source

Regenerates the GENERATED files bundled with the petal-design skill from the compiled modules' Phoenix.Component.__components__/0 metadata:

  • skills/petal-design/data/schemas.json - the full schema snapshot, the same shape and sorted-key encoding as the MCP extractor's output
  • skills/petal-design/references/components.md - the one-line-per-component inventory derived from those schemas

It also stamps petal_components_version: in the skill's SKILL.md frontmatter, so one run refreshes every version marker the snapshot tests pin (test/petal/skill_snapshot_test.exs).

Run from this repo at release time, right after bumping @version in mix.exs and alongside the MCP schema sync:

mix petal.gen.skill_snapshot

Output is deterministic apart from generated_at: JSON keys are sorted (Jason.OrderedObject) and components sort by name, so a regeneration diff shows real schema changes only.

Summary

Functions

Every {module, component} pair the snapshot must cover, as inspect/string pairs. Shared with test/petal/skill_snapshot_test.exs so the completeness guard and the generator can never disagree about what "all components" means.

Functions

live_component_names()

Every {module, component} pair the snapshot must cover, as inspect/string pairs. Shared with test/petal/skill_snapshot_test.exs so the completeness guard and the generator can never disagree about what "all components" means.