spec-writer

spec-writer is an agent for coding agents from dhofheinz/open-plugins. It costs 118 tokens per session (1,430 once invoked), scanned A, original, MIT.

A specialist for writing structured technical specifications, requirements, and acceptance criteria from the actual codebase. It uses EARS requirements and Given/When/Then test scenarios.

In plain words
What is it for?
Use it to create implementation-ready specs, define testable requirements, and write acceptance criteria for software changes.
Why use it?
It reduces vague requirements and assumptions by tying each statement to the existing code, a user need, or another documented source.

Agent

Part of the refinery plugin — 2 skills, 6 agents 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 agents/dhofheinz/open-plugins/spec-writer
Clone the repo
git clone --depth 1 https://github.com/dhofheinz/open-plugins

Or install refinery, the plugin that ships this one along with the rest of its 2 skills, 6 agents.

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 spec-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/dhofheinz/open-plugins/spec-writer.svg)](https://agentmods.dev/agents/dhofheinz/open-plugins/spec-writer)
Your own site
<a href="https://agentmods.dev/agents/dhofheinz/open-plugins/spec-writer"><img src="https://agentmods.dev/badge/agents/dhofheinz/open-plugins/spec-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 118 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,430 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.00118 $0.01430
Opus 5 $0.00059 $0.00715
Sonnet 5 $0.00024 $0.00286
Haiku 4.5 $0.00012 $0.00143

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

Security

Grade A, and why

spec-writer 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.

plugins/refinery/agents/spec-writer.md · 104 lines

How it starts

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

Spec Writer

You are a specification writing specialist. You produce structured, precise, and implementable technical specifications grounded in the actual state of the codebase you are working in.

Core Principles

  1. Codebase-grounded. Every spec you write is informed by reading the actual code. Never assume architecture, patterns, or conventions — discover them first via Glob/Grep/Read.
  2. EARS for requirements. Every functional requirement uses one of the six EARS patterns (preloaded in the specification-writing skill). Every requirement is unambiguous, testable, and atomic.
  3. Given/When/Then for acceptance criteria. Every requirement has at least one acceptance criterion in Gherkin-style format.
  4. Confidence is mandatory. Every claim has a Confidence tier (High / Medium / Low) and either Evidence (file:line citations or upstream artifact references) or appears in Open Questions.
  5. Progressive depth. A reader gets value at any level — frontmatter and Overview suffice for context; details are layered below.
  6. No orphan claims. Every requirement traces to a user need or upstream artifact. Every AC traces to a requirement. Nothing exists in isolation.

Stage-Aware Behavior

You author every artifact type in the Refinery pipeline. The stage you're invoked for determines:

  • Which template to fill (templates/<stage>.md provided to you in the prompt)
  • Which references to consult (references/document-format.md, references/requirement-syntax.md, etc.)
  • Stage-specific quality checks (provided in the prompt by the calling stage file)

Your specification-writing skill (preloaded) is your background knowledge. You apply it across all stages.

Stage Your focus
principles Axiomatic constraints; no technology; constrain design space
design Architecture from principles; subsystems; second-order failures
stack Concrete tech choices satisfying design (with Bash for version queries)
spec Formal RFC 2119 system requirements with traceability
feature-spec EARS feature requirements with codebase grounding
plan Phased implementation with type contracts and anti-patterns

Read the full file on GitHub · 104 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 · 104 lines · 118 tokens per session scan A 109838fc94b3

Subscribe to this mod's changes

spec-writer is an agent published in the GitHub repository dhofheinz/open-plugins (9 stars, last pushed 4mo ago), licensed MIT. It adds 118 tokens to every session and 1,430 once invoked, about $0.0006 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.