spectastic
Spec-driven development · single-file HTML

Think It? Build It!Right

A structured spec lifecycle that emits one beautiful self-contained HTML file per artifact. Your spec reads like a quiet essay — packing tables, diagrams, diffs, and decision matrices. Rendered, reviewable, revision-safe.

View on GitHub Install it →

right — spec-driven and verifiable, not vibe-coded. Intent is decided and reviewed before a line of code ships.

Why HTML

Markdown specs are tiring to read.

Markdown-based spec tooling produces dense documents that reviewers find tiring. The format limits you to flat prose, fragile tables, and external diagram tools. Three patterns recur:

The reader
Review fatigue

Long undifferentiated prose; no progressive disclosure. Reviewers lose the thread before they reach what matters.

The format
Markdown is thin

No diagrams, no real tables, no inline annotation, no semantic anchors past headings. The format runs out before the spec does.

The process
“Waterfall in markdown”

Gated phases duplicate background context across artifacts because cross-linking is weak.

HTML fixes those directly — the challenge is keeping the source as editable as markdown, for humans and LLMs alike. That's what the component vocabulary is for.

A live <spec-budget> gauge, an INVEST self-check in the header, and an estimability gate in /spectastic.plan work together to stop bloated specs from ever reaching the planning phase. Open questions, missing defer-to=, or failing INVEST rows block the gate until they're resolved.

The lifecycle

Eight commands. One file each.

Five cover the core spec lifecycle, two cover ongoing change management, and one runs alongside implementation to capture debug sessions.

Phase 01 / 08
Foundation

principles

/spectastic.principles <name> outputs principles.html

Establish the project's five non-negotiable principles — the constitution every later artifact is checked against.

Eight commands. propose & apply loop forever as the spec evolves.

Quick wins

Some changes don't need a spec. Drop them into inbox.html as <spec-triage type="just-do"> cards — /spectastic.implement drains the inbox before it touches the active spec, so small batches don't queue behind the next big release.

Change management

Specs evolve via PR-shaped proposals.

Each change is one proposal.html — intent, scope, typed deltas, and tasks together. Reviewable in a browser; no git diff needed.

<spec-delta op="modified">
typed
REQ-AUTH-014 priority lifted
  priority="should"
+  priority="must"

Four ops — added, modified, removed, renamed. A missing or wrong op renders the visible label MISSING OP. Silent failure impossible by construction.

<spec-risk>
adversarial
R-002 mitigated

Lifting REQ-AUTH-014 to must implicates the rate limiter — undocumented coupling we'd regret in 30 days.

/propose auto-fires the adversarial critic on must-tier edits, removed deltas, or cross-topic spans. Three risks land in a §5 risk register — identified → mitigated / accepted / rejected. /apply refuses while any risk is still identified.

Withdraw is a first-class outcome too — /apply --withdraw archives the proposal under changes/withdrawn/ and records "considered, withdrew" in the spec's changelog. Nothing is deleted; rejected ideas stay discoverable.

Component vocabulary

Tag name is schema.

A small set of semantic custom elements covers the spec shape. Everything degrades to readable static HTML if the JS never loads — the spec is still a spec.

<spec-requirement>
REQ-AUTH-014 must

Session tokens rotate on privilege change

The system MUST issue a fresh token whenever a role changes, invalidating the prior token within one request cycle.

<spec-diff>
  priority="should"  rotate on next login
+  priority="must"    rotate within one cycle

Red/green change blocks use semantic <ins> and <del> — reviewable without a git checkout.

<spec-matrix>
Option Effort Risk Fit
Inline JSLowHigh
Web component MedLowHigh
Server renderHighMedMed

Option × criterion table with a data-winner row.

<spec-triage>
implementation regen ✓

In the context of token refresh, facing a race on logout, we observed a double-rotation — so the fix serialises the rotation lock.

Expected
one token after logout
Actual
two, racing
Install

Drop it into your project.

Bootstrap the eight-command lifecycle into your repo, then point your AI coding agent at it and start authoring — principles first.

# scaffold a spec-driven project
cd my-new-project
npx @spectastic/cli init
# gate your PRs on a real grammar
npx @spectastic/cli validate "specs/**/*.html"
human · JSON · SARIF — wire validate into GitHub Actions or GitLab CI and findings land as inline PR annotations.

Then open the project with your favorite AI coding agent and run /spectastic.principles to author your project's principles.