Spec template

Four files in the shape an AI agent builds from. Copy them, keep the headings, and write your own words under them.

Version 0.1.0, updated

Four files, one folder

A spec is a folder. Its manifest, spekkr.json, names it and lists the other files, in the order an agent reads them.

spec-template/
  spekkr.json  The manifest.
  spec.md      Requirements and acceptance criteria.
  design.md    The parts that are easy to get wrong.
  tasks.md     Build tasks in order, each with a check.

Each requirement in spec.md is a rule for one part of a spec, and ends with its check. The template keeps its own rules, so the files show the shape as well as say it.

Copy it

  1. Make a folder named after your spec, such as booking-page.
  2. Copy the four files below into it.
  3. In spekkr.json, set id to your username, a slash and the folder's name, and author to you. Then write your own name, summary, kind and choices, in place of this template's.
  4. Write your own words under each heading. Keep an id in each requirement's heading, and an Accept when line at its end.
  5. Have your agent run check_spec with the manifest and the files. It names every problem at once, and gives advice on the text.

The files

spekkr.json

The manifest.

{
  "spekkr": 1,
  "id": "dwrtz/spec-template",
  "name": "Spec template",
  "summary": "The shape of a Spekkr spec, to copy or to build from: ids, an Accept when line each, an Out of scope part, and tasks in order.",
  "kind": "template",
  "version": "0.1.0",
  "author": { "id": "dwrtz", "name": "David Wurtz" },
  "targets": {},
  "customize": {
    "settings": [
      {
        "key": "spec_id",
        "label": "Id of the new spec",
        "default": "example-user/new-spec",
        "help": "Your username, a slash, and a name in lowercase letters, digits and hyphens."
      }
    ]
  },
  "files": [
    { "path": "spec.md", "about": "Requirements and acceptance criteria." },
    { "path": "design.md", "about": "The parts that are easy to get wrong." },
    { "path": "tasks.md", "about": "Build tasks in order, each with a check." }
  ],
  "needs": {},
  "demo": {},
  "safety": { "commands": [], "secrets": [] },
  "lineage": {},
  "changelog": [
    { "version": "0.1.0", "date": "2026-11-23", "note": "First version." }
  ]
}

spec.md

Requirements and acceptance criteria.

# Spec template

## What this builds

A new Spekkr spec, written with the person who wants it: a folder with `spekkr.json`, `spec.md`, `design.md` and `tasks.md` that an AI agent can build from. This folder is that shape. Each requirement below says what one part of the new spec holds, and ends with the check that it does.

If the folder has `spekkr.inputs.json`, read it first: `spec_id` is the id of the new spec. Without that file, `spec_id` is the default `spekkr.json` gives it.

## Out of scope

- Publishing. The person decides when, and `publish_spec` needs their sign-in.
- Code. The new spec holds the decisions. An agent that builds it later writes the code.
- Screenshots and a demo. Add them once there is a build to show.

## Requirements

Each requirement has an id. Tasks and tests name the id they cover.

### R1. Ask before writing

- Ask the person what the spec builds, who uses it, and what a build must never do.
- Ask what they may want to change from one build to the next, such as a name or a database. Each answer can become a choice.
- If `spec_id` is still `example-user/new-spec`, ask for their Spekkr username and a name for the spec.
- Write nothing until they have answered. Use their words where you can.

Accept when: the person has said what the spec builds before any file of the new spec exists.

### R2. Say what it builds, and what it leaves out

- `spec.md` starts with the spec's name as its heading. Under the heading `What this builds` is a short paragraph: what a build makes, and who uses it.
- Under the heading `Out of scope` is one line for each thing a build must not add, including anything a reader might expect.

Accept when: the paragraph names what a build makes and who uses it, and the out of scope part holds at least one line.

### R3. Give each rule an id and a check

