agentleFS
davidscotttuftsdavidscotttufts/hyvemind/skills/write-spec/SKILL.md

write-spec

Skill0 starsChanged 17 days agoApache-2.0View on GitHub

Turn an idea, issue or PRD into a reviewed spec: problem, scope, testable acceptance criteria (WHEN/THEN), and — for structural changes — a numbered decision record (ADR) with alternatives and a phased plan. Grounds every claim in the existing code first. Use before building anything non-trivial.

28 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use implement-spec-with-codex, close-spec and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dzhngSkill

    implement-spec-with-codex

    Run [implement-spec](../implement-spec/SKILL.md) with Codex doing the implementation passes while you orchestrate, integrate, and review. Use when the user asks to implement a spec with Codex, or to run implement-spec with Codex as the implementer.

    Also in 4 projects that use this

  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 4 projects that use this

  • wolverin0Skill

    audit-decisions

    Standardize remediation decisions, baseline-policy entries, and legal-review banners for accepted, deferred, or policy-blocked audit findings.

    Also in 4 projects that use this

  • transitive-bullshitSkill

    compare-screenshots

    Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.

    Also in 4 projects that use this

  • LucasMatuszewskiSkill

    audit-agents

    Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.

    Also in 4 projects that use this

  • antonio-orionusSkill

    find-state-machines

    Report every implicit state machine in a project, with its states, transitions and flaws.

    Also in 3 projects that use this

  • +6 more from dzhng

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read hyvemind.json for specs.dir (where decision records live) and specs.nextNumberCommand.

    line 13
  2. Distinctive:

    Read the earlier decision records that touch this area.

    line 18
  3. Distinctive:

    Every acceptance criterion must be observable and falsifiable.

    line 60
  4. Distinctive:

    Keep it short. Cut any section that says nothing.

    line 65
  5. Distinctive:

    When a phase ships, record it (phase → commit) in the record.

    line 74
  6. Distinctive:

    No code is built against a spec or contract that is not Accepted.

    line 80

“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Write a spec

The aim is a document the next phase can build from and later check against. Without acceptance criteria, "done" can't be checked.

1. Ground it in the code before you write anything

  • Read hyvemind.json for specs.dir (where decision records live) and specs.nextNumberCommand.
  • Find what already exists. Search for the feature's nouns and verbs across the repo and list related modules, routes, tables, configs and earlier decision records. A spec that duplicates an existing system is the most expensive kind of mistake.
  • Read the earlier decision records that touch this area. If the new change overturns one, plan a correction note for it. Never edit its history.

2. Write the spec

# <Title>

Status: Proposed
Date: <YYYY-MM-DD>

## Problem
Who has it, what it costs them today, and how we know (link the issue, data or user quote).

## Scope
In: …   Out (explicitly): …

## Acceptance criteria
- WHEN <situation> THEN <observable result>     ← each one becomes a test
- …

## Design
What changes where: modules, data, interfaces. Name the existing pieces you reuse.

## Alternatives considered
"Do nothing" plus at least one other. For each, one line each for **Debt**, **Foreclosure**
(what it rules out later) and **Reversibility** (one-way or two-way door), then why it
lost and what would change your mind.

## Gaps and risks
Gaps: what this doesn't yet cover, each with its path to closing (phase, issue).
Risks: security, data migration, performance, rollback, and every gap with no path
to closing. "None" needs a sentence of why.

## Plan
Phases, each independently shippable, each with its exit check.

## Open questions
- [ ] …

Rules:

  • Every acceptance criterion must be observable and falsifiable. "Fast" is neither; "p95 < 300 ms on the list endpoint at 1k rows" is both.
  • Mark anything you have not verified as unverified.
  • Big is not a reason to cut scope. Split it into phases; dropping scope is the user's call.
  • Keep it short. Cut any section that says nothing.

3. Structural changes get a numbered decision record

  • Get the number from specs.nextNumberCommand if one is configured. Otherwise use the highest existing number + 1. In a repo with parallel branches, a directory listing can't see unmerged numbers, so prefer the command.
  • File: <specs.dir>/<NNNN>-<kebab-slug>.md. Status moves Proposed → Accepted → Implemented (or Superseded by NNNN).
  • When a phase ships, record it (phase → commit) in the record.

4. Gate

⛔ Show the spec to the user and wait for approval before design review. After the review's corrections are folded in and the user agrees, set Status: Accepted. No code is built against a spec or contract that is not Accepted.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.