ai-runtime-kit 0.5.0 → 0.10.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/CHANGELOG.md +462 -0
- package/README.md +114 -0
- package/bin/cli.js +4 -0
- package/package.json +2 -1
- package/runtime/INDEX.md +139 -11
- package/runtime/agents/executor.md +7 -0
- package/runtime/agents/feature-writer.md +57 -0
- package/runtime/agents/planner.md +60 -0
- package/runtime/agents/prd-writer.md +59 -0
- package/runtime/agents/reviewer.md +60 -0
- package/runtime/agents/spec-writer.md +60 -0
- package/runtime/agents/tdd-writer.md +57 -0
- package/runtime/agents/verifier.md +8 -1
- package/runtime/features/_template.md +75 -0
- package/runtime/plans/_template.md +5 -2
- package/runtime/reviews/_template.md +8 -0
- package/runtime/specs/_template/spec.md +9 -0
- package/runtime/specs/_template-bug-fix/spec.md +9 -0
- package/runtime/tasks/_template.md +25 -2
- package/runtime/workflows/feature-development.md +86 -6
- package/src/init.js +1 -0
- package/src/validate.js +235 -0
package/runtime/INDEX.md
CHANGED
|
@@ -23,17 +23,106 @@ Location:
|
|
|
23
23
|
|
|
24
24
|
Role files in this location:
|
|
25
25
|
|
|
26
|
+
- prd-writer
|
|
27
|
+
- feature-writer
|
|
28
|
+
- spec-writer
|
|
29
|
+
- planner
|
|
30
|
+
- tdd-writer
|
|
26
31
|
- executor
|
|
27
32
|
- verifier
|
|
33
|
+
- reviewer
|
|
28
34
|
|
|
29
|
-
The runtime framework defines
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`.ai/runtime/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
The runtime framework defines an 8-phase agent pipeline that
|
|
36
|
+
covers the full feature-development workflow. Every phase has
|
|
37
|
+
a corresponding role-definition file under
|
|
38
|
+
`.ai/runtime/agents/`. Recommended Agent Flow:
|
|
39
|
+
|
|
40
|
+
```txt
|
|
41
|
+
PRD-Writer
|
|
42
|
+
→ Feature-Writer
|
|
43
|
+
→ Spec-Writer
|
|
44
|
+
→ Planner
|
|
45
|
+
→ TDD-Writer (for TDD-applicable tasks)
|
|
46
|
+
→ Executor
|
|
47
|
+
→ Verifier
|
|
48
|
+
→ Reviewer
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Notes on phases without their own files:
|
|
52
|
+
|
|
53
|
+
- **Task** is a transition concept, not a role. Tasks are
|
|
54
|
+
authored by `planner` and consumed by `tdd-writer` /
|
|
55
|
+
`executor`. No dedicated `task-creator.md` ships
|
|
56
|
+
(decision recorded in
|
|
57
|
+
`.ai/project/specs/2026-05-14-agent-roster-completion/spec.md`
|
|
58
|
+
§ Open Questions Q2).
|
|
59
|
+
- `architect` is replaced by `spec-writer` in the agent
|
|
60
|
+
vocabulary (decision recorded in the same spec § Q3).
|
|
61
|
+
- `prd-writer` is a **pre-pipeline role** active at workflow
|
|
62
|
+
Step 0; the other 7 form the in-pipeline chain
|
|
63
|
+
(Steps 0.5 through Review). See
|
|
64
|
+
`.ai/runtime/workflows/feature-development.md`.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Traceability
|
|
69
|
+
|
|
70
|
+
Every kit artifact carries a structural **upward-citation link**
|
|
71
|
+
to its direct parent, assembling a complete audit chain from any
|
|
72
|
+
commit back to the originating PRD. The chain:
|
|
73
|
+
|
|
74
|
+
```txt
|
|
75
|
+
commit
|
|
76
|
+
→ task (## Parent Spec + ## Parent Plan)
|
|
77
|
+
→ plan (## Parent Spec)
|
|
78
|
+
→ spec (## Parent Feature)
|
|
79
|
+
→ feature (## Parent PRD)
|
|
80
|
+
→ PRD
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### `## Parent <Type>` convention
|
|
84
|
+
|
|
85
|
+
Each artifact template carries one or more `## Parent <Type>`
|
|
86
|
+
sections naming the direct upstream artifact by path. Required
|
|
87
|
+
field; value is a single path string (not a bullet list).
|
|
88
|
+
|
|
89
|
+
| Artifact | Required sections |
|
|
90
|
+
|---|---|
|
|
91
|
+
| PRD | (root of the chain; no parent) |
|
|
92
|
+
| Feature | `## Parent PRD` |
|
|
93
|
+
| Spec | `## Parent Feature` |
|
|
94
|
+
| Plan | `## Parent Spec` |
|
|
95
|
+
| Task | `## Parent Spec` + `## Parent Plan` |
|
|
96
|
+
| Review | `## Parent Spec` |
|
|
97
|
+
|
|
98
|
+
### `(none — <reason>)` rendering
|
|
99
|
+
|
|
100
|
+
Some workflow paths skip an upstream artifact. Each artifact's
|
|
101
|
+
template documents the rendering:
|
|
102
|
+
|
|
103
|
+
- **Engineering-only spec** (no PRD/feature path; e.g.
|
|
104
|
+
documentation tidy) → `## Parent Feature: (none — engineering-only)`.
|
|
105
|
+
- **Bug-fix spec** (workflow skips Step 0 / 0.5) →
|
|
106
|
+
`## Parent Feature: (none — bug-fix workflow)`.
|
|
107
|
+
- **Hot-fix task** (created outside the normal plan-first
|
|
108
|
+
flow) → `## Parent Plan: (none — direct task)`.
|
|
109
|
+
|
|
110
|
+
Empty / blank values are never valid. The `(none — <reason>)`
|
|
111
|
+
rendering keeps the audit chain explicit even where steps are
|
|
112
|
+
skipped.
|
|
113
|
+
|
|
114
|
+
### Why structural
|
|
115
|
+
|
|
116
|
+
The convention motivates **M3** (traceability chain) from the
|
|
117
|
+
v0.6.0 nine-phase-workflow PRD: a future audit walks the
|
|
118
|
+
sections to verify that shipped work satisfies stated intent,
|
|
119
|
+
without parsing prose. Prose remains in `§Goal` and elsewhere
|
|
120
|
+
for human readability — see `.ai/runtime/workflows/feature-development.md`
|
|
121
|
+
for the per-phase rationale.
|
|
122
|
+
|
|
123
|
+
This kit does NOT ship tooling that validates link resolution
|
|
124
|
+
in this release; the convention exists at the doc level so
|
|
125
|
+
future tooling (if needed) has a stable structure to read.
|
|
37
126
|
|
|
38
127
|
---
|
|
39
128
|
|
|
@@ -120,8 +209,9 @@ Location:
|
|
|
120
209
|
|
|
121
210
|
Defines agent-pipeline transition hooks — declarative boundary
|
|
122
211
|
contracts between two agents in the recommended flow
|
|
123
|
-
(
|
|
124
|
-
|
|
212
|
+
(PRD-Writer → Feature-Writer → Spec-Writer → Planner →
|
|
213
|
+
TDD-Writer → Executor → Verifier → Reviewer). Unlike skills
|
|
214
|
+
(task-triggered) and rules (file-scope-triggered), hooks
|
|
125
215
|
trigger on **agent transitions**. Unrelated to the Husky git hooks
|
|
126
216
|
documented in `ADR-0006`. See `.ai/runtime/hooks/README.md` for the
|
|
127
217
|
hook lifecycle, trigger taxonomy, gate behavior, and loading paths.
|
|
@@ -169,6 +259,38 @@ DRAFT
|
|
|
169
259
|
|
|
170
260
|
---
|
|
171
261
|
|
|
262
|
+
## Features
|
|
263
|
+
|
|
264
|
+
Location:
|
|
265
|
+
|
|
266
|
+
```txt
|
|
267
|
+
.ai/project/features/ (instance)
|
|
268
|
+
.ai/runtime/features/_template.md (template)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Defines one discrete capability sliced from a parent PRD. One
|
|
272
|
+
PRD typically produces N features; one feature drives one (or
|
|
273
|
+
occasionally more) downstream spec. Features answer "what
|
|
274
|
+
specific slice of the PRD does this satisfy, and what does done
|
|
275
|
+
look like for this slice." Engineering details (architecture,
|
|
276
|
+
contracts, test plan) belong in the downstream spec, not the
|
|
277
|
+
feature. See
|
|
278
|
+
`.ai/runtime/workflows/feature-development.md` § Step 0.5.
|
|
279
|
+
|
|
280
|
+
Mandatory whenever Step 0 (PRD) ran; same skip criteria as
|
|
281
|
+
Step 0 (bug fixes and engineering-only changes skip both).
|
|
282
|
+
|
|
283
|
+
Feature lifecycle:
|
|
284
|
+
|
|
285
|
+
```txt
|
|
286
|
+
DRAFT
|
|
287
|
+
→ APPROVED
|
|
288
|
+
→ REJECTED
|
|
289
|
+
→ SUPERSEDED
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
172
294
|
## Specs
|
|
173
295
|
|
|
174
296
|
Location:
|
|
@@ -325,10 +447,16 @@ npm run verify
|
|
|
325
447
|
## Recommended Agent Flow
|
|
326
448
|
|
|
327
449
|
```txt
|
|
328
|
-
|
|
450
|
+
PRD-Writer
|
|
451
|
+
↓
|
|
452
|
+
Feature-Writer
|
|
453
|
+
↓
|
|
454
|
+
Spec-Writer
|
|
329
455
|
↓
|
|
330
456
|
Planner
|
|
331
457
|
↓
|
|
458
|
+
TDD-Writer (for TDD-applicable tasks; see workflow Step 1.5)
|
|
459
|
+
↓
|
|
332
460
|
Executor
|
|
333
461
|
↓
|
|
334
462
|
Verifier
|
|
@@ -17,3 +17,10 @@ You implement features according to specs.
|
|
|
17
17
|
- Change unrelated code
|
|
18
18
|
- Add unnecessary dependencies
|
|
19
19
|
- Ignore build failures
|
|
20
|
+
|
|
21
|
+
## Reference
|
|
22
|
+
|
|
23
|
+
Workflow: `.ai/runtime/workflows/feature-development.md`.
|
|
24
|
+
Upstream: `tdd-writer.md` (for TDD-applicable tasks) or
|
|
25
|
+
`planner.md` (direct, for non-TDD tasks). Downstream:
|
|
26
|
+
`verifier.md`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Feature-Writer Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
You author feature docs from an APPROVED PRD. Workflow Step 0.5
|
|
6
|
+
only — between PRD authoring and spec drafting. You do NOT
|
|
7
|
+
design implementation or write engineering content.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Responsibilities
|
|
12
|
+
|
|
13
|
+
- Read the parent PRD for Problem / Target Users / Success
|
|
14
|
+
Metrics.
|
|
15
|
+
- Read `.ai/runtime/features/_template.md` for section structure.
|
|
16
|
+
- Identify discrete capability slices in the PRD; 1 PRD → N
|
|
17
|
+
features. Single-feature PRDs still produce 1 feature doc.
|
|
18
|
+
- Draft each feature with Parent PRD citation + PRD Metrics
|
|
19
|
+
Contributed mapping (primary / partial / not contributed).
|
|
20
|
+
- Save to `.ai/project/features/YYYY-MM-DD-<slug>/feature.md`
|
|
21
|
+
with `Status: DRAFT`.
|
|
22
|
+
- Report each feature path and the PRD metrics it covers.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Inputs
|
|
27
|
+
|
|
28
|
+
- Parent PRD at `.ai/project/prds/...`
|
|
29
|
+
- `.ai/runtime/features/_template.md`
|
|
30
|
+
- `.ai/project/STATE.md`
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Outputs
|
|
35
|
+
|
|
36
|
+
One or more files at
|
|
37
|
+
`.ai/project/features/YYYY-MM-DD-<slug>/feature.md`, each
|
|
38
|
+
citing the parent PRD, mapping PRD metrics, `Status: DRAFT`.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Must Not
|
|
43
|
+
|
|
44
|
+
- Write engineering content (architecture, contracts) — defer
|
|
45
|
+
to spec.
|
|
46
|
+
- Skip feature doc creation when a PRD exists (mandatory per
|
|
47
|
+
workflow Step 0.5).
|
|
48
|
+
- Allow stub-shape feature docs — full template required even
|
|
49
|
+
for single-feature PRDs.
|
|
50
|
+
- Self-promote `Status: APPROVED` — only on user sign-off.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Reference
|
|
55
|
+
|
|
56
|
+
Workflow: `.ai/runtime/workflows/feature-development.md` § 0.5.
|
|
57
|
+
Upstream: `prd-writer.md`. Downstream: `spec-writer.md`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Planner Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
You decompose an APPROVED spec into an implementation plan and
|
|
6
|
+
concrete tasks. Workflow phase Plan + Task — between spec
|
|
7
|
+
approval and TDD. You author both plan and task docs (the
|
|
8
|
+
"task" phase consumes tasks downstream; no separate
|
|
9
|
+
task-creator role).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Responsibilities
|
|
14
|
+
|
|
15
|
+
- Read parent spec, related contracts, runtime constraints
|
|
16
|
+
(SAFETY, RUNTIME_MODE, RUNTIME_HEALTH).
|
|
17
|
+
- Read `.ai/runtime/plans/_template.md` and
|
|
18
|
+
`.ai/runtime/tasks/_template.md`.
|
|
19
|
+
- Decompose: produce one plan (strategy + task graph) and N
|
|
20
|
+
task docs (one per executable unit).
|
|
21
|
+
- For each task, determine **TDD-applies** per
|
|
22
|
+
`feature-development.md` rules (behavior-changing tasks =
|
|
23
|
+
yes; doc / refactor-no-behavior / config-only = no).
|
|
24
|
+
- Save plan + tasks under `.ai/project/plans/...` +
|
|
25
|
+
`.ai/project/tasks/...`.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Inputs
|
|
30
|
+
|
|
31
|
+
- Parent spec at `.ai/project/specs/...`
|
|
32
|
+
- `.ai/runtime/plans/_template.md`,
|
|
33
|
+
`.ai/runtime/tasks/_template.md`
|
|
34
|
+
- `.ai/project/contracts/**`, `.ai/project/STATE.md`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Outputs
|
|
39
|
+
|
|
40
|
+
One plan file plus N task files. Each task carries a
|
|
41
|
+
TDD-applies boolean. Tasks reference parent plan; plan
|
|
42
|
+
references parent spec.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Must Not
|
|
47
|
+
|
|
48
|
+
- Generate tasks for work outside parent spec's §2 Scope.
|
|
49
|
+
- Skip the TDD-applies determination on any task.
|
|
50
|
+
- Combine multiple specs into one plan (1 spec : 1 plan).
|
|
51
|
+
- Pre-assign tasks to specific implementer instances (that's
|
|
52
|
+
execution-time).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Reference
|
|
57
|
+
|
|
58
|
+
Workflow: `.ai/runtime/workflows/feature-development.md` § 2.
|
|
59
|
+
Upstream: `spec-writer.md`. Downstream: `tdd-writer.md` (for
|
|
60
|
+
TDD tasks) or `executor.md` (direct, for non-TDD tasks).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# PRD-Writer Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
You author Product Requirements Documents from a user's
|
|
6
|
+
description of a product-driven feature. Workflow Step 0 only —
|
|
7
|
+
upstream of the spec/plan/task/review pipeline. You do NOT
|
|
8
|
+
design, implement, or verify.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
|
|
14
|
+
- Read `.ai/runtime/prds/_template.md` for section structure.
|
|
15
|
+
- Read `.ai/project/STATE.md` so framing fits current state.
|
|
16
|
+
- Elicit each section from the user conversationally — one
|
|
17
|
+
topic at a time.
|
|
18
|
+
- Save to `.ai/project/prds/YYYY-MM-DD-<slug>/prd.md` with
|
|
19
|
+
`Status: DRAFT`.
|
|
20
|
+
- Report path, remaining open questions, proposed next step.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Inputs
|
|
25
|
+
|
|
26
|
+
- `.ai/runtime/prds/_template.md`
|
|
27
|
+
- `.ai/project/STATE.md`
|
|
28
|
+
- User's conversational description
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Outputs
|
|
33
|
+
|
|
34
|
+
One file at `.ai/project/prds/YYYY-MM-DD-<slug>/prd.md` with all
|
|
35
|
+
7 body sections populated, ≥2 user stories in "As a X, I want Y,
|
|
36
|
+
so that Z" form, ≥1 success metric observable post-ship,
|
|
37
|
+
`Status: DRAFT`, `Downstream Spec: (pending)`.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Must Not
|
|
42
|
+
|
|
43
|
+
- Write engineering content (architecture, API, contracts) —
|
|
44
|
+
defer to spec.
|
|
45
|
+
- Invent unprovided facts — record as Open Questions.
|
|
46
|
+
- Self-promote `Status: APPROVED` — only on user sign-off.
|
|
47
|
+
- Compound multiple features in one PRD.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Reference
|
|
52
|
+
|
|
53
|
+
11-step procedure in
|
|
54
|
+
`.ai/project/skills/product/write-a-prd/SKILL.md` (this repo's
|
|
55
|
+
dogfood; project-side). Concept lattice: agent = WHO,
|
|
56
|
+
skill = HOW.
|
|
57
|
+
|
|
58
|
+
Workflow: `.ai/runtime/workflows/feature-development.md` § 0.
|
|
59
|
+
Downstream: `feature-writer.md` (Step 0.5 — slicing the PRD).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Reviewer Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
You author review files after implementation completes and
|
|
6
|
+
`verifier` has signed off. Workflow Review phase — the final
|
|
7
|
+
step. You verify shipped work satisfies the spec, the feature's
|
|
8
|
+
acceptance, and maps to PRD success metrics.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
|
|
14
|
+
- Read parent spec, feature, PRD, plan, tasks, and verifier
|
|
15
|
+
output.
|
|
16
|
+
- Map each PRD success metric to the artifacts that satisfy
|
|
17
|
+
it. Usage metrics (e.g. "60-day post-ship") get marked
|
|
18
|
+
"to be measured" with a date.
|
|
19
|
+
- Document Blocking Issues, Non-blocking Issues, Suggested
|
|
20
|
+
Fixes, Open Questions Resolved, and Process Notes (dogfood
|
|
21
|
+
reflections useful for future audits — target user D).
|
|
22
|
+
- Save to `.ai/project/reviews/YYYY-MM-DD-<slug>.md` (or
|
|
23
|
+
match the parent spec's directory pattern).
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Inputs
|
|
28
|
+
|
|
29
|
+
- Parent spec / feature / PRD via citation chain
|
|
30
|
+
- Verification output from `verifier`
|
|
31
|
+
- Commit log on the feature branch
|
|
32
|
+
- `.ai/runtime/reviews/_template.md`
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Outputs
|
|
37
|
+
|
|
38
|
+
One review file with sections: Summary / Verification /
|
|
39
|
+
Acceptance Criteria checklist / Blocking Issues /
|
|
40
|
+
Non-blocking Issues / Suggested Fixes / Open Questions
|
|
41
|
+
Resolved / Process Notes / Verdict.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Must Not
|
|
46
|
+
|
|
47
|
+
- Render an "Approved" verdict while blocking issues remain
|
|
48
|
+
unresolved.
|
|
49
|
+
- Skip PRD success metric mapping when a PRD exists upstream.
|
|
50
|
+
- Author the review file before the implementation merges and
|
|
51
|
+
`verifier` has reported PASS.
|
|
52
|
+
- Silently override a verifier FAIL — escalate to the operator.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Reference
|
|
57
|
+
|
|
58
|
+
Workflow: `.ai/runtime/workflows/feature-development.md`.
|
|
59
|
+
Upstream: `verifier.md`. The review feeds future audits
|
|
60
|
+
(target user D in the v0.6.0 nine-phase-workflow PRD).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Spec-Writer Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
You author technical specs from an APPROVED feature. Workflow
|
|
6
|
+
Step 1 only. You define HOW to build a feature; not WHAT or WHY
|
|
7
|
+
(those live in feature and PRD).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Responsibilities
|
|
12
|
+
|
|
13
|
+
- Read the parent feature; follow citation chain to parent PRD
|
|
14
|
+
for strategic context.
|
|
15
|
+
- Read `.ai/runtime/specs/_template/spec.md` (or
|
|
16
|
+
`_template-bug-fix/` for corrective work).
|
|
17
|
+
- Read related `.ai/project/contracts/**`, `.ai/project/STATE.md`.
|
|
18
|
+
- Draft the spec: §1 Goal cites parent feature; §2 Scope
|
|
19
|
+
enumerates every touched runtime path (preflight requirement);
|
|
20
|
+
Requirements / Acceptance Criteria / Test Checklist /
|
|
21
|
+
Verification Commands / Rollback Plan.
|
|
22
|
+
- Save to `.ai/project/specs/YYYY-MM-DD-<slug>/spec.md` with
|
|
23
|
+
`Status: DRAFT`.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Inputs
|
|
28
|
+
|
|
29
|
+
- Parent feature at `.ai/project/features/...`
|
|
30
|
+
- `.ai/runtime/specs/_template/spec.md`
|
|
31
|
+
- Related contracts, project memory, STATE.md
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Outputs
|
|
36
|
+
|
|
37
|
+
One file at `.ai/project/specs/YYYY-MM-DD-<slug>/spec.md`.
|
|
38
|
+
§1 cites parent feature. §2 enumerates runtime paths if any.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Must Not
|
|
43
|
+
|
|
44
|
+
- Expand scope beyond parent feature's `## Includes`.
|
|
45
|
+
- Skip §2 Scope enumeration when touching runtime/**
|
|
46
|
+
(`pre-executor/runtime-scoped-preflight` hook will GATE-fail
|
|
47
|
+
at executor transition otherwise).
|
|
48
|
+
- Mix product intent (PRD / feature) with engineering details
|
|
49
|
+
(your output).
|
|
50
|
+
- Self-promote `Status: APPROVED`.
|
|
51
|
+
- Lock hard byte-budgets on new template/role files without
|
|
52
|
+
prototyping — use ranges or revisit during impl
|
|
53
|
+
(drift hit v0.5.1 + v0.7.0).
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Reference
|
|
58
|
+
|
|
59
|
+
Workflow: `.ai/runtime/workflows/feature-development.md` § 1.
|
|
60
|
+
Upstream: `feature-writer.md`. Downstream: `planner.md`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# TDD-Writer Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
For a given task with `TDD-applies = true`, you write a
|
|
6
|
+
failing test that defines what "done" means *before* any
|
|
7
|
+
implementation lands. Workflow TDD phase. You do NOT write
|
|
8
|
+
implementation code.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
|
|
14
|
+
- Read the task spec and parent spec for behavior requirements.
|
|
15
|
+
- Read existing tests to avoid duplication.
|
|
16
|
+
- Author a test that **fails** when run against the current
|
|
17
|
+
code (red state required — verify red before declaring the
|
|
18
|
+
step done).
|
|
19
|
+
- Commit the test in isolation; the implementation commit lands
|
|
20
|
+
separately under `executor`. M4 metric counts test-commit
|
|
21
|
+
timestamp preceding implement-commit timestamp.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Inputs
|
|
26
|
+
|
|
27
|
+
- Task at `.ai/project/tasks/...` (`TDD-applies = true`)
|
|
28
|
+
- Parent spec for behavior context
|
|
29
|
+
- Existing test files
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Outputs
|
|
34
|
+
|
|
35
|
+
One or more test file commits whose tests fail against current
|
|
36
|
+
code. Each test describes the behavior `executor` will then
|
|
37
|
+
make pass.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Must Not
|
|
42
|
+
|
|
43
|
+
- Write implementation code (defer to `executor`).
|
|
44
|
+
- Author tests that already pass (verify red first).
|
|
45
|
+
- Skip the separate test commit (inlining tests into an
|
|
46
|
+
implementation commit violates M4 test-first ordering).
|
|
47
|
+
- Apply to tasks where `TDD-applies = false`
|
|
48
|
+
(doc / refactor-no-behavior / config-only per workflow rule).
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Reference
|
|
53
|
+
|
|
54
|
+
Workflow: `.ai/runtime/workflows/feature-development.md`
|
|
55
|
+
(TDD phase wired in by F3 of the nine-phase-workflow PRD;
|
|
56
|
+
F2 ships this role file ahead of F3 so F3 can reference it).
|
|
57
|
+
Upstream: `planner.md`. Downstream: `executor.md`.
|
|
@@ -80,4 +80,11 @@ PASS | FAIL
|
|
|
80
80
|
|
|
81
81
|
- Implement features
|
|
82
82
|
- Change feature scope
|
|
83
|
-
- Ignore failing checks
|
|
83
|
+
- Ignore failing checks
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Reference
|
|
88
|
+
|
|
89
|
+
Workflow: `.ai/runtime/workflows/feature-development.md`.
|
|
90
|
+
Upstream: `executor.md`. Downstream: `reviewer.md`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Feature: <Feature Name>
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
DRAFT
|
|
6
|
+
<!-- Allowed: DRAFT | APPROVED | REJECTED | SUPERSEDED.
|
|
7
|
+
Features follow the same lifecycle as PRDs and specs.
|
|
8
|
+
|
|
9
|
+
A feature is a slice of a parent PRD — one discrete
|
|
10
|
+
capability that can be specced, implemented, and reviewed
|
|
11
|
+
as a unit. One PRD typically produces N features. -->
|
|
12
|
+
|
|
13
|
+
## Parent PRD
|
|
14
|
+
|
|
15
|
+
`.ai/project/prds/YYYY-MM-DD-<prd-slug>/prd.md`
|
|
16
|
+
|
|
17
|
+
## Goal
|
|
18
|
+
|
|
19
|
+
<!-- 1–2 paragraphs. What specific slice of the parent PRD
|
|
20
|
+
does this feature satisfy? Why scoped this way — as
|
|
21
|
+
opposed to merging into another feature or splitting
|
|
22
|
+
further? -->
|
|
23
|
+
|
|
24
|
+
## PRD Metrics Contributed
|
|
25
|
+
|
|
26
|
+
<!-- Map this feature to specific Ms in the parent PRD's
|
|
27
|
+
## Success Metrics. For each M state one of:
|
|
28
|
+
- primary (this feature is the main driver of the M)
|
|
29
|
+
- partial (contributes but other features needed too)
|
|
30
|
+
- not contributed
|
|
31
|
+
...with a one-line reason. -->
|
|
32
|
+
|
|
33
|
+
- **M1** —
|
|
34
|
+
- **M2** —
|
|
35
|
+
|
|
36
|
+
## Scope
|
|
37
|
+
|
|
38
|
+
### Includes
|
|
39
|
+
|
|
40
|
+
<!-- Files, artifacts, or behaviors this feature delivers.
|
|
41
|
+
If any path is under .ai/runtime/**, the downstream spec
|
|
42
|
+
is runtime-scoped governance per
|
|
43
|
+
.ai/runtime/SAFETY.md § Runtime Tree Protection. -->
|
|
44
|
+
|
|
45
|
+
-
|
|
46
|
+
|
|
47
|
+
### Excludes
|
|
48
|
+
|
|
49
|
+
<!-- Carry from parent PRD's ## Out of Scope where relevant +
|
|
50
|
+
own feature-level additions (e.g. neighboring features
|
|
51
|
+
in the same PRD slice). -->
|
|
52
|
+
|
|
53
|
+
-
|
|
54
|
+
|
|
55
|
+
## Acceptance
|
|
56
|
+
|
|
57
|
+
<!-- When is THIS feature done? Narrower than the spec's
|
|
58
|
+
§Acceptance Criteria (no test checklist, no verification
|
|
59
|
+
commands here); broader than tasks. Should be checkable
|
|
60
|
+
by reading the downstream spec + review file. -->
|
|
61
|
+
|
|
62
|
+
-
|
|
63
|
+
|
|
64
|
+
## Open Questions
|
|
65
|
+
|
|
66
|
+
<!-- Feature-level questions only. Spec-phase mechanics
|
|
67
|
+
(exact paths, link encoding, test plan) get marked
|
|
68
|
+
"(deferred to spec)" — they aren't blocking for feature
|
|
69
|
+
APPROVED. -->
|
|
70
|
+
|
|
71
|
+
-
|
|
72
|
+
|
|
73
|
+
## Downstream Spec
|
|
74
|
+
|
|
75
|
+
`.ai/project/specs/YYYY-MM-DD-<slug>/spec.md` (pending)
|
|
@@ -6,9 +6,12 @@ Describe the overall engineering goal.
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Parent Spec
|
|
10
10
|
|
|
11
|
-
-
|
|
11
|
+
`.ai/project/specs/YYYY-MM-DD-<slug>/spec.md`
|
|
12
|
+
<!-- Required. Single path — one plan implements one spec. The
|
|
13
|
+
spec in turn cites its parent feature, assembling the
|
|
14
|
+
upward chain. See .ai/runtime/INDEX.md § Traceability. -->
|
|
12
15
|
|
|
13
16
|
---
|
|
14
17
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Review: <Feature Name>
|
|
2
2
|
|
|
3
|
+
## Parent Spec
|
|
4
|
+
|
|
5
|
+
`.ai/project/specs/YYYY-MM-DD-<slug>/spec.md`
|
|
6
|
+
<!-- Required. Single direct-parent path. The review walks
|
|
7
|
+
further upstream (spec → feature → PRD) via the chain;
|
|
8
|
+
only the direct parent (spec) is structurally cited here.
|
|
9
|
+
See .ai/runtime/INDEX.md § Traceability for the full chain. -->
|
|
10
|
+
|
|
3
11
|
## Summary
|
|
4
12
|
|
|
5
13
|
|
|
@@ -6,6 +6,15 @@ DRAFT
|
|
|
6
6
|
<!-- Allowed: DRAFT | APPROVED | REJECTED | SUPERSEDED.
|
|
7
7
|
See .ai/runtime/workflows/feature-development.md for lifecycle rules. -->
|
|
8
8
|
|
|
9
|
+
## Parent Feature
|
|
10
|
+
|
|
11
|
+
`.ai/project/features/YYYY-MM-DD-<slug>/feature.md`
|
|
12
|
+
<!-- Required. Path to the parent feature this spec
|
|
13
|
+
implements; the feature in turn cites its parent PRD,
|
|
14
|
+
assembling the upward chain. For engineering-only specs
|
|
15
|
+
(no upstream feature), render `(none — engineering-only)`.
|
|
16
|
+
See .ai/runtime/INDEX.md § Traceability for the full chain. -->
|
|
17
|
+
|
|
9
18
|
## Goal
|
|
10
19
|
|
|
11
20
|
Describe the user or engineering outcome.
|