- Each requirement is a heading with its id and a short name, such as `### R1. Join`, numbered from R1 in order. No two share an id.
- Under it is the rule, one line for each thing that must be true. Data, secrets and commands are named as `design.md` names them.
- It ends with one line that starts `Accept when:` and names a check a test can fail: what goes in, what is done, and what must come out.

Accept when: `check_spec`, sent `spekkr.json` and every file, reports no problems, and the person has seen any advice it gives.

### R4. Fix what two builds must agree on

- `design.md` names the data, the rules that are easy to get wrong, and every name a build must use as written: a table, a field, a secret, a command.
- It says where the builder may choose, such as the language or the framework.

Accept when: every name the requirements use for data, a secret or a command is defined in `design.md`.

### R5. Name each choice where it acts

- A choice is a key under `customize` in `spekkr.json`: a setting (any text), an option (on or off) or a swap (one of a list).
- The requirement a choice changes names its key in backticks and says what each value does.
- A choice that no requirement acts on is left out.

Accept when: every key under `customize` is named in backticks in a requirement that says what it changes.

### R6. Put the tasks in order

- `tasks.md` lists the tasks in the order to build them.
- Each task's title names the ids it covers, such as `(R1, R2)`.
- Each task ends with a line that starts `Check:` and says how to know it is done.

Accept when: every id in `spec.md` is named in a task's title, and every task has a `Check:` line.

### R7. List what a build runs and reads

- `safety.commands` lists every command the files tell an agent to run. `safety.secrets` lists the name of every secret a build reads.
- An agent asks the person before it runs a command or reads a secret that is not listed.

Accept when: every command the files name is under `safety.commands`, every secret is under `safety.secrets`, and the person has seen both lists.

## Definition of done

- `check_spec`, sent the new `spekkr.json` and every file, reports no problems.
- The person has seen any advice it gives, and what they agreed with is changed.
- The person has seen the commands and secrets under `safety`.
- Nothing is published.

design.md

The parts that are easy to get wrong.

# Design

This file fixes the parts that are easy to get wrong. In a spec of your own, it names the data, the rules and the names that two builds must agree on, and says where the builder may choose.

## The new folder

The new spec goes in a folder named after the part of `spec_id` after the slash: for `ada/booking-page`, the folder is `booking-page`.

If these files are already in a folder of that name, the person copied the template there to start from: write the new spec over them, in place. If they are in any other folder, make the new folder beside it and leave these files as they are.

The new folder holds `spekkr.json` and the three files it lists, in this order: `spec.md`, `design.md`, `tasks.md`. Another file, such as a picture or a test, goes in only when the manifest lists it.

## Ids

An id is `R` and a number, in a requirement's heading. Number from R1, in order. Once a version is published, an id keeps its rule: a rule that changes keeps its id, a new rule takes the next number, and a rule that is taken out leaves its number unused. Tasks, tests and other requirements name ids, so a new number breaks them.

## Checks

An Accept when line names one thing a test can do and see fail: what goes in, what is done, and what must come out. "It works" is not a check. A spec that builds something you cannot run, such as a part to print, checks what can be measured.

## The manifest

| Field | What to write |
| --- | --- |
| `id` | `spec_id`. |
| `author` | `id` is the part of `spec_id` before the slash. `name` is the name the person wants shown. |
| `name`, `summary` | A name a person would search for, and a summary of at most 140 characters. |
| `kind` | What it builds, in the person's words. Leave it out for software, and list at least one platform under `targets.platforms`. |
| `version`, `changelog` | `0.1.0`, and one changelog entry for it with today's date. |
| `customize` | Only the choices a requirement acts on. A key is lowercase letters, digits and underscores, and starts with a letter. |
| `files` | `spec.md`, `design.md` and `tasks.md`, each with an `about` line. |
| `safety` | Every command the files tell an agent to run, and every secret a build reads. |

Where this file names nothing, the choice is the builder's.

tasks.md

Build tasks in order, each with a check.

