scaffold-agent-specs 0.1.4 → 0.1.8
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
CHANGED
|
@@ -6,33 +6,7 @@ A deliberately small, dependency-free CLI for **spec-driven agentic coding**. It
|
|
|
6
6
|
|
|
7
7
|
Node.js 20 or newer and npm (for installation or `npx`). The scaffolded repository itself can use **any** programming language or framework.
|
|
8
8
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
Download and extract this project, then run:
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
cd scaffold-agent-specs
|
|
15
|
-
npm test
|
|
16
|
-
node bin/scaffold-agent-specs.js --help
|
|
17
|
-
|
|
18
|
-
# Preview what will be created in any repo:
|
|
19
|
-
node bin/scaffold-agent-specs.js init --dir /path/to/your/repo --dry-run
|
|
20
|
-
|
|
21
|
-
# Actually initialize the repo:
|
|
22
|
-
node bin/scaffold-agent-specs.js init --dir /path/to/your/repo
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Or use `npm link` from this package directory to install the development command into your PATH:
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
npm link
|
|
29
|
-
cd /path/to/your/repo
|
|
30
|
-
scaffold-agent-specs init
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Unlink later with `npm unlink -g scaffold-agent-specs`.
|
|
34
|
-
|
|
35
|
-
## After publishing to npm
|
|
9
|
+
## Usage
|
|
36
10
|
|
|
37
11
|
From the root of any project:
|
|
38
12
|
|
|
@@ -46,7 +20,7 @@ When the user and agent have discussed a feature and the user **explicitly accep
|
|
|
46
20
|
npx scaffold-agent-specs feature "User statistics page" --approved
|
|
47
21
|
```
|
|
48
22
|
|
|
49
|
-
This
|
|
23
|
+
This creates `docs/features/feature-001-user-statistics-page/` with these files:
|
|
50
24
|
|
|
51
25
|
- `PLAN.md` for the approved scope, constraints, requirements and proposed approach.
|
|
52
26
|
- `ACCEPTANCE_MATRIX.md` for objective acceptance criteria and verification evidence.
|
|
@@ -115,6 +89,16 @@ There is intentionally no `implement` command: an agent should follow `AGENTS.md
|
|
|
115
89
|
|
|
116
90
|
## Develop
|
|
117
91
|
|
|
92
|
+
To run the CLI from a clone of this repository:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
npm test
|
|
96
|
+
node bin/scaffold-agent-specs.js --help
|
|
97
|
+
node bin/scaffold-agent-specs.js init --dir /path/to/your/repo --dry-run
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Or use `npm link` to put the development command on your PATH, and `npm unlink -g scaffold-agent-specs` to remove it later.
|
|
101
|
+
|
|
118
102
|
```sh
|
|
119
103
|
npm test # Built-in Node.js test runner
|
|
120
104
|
npm run format # Format scaffold Markdown with Prettier
|
|
@@ -123,7 +107,7 @@ npm run pack:check # Preview npm-published file manifest
|
|
|
123
107
|
npm pack # Produce local npm tarball for testing
|
|
124
108
|
```
|
|
125
109
|
|
|
126
|
-
For
|
|
110
|
+
For the release steps, see [`PUBLISHING.md`](PUBLISHING.md).
|
|
127
111
|
|
|
128
112
|
## License
|
|
129
113
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"6bdd5aa7149e0e3a53ddf1ff3fc067c3797e0c9942844cbb00b34c228204183c"
|
|
4
4
|
],
|
|
5
5
|
".agent-specs/templates/conventions/CONVENTION.md": [
|
|
6
|
-
"462a9cbf6c502f6692c9813a2da02e796a3547d02fb58058e2153bf4e3dc91d3"
|
|
6
|
+
"462a9cbf6c502f6692c9813a2da02e796a3547d02fb58058e2153bf4e3dc91d3",
|
|
7
|
+
"636e0b91189004f35c12da1d31bca6a26d5b6e6460547ac7b052f6dcfe4122c8",
|
|
8
|
+
"6f048a218b8fa094fe8d12ee1978d0600849db4d8142ca56502e986b5af7dfaa"
|
|
7
9
|
],
|
|
8
10
|
".agent-specs/templates/feature/ACCEPTANCE_MATRIX.md": [
|
|
9
11
|
"0efef77a6c06737d224289611ab9cd7640a987395bcb526fff4f4b5f86295753"
|
|
@@ -36,7 +38,9 @@
|
|
|
36
38
|
"c08f3412d558b6992b0a2e003d5be0de201502846453c2b2da70c2d682d5815a",
|
|
37
39
|
"bc70d6dee9f3f76affb0636ff804a112885b0973aaa2753ac970fc83d0260b5e",
|
|
38
40
|
"a09404a3dce7e2c1f7aa0efce59c5b075943ad768a02b62dc51e08e44a050318",
|
|
39
|
-
"53776f37c6f55ece45c4b4d32d2a48749031c90e77047d9a730c3f150af0d79f"
|
|
41
|
+
"53776f37c6f55ece45c4b4d32d2a48749031c90e77047d9a730c3f150af0d79f",
|
|
42
|
+
"3753a29898a4209208fdbb8f1e9a3de206d845d95e60d8c543f48c2c239780bf",
|
|
43
|
+
"78e89555d30c751816a523575b57aca8d8f2421b478769134bf31c1a16967a04"
|
|
40
44
|
],
|
|
41
45
|
"CLAUDE.md": [
|
|
42
46
|
"272bcb5a9f136af56c1c93203c21976e02a09ed0a59d2515fad23d24b6c34408"
|
|
@@ -45,7 +49,10 @@
|
|
|
45
49
|
"0712abf011e6632fcdaee95c9b0c7bcad39808b5d28678c25aa0c05d281f795f",
|
|
46
50
|
"637e83ce425e97ee9751a8500f5928d1f1ed2536e8d1a02b85bf6e11bc937192",
|
|
47
51
|
"9dd7762484311d7a2a59620d4e89c61e4eb68688d9ebe1b3e2f2ac6d114373fd",
|
|
48
|
-
"049b5a682f613a0bb2dab7bd39e79645860eb30202d358ed9a879dbe238e84bc"
|
|
52
|
+
"049b5a682f613a0bb2dab7bd39e79645860eb30202d358ed9a879dbe238e84bc",
|
|
53
|
+
"8f66846159f0f049af2035fd71be7b289cc999099ad2ac6c1aa3b61745754745",
|
|
54
|
+
"4e12aed278f410305dc640a9f9cb0fa5135e28b0963c2a9bc4a8b7810e4af63f",
|
|
55
|
+
"3c2f525236c4b45addd5d62ffa3466b93d6502829082c1248da35a504d186e8a"
|
|
49
56
|
],
|
|
50
57
|
"docs/adr/README.md": [
|
|
51
58
|
"2f27a4a5ecfb92725875c0b859194588b0ed367ac87b7d321ba063062abf25d5"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# [Topic] Conventions
|
|
2
2
|
|
|
3
|
-
> **Optional project document.** When a stable convention applies across multiple features, copy this template to `docs/conventions/[topic].md`. Keep concrete rules here, not generic agent-process instructions. Prefer existing formatters, linters, and tooling as the source of truth for mechanically enforced rules.
|
|
3
|
+
> **Optional project document.** When a stable convention applies across multiple features, copy this template to `docs/conventions/[topic].md`. Keep concrete rules here, not generic agent-process instructions or decisions specific to one feature (record those in an ADR and link it). Prefer existing formatters, linters, and tooling as the source of truth for mechanically enforced rules.
|
|
4
4
|
|
|
5
5
|
## Scope
|
|
6
6
|
|
|
@@ -17,3 +17,5 @@
|
|
|
17
17
|
## Exceptions and evolution
|
|
18
18
|
|
|
19
19
|
[Known exceptions, how to propose changes, and links to relevant ADRs or tooling.]
|
|
20
|
+
|
|
21
|
+
Rules specific to one feature belong in that feature's plan or an ADR; link them here instead of restating them.
|
package/scaffold/AGENTS.md
CHANGED
|
@@ -16,7 +16,7 @@ These are the shared instructions for AI coding agents working in this repositor
|
|
|
16
16
|
For **new features**, follow this sequence:
|
|
17
17
|
|
|
18
18
|
1. **Discover:** Discuss the idea with the user. Understand the problem, users, expected behavior, constraints, boundaries, and unresolved questions. Do not implement the feature or create its feature directory during discovery.
|
|
19
|
-
2. **Propose:** Present a concise scope summary covering the goal, in-scope and out-of-scope behavior, important acceptance outcomes, assumptions, and consequential open questions. Explicitly offer **accept / revise / discard**.
|
|
19
|
+
2. **Propose:** Present a concise scope summary covering the goal, in-scope and out-of-scope behavior, important acceptance outcomes, assumptions, and consequential open questions. If the scope holds parts that can be built and verified on their own, propose splitting it into several features. Explicitly offer **accept / revise / discard**.
|
|
20
20
|
3. **Get approval:** Treat only a clear, affirmative user response as scope approval. If the user revises the proposal, summarize the revised scope and seek approval again. If discarded, do not create feature artifacts.
|
|
21
21
|
4. **Specify:** After approval, create `docs/features/feature-NNN-kebab-case/` and populate `PLAN.md`, `ACCEPTANCE_MATRIX.md`, and `TASKS.md` from `.agent-specs/templates/feature/`, following the steps in [`docs/WORKFLOW.md`](docs/WORKFLOW.md) (Phase 3). Add `DESIGN.md` for substantial UX/technical design and `RESEARCH.md` for findings worth preserving, only when needed. Create `HANDOFF.md` when a real session handoff is useful. Record the approved scope faithfully. Mark proposed technical choices as proposed, not approved.
|
|
22
22
|
5. **Stop at the spec boundary:** After writing the feature documents, summarize what was created and stop. **Do not start implementation** until the user explicitly requests it, possibly in a later session.
|
|
@@ -27,7 +27,7 @@ Existing-feature work and ordinary fixes should follow the user's requested scop
|
|
|
27
27
|
|
|
28
28
|
### Scope changes and technical decisions
|
|
29
29
|
|
|
30
|
-
- An approved feature scope is the baseline. Ask for renewed approval before materially changing promised behavior, exclusions, or acceptance criteria.
|
|
30
|
+
- An approved feature scope is the baseline. Ask for renewed approval before materially changing promised behavior, exclusions, or acceptance criteria, and before adding user-visible behavior the scope doesn't include, however small.
|
|
31
31
|
- Technical implementation details can evolve within that scope. Surface decisions that introduce major dependencies, migrations that modify or delete existing data, security implications, substantial complexity, or broad architectural consequences before committing to them.
|
|
32
32
|
- Keep proposed decisions in the feature `PLAN.md`. Add a project-wide ADR **when a significant architectural decision has actually been adopted**, typically after implementation. For consequential decisions adopted earlier, record the ADR at adoption rather than losing the rationale. Never turn an unimplemented proposal into an accepted ADR.
|
|
33
33
|
|
|
@@ -50,7 +50,7 @@ Existing-feature work and ordinary fixes should follow the user's requested scop
|
|
|
50
50
|
- Do not write speculative ADRs during feature discovery or initial specification. Capture proposed approaches and uncertainties in `PLAN.md` instead.
|
|
51
51
|
- Keep docs concise and accurate; remove stale claims rather than merely appending new text.
|
|
52
52
|
- Practice **progressive documentation**: create an optional document only to solve a concrete problem. Prefer updating an existing source of truth over producing redundant or empty files.
|
|
53
|
-
- If maintained, keep `docs/ARCHITECTURE.md` aligned with the _implemented_ system, `docs/GLOSSARY.md` aligned with shared domain language, and `docs/conventions/` aligned with stable project-specific practices. Create them only when useful, from `.agent-specs/templates/project/` or `.agent-specs/templates/conventions/`. When closing a feature, check whether one has become useful and
|
|
53
|
+
- If maintained, keep `docs/ARCHITECTURE.md` aligned with the _implemented_ system, `docs/GLOSSARY.md` aligned with shared domain language, and `docs/conventions/` aligned with stable project-specific practices. Create them only when useful, from `.agent-specs/templates/project/` or `.agent-specs/templates/conventions/`. When closing a feature, check whether one has become useful and report your recommendation to the user (see [`docs/WORKFLOW.md`](docs/WORKFLOW.md), Phase 5). An adopted architecture decision still belongs in an ADR.
|
|
54
54
|
|
|
55
55
|
## Verification and completion
|
|
56
56
|
|
|
@@ -5,8 +5,10 @@ This document expands the feature lifecycle required by [`AGENTS.md`](../AGENTS.
|
|
|
5
5
|
## Phase 1: Discover (conversation only)
|
|
6
6
|
|
|
7
7
|
- Read existing code and documentation when relevant, then explore the user's idea collaboratively.
|
|
8
|
+
- Check for overlap with existing features: list `docs/features/` and judge by folder names. Open a feature's `PLAN.md` only when its name suggests related scope, and read its summary and approved scope rather than the whole folder. If scope overlaps, say so in the proposal and settle with the user which feature owns it.
|
|
8
9
|
- Ask focused clarifying questions, using the agent's interactive question interface where available or normal chat otherwise. Prefer small, purposeful batches over long questionnaires.
|
|
9
10
|
- Establish the problem, target users, expected behaviors, important edge cases, constraints, dependencies, and exclusions.
|
|
11
|
+
- Ask how the user wants the feature verified when that affects effort or tooling, for example browser end-to-end tests or checks on a device or service the agent can't reach. If the project already has a test approach, follow it instead of asking.
|
|
10
12
|
- Offer sensible defaults and surface tradeoffs; do not silently make consequential product decisions.
|
|
11
13
|
- Do **not** create a feature directory, commit a spec, or implement the feature yet.
|
|
12
14
|
|
|
@@ -20,6 +22,8 @@ Present a readable summary with:
|
|
|
20
22
|
4. **Acceptance expectations**: how success will be recognized.
|
|
21
23
|
5. **Assumptions, risks, and open questions**: especially choices that affect cost or design.
|
|
22
24
|
|
|
25
|
+
**Size the feature.** A feature is one increment the user can review and verify in one sitting. If the scope contains parts that can be built and verified on their own, or would need more than about ten acceptance criteria, propose splitting it into several features: list them in build order with their dependencies, and let the user choose between the split and a single feature. Each feature gets its own directory; one approval can cover the whole set.
|
|
26
|
+
|
|
23
27
|
Ask the user to **accept, revise, or discard**.
|
|
24
28
|
|
|
25
29
|
- **Accept:** proceed to specification.
|
|
@@ -31,7 +35,7 @@ Ask the user to **accept, revise, or discard**.
|
|
|
31
35
|
|
|
32
36
|
Create the feature directory by hand:
|
|
33
37
|
|
|
34
|
-
1. **Number:** find the highest `NNN` among the existing `docs/features/feature-NNN-*` directories and add one (start at `001`). Never reuse a number.
|
|
38
|
+
1. **Number:** find the highest `NNN` among the existing `docs/features/feature-NNN-*` directories and add one (start at `001`). Never reuse a number. If the user re-scopes or splits a feature before any of it is implemented, restructure its documents in a new commit; it may keep its number and take a new slug.
|
|
35
39
|
2. **Name:** `docs/features/feature-NNN-kebab-case/`, where `kebab-case` is a short slug of the feature title (for example `feature-007-user-statistics-page`).
|
|
36
40
|
3. **Copy:** `PLAN.md`, `ACCEPTANCE_MATRIX.md`, and `TASKS.md` from `.agent-specs/templates/feature/`, plus any optional templates needed (see the table below).
|
|
37
41
|
4. **Fill identifiers:** in every copied file, replace `feature-NNN-kebab-case` with the directory name, the `NNN` in `Feature NNN:` with the number, `[Feature title]` with the title, and `[YYYY-MM-DD]` with today's date.
|
|
@@ -50,7 +54,7 @@ Required and optional documents:
|
|
|
50
54
|
| `RESEARCH.md` | Durable findings from meaningful investigation | Optional |
|
|
51
55
|
| `HANDOFF.md` | Short-lived context for work that will resume elsewhere | Only if useful |
|
|
52
56
|
|
|
53
|
-
Write the approved scope into `PLAN.md`. Draft acceptance criteria and tasks that correspond to that scope. Cross-reference IDs where practical. Put unresolved technical questions in the plan, rather than inventing answers. Add `DESIGN.md` only for substantial design detail, and `RESEARCH.md` only when research findings are worth retaining. Do not write an ADR for an unimplemented option.
|
|
57
|
+
Write the approved scope into `PLAN.md`. Draft acceptance criteria and tasks that correspond to that scope. Cross-reference IDs where practical. State each criterion's verification method as the observable check (for example "journey completes in a browser at 360 px width"), not a specific test tool, unless the user or the project has already chosen one; tooling is an implementation choice. Put unresolved technical questions in the plan, rather than inventing answers. Add `DESIGN.md` only for substantial design detail, and `RESEARCH.md` only when research findings are worth retaining. Do not write an ADR for an unimplemented option.
|
|
54
58
|
|
|
55
59
|
**Then stop.** Tell the user what was scaffolded, identify open decisions or blockers, and wait for an explicit implementation request. Feature approval is **not** implementation authorization.
|
|
56
60
|
|
|
@@ -59,6 +63,7 @@ Write the approved scope into `PLAN.md`. Draft acceptance criteria and tasks tha
|
|
|
59
63
|
- Re-read the active feature's plan, acceptance matrix, and tasks, plus any optional design/research documents; inspect relevant code and applicable `docs/conventions/` documentation.
|
|
60
64
|
- Check readiness: requirements coherent, blockers identified, implementation direction sensible, verification approach practical. Record any blockers under "Dependencies and blockers" in `TASKS.md`, then set its status to `Ready`, and to `In progress` once work starts.
|
|
61
65
|
- Seek human input before significant new dependencies, migrations that modify or delete existing data, security-sensitive choices, or changes to approved behavior. Purely additive migrations (for example, a new table or store that leaves existing data untouched) need no prior approval, but record them in the plan and report them. Technical refinement that stays within scope usually needs no additional approval.
|
|
66
|
+
- Treat user-visible behavior beyond the approved requirements as a scope change, however small (for example, undoing an action or an extra management capability): ask before building it, then add it to the plan's requirements and scope change log. Supporting work that leaves behavior unchanged, such as operator scripts or security hardening, needs no approval but belongs in the plan's technical approach.
|
|
62
67
|
- Work through `TASKS.md`, updating checked items to reflect reality. Keep plan notes synchronized when implementation choices change.
|
|
63
68
|
- Add or update tests and record concrete results in `ACCEPTANCE_MATRIX.md`.
|
|
64
69
|
- If interrupted, add or refresh `HANDOFF.md` with the current task, blockers, commands run, and the next actionable step.
|
|
@@ -67,8 +72,9 @@ Write the approved scope into `PLAN.md`. Draft acceptance criteria and tasks tha
|
|
|
67
72
|
|
|
68
73
|
- Review each acceptance criterion against observable evidence. Use `Pass`, `Fail`, `Blocked`, or `Not run`; never invent a result. If a criterion is waived or removed, record the user's approval and update scope accordingly.
|
|
69
74
|
- Run applicable checks and document anything not run.
|
|
75
|
+
- Reconcile `PLAN.md` with what shipped: its technical approach, assumptions, and references (ADRs, related features) must describe the implementation, with no stale claims left, and any behavior added during implementation must appear in its requirements.
|
|
70
76
|
- Update affected user/developer/project documentation in the same change. Maintain `docs/ARCHITECTURE.md`, `docs/GLOSSARY.md`, and `docs/conventions/` when they exist and are affected by the change.
|
|
71
|
-
- Check whether a missing project document has become useful.
|
|
77
|
+
- Check whether a missing project document has become useful. Consider `docs/conventions/` for a rule that earlier features also relied on and that the code doesn't make obvious (one whose violation would be a silent bug), and `docs/GLOSSARY.md` for domain terms used across several features or easily confused with each other. **Always include the outcome in your report**: name each candidate and say whether you recommend it and why, even if you recommend against it. The user decides; don't create the document until they agree.
|
|
72
78
|
- Create ADRs for meaningful architectural decisions **actually adopted**. Normally do this after the implementation is known; for a consequential choice adopted earlier, record it at that point.
|
|
73
79
|
- Report what shipped, what was validated, any limitations, and whether the feature is complete. A feature is not complete while required acceptance criteria remain failing, blocked, or unverified.
|
|
74
80
|
- Set the `TASKS.md` status to `Complete` only when that holds; otherwise use `Implemented (verification pending)` and list what remains.
|
|
@@ -82,6 +88,6 @@ Write the approved scope into `PLAN.md`. Draft acceptance criteria and tasks tha
|
|
|
82
88
|
- `RESEARCH.md`, if present, preserves meaningful investigation and uncertainty, not decisions.
|
|
83
89
|
- `HANDOFF.md`, if present, is a snapshot for resumption and may be deleted once unnecessary.
|
|
84
90
|
- ADRs document _adopted_, broadly relevant architecture decisions; feature plans retain proposals and feature-local tradeoffs.
|
|
85
|
-
- `docs/ARCHITECTURE.md` describes the implemented system; `docs/GLOSSARY.md` defines shared domain terminology; `docs/conventions/` records reusable project practices. Create these documents only when they provide value. Templates are under `.agent-specs/templates/`.
|
|
91
|
+
- `docs/ARCHITECTURE.md` describes the implemented system; `docs/GLOSSARY.md` defines shared domain terminology; `docs/conventions/` records reusable project practices, not decisions specific to one feature (those belong in an ADR or the feature's plan; link them instead of restating them). Create these documents only when they provide value. Templates are under `.agent-specs/templates/`.
|
|
86
92
|
|
|
87
93
|
Approved scope changes must be brought back to the user before being incorporated as commitments. Keep artifacts understandable to someone resuming the project without the original chat history. **Progressive documentation:** do not create an optional document just because a template exists; prefer updating a single authoritative source over duplicating content.
|