Skip to content
Primer printing platePrimer

Use Primer in another app

The goal is for an agent in a fresh project to build a recognizable Primer workspace, inbox or reading page using local files. The kit includes the design standard, three illustrated recipes, a copyable screen for each recipe, the control stylesheet those screens use, a skill, the public token contract with resolved values, web foundations, Geist and its license, and a standalone checker. The app owns its content and behavior. It copies the screen and links the control stylesheet instead of inventing spacing or controls.

Download the kit from this catalog build. In the target app’s root, extract the ZIP into your project’s skill directory. The archive contains one folder named primer-design.

Terminal window
mkdir -p .agents/skills
unzip primer-design.zip -d .agents/skills
node .agents/skills/primer-design/check.mjs --verify

Commit the extracted folder with the app to pin it for offline use. Add this line to the app’s AGENTS.md, or to the instruction file your editor reads.

For interface work, read .agents/skills/primer-design/SKILL.md. Copy the recipe’s screen specimen, keep its control classes, and compare the rendered screen with its desktop and phone references.

Try “Build a news inbox and article view using this project’s design standard.” A tool that only reads Markdown can start directly at .agents/skills/primer-design/DESIGN.md. Search contract.json for an exact token or control. Example HTML and Fable source are optional references outside the kit.

Use the web workspace recipe for browser layouts at every width. The Fieldpost trial documents the decision.

Copy or serve the kit’s tokens.css, styles/type.css and assets/fonts/ in the same relative arrangement. Load the two stylesheets in that order. Set data-primer-theme="system" on the document root and the primer class on the app. Keep the font notice with the font. An existing app can map its semantic variables to these roles incrementally.

Run the checker on the paths that actually contain the app’s styles and components. For example, from an app with a src directory, run the following.

Terminal window
node .agents/skills/primer-design/check.mjs --verify ./src

Verification checks the snapshot’s files against its lock. The source scan checks names and deprecated usage, and reports literal colors and sizes. Complete the visual and interaction checks in the selected recipe.

From Primer, run npm run design:pack. The command writes a ZIP in work/design-packs/. Its filename contains the SHA-256 of the enclosed primer.lock.json. The lock records the Primer version and an individual hash for every payload file. Two builds from identical inputs produce the same archive. Each catalog build also offers its snapshot at a convenient download URL. Retain the copy used by an app for future reproduction.

Each catalog build also publishes the current lock at design/current.json, beside the zip. From an adopted kit, compare without replacing anything:

Terminal window
node .agents/skills/primer-design/check.mjs --upstream

The default status address is https://otherhours-primer.pages.dev/design/current.json. A matching revision leaves the local kit in place. A different revision names the waiting Primer version and every file whose hash changed, then stops. The command does not download the zip or edit the kit. If the status cannot be read, the check says so and the local kit remains the one in use.

For an upgrade, extract the new ZIP into an empty directory, compare the two locks and guides, replace only the adopted kit directory, and verify it against the app. Review affected views before committing. A kit upgrade and a product-wide redesign are independent decisions.

Maintain the standard and recipes in docs/, Fable reference images in docs/design-screens/, tokens in tokens/, and component guidance in specs/. Record the reference revision, fixture, viewport and visual decision when replacing an image. Build and exercise a fresh consumer when the guidance changes.