Contributing
How to add to the system so the compiler picks it up and consumers can use it. After any change, run check_design_system and fix what it reports.
How the compiler sees the project
- Global CSS is
styles.css(an@importmanifest). Tokens and@font-faceare read from its closure. - A component = a
Name.d.ts(PascalCase) plus a siblingName.jsxin the same folder. It compiles into_ds_bundle.jsand is exposed atwindow.PrismDesignSystem_39d121.Name. - A specimen / doc card = an
.htmlwhose first line is<!-- @dsCard group="…" viewport="WxH" name="…" subtitle="…" -->. It renders in the Design System tab, grouped bygroup. - Never hand-edit
_ds_bundle.js,_ds_manifest.json, or_adherence.oxlintrc.json— they are regenerated every turn.
Add a component
- Create
components/<group>/<Name>.jsx. Plain React. Styling = tokens-only, applied via aprism-*className. - Add its CSS to
components/<group>/<group>.cssand ensure that file is@imported incomponents/components.css. - Write
components/<group>/<Name>.d.ts— exact prop types (this is the contract). - Write
components/<group>/<Name>.prompt.md— what it's for, when to use it, a code example, and aStatus:line (maturity). - Add or update the group's
.card.htmlspecimen (load../../_ds_bundle.js, read from the namespace). - Add the component to the README index.
check_design_system→ fix → repeat until clean.
Naming: PascalCase exports; prism-<component> / prism-<component>-<part> classes. Only capitalised exports reach the window namespace.
Add a token
- Put it in the right
tokens/*.cssfile (colour →colors.css, etc.). Define both light and dark values if it's a semantic colour. - Reference existing primitives (
var(--brand-500)) rather than new raw values; introduce a new palette ramp only when no existing hue fits, and define it in OKLCH. - If you rename a token, alias the old name for one minor cycle (see MATURITY).
- Document it (token card and/or README token index). Validate contrast for any text/border colour.
Add a pattern
A pattern is a composition (a workflow, a form layout, a permission flow). Build it from existing components; if you find yourself writing one-off markup twice, promote it to a component first. Document the recipe in PATTERNS.md (or the relevant docs/ guide) with a @dsCard if it warrants a visual.
Add a product signature
Signatures live in tokens/signatures.css and re-skin a subtree via data-signature="…".
- Add a canonical hue to the
--domain-*set incolors.css. - Add
[data-signature="<name>"] { --sig: var(--domain-<name>); }— the shared[data-signature]block derives the rest and adapts to light/dark automatically. - If the hue is light (e.g. amber), override
--accent-onto a dark value so on-accent text passes contrast. - Note the recommended
data-densityin a comment and add the signature to the signatures card.
Add a template
Templates are starting folders consumers copy. Create templates/<slug>/<Slug>.dc.html via dc_write with <!-- @template name="…" description="…" --> as the first line of the body and <helmet><script src="./ds-base.js"></script></helmet>. Keep every file the template needs inside templates/<slug>/.
Demo data & assets
- Real photos in kits are reference-only (Pexels), declared in
assets/demo/and excluded from the package. Never depend on them in a shipped component. - Prefer CSS gradient/placeholder fallbacks so a component looks intentional even if an image 404s.
Review expectations
- Passes all applicable QA gates.
- Tokens-only styling; correct maturity status; docs updated.
check_design_systemclean.- Semver-appropriate (see MATURITY); breaking changes carry a migration note.