@spec-engine/spec-engine 0.8.1 → 0.9.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 +1 -1
- package/dist/agent/AGENTS.md +678 -0
- package/dist/agent/mcp.json +11 -0
- package/dist/agent/pre-commit +3 -0
- package/dist/agent/skills/req-author/SKILL.md +102 -0
- package/dist/docs/agent-reference/index.html +1280 -33
- package/dist/docs/architecture/index.html +6 -6
- package/dist/docs/checks/index.html +19 -266
- package/dist/docs/commands/index.html +32 -164
- package/dist/docs/format/index.html +2 -9
- package/dist/docs/getting-started/index.html +3 -3
- package/dist/docs/guides/platform-setup/index.html +2 -2
- package/dist/docs/pagefind/fragment/en_10e3da6.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_37cae5e.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_7fc2fcd.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_96d3bc1.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_a26aa07.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_b7e68ef.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_d8a5bcd.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_de67937.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_fc3c55b.pf_fragment +0 -0
- package/dist/docs/pagefind/index/en_1664b45.pf_index +0 -0
- package/dist/docs/pagefind/index/en_a8b8bb6.pf_index +0 -0
- package/dist/docs/pagefind/pagefind-entry.json +1 -1
- package/dist/docs/pagefind/pagefind.en_bc3d4a7766.pf_meta +0 -0
- package/dist/docs/platform-mapping/index.html +2 -1
- package/dist/docs/tags/index.html +9 -92
- package/dist/impl.js +1948 -653
- package/package.json +1 -1
- package/dist/docs/pagefind/fragment/en_1f98c2d.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_24f76b6.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_2ee687a.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_4bd9de6.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_9cc1878.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_9cfc306.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_b81dc52.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_c3abf3d.pf_fragment +0 -0
- package/dist/docs/pagefind/fragment/en_c3e92c6.pf_fragment +0 -0
- package/dist/docs/pagefind/index/en_59c3abf.pf_index +0 -0
- package/dist/docs/pagefind/index/en_a630d23.pf_index +0 -0
- package/dist/docs/pagefind/pagefind.en_ced49c317e.pf_meta +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: req-author
|
|
3
|
+
description: Turn a rough brief or ticket into Spec Engine requirements — draft them in the fixed EARS shape, tie every draft to the exact words it came from, present the batch for human approval, and only then mint via the real `spec` CLI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# req-author
|
|
7
|
+
|
|
8
|
+
> A requirement is one rule of the product's behavior, stated from the user's point of view.
|
|
9
|
+
|
|
10
|
+
The full requirement authoring standard is the "Requirement authoring
|
|
11
|
+
standard" section of the agent reference
|
|
12
|
+
(`packages/site/src/content/docs/agent-reference.md`); this skill applies it.
|
|
13
|
+
|
|
14
|
+
This skill drives the real `spec` CLI (`spec req`, `spec query`,
|
|
15
|
+
`spec domain list`) and never reimplements minting. It is the front half of
|
|
16
|
+
the lifecycle: brief in, approved requirements out; the route → tag → check
|
|
17
|
+
loop consumes what it produces.
|
|
18
|
+
|
|
19
|
+
**Two non-negotiable rules:**
|
|
20
|
+
|
|
21
|
+
1. **Never write without approval.** Draft, self-check, present the batch —
|
|
22
|
+
then STOP. No `spec req` runs until the human explicitly approves.
|
|
23
|
+
2. **Every draft quotes its source.** Each drafted requirement carries the
|
|
24
|
+
exact phrase from the brief it derives from, verbatim. A requirement you
|
|
25
|
+
cannot anchor to the author's words is labeled **inferred** so the human
|
|
26
|
+
can accept or reject the inference knowingly. This exists because
|
|
27
|
+
agent-drafted requirements have shipped that the product owner could not
|
|
28
|
+
trace back to anything they said.
|
|
29
|
+
|
|
30
|
+
## Procedure
|
|
31
|
+
|
|
32
|
+
1. **Read the brief.** A ticket is temporary work; the requirements outlive
|
|
33
|
+
it. One brief usually splits into several requirements — one per behavior,
|
|
34
|
+
never one per ticket.
|
|
35
|
+
|
|
36
|
+
2. **Draft each requirement in the fixed shape.** Every statement uses one of
|
|
37
|
+
the five EARS shapes (the word "shall" separates who acts from the
|
|
38
|
+
observable result):
|
|
39
|
+
|
|
40
|
+
| Situation | Shape |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Always true | The `<system>` shall `<result>` |
|
|
43
|
+
| Triggered by an event | When `<trigger>`, the `<system>` shall `<result>` |
|
|
44
|
+
| Only in a certain state | While `<state>`, the `<system>` shall `<result>` |
|
|
45
|
+
| Handling something going wrong | If `<failure>`, then the `<system>` shall `<result>` |
|
|
46
|
+
| Only when a feature is present | Where `<feature>`, the `<system>` shall `<result>` |
|
|
47
|
+
|
|
48
|
+
Example: "When an unknown requirement id is passed, spec resolve shall
|
|
49
|
+
print [] and exit 0." If a draft fits no row, you have not yet decided
|
|
50
|
+
what triggers the behavior or what observably happens — decide, or mark
|
|
51
|
+
the draft as a question for the human.
|
|
52
|
+
|
|
53
|
+
One promise per statement: a result chaining two behaviors with `and` is
|
|
54
|
+
two drafts. Prefer `When`, `If … then`, and the bare `shall` form; `While`
|
|
55
|
+
and `Where` only when a state or feature gates the behavior. Rationale
|
|
56
|
+
belongs in the why, never in the statement.
|
|
57
|
+
|
|
58
|
+
The statement rules are checked the same way: one sentence ending in a
|
|
59
|
+
period, at most 280 characters, and no repository file or folder, test
|
|
60
|
+
mechanics, CI or tooling layout, history, project jargon, or tool choice.
|
|
61
|
+
`spec req` refuses a draft that breaks one; `spec lint <KEY-NNN> .` lists
|
|
62
|
+
the findings for an existing requirement.
|
|
63
|
+
|
|
64
|
+
3. **Write a why that names what breaks.** The `why` answers "what goes wrong
|
|
65
|
+
if this stops being true" — never a restatement of the statement in
|
|
66
|
+
different words.
|
|
67
|
+
|
|
68
|
+
4. **Place and dedup.** `spec domain list --json` shows every domain's
|
|
69
|
+
charter; put each requirement in the domain whose promise it protects (not
|
|
70
|
+
where the code file sits). Then `spec query "<phrase>" . --json` — if a
|
|
71
|
+
close requirement already exists, propose amending or relating it instead
|
|
72
|
+
of a new id.
|
|
73
|
+
|
|
74
|
+
5. **Present the batch and STOP.** For each candidate show: the domain, the
|
|
75
|
+
statement, the why, and the **source quote** (or the
|
|
76
|
+
`inferred` label). Write nothing until the human approves. This gate is
|
|
77
|
+
mandatory.
|
|
78
|
+
|
|
79
|
+
6. **On approval, mint via the real CLI:**
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
spec req <domain> --text "<statement>" --why "<what breaks>"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
(or the equivalent `spec mcp` tools). `spec req` validates through the one
|
|
86
|
+
shared schema — in a domain that declares the ears grammar it also checks
|
|
87
|
+
the statement shape at write time, and with `--json` it returns the parsed
|
|
88
|
+
clauses.
|
|
89
|
+
|
|
90
|
+
7. **Record the ticket as provenance only.** The originating ticket id is
|
|
91
|
+
history, never a requirement id and never a code `@spec` tag.
|
|
92
|
+
|
|
93
|
+
8. **Verify.** `spec index . && spec check . --ci` (exit 0) and
|
|
94
|
+
`spec guard .` (no loss) before the change ships.
|
|
95
|
+
|
|
96
|
+
## Invocation note
|
|
97
|
+
|
|
98
|
+
The repo's `.mcp.json` registers the local `spec mcp` server (stdio,
|
|
99
|
+
loopback), so the tools and the `author_requirements` prompt are callable
|
|
100
|
+
natively from the harness. From a source checkout the server runs as
|
|
101
|
+
`bun packages/engine/src/cli.ts mcp .`; a compiled `spec` binary on PATH runs
|
|
102
|
+
as `spec mcp .`.
|