levi-gear 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -8
- package/agents/_team-protocol.md +15 -6
- package/agents/designer.md +2 -2
- package/agents/developer.md +1 -1
- package/agents/pm.md +4 -1
- package/agents/qa.md +1 -1
- package/agents/teamlead.md +1 -1
- package/package.json +4 -1
- package/src/commands/list.js +2 -1
- package/src/lib/agents.js +9 -2
- package/src/lib/desired-state.js +38 -11
- package/src/lib/role-skills.js +23 -0
- package/src/lib/tools.js +6 -1
- package/src/lib/usecases.js +44 -2
- package/src/runtime/codex-run-state.mjs +156 -0
- package/src/runtime/quota-check.mjs +195 -0
- package/usecases/_run-rules.md +38 -0
- package/usecases/brainstorming/SKILL.md +60 -14
- package/usecases/brainstorming/references/codex-runner.md +28 -0
- package/usecases/code-review/SKILL.md +86 -0
- package/usecases/code-review/references/codex-runner.md +5 -0
- package/usecases/code-review/references/large-changes.md +37 -0
- package/usecases/code-review/references/performance-and-correctness.md +101 -0
- package/usecases/code-review/references/review-guide.md +72 -0
- package/usecases/code-review/references/security.md +119 -0
- package/usecases/create-feature/SKILL.md +97 -0
- package/usecases/create-feature/references/codex-runner.md +57 -0
- package/usecases/create-feature/scripts/lock-tests.mjs +66 -0
- package/usecases/create-feature/workflow.js +532 -0
- package/usecases/design/SKILL.md +66 -0
- package/usecases/design/references/codex-runner.md +27 -0
- package/usecases/design/references/svg-guide.md +14 -0
- package/usecases/design/scripts/check-svg.py +77 -0
- package/usecases/fix-bug/SKILL.md +97 -0
- package/usecases/fix-bug/references/codex-runner.md +32 -0
- package/usecases/fix-bug/workflow.js +392 -0
- package/usecases/generate-test-scenarios/SKILL.md +102 -0
- package/usecases/generate-test-scenarios/references/codex-runner.md +32 -0
- package/usecases/generate-test-scenarios/references/test-case-guide.md +171 -0
- package/usecases/generate-test-scenarios/scripts/render-test-cases-markdown.mjs +76 -0
- package/usecases/generate-test-scenarios/scripts/render-test-cases.mjs +68 -0
- package/usecases/generate-test-scenarios/scripts/test-case-fields.mjs +63 -0
- package/usecases/generate-test-scenarios/scripts/validate-test-cases.mjs +69 -0
- package/usecases/generate-test-scenarios/scripts/write-xlsx.mjs +157 -0
- package/usecases/spec-writing/SKILL.md +63 -0
- package/usecases/spec-writing/references/codex-runner.md +25 -0
- package/usecases/spec-writing/references/spec-guide.md +62 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Writes a single-sheet .xlsx workbook with Node's standard library only (no dependencies).
|
|
2
|
+
//
|
|
3
|
+
// writeXlsx(file, { sheet, columns: [{ header, width }], rows: [[cell, ...], ...] })
|
|
4
|
+
//
|
|
5
|
+
// Every cell is written as text, so nothing is ever read as a number, a date or a formula. The header row is bold,
|
|
6
|
+
// frozen and filterable; cells wrap and align to the top, and line breaks inside a cell are kept.
|
|
7
|
+
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import zlib from 'node:zlib';
|
|
10
|
+
|
|
11
|
+
const MAIN = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main';
|
|
12
|
+
const REL = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';
|
|
13
|
+
const PKG_REL = 'http://schemas.openxmlformats.org/package/2006/relationships';
|
|
14
|
+
const XML_HEAD = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
15
|
+
const INVALID_XML = /[^\t\n\r --�\u{10000}-\u{10FFFF}]/gu;
|
|
16
|
+
|
|
17
|
+
const CRC_TABLE = Array.from({ length: 256 }, (_, n) => {
|
|
18
|
+
let c = n;
|
|
19
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
20
|
+
return c >>> 0;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function crc32(buf) {
|
|
24
|
+
let c = 0xffffffff;
|
|
25
|
+
for (const byte of buf) c = CRC_TABLE[(c ^ byte) & 0xff] ^ (c >>> 8);
|
|
26
|
+
return (c ^ 0xffffffff) >>> 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function escapeXml(text) {
|
|
30
|
+
return String(text)
|
|
31
|
+
.replace(INVALID_XML, '')
|
|
32
|
+
.replace(/&/g, '&')
|
|
33
|
+
.replace(/</g, '<')
|
|
34
|
+
.replace(/>/g, '>')
|
|
35
|
+
.replace(/"/g, '"');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function columnName(index) {
|
|
39
|
+
let name = '';
|
|
40
|
+
for (let n = index + 1; n > 0; n = Math.floor((n - 1) / 26)) name = String.fromCharCode(65 + ((n - 1) % 26)) + name;
|
|
41
|
+
return name;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// A ZIP archive of deflated entries, as an .xlsx package expects.
|
|
45
|
+
function zip(entries) {
|
|
46
|
+
const locals = [];
|
|
47
|
+
const centrals = [];
|
|
48
|
+
let offset = 0;
|
|
49
|
+
for (const [name, text] of entries) {
|
|
50
|
+
const nameBuf = Buffer.from(name, 'utf8');
|
|
51
|
+
const data = Buffer.from(text, 'utf8');
|
|
52
|
+
const packed = zlib.deflateRawSync(data);
|
|
53
|
+
const crc = crc32(data);
|
|
54
|
+
const local = Buffer.alloc(30);
|
|
55
|
+
local.writeUInt32LE(0x04034b50, 0);
|
|
56
|
+
local.writeUInt16LE(20, 4);
|
|
57
|
+
local.writeUInt16LE(8, 8);
|
|
58
|
+
local.writeUInt16LE(33, 12); // DOS date 1980-01-01
|
|
59
|
+
local.writeUInt32LE(crc, 14);
|
|
60
|
+
local.writeUInt32LE(packed.length, 18);
|
|
61
|
+
local.writeUInt32LE(data.length, 22);
|
|
62
|
+
local.writeUInt16LE(nameBuf.length, 26);
|
|
63
|
+
const central = Buffer.alloc(46);
|
|
64
|
+
central.writeUInt32LE(0x02014b50, 0);
|
|
65
|
+
central.writeUInt16LE(20, 4);
|
|
66
|
+
central.writeUInt16LE(20, 6);
|
|
67
|
+
central.writeUInt16LE(8, 10);
|
|
68
|
+
central.writeUInt16LE(33, 14);
|
|
69
|
+
central.writeUInt32LE(crc, 16);
|
|
70
|
+
central.writeUInt32LE(packed.length, 20);
|
|
71
|
+
central.writeUInt32LE(data.length, 24);
|
|
72
|
+
central.writeUInt16LE(nameBuf.length, 28);
|
|
73
|
+
central.writeUInt32LE(offset, 42);
|
|
74
|
+
locals.push(local, nameBuf, packed);
|
|
75
|
+
centrals.push(central, nameBuf);
|
|
76
|
+
offset += local.length + nameBuf.length + packed.length;
|
|
77
|
+
}
|
|
78
|
+
const directory = Buffer.concat(centrals);
|
|
79
|
+
const end = Buffer.alloc(22);
|
|
80
|
+
end.writeUInt32LE(0x06054b50, 0);
|
|
81
|
+
end.writeUInt16LE(entries.length, 8);
|
|
82
|
+
end.writeUInt16LE(entries.length, 10);
|
|
83
|
+
end.writeUInt32LE(directory.length, 12);
|
|
84
|
+
end.writeUInt32LE(offset, 16);
|
|
85
|
+
return Buffer.concat([...locals, directory, end]);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function sheetXml(columns, rows) {
|
|
89
|
+
const lastCell = `${columnName(columns.length - 1)}${rows.length + 1}`;
|
|
90
|
+
const row = (cells, r, style) =>
|
|
91
|
+
`<row r="${r}">` +
|
|
92
|
+
cells
|
|
93
|
+
.map((cell, c) => `<c r="${columnName(c)}${r}" t="inlineStr" s="${style}"><is><t xml:space="preserve">${escapeXml(cell ?? '')}</t></is></c>`)
|
|
94
|
+
.join('') +
|
|
95
|
+
'</row>';
|
|
96
|
+
return (
|
|
97
|
+
XML_HEAD +
|
|
98
|
+
`<worksheet xmlns="${MAIN}"><dimension ref="A1:${lastCell}"/>` +
|
|
99
|
+
'<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>' +
|
|
100
|
+
'<sheetFormatPr defaultRowHeight="15"/><cols>' +
|
|
101
|
+
columns.map((col, i) => `<col min="${i + 1}" max="${i + 1}" width="${col.width}" customWidth="1"/>`).join('') +
|
|
102
|
+
'</cols><sheetData>' +
|
|
103
|
+
row(columns.map((col) => col.header), 1, 2) +
|
|
104
|
+
rows.map((cells, i) => row(cells, i + 2, 1)).join('') +
|
|
105
|
+
`</sheetData><autoFilter ref="A1:${lastCell}"/></worksheet>`
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const STYLES =
|
|
110
|
+
XML_HEAD +
|
|
111
|
+
`<styleSheet xmlns="${MAIN}">` +
|
|
112
|
+
'<fonts count="2"><font><sz val="11"/><name val="Calibri"/></font><font><b/><sz val="11"/><name val="Calibri"/></font></fonts>' +
|
|
113
|
+
'<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>' +
|
|
114
|
+
'<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>' +
|
|
115
|
+
'<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>' +
|
|
116
|
+
'<cellXfs count="3"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>' +
|
|
117
|
+
'<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1"><alignment vertical="top" wrapText="1"/></xf>' +
|
|
118
|
+
'<xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment vertical="top" wrapText="1"/></xf></cellXfs>' +
|
|
119
|
+
'<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>';
|
|
120
|
+
|
|
121
|
+
export function writeXlsx(file, { sheet, columns, rows }) {
|
|
122
|
+
const lastCell = `${columnName(columns.length - 1)}${rows.length + 1}`;
|
|
123
|
+
const quotedSheet = `'${sheet.replace(/'/g, "''")}'`;
|
|
124
|
+
const filterRange = `${quotedSheet}!$A$1:$${lastCell.replace(/(\d+)$/, '$$$1')}`;
|
|
125
|
+
const entries = [
|
|
126
|
+
[
|
|
127
|
+
'[Content_Types].xml',
|
|
128
|
+
XML_HEAD +
|
|
129
|
+
'<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">' +
|
|
130
|
+
'<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>' +
|
|
131
|
+
'<Default Extension="xml" ContentType="application/xml"/>' +
|
|
132
|
+
'<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>' +
|
|
133
|
+
'<Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>' +
|
|
134
|
+
'<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>',
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
'_rels/.rels',
|
|
138
|
+
XML_HEAD +
|
|
139
|
+
`<Relationships xmlns="${PKG_REL}"><Relationship Id="rId1" Type="${REL}/officeDocument" Target="xl/workbook.xml"/></Relationships>`,
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
'xl/workbook.xml',
|
|
143
|
+
XML_HEAD +
|
|
144
|
+
`<workbook xmlns="${MAIN}" xmlns:r="${REL}"><sheets><sheet name="${escapeXml(sheet)}" sheetId="1" r:id="rId1"/></sheets>` +
|
|
145
|
+
`<definedNames><definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">${escapeXml(filterRange)}</definedName></definedNames></workbook>`,
|
|
146
|
+
],
|
|
147
|
+
[
|
|
148
|
+
'xl/_rels/workbook.xml.rels',
|
|
149
|
+
XML_HEAD +
|
|
150
|
+
`<Relationships xmlns="${PKG_REL}"><Relationship Id="rId1" Type="${REL}/worksheet" Target="worksheets/sheet1.xml"/>` +
|
|
151
|
+
`<Relationship Id="rId2" Type="${REL}/styles" Target="styles.xml"/></Relationships>`,
|
|
152
|
+
],
|
|
153
|
+
['xl/worksheets/sheet1.xml', sheetXml(columns, rows)],
|
|
154
|
+
['xl/styles.xml', STYLES],
|
|
155
|
+
];
|
|
156
|
+
fs.writeFileSync(file, zip(entries));
|
|
157
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: levi-spec-writing
|
|
3
|
+
description: Write or update a project spec with the PM, without inventing anything. The PM lists every open question and doubt, the user confirms them, and the spec is written only once the facts are sufficient and confirmed; whatever is still unconfirmed is left as an open question, never filled in. The spec goes to docs/specs/<slug>.md. Fits requests such as "write a spec for X", "update the spec of X", "turn this idea into a spec", "viết spec cho X".
|
|
4
|
+
argument-hint: "<what the spec is about>"
|
|
5
|
+
skill-for: pm
|
|
6
|
+
skill-when: you write or update a spec
|
|
7
|
+
skill-guide: references/spec-guide.md
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Spec writing
|
|
11
|
+
|
|
12
|
+
Turn a request into a spec that contains only what is certain. `levi-pm` is the only agent that writes the spec; you run it in turn, relay its questions to the user, and never write, edit or answer any part of the spec yourself.
|
|
13
|
+
|
|
14
|
+
A spec is a promise to the rest of the team: **a line goes into the spec only when it is confirmed.** What counts as confirmed, and the format of the spec, are in `references/spec-guide.md`; the PM follows that guide.
|
|
15
|
+
|
|
16
|
+
## Files
|
|
17
|
+
|
|
18
|
+
| File | Owner | Purpose |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `docs/specs/<slug>.md` | PM | **The deliverable**: the spec |
|
|
21
|
+
| `docs/levi/<slug>/ledger.md` | PM | Scratch: confirmed facts, open questions and the readiness verdict. Deleted at the end |
|
|
22
|
+
|
|
23
|
+
`<slug>` is a short kebab-case name for the subject, in English (for example `export-orders-csv`). Create folders as needed. Pass the PM the exact paths it should read and write. Only the PM touches either file.
|
|
24
|
+
|
|
25
|
+
## Codex runner
|
|
26
|
+
|
|
27
|
+
On Codex, use [`references/codex-runner.md`](references/codex-runner.md). It persists question rounds and the selected output in `docs/levi/<slug>/run.json`, allowing the run to continue after an interruption.
|
|
28
|
+
|
|
29
|
+
## Steps
|
|
30
|
+
|
|
31
|
+
1. **Intake.** The request is the subject. If it is empty, ask what the spec is about and stop. Derive the slug. Note every file or link the user mentioned: they are sources.
|
|
32
|
+
2. **Find an existing spec.** List `docs/specs/` and match files against the subject by name and title.
|
|
33
|
+
- One clear match: update mode, using that file.
|
|
34
|
+
- Two or more equally plausible: ask the user which one (or "new spec"), then continue.
|
|
35
|
+
- None: new spec at `docs/specs/<slug>.md`.
|
|
36
|
+
3. **PM discovers.** Call `levi-pm` with the subject, the source paths, the existing spec path (update mode), and the ledger path. It reads every source and writes `ledger.md` in this format:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## Confirmed
|
|
40
|
+
| ID | Fact | Source |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| F1 | <one fact> | user / <file path> / existing spec |
|
|
43
|
+
|
|
44
|
+
## Open questions
|
|
45
|
+
| ID | Question | Why it matters | Options (recommended first) | Blocks |
|
|
46
|
+
|---|---|---|---|---|
|
|
47
|
+
| Q1 | <question> | <what in the spec changes with the answer> | A, B, C | goal / scope / story / criterion / ... |
|
|
48
|
+
|
|
49
|
+
## Readiness
|
|
50
|
+
Ready to write: yes | no
|
|
51
|
+
Missing: <what is still unconfirmed and which section it blocks>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The PM must look hard for what is unclear before it says anything is ready: unclear rules, missing states, edge cases and error cases, who the users are and their permissions, what is out of scope, data and limits, priorities, integrations, and terms that could mean two things. Anything it cannot point to a source for is an open question, not a fact. It also lists the questions in its reply.
|
|
55
|
+
4. **Ask the user, all at once.** Take every open question from the ledger and ask them in one round (use the tool's structured question feature if it has one; if it limits the number of questions per call, make the calls back to back). Give each question two to four options with the recommended one first, and let the user answer freely instead. "Not sure yet" is a valid answer and leaves the question open. Do not answer a question for the user and do not treat its recommended option as the answer. Skip this step when there are no open questions.
|
|
56
|
+
5. **PM absorbs the answers.** Call `levi-pm` with the user's answers, quoted as given, and the ledger path. It moves each answered question into Confirmed (source: user), closes it, adds any follow-up question the answers newly raise, and updates Readiness. Then:
|
|
57
|
+
- The ledger says ready: go to step 6.
|
|
58
|
+
- Not ready, and there are open questions the user can still answer: go back to step 4. Ask only the new and the still-open ones. At most three rounds in total.
|
|
59
|
+
- The user says to write now, or the three rounds are used up: go to step 6 with what is confirmed. Say what is still open.
|
|
60
|
+
- The goal, the users or the core scope are still unconfirmed: do not write a spec. Tell the user exactly what is missing and stop. Keep `ledger.md` so a later run can continue; do not delete it.
|
|
61
|
+
6. **PM writes the spec.** Call `levi-pm` with the ledger path and the spec path. It writes `docs/specs/<slug>.md` following `references/spec-guide.md`, using only Confirmed facts, in the language of the request. In update mode it changes only what a confirmed fact touches and leaves the rest as it was. Every unresolved question goes into the spec's Open questions; a section that depends on one says so instead of being filled in.
|
|
62
|
+
7. **Clean up.** Read `choices/` for the report if it exists, then delete it and `ledger.md`, then remove `docs/levi/<slug>/` if empty, and `docs/levi` if that is empty. Delete only after the spec is written. The spec's Source column keeps the traceability.
|
|
63
|
+
8. **Report.** Tell the user the spec path, whether it is new or updated, its Status, how many stories and acceptance criteria it holds, the open questions still in it (one line each).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Codex runner
|
|
2
|
+
|
|
3
|
+
Run this workflow from the project root with a durable checkpoint. Initialize it immediately after intake:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
node <this skill folder>/scripts/codex-run-state.mjs status docs/levi/<slug>
|
|
7
|
+
node <this skill folder>/scripts/codex-run-state.mjs init docs/levi/<slug> spec-writing <slug> discover decide write verify
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
node <this skill folder>/scripts/codex-run-state.mjs begin docs/levi/<slug> <stage>
|
|
12
|
+
node <this skill folder>/scripts/codex-run-state.mjs complete docs/levi/<slug> <stage> <artifact>...
|
|
13
|
+
node <this skill folder>/scripts/codex-run-state.mjs wait docs/levi/<slug> <stage> "<questions>"
|
|
14
|
+
node <this skill folder>/scripts/codex-run-state.mjs block docs/levi/<slug> <stage> "<blocker>"
|
|
15
|
+
node <this skill folder>/scripts/codex-run-state.mjs resume docs/levi/<slug>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
On a resumed run, `status` is authoritative. Begin the current stage, complete it only after the stated artifact exists, and never repeat a completed stage. Use `wait` to preserve unanswered user questions, `block` for an external dependency, and `resume` after it is resolved.
|
|
19
|
+
|
|
20
|
+
- `discover`: select update/new mode and dispatch `levi-pm` to write `ledger.md`. Complete with that ledger.
|
|
21
|
+
- `decide`: run the up-to-three user-answer rounds. Before each question round use `wait`; after the answer use `resume` and have the PM update `ledger.md`. Complete when it is ready to write, when the user explicitly asks to write with remaining questions, or mark `block` when the goal/users/core scope cannot be confirmed.
|
|
22
|
+
- `write`: dispatch `levi-pm` once with the ledger and selected spec path. Complete only when `docs/specs/<slug>.md` exists.
|
|
23
|
+
- `verify`: confirm the PM-owned spec is the requested new/update output and report its status. Cleanup can remove the state and ledger only after this stage completes.
|
|
24
|
+
|
|
25
|
+
The coordinator never edits the ledger or spec. Only `levi-pm` writes them.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Spec guide
|
|
2
|
+
|
|
3
|
+
How `levi-pm` writes or updates a spec, in the `spec-writing` usecase and in every usecase that has it write one. The prompt names the spec to write, the sources, and the facts already confirmed (for example a ledger).
|
|
4
|
+
|
|
5
|
+
## Only what is confirmed
|
|
6
|
+
|
|
7
|
+
A spec is a promise to the rest of the team, so the rule is simple: **a line goes into the spec only when it is confirmed.** Confirmed means one of:
|
|
8
|
+
|
|
9
|
+
- the user stated it, in the request or in an answer to a question;
|
|
10
|
+
- it is written in a document the user pointed to, or in a project file the PM read (the path is the proof);
|
|
11
|
+
- for an update, it is already in the existing spec and the user did not change it.
|
|
12
|
+
|
|
13
|
+
These are not confirmed, and never go into the spec as fact: a guess, a plausible default, "what products like this usually do", a recommended option the user did not accept, an unanswered question. They stay open questions.
|
|
14
|
+
|
|
15
|
+
In update mode, change only what a confirmed fact touches and leave the rest as it was.
|
|
16
|
+
|
|
17
|
+
## Format
|
|
18
|
+
|
|
19
|
+
`docs/specs/<slug>.md`, in the language of the request:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# <Title>
|
|
23
|
+
|
|
24
|
+
- **Status:** Ready | Draft (open questions remain)
|
|
25
|
+
- **Sources:** <documents and people the facts come from>
|
|
26
|
+
|
|
27
|
+
## Goal
|
|
28
|
+
<What the product or change must achieve, and for whom.>
|
|
29
|
+
|
|
30
|
+
## Users
|
|
31
|
+
<Who uses it and what each kind of user may do.>
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
<What is included.>
|
|
35
|
+
|
|
36
|
+
## Out of scope
|
|
37
|
+
<What is explicitly excluded.>
|
|
38
|
+
|
|
39
|
+
## User stories
|
|
40
|
+
| ID | Story | Source |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| US-1 | As a <user>, I want <goal>, so that <reason> | user / <file path> |
|
|
43
|
+
|
|
44
|
+
## Acceptance criteria
|
|
45
|
+
| ID | Story | Criterion | Source |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| AC-1 | US-1 | <observable behavior that can be checked yes or no> | user / <file path> |
|
|
48
|
+
|
|
49
|
+
## Rules and constraints
|
|
50
|
+
<Business rules, limits, states and error cases. Omit this section when none is confirmed.>
|
|
51
|
+
|
|
52
|
+
## Open questions
|
|
53
|
+
| # | Question | Blocks |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| 1 | <unanswered question> | <the section it blocks> |
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- **Status** is Ready only when Open questions is empty; otherwise Draft.
|
|
59
|
+
- Every story and criterion has a **Source**. A row with no source does not belong in the spec.
|
|
60
|
+
- Criteria describe behavior the user or a tester can observe, never how it is built. Do not name technologies, tables or classes unless the user stated them as a requirement.
|
|
61
|
+
- Goal, Users, Scope, Out of scope, Stories and Criteria are always present. When nothing is confirmed for one, its body is `Not yet defined. See Open questions.`, with the matching question listed.
|
|
62
|
+
- Open questions are written as questions, never as assumptions. The spec has no "Assumptions" section.
|