write-document
Create or edit a Markdown document inside a prototype, with its title, Mermaid diagrams, links and embedded views. Only while the Documents module is on; shared system context and the Manual have thei
Files1
View on GitHubSKILL.mdsrc/modules/document/skills/write-document/SKILL.md
GitHubWrite a document
The Documents README is the contract; read the sections you need (frontmatter, links, embeds).
Before you start
- Find the prototype's folder,
src/prototypes/<contributor>/<folder>/. Work only in your own prototypes unless you are an Admin:yarn studio context src/prototypes/<contributor>/<folder> --jsonsays whether you may (canEdit). - Keep context that more than one prototype needs in the system's own context, not in a prototype document.
Write
A document is a
.mdfile anywhere in the prototype outside helper folders (names starting with_). Nothing registers it.Write plain Markdown: no HTML, no components. HTML you type shows as text; an HTML comment stays hidden and can hold a note for the next editor.
Give it a title:
titlein the frontmatter, or an opening# Heading. Adddescriptionfor a line under it andtoc: truefor "On this page" in a long document.Draw diagrams with a
mermaidfence, never an image file, and give each anaccTitleandaccDescrso screen readers can describe it:```mermaid flowchart LR accTitle: Sign-in flow accDescr: A returning member signs in, then lands on Home. Start --> Home ```Link to the prototype's files with paths relative to the document, with their extension so other Markdown readers follow them too:
[the brief](./notes/Brief.md).To show a view next to the text, link it with image syntax on its own line:
(wrap a path with spaces in angle brackets:). A named state is embedded by its permanent address,. A standalone diagram () shows as a compact drawing; documents embedded this way show as cards. Only files of the same prototype can be embedded; refer to the original view instead of copying its code into the document.
Identity
- Leave
studioIdto the studio. While the dev server runs, a new document in your own prototype gets one in its frontmatter within a second. Otherwise runyarn studio identify src/prototypes/<contributor>/<folder> --json, then--yes. Never change or copy an existingstudioId.
Check
- Open the document in the studio (its address is
/prototypes/<prototype-id>/artifacts/<document-id>) and look at its links, diagrams and embeds. A card saying "Not found" names what to fix. A document that can't be read shows its error; fix the file and it reads again by itself. - Run
yarn studio identity-audit; it reports frontmatter that is never closed and atocthat isn'ttrueorfalse, as the build does. - Report the document's address and anything you couldn't resolve.