Format and quality rules for writing an issue an agent resolves autonomously. Use in /flow:issue. Ensures a precise map (path+line, types, contracts, conflicts) without dictating implementation.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Issue Spec?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/eusilvio-issue-spec)
---
name: issue-spec
description: "Format and quality rules for writing an issue an agent resolves autonomously. Use in /flow:issue. Ensures a precise map (path+line, types, contracts, conflicts) without dictating implementation."
user-invocable: false
---
# Writing an agent-resolvable issue
The issue body is the only spec the implementer gets — there is no separate
implementer comment. It carries the MAP (where, what, integration order) and
the CONTRACTS (exact names crossing layer boundaries), but not design
choices: architecture judgment stays with /flow:implement.
Two failure modes cost the most downstream rounds, in this order:
1. **A decision the implementer had to make and you did not notice you left
open.** It never trips `SKIPPED open-decisions`, so `--auto` picks one
silently and QA passes it.
2. **A success criterion that is green either way.** QA verifies literally;
a non-discriminating criterion certifies the wrong build.
Everything below exists to kill those two.
## Format
```
Origin: <PR/issue/context, if any>
Investigated at: <short SHA of HEAD during the investigation>
Brain: <[[slug]] of each brain note relied on, or omit the line>
## Problem
<what is wrong/missing today, with exact paths>
<fields/data left out, by name, and where the type comes from>
## Map
- <path:line> — <symbol/function> — <why it is the entry point>
- Types: <TypeX (path:line)> consumed at <path:line>, <path:line>
- Mirror: <existing analogous pattern to follow, with path>
- Claims: <behavioral assertion> — verified by `<command that proves it>`
<or> ASSUMPTION — not verified, confirm before relying on it
## Contracts
<only for changes that cross a layer boundary; omit otherwise>
- New/changed fields, each with: db column (exact name+type+null+default for
existing rows) → shared type field (exact name) → payload key (exact name)
- Invariant: <statement> — enforced at <db constraint | service | schema>
- Rejected input: <shape> → <status code>
## Scope
- <what to do>
- <explicit do/don't: what NOT to reuse/break, and WHY>
- Out of scope: <things a reader might assume are included>
## Open decisions (stop and ask the user before implementing)
- <decision>
Recommended resolution: <concrete enough that two implementers produce the
same observable behavior>
(omit the whole section if there is no genuine decision)
## Implementer notes
- Checklist: <ordered; shared/contract-defining change FIRST, consumers after>
- CHECKPOINT after <item>: <what must be green before continuing>
- Edge cases: <trigger> → <failure mode> → <required guard>
(omit for trivial issues)
## How to verify
- <test command to run, or "no test: verify manually by doing X">
- <convention to mirror, if a similar pattern exists>
## Success criteria
- [ ] C1 <observable result>
verify: `<exact command whose output proves it>` -> <expected output>
- [ ] C2 <UI-only result>
verify: MANUAL - <url>, <role>, <clicks>, <what the user sees>
```
## Quality rules
### Citations
- **Vague paths are failure #1.** Every code reference has a real path+line
behind it. Confirm the line exists — do not guess ranges.
- **Types with full origin:** where defined, where consumed, what is missing.
- **A behavioral claim is not a citation.** "`certificate.service.ts:127`
does not filter cancelled lessons, unlike `recalculate…`" asserts a
*difference between two code paths*. Path validation does not test it, and
if it is wrong the implementer "fixes" working code. Every such claim goes
under `Claims:` with the grep/read that proves it, or is labelled
`ASSUMPTION`.
- **Do not invent.** If you did not find it in the codebase, say so.
### Contracts
Write this section whenever a change crosses db ↔ shared types ↔ API payload
↔ client. Naming drift across those four layers is the most common silent
defect and the cheapest to prevent: state the exact strings once.
Always answer, for each new column: **what happens to existing rows.** An
unstated migration default is a decision in disguise.
Stating names and invariants is not dictating design — it is fixing the
contract. *How* the invariant is upheld (constraint vs service guard) is a
choice, so name the enforcement point only when the issue genuinely requires
one; otherwise list it as an Open decision.
### Open decisions
- **Real conflicts become "Open decisions"**, not closed scope. Hunt for them.
- **The concreteness test:** could two competent implementers follow this
recommendation and produce *different observable behavior*? If yes, it is
not a resolution — finish it.
- ✗ "Above the limit, by date/lesson order, they count as normal absences."
(which column breaks ties? per enrollment or per class group? applied
before or after filtering cancelled lessons?)
- ✓ "Above the limit, ordered by `lessons.scheduledAt` then `lessons.id`,
counted per enrollment, applied after cancelled lessons are filtered out."
- **A decision may never hide in Edge cases.** If an edge-case bullet ends in
"decide", "or … or", "document that", it is a decision. Promote it.
- **No padding.** A restatement of something already in "Out of scope" is not
a decision. This section gates `--auto`; every fake entry taxes the run.
### Implementer notes
- **Do not dictate design:** the checklist fixes the integration ORDER, never
the architecture choice — that stays with /flow:implement.
- **Shared piece first.** When many call sites consume one new behavior, the
shared change and its test come first, consumers after. The reverse order
means every consumer is rewritten when the shared shape shifts.
- **Checkpoints.** If the issue carries more than one independently shippable
behavior, mark a CHECKPOINT with what must be green before continuing, and
group the success criteria the same way. QA then fails fast on the core
instead of reporting eight symptoms of one cause.
- **Edge cases are `trigger → failure mode → required guard`.** Three parts,
every line. Missing guard = it was a decision.
### Success criteria
- **Behavioral and checkable**, not "do X".
- **Discriminating:** for each criterion ask *would this be red if the agent
chose the other plausible option?* If it is green either way, it certifies
nothing — sharpen it or drop it.
- ✗ "With `maxJustifiedAbsences = 1`, the second justified absence counts
as a normal absence." (passes under any tie-break rule)
- ✓ "Lessons 1 and 3 justified, limit 1 → lesson 1 stays justified, lesson
3 counts as absent; attendance = 50%."
- **A "no duplicate logic" requirement needs its own grep criterion.** Prose
in Scope does not survive contact with an implementer taking the path of
least resistance through existing code.
- **Every criterion ships with its proof: a `verify:` line.** Either the
exact command whose output decides it (a test name to run, a `curl` with
the expected status and body fragment, a `grep` with the expected hit
count, a SQL query with the expected row) plus the expected result, or
`MANUAL -` followed by the steps a human runs. QA runs the command
verbatim first, so a vague one ("run the tests") is a defect in the issue.
Number criteria (`C1`, `C2`, ...) so the QA report and the fix rounds can
cite them.
- ✗ `verify: run the API tests`
- ✓ `verify: npx vitest run src/modules/quotes/__tests__/discount.test.ts -t "applies discount once"` -> 1 passed
- ✓ `verify: curl -s -o /dev/null -w '%{http_code}' -X POST $API/v1/quotes -d '{}'` -> 400
- **A test command must reach the test it names.** Repos often split
tests by config (`vitest.config.integration.ts`, a `test:integration`
script, a pytest marker) and the default script excludes the rest: the
command then prints "No test files found" and proves nothing. Before
writing a test `verify:` (and the `## How to verify` line), read the
package's `scripts` and the test config's `include`/`exclude`, pick the
script whose config includes that file, and state any env it needs (test
database URL). Example: `*.integration.test.ts` excluded by
`vitest.config.ts` -> `pnpm --filter <pkg> test:integration <pattern>`.
- **MANUAL is the exception, not the default.** Only UI look-and-feel and
flows no command can reach. MANUAL criteria are the ones the orchestrator
reports as `UNVERIFIED` in `--auto`; a criterion with no `verify:` line gets
silently claimed as done.
### Proportionality
Trivial issue (one symbol, obvious change) → Problem + Map + Success criteria
are enough; omit the rest. Never pad a section to fill the template — an
invented edge case dilutes the real ones, and a fake open decision stalls
`--auto`.
## Pre-flight lint
Run before posting. Each miss is fixed in the draft, not noted as a caveat.
- [ ] Every `path:line` verified this session; no guessed ranges.
- [ ] Every behavioral claim has its proving command, or says `ASSUMPTION`.
- [ ] Contracts: every new field named at all layers; migration default for
existing rows stated; invariant has an enforcement point or is an Open
decision.
- [ ] Every Recommended resolution passes the concreteness test.
- [ ] No edge-case bullet contains "decide" / "or … or" / "document that".
- [ ] Every edge case has all three parts.
- [ ] No Open decision restates Out of scope.
- [ ] Every success criterion is numbered, discriminating, and has a
`verify:` line with an exact command + expected result (or MANUAL steps).
- [ ] Every test command runs under the config that includes its file
(unit vs integration script checked against `include`/`exclude`).
- [ ] Any "single source of truth" requirement has a grep criterion.
- [ ] Checklist puts the shared change first; checkpoints marked if >1
shippable behavior.
- [ ] Every QA trap whose trigger matches this change is carried in a
`verify:` or an edge case, cited as `(T<n>)`.