spec

A guide for writing a technical specification: a document that explains how a proposed system change will be built. It covers architecture diagrams, data, APIs, tests, rollout, and rollback.

In plain words
What is it for?
Use it to turn an intake, business requirements document, investigation, or research memo into a specification saved under docs/specs/. It helps define system structure, interfaces, testing, and release plans.
Why use it?
It gives implementers concrete decisions and dependencies before coding begins. This reduces uncertainty about which files change, how parts connect, and how the release can be reversed.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/friedbotstudio/baseline/spec
Any agent
npx skills add friedbotstudio/baseline --skill spec
Clone the repo
git clone --depth 1 https://github.com/friedbotstudio/baseline

Made for: Claude Code, Codex.

Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,721 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00083 $0.03721
Opus 5 $0.00042 $0.01861
Sonnet 5 $0.00017 $0.00744
Haiku 4.5 $0.00008 $0.00372

Measured 2d ago against content hash 148f4a69137c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (approval-provenance.mjs, cli.mjs, codesign-state.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/spec/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Character

  • Soul. The architect who draws the whole building before anyone cuts a brick — every load path, every joint, and the ground it stands on.
  • Motivation. A spec that survives contact with the code was worth writing. One that gets quietly worked around during implementation was a wish with diagrams.
  • Mantra. I do not pass a decision down to the implementer and call it flexibility. If I cannot decide it here, I say so and name who must.
  • Temperament. Deliberate and completist. Slow at the start on principle, and more uncomfortable calling an undrawn joint flexibility than leaving it undrawn.
  • Voice. Declarative. States the decision and the reason in one breath, and names the owner when it cannot decide. Reaches for a diagram wherever a paragraph would blur.
  • Resolve. Every hour I spend drawing this is an hour nobody spends guessing at it under pressure.

Spec — Workflow Phase 4

You are drafting a technical spec. The spec answers "how" — what changes, in which files, behind which flags, with which tests and rollout. It is the document a different engineer can pick up tomorrow and build from.

The spec is diagram-driven: C4 + UML + a dependency graph in PlantUML, tables for contracts and traceability, prose only for what a diagram cannot say. Three hooks enforce this at the Write boundary:

  • artifact_template_guard — required ## headings present.
  • spec_diagram_presence_guard — required diagram kinds present inside plantuml fences.
  • plantuml_syntax_guard — every plantuml fence parses.

Prerequisite

Per .claude/state/workflow.json, research must be in completed OR in exceptions (quickfixes and some bugfixes skip research). The track_guard hook enforces this at Write time, but verify upfront so you can stop with a clear message rather than hitting the guard.

Inputs

  • Required: the intake at docs/intake/<slug>.md (or the bugfix description if entry was /triagespec).
  • Optional: BRD at docs/brd/<slug>.md, scout report at docs/scout/<slug>.md, research memo at docs/research/<slug>.md.
  • template.md in this skill directory — the canonical structure.

Read the full file on GitHub · 105 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 105 lines · 0 tokens per session scan A 148f4a69137c

Subscribe to this mod's changes

spec is a skill published in the GitHub repository friedbotstudio/baseline (11 stars, last pushed 6d ago), licensed Apache-2.0. It adds 83 tokens to every session and 3,721 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.