Guide
How to build a design system with Pattern Dump, step by step, from an empty folder to a style guide you run, check and publish.
A design system starts with an empty folder and one command:
npx pattern-dump@latest init my-design-system
This guide takes you from there, one step per page. Read it in order: each step ends at something that works, and the next step starts from it.
What you need
- Node.js 22.22 or later. The
pattern-dumppackage requires it. - npm.
pd initrunsnpm installfor you, unless you tell it not to. - git, if you want a repository. Outside an existing repository,
pd initoffers to create one. Ifgit initfails, Pattern Dump says so and sets the project up anyway.
The commands
Pattern Dump is one npm package, pattern-dump, with one command-line tool, pd. npx pattern-dump@latest runs it before you have a project, and npx pd inside one. The guide uses four of its commands:
pd init- Sets up a project: a style guide, a site on an existing style guide, or both in one project.
pd dev- Runs the workbench while you work, at
http://localhost:4000unless you set a port. pd audit- Writes a report of what Pattern Dump finds in your components.
pd build- Writes the workbench as static files, and the site, when there is one.
Four more answer questions about your project, for you or for an agent: pd graph, pd describe, pd affected and pd mcp. The command-line reference has them.
pd help prints every command with its options, and pd --version the version you have.
The steps
Nine steps, in order:
- Create a style guide: set the project up with
pd init, and see what each file it writes is for. - Run the workbench: start
pd devand find your way around the workbench, where your components render. - Add a component: a template with its data, its documentation and a schema, then a variant.
- Style a component: a stylesheet of its own, a rule in the base layer and design tokens in your themes.
- Check your work: the Diagnostics tab while you work, and
pd auditfor the whole style guide. - Add a page to your site: a page in markdown, with a live example of your own component.
- A site on a style guide: the style guide as a package and the site as content only, in one repository.
- Publish: build both with
pd build, fix what it refuses, and publish them on any host. - Upgrade: move the pin to a new version, and read what changed first.
Where you end up
At the end you have a style guide in a project of its own: components with their docs, a workbench to see them in, an audit, a site built from the same components, and a static build to publish.
Start by creating a style guide.