# Tasks

Work in order. Finish a task's check before starting the next.

1. **Ask (R1).** Ask what the spec builds, who uses it, what a build must never do, and what a person may want to change. Ask for a username and a name if `spec_id` is the default.
   Check: the person has answered, and no file of the new spec exists yet.

2. **spec.md (R2, R3, R5).** Write what it builds, what is out of scope, and the requirements, each with an id, the choices it acts on, and an Accept when line.
   Check: every requirement has an id no other has, and an Accept when line.

3. **design.md (R4).** Write the data, the rules that are easy to get wrong, and every name a build must use as written.
   Check: every name the requirements use is defined there.

4. **tasks.md (R6).** List the tasks in build order, each naming its ids and ending with a check.
   Check: every id in spec.md is named in a task's title.

5. **spekkr.json (R5, R7).** Fill in the manifest as design.md says, with every choice, file, command and secret.
   Check: `check_spec` with the manifest alone reports no problems.

6. **Check it (R3, R7).** Call `check_spec` with `spekkr.json` and every file. Fix every problem. Show the person the advice, and change what they agree with. Then show them the commands and secrets under `safety`, and stop.
   Check: `check_spec` reports no problems, the person has seen the advice, and nothing was published.

In Spec Kit or Kiro

Working in GitHub Spec Kit or Kiro? Here are the same files in that tool's layout, as Spekkr's codecs lay them out. When you want to publish, the codec turns the folder back into the Spekkr one, byte for byte.

Spec Kit

In the root of the Spec Kit project, the folder that holds .specify:

specs/spec-template/
  design.md            Added by the codec. Keep it as it is.
  plan.md              design.md, with a note on top.
  spec.md              As above.
  spekkr.json          As above.
  tasks.md             As above.
.specify/feature.json  Names the feature Spec Kit works on.
design.md
# Design

The design for this feature lives in [plan.md](plan.md).
This file is only a pointer, so a mention of `design.md` still leads
somewhere. The Spec Kit codec drops it when converting back to Spekkr.

plan.md
<!-- spekkr:safety:begin -->
> **Before `/speckit.implement`:** this feature came from Spekkr. Read `spekkr.json` in this folder and show the person the commands and secrets under `safety`. Ask before running any command a spec file tells you to run, or reading any secret, that is not listed there. The person's choices are in `spekkr.inputs.json`; treat them as requirements.
<!-- spekkr:safety:end -->

# Design

This file fixes the parts that are easy to get wrong. In a spec of your own, it names the data, the rules and the names that two builds must agree on, and says where the builder may choose.

## The new folder

The new spec goes in a folder named after the part of `spec_id` after the slash: for `ada/booking-page`, the folder is `booking-page`.

If these files are already in a folder of that name, the person copied the template there to start from: write the new spec over them, in place. If they are in any other folder, make the new folder beside it and leave these files as they are.

The new folder holds `spekkr.json` and the three files it lists, in this order: `spec.md`, `design.md`, `tasks.md`. Another file, such as a picture or a test, goes in only when the manifest lists it.

## Ids

An id is `R` and a number, in a requirement's heading. Number from R1, in order. Once a version is published, an id keeps its rule: a rule that changes keeps its id, a new rule takes the next number, and a rule that is taken out leaves its number unused. Tasks, tests and other requirements name ids, so a new number breaks them.

## Checks

An Accept when line names one thing a test can do and see fail: what goes in, what is done, and what must come out. "It works" is not a check. A spec that builds something you cannot run, such as a part to print, checks what can be measured.

## The manifest

