From spec-creator
Use this skill when the user wants to create or expand formal design specifications for an app, package, or codebase. Triggers on phrases like "create a spec", "spec out this app", "write design docs", "formalize the architecture", "document the design", "spec for <component>", "promote this to a global spec", "make repo-wide spec", or when the user references using another project's specs as a template ("use ../foo/specs as a template"). Also triggers when the user asks to add a per-app spec under an existing global spec layer, or to extract repeated content into a global cross-cutting spec. The output is a numbered directory of markdown files plus a JSON Schema sidecar, layered as repo-wide globals + per-app specs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spec-creator:spec-creatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A skill for writing canonical design specifications: numbered, layered, cross-linked markdown that defines what exists in the current branch.
A skill for writing canonical design specifications: numbered, layered, cross-linked markdown that defines what exists in the current branch.
A spec is the canonical definition of what exists in the current branch. Not a plan, not a wishlist, not an MVP cut. Body sections describe code that is checked in. Aspirational content — "to be tuned later", "deferred", "next iteration" — lives only in the closing Assumptions / Decisions / Open questions block of each page.
If something the spec describes does not exist in the code, that's a divergence. Flag it; do not paper over it with "deferred at MVP". Plans to resolve divergence are a separate workflow handled by other skills.
This rule shapes every section. A Routes section lists routes that exist. A Plugins mounted section lists plugins that the app actually mounts. A Database shape section describes the schema of the IndexedDB store as it is, not as it will be.
Skip if the request is for a README, a runbook, a tutorial, an API reference, or any prose-first doc. Specs are about structural design — entities, lifecycles, contracts, conventions — not how-to walkthroughs.
The skill is a four-phase process. The phases are sequential; don't skip the investigation. The bulk of the value of a good spec comes from the understanding the writer has of the code before they write a word.
Before writing anything, build the understanding:
docs/<app>/, docs/, README.md files, CHANGELOG.md. Don't reinvent what's already documented; extend or formalize.docs/specs/ or docs/<other-app>/specs/ already exists, read them. Match the shape and the cross-link style.docs/specs/) versus the per-app layer (docs/<app>/specs/). See §Layered structure below.The investigation phase often reveals divergence (the code doesn't match a previous doc, or two apps disagree on the same convention). Flag these to the user before writing — the spec should describe one consistent reality.
Sketch the file set before writing. Specs use flexible numbered files — the numbering is a reading order, not a schema. Pick a set that matches the project's surface area.
A typical small app:
00-overview.md
01-domain-model.md
02-app-shell.md
03-runtime.md (e.g. editor runtime, query engine)
04-persistence-and-export.md
05-design-system.md (link to global)
06-architecture.md (link to global)
07-development.md (link to global)
canonical-types.schema.json
A more complex app might split further: 02-routes.md, 03-api-contract.md, 04-storage.md, 05-jobs.md, 06-auth.md, 07-design-system.md, 08-architecture.md, 09-development.md. Numbering is local to the directory; the global layer has its own (or no) numbering.
Always include:
00-overview.md).canonical-types.schema.json) for any spec that has typed entities, even small ones.Always include if applicable:
For the global layer (docs/specs/), the typical set is:
architecture-principles.mddevelopment-guidelines.mdcanonical-types.schema.json (shared types only — Id, Timestamp, Url, common envelopes)For each file, follow the conventions in §File conventions and §Section conventions below.
Write one file at a time. Cross-link as you go. Keep an internal map of "claims that need a Decision entry at the bottom" — every non-obvious choice ends up in the closing block.
If the spec layers on a global spec (e.g., per-app architecture builds on docs/specs/architecture-principles.md), open with a one-paragraph Read first pointer rather than restating the global rules. See §Layered structure.
This phase is mandatory and easy to skip — every iteration of this skill has missed at least one of the steps below when not made explicit. Treat each as a checkbox before declaring the spec done.
docs/README.md (creating it if absent) to index every spec file and directory you created or moved. This includes:
docs/specs/foo.md) — add it to the global-specs list.docs/<app>/specs/) — add the app to the per-app section.docs/specs/<name>.md or under docs/<app>/specs/, the very next edit is docs/README.md.docs/<app>/README.md for per-app specs — open with a pointer to the global specs at docs/specs/, then list the per-app spec set.(other-spec.md), […](../specs/foo.md)) resolves to a real file.canonical-types.schema.json entity referenced in prose actually exists in the schema (and vice versa — every schema entity is described somewhere in prose).Assumptions and open questions section, add it before declaring done. The closing block is mandatory; even (None at this stage.) under a heading counts.Do not declare the spec complete until all five steps are done. The checklist at references/checklist.md has the full pre-handoff verification.
NN-name.md, two-digit prefix, kebab-case suffix. Number is reading order; pad with leading zero.architecture-principles.md, not 01-architecture-principles.md).canonical-types.schema.json (Draft 2020-12).Every spec file (markdown only — not the JSON Schema) opens with:
# <Title>
**Status:** Draft · **Date:** YYYY-MM-DD · **Owner:** <Name>
The status is Draft, Implemented, or Deprecated. The date is the spec's last meaningful revision (today's date for new specs). The owner is the human accountable for the spec's correctness.
For specs with explicit scope, add · **Scope:** Repo-wide (global) or · **Scope:** apps/editor (per-app). Scope is optional; include it on global specs and on per-app specs that share a name with a global one.
Every spec file closes with ## Assumptions and open questions, divided into three subheadings:
## Assumptions and open questions
**Assumptions**
- A bullet list of facts about the world that the spec relies on but does not control. ("IndexedDB is available", "the user is on a desktop browser".)
**Decisions**
- *Item.* **Choice.** One- to two-sentence rationale, ideally pointing at the code or commit.
**Open questions**
- *Item.* The question. What's blocking resolution. (Or: `(None at this stage.)`)
This block is the only place aspirational, "to be tuned", or hypothetical content belongs. The body of every spec page describes what is.
Aim for spec files between 100 and 300 lines of markdown. Above 300 lines, consider splitting (a spec that mixes routes + storage + design probably wants three files). Below 50 lines, consider merging (a sub-section, not its own page).
The architecture-principles and development-guidelines pages are the common exceptions — they tend to be longer because they hold many cross-cutting decisions.
Different spec types have different section sets. The skeletons below are starting points — adapt to what the code actually warrants.
00-overview.mdThe entry point. A reader should be able to read only this file and know what the spec covers, what the system does, and where to go next.
# <Project> — <Surface> Design Overview
header
The <surface> is <what it is>. <One sentence on the system shape.>
This document is the entry point. Detail pages are linked from each section.
---
## Problem
<Two short paragraphs on what the system solves and why existing options don't.>
---
## Goals
<Numbered list of what the code achieves, today.>
## Non-goals
<Bullet list of what the code deliberately does NOT do.>
---
## System shape
<ASCII diagram of the moving parts, drawn so a reader can follow the data flow.>
<One paragraph naming each box.>
---
## Detail pages
| Page | Topic |
|---|---|
| [01-domain-model.md](01-domain-model.md) | … |
| … | … |
---
## Scope summary
| Area | Implementation | Notes |
|---|---|---|
| <Area> | <What's in the code> | <Constraints> |
(Replace the old "MVP cut" matrix. The scope summary describes implemented surface, not future plans.)
---
closing block
No "MVP" anywhere. Goals describe what the code achieves now, Non-goals describe what's intentionally absent.
01-domain-model.mdDefines entities, IDs, relationships, lifecycles.
# 01 — Domain Model
intro paragraph
## ID scheme
<rule for IDs; table of prefixes>
## Entities
### <Entity> (`<prefix>_`)
<one-paragraph description>
<bullet list of fields>
(repeat per entity)
## Relationships
<ASCII diagram of cardinalities>
## Lifecycle / state machines
<ASCII diagram per stateful entity>
## Required query patterns
<table: query name → access pattern>
closing block
02-…, 03-…)Pattern: Responsibilities · Contract · Flow · Layout · closing block.
# NN — <Component>
intro paragraph
## Responsibilities
<numbered list>
## Contract / API / Routes
<table: method/path → purpose>
## Flow / Lifecycle
<ASCII diagram>
## Implementation layout
<file tree or pointer to where it lives>
closing block
architecture-principles.md (global)Defines how the code is organised. Hexagonal layering, monorepo layout, dependency graph, language conventions, frontend stack baseline. Long file (200–400 lines is normal). Closes with the standard block.
development-guidelines.md (global)Toolchain, code style, defensive coding, version control conventions, testing pyramid, repo hygiene, definition of done, AI-agent rules. Long file. Closes with the standard block.
When a per-app 06-architecture-principles.md builds on a global docs/specs/architecture-principles.md, open with a Read first pointer:
# 06 — Architecture (editor-specific)
> **Read first:** [`docs/specs/architecture-principles.md`](../../specs/architecture-principles.md). That document defines the cross-cutting rules. This page only covers the <app>-specific shape under those rules.
This page records how the <app> applies the global principles: …
Then describe only the per-app deltas. Don't restate the global rules.
canonical-types.schema.json (sidecar)JSON Schema Draft 2020-12. $defs for each entity. Per-app schemas $ref the global schema for shared types.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.dev/schemas/<scope>-canonical-types.schema.json",
"title": "<scope> canonical types",
"description": "Authoritative shapes for <scope>'s domain entities.",
"$defs": {
"<Entity>": { … }
}
}
The global schema (docs/specs/canonical-types.schema.json) holds only truly shared types: Id, Timestamp, Url, Email, Bytes, Milliseconds, ErrorEnvelope, NonEmptyString. A type belongs in the global schema only when at least two apps reference it.
Two layers, with strict rules:
docs/specs/) — repo-wide, cross-cutting. Architecture principles, development guidelines, shared types schema.docs/<app>/specs/) — app-specific. Numbered detail pages, app schema.Rules:
the editor exposes /api/opengraph).we chose IndexedDB because …).what is the migration strategy when …).Every non-obvious choice is recorded in the closing block as a Decision:
- *Document size cap.* **5 MiB serialised JSON.** Rough envelope: a long-form essay with embedded images encoded as data URLs would bump against this; plain prose is well below.
Format:
A spec without a Decisions list is a spec that hasn't done enough thinking. If you're writing the body and find yourself wanting to insert "we picked X because…" inline, lift it into the Decisions list and reference forward (see Decisions §<name>).
description: "Reserved for next iteration" is a lie. If the field doesn't exist, leave it out and put the gap in Open questions.(None at this stage.) is a valid Open Questions entry.User: "The architecture page in docs/editor/specs/06-architecture-principles.md is mostly cross-cutting. Make it global."
docs/specs/architecture-principles.md with the cross-cutting content, scoped Repo-wide.docs/editor/specs/06-architecture-principles.md to a thin per-app version that opens with the Read first pointer and only covers the editor-specific deltas.docs/README.md (creating it if needed) to index the new global spec.User: "Add a spec for the website app at apps/website modelled on the editor specs."
docs/editor/specs/ end-to-end as the template.apps/website/ source: routes, layouts, build config.docs/README.md to add the website specs.references/section-templates.md — Detailed section skeletons for overview, domain-model, architecture, dev-guidelines, canonical-types schema. Read when you need a starting point for a specific page type.references/voice-and-decisions.md — Worked examples of the Decisions pattern and the voice rules. Read when phrasing feels awkward.references/checklist.md — Pre-handoff checklist (no MVP language, all cross-refs resolve, closing block on every page, schema sidecar matches body claims). Read after writing, before declaring done.Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub antstanley/skills --plugin spec-creator