/specpin:specpinfrom specpin
Authors and pins versioned business specs (rules, descriptions, acceptance criteria) onto web UI elements via JSON spec files and a local CLI sidecar. Use when documenting UI with .spec.json files or running specpin serve/validate.
Ships in specpin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Specpin is a Git-native knowledge layer. It pins business specifications onto
the elements of a web UI you already have, then renders them in the browser as
you hover or browse. It is NOT a code generator and does not write application
code. You (the coding agent) author JSON spec files in the consumer repo's
.specs/ directory; the specpin CLI serves and validates them; a browser
extension matches each spec's element fingerprint against the live DOM and
renders it.
Flow: .specs/ (in the repo) -> specpin serve (Go sidecar, localhost) ->
browser extension (match + render).
Your job: read the UI source, write <area>.spec.json files that conform to
schema v1, register them in manifest.json, and confirm specpin validate
exits 0.
No login, no API key, no model. The sidecar is localhost-only and prints its own
bearer token on serve. Contrast with agent CLIs that need auth: there is
nothing to authenticate here.
specpin --version (or npx @specpin/cli --version).npm i -g @specpin/cli (or use npx @specpin/cli ...)..specs/ directory, never a
temp directory.a. Scaffold (only if .specs/manifest.json is absent):
specpin init --project "<Name>" --domains <origin> where <origin> is
where the UI runs, e.g. localhost:3000. This refuses to overwrite an
existing manifest.
b. Identify the target element in the UI source (JSX/HTML/Vue/Svelte) and
decide the fingerprint approach. Specpin is non-intrusive by default: build the
fingerprint from signals the element already has (an existing
data-testid / data-spec-id, a non-generated id, an aria-label, or a
unique selector) and do NOT edit the app's source. Adding a data-spec-id is
an optional opt-in upgrade for the most resilient anchor, only when the project
agrees to small markup additions. See references/fingerprint-strategy.md.
c. Write <area>.spec.json (one file per page or feature). It has a group
string and a specs[] array. Each spec needs:
id: stable, unique within the project, e.g. "login-submit-btn".title, description: locale-keyed objects, never flat strings,
e.g. { "en": "Log in button" }. description must be non-empty.businessRules (optional): array of locale-keyed objects, one rule each.tags (optional): plain string array (not localized).links, verifiedBy, status (all optional provenance): links are
ticket/doc/PR refs ({label,url}, http/https); verifiedBy are repo-relative
test paths that declare the spec (checked to exist, never run — only list
real files); status is draft | approved | deprecated (omit = neutral).preferredDisplayMode (optional): tooltip | sidebar | modal
(overlay and inline-badge are reserved and fall back to tooltip).fingerprint: the element link (required). See the fingerprint reference.meta: set "source": "ai-generated" for specs you author, plus
createdBy, createdAt, updatedAt (RFC3339). Do NOT author
reviewedAt/reviewedBy — a human stamps those via Mark-reviewed.description and each businessRules item may use a small, safe Markdown
subset (bold, italic, [label](url) links, and lists in description).
See references/schema-authoring.md.
d. Register the file in manifest.json under specFiles[]. A spec file on
disk that is not listed (or listed but missing) trips a drift warning.
e. Validate: specpin validate (or specpin validate --dir <path>).
Exit 0 = done. Exit 1 = fix the reported FAIL lines and re-run. Exit 2 =
the check could not run (no manifest, wrong --dir).
f. Preview (optional): specpin serve prints a URL + token to paste into the
extension, then specs render live on their elements with SSE live-reload.
DO:
meta.source: "ai-generated" on every spec you author (output is meant to
be reviewed by a human).<area>.spec.json per page or feature; name it after the area.data-testid /
data-spec-id, a non-generated id, or an aria-label): it gives exact
matching with zero source changes.DON'T:
data-spec-id / data-testid unless the project
opts in. Specpin attaches to the UI you already have; adding an anchor is an
optional resilience upgrade, never a requirement. Default to synthesizing the
fingerprint from the existing markup.title / description / businessRules: both
validators reject "title": "Log in". Use { "en": "Log in" }.additionalProperties: false..specs/.specpin validate outputEach file prints OK <file> or FAIL <file> followed by indented error lines,
then a summary N files checked, M error(s). Drift between manifest.specFiles
and on-disk files prints warning: lines (or FAIL: under --strict-manifest).
FAIL block,
fix the JSON, re-run..specs/, no manifest.json, or --dir
pointed at the repo root instead of .specs/). Fix the path or run init.This skill ships inside @specpin/cli and is version-synced with the CLI. To
fetch the latest copy without installing:
https://unpkg.com/@specpin/cli@latest/skill/SKILL.mdhttps://unpkg.com/@specpin/cli@latest/skill/references/<file>.md$schema autocomplete: https://specpin.ohnice.app/schema/v1.json
(also https://unpkg.com/@specpin/spec-schema/schema/v1.json).Compare npm view @specpin/cli version against your installed
specpin --version; refresh the skill if they differ.
references/schema-authoring.md: the full v1 shape (Manifest, SpecFile, Spec,
LocalizedString, fingerprint, meta), a complete minimal valid example, and the
Markdown subset.references/fingerprint-strategy.md: the test-id-first decision tree, how to
derive each fingerprint field from source, and page scoping (pageUrl) for
multi-screen apps.references/cli-commands.md: every command, its flags, and exit-code
semantics.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
specpin, business-specs, ui-documentation, spec-json, sidecar
Other plugins' skills for the same job
npx claudepluginhub lamngockhuong/specpin --plugin specpin2 skills in this plugin