agentleFS
anhle9xanhle9x/ai-worker/skills/write-spec/SKILL.md

write-spec

Skill4 starsChanged 22 days agoMITView on GitHub

Write or update a specification for a system, feature or tool, with a goal, what is not in scope, who uses it, numbered requirements and limits, so a reader can tell what must be built and whether it is done. Use when the user types /write-spec, asks for a spec, a specification or requirements, or wants an existing system written down before changing it. Viết hoặc cập nhật đặc tả cho một hệ thống, tính năng hay công cụ, gồm mục tiêu, ngoài phạm vi, người dùng, yêu cầu có mã và giới hạn, để người đọc biết phải làm gì và thế nào là xong. Dùng khi người dùng gõ /write-spec, nhờ viết spec, đặc tả, yêu cầu, hoặc muốn ghi lại một hệ thống đang có trước khi sửa.

32 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use audit-decisions, implement-spec-with-codex 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

    audit-decisions

    Audit the decisions an implementing agent made, not its diff — a pure audit that traces the session's history into a decisions ledger, changes no code, and never blocks an unsupervised run. Working code still embeds architecture the user never chose; surface it because future work inherits it. Use when the user wants to review the decisions the AI made on their behalf, before merging or committing AI-implemented work, when integrating a delegated subagent's pass, or when a fix "works" but might be a point fix.

    Also in 4 projects that use this

  • 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

  • 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

  • +9 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 31 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. Distinctive:

    Do any two requirements contradict each other, or contradict "Not in scope"?

    line 89
  2. Very specific:

    Do not invent numbers, names or dates.

    line 93
  3. Distinctive:

    If the code and what the user says disagree, write down both and ask which is right.

    line 94
  4. Distinctive:

    Do not write passwords, keys, tokens, real names or internal addresses into a spec.

    line 95
  5. Distinctive:

    Do not send a draft with internal names or figures to Gemini or ChatGPT.

    line 96
  6. Distinctive:

    Do not change code while writing a spec.

    line 97

“Common” is measured: kept by at least 6 in 10 of the 31 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

Answer and write the spec in the user's language.

Purpose: someone who was not in this conversation reads the spec and can tell what must be built, what must not, and whether each part is finished. A spec says what and why. How the parts fit together belongs in a design document; use the draw-flow skill for its diagrams.

Input

$ARGUMENTS: what the spec is about. It describes one of two things:

  • A system that exists: the code is the evidence. The spec records what it does today.
  • Something new: the user is the evidence. The spec records what they want.

How to do it

  1. Read first. In a project, read the README, the existing documents and the code that matters. If a spec already exists, update it; do not create a second one.
  2. Fill the five sections from what you read. Ask only what you cannot find, one question at a time, each with your best guess attached. If the user cannot yet say who it is for or why they want it, use the interview-me skill first.
  3. Write it in the frame below. Anything still unknown is marked [to confirm].
  4. Check it against the checklist below and fix what fails.
  5. Save it where the project keeps its documents, or as docs/SPEC.md if there is no such place. If the project keeps documents in two languages, write both.
  6. Report in a few lines: where it was saved, how many requirements it has, every [to confirm], and any code that looked like a mistake.

The five sections

  • Goal: one to three sentences on who gets what, and the price they refuse to pay. No features here. If the goal could describe any product, it is too vague.
  • Not in scope: things a reader would reasonably expect but will not get, including risks the system knowingly leaves open. Say why when it is not obvious. This section stops arguments later, so it is never empty; if you find nothing, ask.
  • Who uses it: one row per role, never a real person's name. A screen or another system that acts on its own counts as a role. "Can do" is what separates the roles.
  • What it must do: one behavior per row.
    • The ID is F plus a number. IDs stay fixed: a removed requirement leaves its number unused, so other documents can keep pointing at them.
    • The wording is something a person could check and answer yes or no.
    • It says what happens, not how it is built.
    • It covers failure as well as success: what happens when a check fails or an answer never comes.
    • "Where" is the function or file you opened and saw doing this, or not built. Never write a location you did not open. Avoid line numbers: they go stale.
    • It records what a reader would object to losing, not every branch of the code. Past about 20 rows, merge rows that are one rule, or split the spec.
    • Code that looks like a mistake is not a requirement. Leave it out and tell the user in your report (step 6).
  • Limits: numbers the system enforces, how long data is kept, and fixed conditions such as platform, budget or "no outside libraries". Each value comes from the code or the user. Do not repeat what a requirement already says.

Frame

# <Name>: specification

<One line: what this is. One line: which wins if this document and the code disagree. For a system that exists, the code shows what runs today and the document gets corrected. For something new, the spec wins until the user changes it.>

## Goal

<Who gets what, and the price they refuse to pay.>

## Not in scope

- <What a reader might expect, and why it is left out.>

## Who uses it

| Role | Uses | Can do |
|---|---|---|
| Admin | Dashboard, `/admin` | Change accounts and settings |
| Viewer | Dashboard, `/board` | See the numbers; change nothing |

## What it must do

| ID | Requirement | Where |
|---|---|---|
| F1 | Without a server the tool still works on one computer | `src/start.ts` |
| F2 | A failed permission question counts as no, and nothing is sent | `not built` |

## Limits

| Limit | Value |
|---|---|
| Size of one upload | 256 KB |
| Wrong logins | 5 per account in 15 minutes |
| Action log kept for | 12 months |

Weak and strong requirements

WeakStrongWhat changed
Logins must be secureFive wrong codes in 15 minutes block the accountIt can be tested
Updates are checked properlyA computer installs an update only with a valid signatureIt says what must be true
Use a Redis cacheA repeated search answers within one secondIt says what, not how
Handle errors wellIf sending fails, the tool tries again and warns once the problem lastsIt says what the person sees

Checklist

  • Does the goal name who benefits?
  • Could each requirement be answered yes or no, by someone who did not write it?
  • Does each "Where" point to something you opened, or say not built?
  • Does each role appear in at least one requirement, and does each requirement serve a role?
  • Do any two requirements contradict each other, or contradict "Not in scope"?
  • Is every number traceable to the code or the user?

Limits

  • Do not invent numbers, names or dates. Mark them [to confirm].
  • If the code and what the user says disagree, write down both and ask which is right.
  • Do not write passwords, keys, tokens, real names or internal addresses into a spec.
  • Do not send a draft with internal names or figures to Gemini or ChatGPT.
  • Do not change code while writing a spec. If you find a bug, report it separately.

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.