spec

A controlled workflow for creating or changing a project’s SPEC.md file, the document that records its goals, constraints, interfaces, rules, tests, and known bugs.

In plain words
What is it for?
It helps start a specification from an idea or existing code, add research and review results, amend defined sections, and record bugs from implementation feedback.
Why use it?
It keeps the project specification consistent and prevents unrelated sections from being changed accidentally.

Skill for Claude CodeCodex

Part of the ck plugin — 8 skills, 7 commands shipped together

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/juliusbrussee/cavekit/spec
Any agent
npx skills add JuliusBrussee/cavekit --skill spec
Clone the repo
git clone --depth 1 https://github.com/JuliusBrussee/cavekit

Made for: Claude Code, Codex.

Or install ck, the plugin that ships this one along with the rest of its 8 skills, 7 commands.

Per session 149 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 978 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.00149 $0.00978
Opus 5 $0.00075 $0.00489
Sonnet 5 $0.00030 $0.00196
Haiku 4.5 $0.00015 $0.00098

Measured 3d ago against content hash 99361ddf25a6, 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 3d ago.

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.

skills/spec/SKILL.md · 96 lines

How it starts

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

spec — spec mutator

Read FORMAT.md at repo root if not already loaded. Caveman skill applies to all writes here.

DISPATCH

Inspect user request and project state:

  1. No SPEC.md at repo root AND args describe idea → NEW
  2. No SPEC.md AND from-code in args → DISTILL
  3. SPEC.md exists AND args start bug:BACKPROP
  4. SPEC.md exists AND args start amendAMEND
  5. SPEC.md exists, no args → ask user which mode

INPUTS — spec is the sole mutator

The other verbs produce material; spec writes it. Ingest their handoff blocks into the right section, show a diff, write on OK:

  • grill → sharpened §G + §C
  • research → §R rows (add the §R section if absent)
  • review → drafted §V lines + the risk verdict
  • deepen → §I/§V/§T amendments

⊥ rewrite a section the handoff did not name. Sectioned ownership (see FORMAT.md).

NEW — idea → spec

Input: user idea. If it arrived fuzzy, prefer running grill first.

Steps:

  1. Extract goal (1 line, caveman). → §G.
  2. List constraints user stated or implied. → §C.
  3. List external surfaces user named. → §I.
  4. §R only if research ran — else omit the section (right-size).
  5. Propose initial invariants. → §V (numbered V1…).
  6. Break goal into ordered tasks. → §T pipe table, all status ., ids T1…
  7. §B section with header row only (id|date|cause|fix).

Write to SPEC.md. Show user full file. Ask: "spec OK? /review if high-blast-radius, else /build."

DISTILL — code → spec

Walk repo. Produce §G (infer from README/package.json/main entry), §C (infer from stack), §I (enumerate public APIs/CLIs/configs), §V (derive from tests and assertions), §T (one task per known TODO or missing test), §B (empty).

Caveman everywhere. Flag uncertain items with ? in text so user can confirm.

BACKPROP — bug → §B + §V

Input: bug: <description>.

Steps:

  1. Parse bug description.
  2. Find root cause (read relevant code).
  3. Decide: would a new invariant catch recurrence? If yes → draft V<next>.
  4. Append §B row: B<next>|<date>|<cause>|V<N>.
  5. Append new invariant to §V.
  6. If fix also changes behavior → add/update §T rows.
  7. Show diff. Apply only on user OK.

Read the full file on GitHub · 96 lines

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. 3d ago First seen · 96 lines · 149 tokens per session scan A 99361ddf25a6

Subscribe to this mod's changes

spec is a skill published in the GitHub repository JuliusBrussee/cavekit (1,141 stars, last pushed 19d ago), licensed MIT. It adds 149 tokens to every session and 978 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

build-executor

Govern implementation from an approved execution contract. Invoke when execution-contract.md is approved and the user wants disciplined build work, TDD execution, or guarded batch-by-batch implementation.

MageByte-Zero/spec-superflow · 39 tokens

workflow-start

Primary entry point for the spec-superflow state-machine workflow. Invoke when the user is inside an active spec-superflow change directory (look for .spec-superflow.yaml, changes/ /, proposal.md, specs/, design.md, tasks.md, or execution-contract.md) and asks to start, continue, resume, implement, plan, or figure out…

MageByte-Zero/spec-superflow · 125 tokens

release-archivist

Close out a spec-superflow change with verification, summary, and archive readiness. Invoke when implementation is complete, verification is underway, or the user asks for a final wrap-up.

MageByte-Zero/spec-superflow · 42 tokens

bug-investigator

Use when encountering any bug, test failure, or unexpected behavior during spec-superflow execution, before proposing fixes. Invoked automatically when build-executor hits a blockage.

MageByte-Zero/spec-superflow · 37 tokens

spec-writer

Create or refine spec-superflow planning artifacts. Invoke when the change is understood well enough to write proposal.md, specs/, design.md, and tasks.md.

MageByte-Zero/spec-superflow · 35 tokens

contract-builder

Convert approved planning artifacts into an execution contract. Invoke when the user wants to start building, asks to move from planning to implementation, or when execution-contract.md is missing or stale.

MageByte-Zero/spec-superflow · 39 tokens