prespec

prespec is a skill for Claude Code, Codex from emretheus/prespec. It costs 91 tokens per session (1,164 once invoked), scanned A, original, MIT.

A skill that writes a feature's behavior as test cases before implementation. This approach uses tests as a precise, checkable specification, including normal behavior, contracts, boundaries, failures, and guarantees.

In plain words
What is it for?
Use it before building an endpoint, screen, workflow, or behavior, especially one involving authentication, sessions, tokens, lists, or pagination.
Why use it?
It prevents coding from starting with an incomplete understanding of what the feature must do. The cases make expected behavior easier to check, including empty input, limits, races, and security requirements.

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

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prespec

README.md
[![agentmods](https://agentmods.dev/badge/skills/emretheus/prespec/prespec.svg)](https://agentmods.dev/skills/emretheus/prespec/prespec)
Your own site
<a href="https://agentmods.dev/skills/emretheus/prespec/prespec"><img src="https://agentmods.dev/badge/skills/emretheus/prespec/prespec.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,164 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.00091 $0.01164
Opus 5 $0.00046 $0.00582
Sonnet 5 $0.00018 $0.00233
Haiku 4.5 $0.00009 $0.00116

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

Security

Grade A, and why

prespec 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 4d 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/prespec/SKILL.md · 141 lines

How it starts

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

prespec

Writing the test cases first is writing the specification first. A test case is the only spec format that is unambiguous and checkable, which is why the spec is expressed as cases rather than prose.

This is not an edge-case checklist. A feature's spec has five parts, and edge cases are one of them:

Section Answers
What it must do The feature working, on ordinary input
Contract it must honour Response shape, status, ordering, scope
Boundaries it must hold at Empty, one, enormous, past-the-end
Conditions it must survive Races, partial failure, concurrent writes
Guarantees it must not break Security, and what the user is left believing

An agent that skips straight to section three has written a warning list, not a spec.

The order

1. Do not write implementation code yet.

Not a scaffold, not a "rough version". Changing your mind is free right now and expensive in twenty minutes.

2. Call define_behavior.

feature_description: what is being built, in the user's own words
side: backend | frontend | both
depth: quick (~5) | standard (~12) | deep (~25)

Use deep when the feature handles money, credentials, permissions, or anything irreversible. Happy-path and contract cases come back in full at every depth — depth only controls how far into the failure modes you go.

Read gaps in the response. If it says the domain has no defining behaviour, the bank only knows how this breaks, not what it should do — write that part yourself and say you did.

If matched_domains is empty the bank does not cover this. Say so in one line, proceed on your own judgement, and do not imply the bank backed you.

3. Ask 2–4 questions. Not more.

open_questions is raw material, not a script. Ask only where a different answer produces genuinely different code. Where one answer is obviously right, decide it yourself and put it in step 4.

Ask in the user's vocabulary:

When a user changes their password, should their other devices be logged out?

Read the full file on GitHub · 141 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. 4d ago First seen · 141 lines · 91 tokens per session scan A 6e9c6787f6bc

Subscribe to this mod's changes

prespec is a skill published in the GitHub repository emretheus/prespec (0 stars, last pushed 1mo ago), licensed MIT. It adds 91 tokens to every session and 1,164 once invoked, about $0.0005 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-31.