document-component
Document a design system's Vue component with a page, live examples and a props table, using yarn component-docs. Use when asked to document, or add a page for, a component of a system in src/systems/
SKILL.mdsrc/modules/systems/skills/document-component/SKILL.md
GitHubDocument a component
The Systems README is the contract: file names, the page's order, how examples and props are read, and the documentation checks. Read it first.
Before you start
- Find the system,
src/systems/<key>/, and read itsAGENTS.md. Only an Admin or one of the system's maintainers changes a system:yarn studio whoamisays who you are. - The component needs a component file first:
components/<name>/<name>.vue(or a flatcomponents/<Name>.vue). For a component the app takes from a library (Endless Studios uses Nuxt UI'sUButtonandUCard), the file is a thin<script setup>wrapper that declares the props screens use, with a doc comment on each, and passes them on. Keep existing source, examples and pages.
Create the files
- Run
yarn component-docs <system> <component>to see what it would add, then again with--yes. It creates the missing<name>.examples.vueand<name>.mdfrom templates, moves a flat component into its own folder with anindex.ts, and never overwrites a file.
Fill them in
- The page,
<name>.md: atitle, a one-linedescription, and a## When to usesection. Addsource(one sentence: the library and version it comes from, or the app revision it was copied from) anddocs(the library's page for it) when it comes from elsewhere. Add other sections only when they help: variants, parts, accessibility, how screens use it. - The examples,
<name>.examples.vue: one<Example name="…">per variant, size or state worth seeing, named in PascalCase (WithIconsshows as "With icons"). Write each as a screen would, with the system's own components (<UButton>in Endless Studios), so Show code can be copied into a view. Don't wrap examples in frames or themes: the page renders each one alone in the system's own preview document. Replace everyundefinedthe template left for a required prop. - Props come from the component file's
defineProps: give each prop a doc comment (/** … */) and defaults inwithDefaults, so the table explains them.
Check
- Open
/systems/<system-id>/components/<name>(the system's permanent ID, fromsystem.ts'sstudioId). Every example should render; one that throws shows its error in its own frame. Look at each example; previews render light only, whatever colour modes the system declares. - The dev server's start and
yarn buildwarn about documentation gaps, the first five per system; a system withdocs: 'strict'fails the build until they're fixed.
Report the files you created and anything the component can't show yet. Don't call it done while examples hold placeholders.