@subsimplicity/pi-extension-design-md
Pi extension for Google DESIGN.md visual identity specs
Package details
Install @subsimplicity/pi-extension-design-md from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@subsimplicity/pi-extension-design-md- Package
@subsimplicity/pi-extension-design-md- Version
0.1.0- Published
- Jun 2, 2026
- Downloads
- not available
- Author
- xz-subsimplicity
- License
- unknown
- Types
- extension
- Size
- 75.6 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
design-md
@subsimplicity/pi-extension-design-md is a pi extension that gives agents first-class access to Google's DESIGN.md visual identity specification while they work on UI code.
Features
- Finds the nearest
DESIGN.mdordesign.mdby walking up from pi's current working directory. - Injects DESIGN.md context into pi's system prompt for design-related requests only.
- Registers tools for onboarding, linting, exporting, previewing, and reading the formal DESIGN.md spec.
- Re-lints
DESIGN.md/design.mdafter piwriteoredittool changes and appends findings to the tool result. - Shows a
design:status indicator in pi:design: nonewhen no design file is found.design: ✓ DESIGN.mdwhen lint passes without warnings.design: ! DESIGN.mdwhen warnings are present.design: ✗ DESIGN.mdwhen errors are present or linting fails.
Prompt injection runs in auto mode. DESIGN.md context is added only when the user request appears related to UI/design work, including styling, frontend changes, components, layout, colors, typography, spacing, Tailwind/CSS, accessibility, and similar topics. The DESIGN.md tools remain available at all times.
Requirements
- Bun for local development in this repository.
- pi with extension/package support.
Install / use locally
From this package directory:
bun install
pi -e ./src/index.ts
To install from a local checkout so pi loads it automatically:
pi install ./path/to/design-md
Use a project-local install when you want pi to record it in that project's .pi/settings.json:
pi install -l ./path/to/design-md
Tools
| Tool | Purpose |
|---|---|
designmd_onboard |
Start a DESIGN.md onboarding flow with discovery questions, generation guidance, and optionally a valid starter DESIGN.md file. |
designmd_lint |
Validate a DESIGN.md file and return findings, resolved tokens, sections, and summary data. |
designmd_export |
Export tokens to a file as Tailwind v3 JSON (json-tailwind or tailwind), Tailwind v4 CSS @theme (css-tailwind), or DTCG JSON (dtcg). |
designmd_preview |
Generate a standalone HTML preview with palette, typography, spacing, radius tokens, component samples, and lint findings. |
designmd_spec |
Return the formal DESIGN.md specification, optionally with the active lint rules. |
Most tools accept either a path to a DESIGN.md file or raw content. When neither is provided, the nearest DESIGN.md/design.md from the current working directory is used.
Tool parameters
designmd_onboard:{ projectName?, productDescription?, audience?, personality?, existingBrand?, visualReferences?, constraints?, createStarter?, outputPath?, force? }- by default it returns onboarding questions and a starter draft in the tool result
- set
createStarter: trueto write a starter file, defaulting to./DESIGN.md - set
force: trueto overwrite an existing output file
designmd_lint:{ path?, content? }designmd_export:{ format, path?, content?, outputPath? }format:json-tailwind,tailwind,css-tailwind, ordtcgoutputPathdefaults to./design-md-tailwind.json,./design-md-tailwind.css, or./design-md-tokens.jsondepending on the format
designmd_preview:{ path?, content?, outputPath?, title? }outputPathdefaults to./design-md-preview.html
designmd_spec:{ rules?, rulesOnly? }
Commands
/designmd-onboard— start interactive onboarding by having the agent ask discovery questions one at a time without dumping the full brief into chat./designmd-onboard write [path]— write a valid starter file, defaulting to./DESIGN.md./designmd-onboard force [path]— overwrite an existing starter file./designmd-lint [path]— lint the nearest or specifiedDESIGN.md/design.md./designmd-export <json-tailwind|tailwind|css-tailwind|dtcg> [path] [--out outputPath]— export tokens from the nearest or specified design file directly to a file without dumping the export into chat./designmd-preview [output.html]— generate a visual preview HTML file from the nearest design file. Defaults to./design-md-preview.html./designmd-spec— add the DESIGN.md spec to the transcript./designmd-spec rules— add active lint rules only./designmd-spec with-rules— add the spec plus active lint rules.
Typical workflow
- Run
/designmd-onboardto have pi collect brand/audience/context answers interactively, or/designmd-onboard writeto create a starterDESIGN.md. - Add or update
DESIGN.mdin your project. - Run
/designmd-lintto validate it. - Ask pi to implement UI work; design-related prompts automatically receive DESIGN.md context.
- Run
/designmd-previewto inspect the identity in a browser. - Export tokens to files with
designmd_exportor/designmd-exportwhen wiring DESIGN.md into Tailwind, CSS theme variables, or design-token JSON.
Development
bun install
bun run typecheck
Useful scripts:
bun run typecheck— TypeScript type checking.bun run lint— run ESLint with fixes.bun run format— format the repository with Prettier.
Use Bun for package management and scripts in this repo.