From spec-print
Build software from a printspec — a deterministic agent-focused spec that produces equivalent software wherever 'printed'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spec-print:spec-printThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A **printspec** is like a 3D printer file for software: any agent, anywhere, reading the same spec must produce equivalent working software. When this skill is invoked, your job is to **build** the software (print command) or **reverse-engineer the spec** (create command) — not just render docs.
A printspec is like a 3D printer file for software: any agent, anywhere, reading the same spec must produce equivalent working software. When this skill is invoked, your job is to build the software (print command) or reverse-engineer the spec (create command) — not just render docs.
/spec-print <spec> — Print (build) software from an existing printspec. See "Print Command" below./spec-print create — Reverse-engineer a printspec from the current codebase. See "Create Command" below.Every printspec — whether written by hand or generated by create — MUST follow this format exactly. Sections are required unless marked optional. Order is fixed.
# <Project Name> Printspec
> **Version:** <semver>
> **Runtime:** <e.g. Node 22+, Python 3.12+, Bun 1.x>
> **Primary datastore:** <e.g. SQLite, Postgres, in-memory>
> **Output directory:** <relative path, e.g. `./src` or `.`>
One-paragraph description of what this software does and its core purpose.
---
## Entities
For each entity:
### <EntityName>
| Field | Type | Required | Default | Notes |
|-------|------|----------|---------|-------|
| id | UUIDv7 | yes | generated | primary key |
| ... | ... | ... | ... | ... |
**Indexes:** `<field>` (unique), `<field, field>` (composite), ...
**Lifecycle states:** `DRAFT → ACTIVE → ARCHIVED` (list all valid states)
---
## Functional Requirements
Numbered `FR-NNN`. Priority: P1 (must), P2 (should), P3 (nice).
| ID | Priority | Behavior | Inputs | Outputs | Errors |
|----|----------|----------|--------|---------|--------|
| FR-001 | P1 | <what it does> | <params> | <return value> | <error codes> |
| FR-002 | P1 | ... | ... | ... | ... |
---
## Command / API Surface
| ID | Method | Path / Name | Request Schema | Success | Errors |
|----|--------|-------------|----------------|---------|--------|
| CMD-001 | POST | /resource | `{ field: string }` | 201 | validation_error |
| CMD-002 | GET | /resource/:id | — | 200 | not_found |
---
## State Machine
### <EntityName> States
```
INITIAL → STATE_A [guard: <condition>]
STATE_A → STATE_B [guard: <condition>]
STATE_B → TERMINAL [guard: <condition>]
STATE_A → FAILED [guard: any error]
```
**Terminal states:** `TERMINAL`, `FAILED`
**Invalid transitions:** any not listed above must throw `invalid_transition`
---
## Determinism Contracts
These rules are absolute. Any agent printing this spec must produce identical behavior.
| Contract | Rule |
|----------|------|
| ID format | UUIDv7, generated at creation time |
| Timestamp format | RFC3339 UTC milliseconds |
| Name validation | `/^[a-z][a-z0-9_-]{2,63}$/` |
| Sort order | `<field> ASC NULLS LAST` |
| Default page size | 20 |
| Max retries | 3, exponential backoff base 500ms |
| Rate limit | <N req/min per user> |
---
## Error Contract
This set is closed. No agent may add or remove codes.
| Code | HTTP | Meaning |
|------|------|---------|
| `validation_error` | 400 | Input failed schema validation |
| `not_found` | 404 | Resource does not exist |
| `duplicate_resource` | 409 | Unique constraint violated |
| `invalid_transition` | 422 | State machine guard rejected |
| `rate_limit_exceeded` | 429 | Too many requests |
| `internal_error` | 500 | Unexpected failure |
---
## Test Plan
Tests MUST be implemented in this order: broken → failure → happy.
| ID | Order | Fixture | Scenario | Assertion |
|----|-------|---------|----------|-----------|
| T-001 | broken | `fixture-missing-field.json` | missing required field | throws `validation_error` |
| T-002 | failure | `fixture-duplicate.json` | duplicate name | throws `duplicate_resource` |
| T-003 | happy | `fixture-valid.json` | valid creation | returns entity with id |
---
## Design & Style
Describes the visual and UX language of the application. Any agent printing this spec must produce UI that matches this profile.
| Attribute | Value |
|-----------|-------|
| UI framework | e.g. React, Vue, SwiftUI |
| Component library | e.g. shadcn/ui, MUI, Tailwind UI, none |
| CSS approach | e.g. Tailwind v4, CSS Modules, styled-components |
| Color scheme | e.g. neutral base + blue accent; dark mode first |
| Typography | e.g. Inter, system-ui; scale: sm/base/lg/xl |
| Spacing system | e.g. 4px base unit, Tailwind default scale |
| Border radius | e.g. rounded-md globally, pill on badges |
| Icon set | e.g. Lucide, Heroicons, custom SVG |
| Motion / animation | e.g. subtle fade transitions, no motion if prefers-reduced-motion |
| Layout pattern | e.g. sidebar + content, stacked cards, data table |
| Tone | e.g. minimal, dense, playful, enterprise |
| Notable conventions | e.g. destructive actions always red, empty states always illustrated |
---
## Appendix — Constants
These values are law. Never change them in code.
```
MAX_NAME_LENGTH = 64
MIN_NAME_LENGTH = 3
DEFAULT_PAGE_SIZE = 20
MAX_PAGE_SIZE = 100
MAX_RETRIES = 3
BACKOFF_BASE_MS = 500
```
Invocation: /spec-print create [<output-path>] [-- <scope/focus guidance>]
When create is the argument, reverse-engineer a canonical printspec from the current codebase.
Using the Glob, Grep, and Read tools, systematically discover:
package.json / pyproject.toml / Cargo.toml / etc. for name, version, runtime, dependencies*.prisma, *.sql, migration files, ORM models, type definitions representing persisted entities)status, state, enum fields with lifecycle names)constants, config, or containing uppercase SCREAMING_SNAKE_CASE valuestailwind.config.*, globals.css, theme files, component library config, design tokens, and representative UI components/pages to understand visual language, layout patterns, color scheme, typography, spacing, and interaction styleExplore broadly first (Glob for structure), then drill into key files (Read for content). Do not stop at surface level — follow imports to find the real logic. For design, read at least 3–5 representative UI components or pages to establish patterns — do not infer style from config alone.
From what you found, infer:
If something cannot be confidently inferred, mark it ⚠ INFERRED: with your best guess, or ⚠ UNKNOWN: if truly opaque.
Produce the full printspec following the Canonical Printspec Format above exactly. Rules:
FR-001, FR-002, ...; CMD-001, ...; T-001, ...⚠ INFERRED: annotation inline⚠ SPEC GAP: annotationWrite the spec to <output-path> if provided, otherwise to <project-name>.spec.md in the current directory.
Then print a summary:
SPEC CREATED
============
Source: <cwd>
Output: <output path>
Entities: <count>
FRs: <count> (P1: N, P2: N, P3: N)
CMDs: <count>
States: <list all state machine states found>
Errors: <count codes>
Tests: <count> (broken: N, failure: N, happy: N)
Constants: <count>
⚠ Inferred values: <count> — review before treating as authoritative
⚠ Spec gaps: <count> — listed inline in spec
Invocation: /spec-print <path-to-spec> | <spec-content> [-- <additional guidance>]
The user may append natural language guidance after the spec path/content using -- as a separator:
/spec-print path/to/spec.md -- use Postgres instead of SQLite; skip all tests for now
/spec-print path/to/spec.md -- add rate limiting to all endpoints
If additional guidance is present:
Amendments: sectionAmendments applied:⚠ GUIDANCE CONFLICT: and ask the user to clarify before proceedingThe user will provide either:
.spec.md or .md file — read it with the Read tool first.Internally extract and hold onto:
Before writing a single file, produce a concise build plan:
BUILD PLAN
==========
Project: <name>
Output directory: <cwd or path from spec>
Structure:
<list the files/modules you will create, one per line>
Build order:
1. Data model / schema
2. Core domain logic + state machine
3. Services / business logic
4. API / command surface
5. Error handling (all codes)
6. Tests (broken → failure → happy)
7. Entry point / wiring
Constants to enforce: <list>
Determinism contracts to enforce: <list>
Amendments: <list any active additional guidance, or "none">
Ask the user to confirm the output directory and tech stack if not specified in the spec. If the spec specifies a runtime (e.g. "Node 22+", "SQLite"), use it.
Implement the software. Rules:
constants file/module — they are lawAfter building, self-check against the spec:
BUILD VERIFICATION
==================
✓/✗ All FRs implemented: FR-001 FR-002 ...
✓/✗ All CMDs implemented: CMD-001 CMD-002 ...
✓/✗ All error codes present: validation_error duplicate_resource ...
✓/✗ State machine complete: QUEUED STARTING RUNNING PAUSED COMPLETED FAILED CANCELLED
✓/✗ All tests written: T-001 T-002 ... (broken→failure→happy order)
✓/✗ All constants defined: <list>
✓/✗ Determinism contracts: name regex, ID format, sort order, defaults
✓/✗ Amendments applied: <list each guidance item and how it was applied, or "none">
PRINT COMPLETE
==============
Source: <path or "inline">
Files written: <count>
FRs: <count> CMDs: <count> Tests: <count> Constants: <count>
This software was produced from a printspec. Another agent printing the same spec should produce equivalent software.
Flag any spec gaps (missing fields, ambiguous behavior, underspecified transitions) as ⚠ SPEC GAP: items at the end of the verification block.
npx claudepluginhub sethwebster/ai-marketplace --plugin spec-printGuides GitHub Spec-Kit CLI integration for 7-phase constitution-based spec-driven feature development, managing .specify/specs/ directories with phases: Constitution, Specify, Clarify, Plan, Tasks, Analyze, Implement.
Transforms ideas into structured specifications (requirements, design, tasks) before implementation. Use when building features, fixing bugs, refactoring, or designing systems.
Guides specification-driven AI development workflows by breaking projects into 2-4 hour sessions using 13 commands like /plansession, /implement, /validate, and /phasebuild.