| Field | What to write |
| --- | --- |
| `id` | `spec_id`. |
| `author` | `id` is the part of `spec_id` before the slash. `name` is the name the person wants shown. |
| `name`, `summary` | A name a person would search for, and a summary of at most 140 characters. |
| `kind` | What it builds, in the person's words. Leave it out for software, and list at least one platform under `targets.platforms`. |
| `version`, `changelog` | `0.1.0`, and one changelog entry for it with today's date. |
| `customize` | Only the choices a requirement acts on. A key is lowercase letters, digits and underscores, and starts with a letter. |
| `files` | `spec.md`, `design.md` and `tasks.md`, each with an `about` line. |
| `safety` | Every command the files tell an agent to run, and every secret a build reads. |

Where this file names nothing, the choice is the builder's.

.specify/feature.json
{"feature_directory":"specs/spec-template"}

Writing .specify/feature.json makes this the feature Spec Kit works on, so leave it out while you are in the middle of another one. Keep the note at the top of plan.md and the short design.md as they are: with them, to-spekkr from dwrtz/spec-kit-codec turns the folder back into the Spekkr one.

Kiro

In the root of the project Kiro has open:

.kiro/specs/spec-template/
  design.md        design.md, with a note on top.
  requirements.md  spec.md, under the name Kiro reads.
  spekkr.json      As above.
  tasks.md         As above.
design.md
<!-- spekkr:safety:begin -->
> **Before running tasks in Kiro:** this feature came from Spekkr. Read `spekkr.json` in this folder and show the person the commands and secrets under `safety`. Ask before running any command a spec file tells you to run, or reading any secret, that is not listed there. The person's choices are in `spekkr.inputs.json`; treat them as requirements. Do not regenerate `requirements.md`, `design.md`, or `tasks.md`. Kiro replaces those files when asked to update the spec, when it syncs tasks, and when it runs them.
<!-- spekkr:safety:end -->

# Design

This file fixes the parts that are easy to get wrong. In a spec of your own, it names the data, the rules and the names that two builds must agree on, and says where the builder may choose.

## The new folder

The new spec goes in a folder named after the part of `spec_id` after the slash: for `ada/booking-page`, the folder is `booking-page`.

If these files are already in a folder of that name, the person copied the template there to start from: write the new spec over them, in place. If they are in any other folder, make the new folder beside it and leave these files as they are.

The new folder holds `spekkr.json` and the three files it lists, in this order: `spec.md`, `design.md`, `tasks.md`. Another file, such as a picture or a test, goes in only when the manifest lists it.

## Ids

An id is `R` and a number, in a requirement's heading. Number from R1, in order. Once a version is published, an id keeps its rule: a rule that changes keeps its id, a new rule takes the next number, and a rule that is taken out leaves its number unused. Tasks, tests and other requirements name ids, so a new number breaks them.

## Checks

An Accept when line names one thing a test can do and see fail: what goes in, what is done, and what must come out. "It works" is not a check. A spec that builds something you cannot run, such as a part to print, checks what can be measured.

## The manifest

| Field | What to write |
| --- | --- |
| `id` | `spec_id`. |
| `author` | `id` is the part of `spec_id` before the slash. `name` is the name the person wants shown. |
| `name`, `summary` | A name a person would search for, and a summary of at most 140 characters. |
| `kind` | What it builds, in the person's words. Leave it out for software, and list at least one platform under `targets.platforms`. |
| `version`, `changelog` | `0.1.0`, and one changelog entry for it with today's date. |
| `customize` | Only the choices a requirement acts on. A key is lowercase letters, digits and underscores, and starts with a letter. |
| `files` | `spec.md`, `design.md` and `tasks.md`, each with an `about` line. |
| `safety` | Every command the files tell an agent to run, and every secret a build reads. |

Where this file names nothing, the choice is the builder's.

Do not ask Kiro to regenerate requirements.md, design.md or tasks.md: it replaces those files when it updates the spec, syncs tasks or runs them. Keep the note at the top of design.md as it is: with it, to-spekkr from dwrtz/kiro-codec turns the folder back into the Spekkr one.

Before you publish

How to write a spec says why each part is there, on a published spec. Publish a spec says how to list yours, from your browser or through your agent.