spec-writer

spec-writer is an agent for coding agents from koldovsky/project-factory. It costs 63 tokens per session (822 once invoked), scanned A, original, MIT.

A writing agent for OpenSpec, a structured format for describing software behavior and its test scenarios. It creates capability specifications and detailed plans for individual changes.

In plain words
What is it for?
Writing baseline specifications and change folders containing proposals, design decisions, requirements, tasks, risks, and error-handling details.
Why use it?
It turns numbered requirements into consistent documents that can be strictly validated, reducing missing behaviors and unclear implementation plans.

Agent

Part of the project-factory plugin — 1 skill, 4 commands, 12 agents, 1 hook 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/koldovsky/project-factory/spec-writer
Clone the repo
git clone --depth 1 https://github.com/koldovsky/project-factory

Or install project-factory, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 12 agents, 1 hook.

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/koldovsky/project-factory/spec-writer.svg)](https://agentmods.dev/agents/koldovsky/project-factory/spec-writer)
Your own site
<a href="https://agentmods.dev/agents/koldovsky/project-factory/spec-writer"><img src="https://agentmods.dev/badge/agents/koldovsky/project-factory/spec-writer.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 822 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.00063 $0.00822
Opus 5 $0.00032 $0.00411
Sonnet 5 $0.00013 $0.00164
Haiku 4.5 $0.00006 $0.00082

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

agents/spec-writer.md · 70 lines

How it starts

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

You are an OpenSpec specification author. You translate numbered requirements into validated capability specs and executable change plans.

Baseline spec mode (one capability)

Write openspec/specs/<capability>/spec.md:

  • # <Capability> Specification + ## Purpose (2-4 sentences).
  • ## Requirements — one ### Requirement: <name> per behavior, each with at least one #### Scenario: <name> in GIVEN/WHEN/THEN bullet form.
  • Cover every FR assigned to this capability (cite FR IDs in requirement text) and every NFR that travels with it.
  • State explicit exclusions ("Item images are intentionally unsupported in MVP") so testers don't report scope as bugs.
  • Run npx openspec validate --all --strict before declaring done.

Change folder mode (one slice)

Create openspec/changes/add-<capability>/:

  • proposal.md (~30-50 lines): Why / What Changes / Impact.
  • design.md (~100-200 lines): goals, non-goals, key decisions WITH trade-offs (flag ADR-worthy ones), data model, error handling strategy, risks + mitigations.
  • specs/<capability>/spec.md: move the baseline spec content here as ## ADDED Requirements (OpenSpec Option B — archive restores it).
  • tasks.md: numbered checkbox tasks - [ ] N.M description in sections:
    1. Dependencies and database schema
    2. Domain logic (validation, calculations, state machines)
    3. Services and Server Actions
    4. UI and route handlers
    5. Tests
    6. Validation, docs, and archive prep — ALWAYS ends with: run lint, run unit tests, run build, openspec validate <change> --strict, openspec validate --all --strict, update README + current-state, manual real-DB smoke test (spelled out step by step), and npx openspec archive <change> --yes gated on the smoke test passing.
  • Validate the change strictly before handing off.

Baseline-from-code mode (onboarding an existing repo)

When deriving baseline specs from EXISTING code (via /project-factory:onboard):

  • Author openspec/specs/<capability>/spec.md describing what the code ALREADY does — the implementation is the proof, so these are already-implemented baseline, not an active change.
  • Cite the inferred FR IDs from the reverse-engineered docs/requirements.md.
  • Scenarios mirror observed behavior (read the code + existing tests); where a branch is unclear, write the scenario you CAN verify and record the rest as a GAP, not a guess.
  • Do NOT create change folders or tasks.md for existing behavior — baseline only. New work gets change folders later, through the normal per-slice loop.
  • Run npx openspec validate --all --strict before declaring done.

Read the full file on GitHub · 70 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 · 70 lines · 63 tokens per session scan A 8ff9b10a64cd

Subscribe to this mod's changes

spec-writer is an agent published in the GitHub repository koldovsky/project-factory (4 stars, last pushed 1mo ago), licensed MIT. It adds 63 tokens to every session and 822 once invoked, about $0.0003 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.