@seanmars/tospec 0.9.0 → 0.11.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 +2 -2
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +19 -9
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/decision.js +4 -4
- package/dist/commands/decision.js.map +1 -1
- package/dist/core/archive.d.ts +3 -3
- package/dist/core/archive.js +8 -8
- package/dist/core/archive.js.map +1 -1
- package/dist/core/artifact-graph/resolver.d.ts +10 -0
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +28 -6
- package/dist/core/artifact-graph/resolver.js.map +1 -1
- package/dist/core/config-schema.d.ts +6 -0
- package/dist/core/config-schema.d.ts.map +1 -1
- package/dist/core/config-schema.js +36 -0
- package/dist/core/config-schema.js.map +1 -1
- package/dist/core/dashboard-data.d.ts +1 -1
- package/dist/core/dashboard-data.js +1 -1
- package/dist/core/migrate.d.ts.map +1 -1
- package/dist/core/migrate.js +2 -1
- package/dist/core/migrate.js.map +1 -1
- package/dist/core/parsers/change-parser.d.ts +11 -2
- package/dist/core/parsers/change-parser.d.ts.map +1 -1
- package/dist/core/parsers/change-parser.js +14 -0
- package/dist/core/parsers/change-parser.js.map +1 -1
- package/dist/core/parsers/requirement-blocks.d.ts +8 -0
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
- package/dist/core/parsers/requirement-blocks.js +10 -0
- package/dist/core/parsers/requirement-blocks.js.map +1 -1
- package/dist/core/shared/rules-generation.js +2 -2
- package/dist/core/shared/rules-generation.js.map +1 -1
- package/dist/core/specs-apply.d.ts +3 -2
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +127 -15
- package/dist/core/specs-apply.js.map +1 -1
- package/dist/core/templates/workflows/apply.d.ts +1 -1
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +60 -25
- package/dist/core/templates/workflows/apply.js.map +1 -1
- package/dist/core/templates/workflows/archive.js +3 -3
- package/dist/core/templates/workflows/decision.d.ts.map +1 -1
- package/dist/core/templates/workflows/decision.js +15 -13
- package/dist/core/templates/workflows/decision.js.map +1 -1
- package/dist/core/templates/workflows/explore.d.ts.map +1 -1
- package/dist/core/templates/workflows/explore.js +9 -7
- package/dist/core/templates/workflows/explore.js.map +1 -1
- package/dist/core/templates/workflows/grill.d.ts.map +1 -1
- package/dist/core/templates/workflows/grill.js +29 -6
- package/dist/core/templates/workflows/grill.js.map +1 -1
- package/dist/core/templates/workflows/propose.js +1 -1
- package/dist/core/templates/workflows/sync.js +10 -10
- package/dist/core/templates/workflows/update.d.ts.map +1 -1
- package/dist/core/templates/workflows/update.js +4 -3
- package/dist/core/templates/workflows/update.js.map +1 -1
- package/dist/core/validation/validator.d.ts.map +1 -1
- package/dist/core/validation/validator.js +23 -2
- package/dist/core/validation/validator.js.map +1 -1
- package/dist/utils/change-utils.d.ts +9 -4
- package/dist/utils/change-utils.d.ts.map +1 -1
- package/dist/utils/change-utils.js +13 -13
- package/dist/utils/change-utils.js.map +1 -1
- package/dist/utils/timestamp.d.ts +6 -0
- package/dist/utils/timestamp.d.ts.map +1 -1
- package/dist/utils/timestamp.js +9 -0
- package/dist/utils/timestamp.js.map +1 -1
- package/package.json +2 -1
- package/schemas/decision/schema.yaml +10 -7
- package/schemas/decision/templates/decision.md +22 -22
- package/schemas/issue/schema.yaml +15 -11
- package/schemas/issue/templates/spec.md +9 -9
- package/schemas/issue/templates/task.md +11 -11
- package/schemas/issue/templates/ticket.md +1 -1
- package/schemas/sdd/schema.yaml +36 -17
- package/schemas/sdd/templates/design.md +23 -3
- package/schemas/sdd/templates/proposal.md +5 -5
- package/schemas/sdd/templates/spec.md +9 -9
- package/schemas/sdd/templates/tasks.md +9 -9
- package/schemas/sdd/templates/ticket.md +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [decision topic]
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Status
|
|
4
4
|
|
|
5
5
|
- proposed
|
|
6
|
-
-
|
|
6
|
+
- Date: [yyyyMMdd_HHmmss]
|
|
7
7
|
|
|
8
|
-
<!--
|
|
8
|
+
<!-- Status: proposed / accepted / superseded (name the successor when superseded) -->
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
<!--
|
|
10
|
+
## Context
|
|
11
|
+
<!-- Why this decision is needed: current state, constraints, and requirement goals -->
|
|
12
12
|
|
|
13
|
-
##
|
|
14
|
-
<!--
|
|
13
|
+
## Decision
|
|
14
|
+
<!-- What was chosen; the canonical terms; why this over the other options -->
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
<!--
|
|
16
|
+
## Impact
|
|
17
|
+
<!-- Affected modules / APIs / docs / tests -->
|
|
18
18
|
|
|
19
|
-
##
|
|
20
|
-
<!--
|
|
19
|
+
## Alternatives
|
|
20
|
+
<!-- Options evaluated, their trade-offs, and the conclusion -->
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
<!--
|
|
22
|
+
## Follow-up
|
|
23
|
+
<!-- Follow-up implementation items, phased if useful -->
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
<!--
|
|
25
|
+
## Related Changes
|
|
26
|
+
<!-- Optional: changes that implement this decision (back-linked by tospec new change --decisions); list change names, add archive paths once archived; omit if none yet -->
|
|
27
27
|
|
|
28
|
-
##
|
|
29
|
-
<!--
|
|
28
|
+
## Decision Process
|
|
29
|
+
<!-- Optional: the key Q&A that shaped this decision; each pair starts with **Q:**, answer in the next paragraph; summarize, don't paste a transcript; omit if there was no interactive discussion -->
|
|
30
30
|
|
|
31
|
-
**Q:** [
|
|
31
|
+
**Q:** [question]
|
|
32
32
|
|
|
33
|
-
[
|
|
33
|
+
[answer]
|
|
34
34
|
|
|
35
|
-
**Q:** [
|
|
35
|
+
**Q:** [question]
|
|
36
36
|
|
|
37
|
-
[
|
|
37
|
+
[answer]
|
|
@@ -2,18 +2,20 @@ name: issue
|
|
|
2
2
|
version: 1
|
|
3
3
|
description: Diagnosis and repair workflow for issues
|
|
4
4
|
artifacts:
|
|
5
|
-
# ticket
|
|
6
|
-
#
|
|
5
|
+
# ticket is a CLI-managed global index (tospec/tickets/<yyyyMMdd_HHmmss>-<name>.md),
|
|
6
|
+
# not a graph artifact: `tospec new change` auto-generates it outside the change
|
|
7
|
+
# directory, so it is not listed here.
|
|
7
8
|
- id: task
|
|
8
9
|
generates: task.md
|
|
9
10
|
description: Root-cause diagnosis and repair plan
|
|
10
11
|
template: task.md
|
|
11
12
|
requires: []
|
|
12
13
|
instruction: |
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
Diagnose and write the issue task: first build a tight feedback loop (one
|
|
15
|
+
command that turns this bug red), list 3-5 falsifiable hypotheses and rank
|
|
16
|
+
them, verify each, then write down the root cause. Contents: root-cause
|
|
17
|
+
analysis, fix plan, test plan (why existing tests missed it / which edge
|
|
18
|
+
cases are missing), and a task checkbox list.
|
|
17
19
|
validation:
|
|
18
20
|
requiredSections: [Feedback Loop, Root Cause, Fix Plan, Test Plan, Tasks]
|
|
19
21
|
- id: specs
|
|
@@ -23,12 +25,14 @@ artifacts:
|
|
|
23
25
|
requires: []
|
|
24
26
|
optional: true
|
|
25
27
|
instruction: |
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
Write delta specs only when the fix changes externally observable behavior
|
|
29
|
+
(same grammar as sdd). If the bug stems from a wrong spec, fix that
|
|
30
|
+
Requirement with MODIFIED.
|
|
28
31
|
apply:
|
|
29
32
|
requires: [task]
|
|
30
33
|
tracks: task.md
|
|
31
34
|
instruction: |
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
Fix per task.md: first check whether a related test exists —
|
|
36
|
+
exists and fails → find out why it fails; exists and passes → check for missing
|
|
37
|
+
edge cases and add tests; none → write a regression test that goes red first.
|
|
38
|
+
Fix until everything is green, and verify it matches task.md.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
## ADDED Requirements
|
|
2
2
|
|
|
3
|
-
### Requirement: [
|
|
4
|
-
[
|
|
3
|
+
### Requirement: [name]
|
|
4
|
+
[Behavior the system SHALL/MUST ... — the keyword must appear in the body, not only in the heading]
|
|
5
5
|
|
|
6
|
-
#### Scenario: [
|
|
7
|
-
- **WHEN** [
|
|
8
|
-
- **THEN** [
|
|
9
|
-
- **AND** [
|
|
6
|
+
#### Scenario: [scenario name]
|
|
7
|
+
- **WHEN** [condition]
|
|
8
|
+
- **THEN** [outcome]
|
|
9
|
+
- **AND** [additional outcome]
|
|
10
10
|
|
|
11
|
-
<!--
|
|
12
|
-
MODIFIED
|
|
13
|
-
REMOVED
|
|
11
|
+
<!-- MODIFIED, REMOVED, and RENAMED Requirements may also be used.
|
|
12
|
+
MODIFIED must contain the full updated requirement block.
|
|
13
|
+
REMOVED must include Reason and Migration; RENAMED uses a FROM/TO pair. -->
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# Task: [issue
|
|
1
|
+
# Task: [issue name]
|
|
2
2
|
|
|
3
3
|
## Feedback Loop
|
|
4
|
-
[
|
|
4
|
+
[The single command that turns this bug red]
|
|
5
5
|
|
|
6
6
|
## Root Cause
|
|
7
|
-
[
|
|
7
|
+
[The verified root cause — not a guess; include how it was verified]
|
|
8
8
|
|
|
9
9
|
## Fix Plan
|
|
10
|
-
[
|
|
10
|
+
[The fix and its rationale; why fixing here is a root-cause fix rather than a symptom fix]
|
|
11
11
|
|
|
12
12
|
## Test Plan
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
- Why existing tests didn't catch it: [analysis]
|
|
14
|
+
- Tests / edge cases to add: [list]
|
|
15
15
|
|
|
16
16
|
## Tasks
|
|
17
|
-
### 1.
|
|
18
|
-
- [ ] 1.1
|
|
19
|
-
- [ ] 1.2
|
|
20
|
-
- [ ] 1.3
|
|
21
|
-
- [ ] 1.4
|
|
17
|
+
### 1. Fix
|
|
18
|
+
- [ ] 1.1 Write a regression test (red)
|
|
19
|
+
- [ ] 1.2 Implement the fix until the test passes (green)
|
|
20
|
+
- [ ] 1.3 Add edge-case tests: [...]
|
|
21
|
+
- [ ] 1.4 Run the full test suite to confirm no regressions
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
## Summary
|
|
2
|
-
[
|
|
2
|
+
[One sentence describing the symptom of this issue — detailed root cause / repro / fix live in task.md]
|
package/schemas/sdd/schema.yaml
CHANGED
|
@@ -2,17 +2,19 @@ name: sdd
|
|
|
2
2
|
version: 1
|
|
3
3
|
description: Spec-driven development workflow for new requirements
|
|
4
4
|
artifacts:
|
|
5
|
-
# ticket
|
|
6
|
-
#
|
|
5
|
+
# ticket is a CLI-managed global index (tospec/tickets/<yyyyMMdd_HHmmss>-<name>.md),
|
|
6
|
+
# not a graph artifact: `tospec new change` auto-generates it outside the change
|
|
7
|
+
# directory, so it is not listed here.
|
|
7
8
|
- id: proposal
|
|
8
9
|
generates: proposal.md
|
|
9
10
|
description: Main proposal — why, what changes, capabilities, impact
|
|
10
11
|
template: proposal.md
|
|
11
12
|
requires: []
|
|
12
13
|
instruction: |
|
|
13
|
-
|
|
14
|
-
Capabilities (New/Modified
|
|
15
|
-
|
|
14
|
+
Carry the main detail: Why (motivation, why now), What Changes (concrete
|
|
15
|
+
add/modify/remove), Capabilities (New/Modified capabilities and their specs),
|
|
16
|
+
Impact (affected code/APIs/dependencies/systems). This is what specs and
|
|
17
|
+
design expand from; never write file paths or code snippets (they go stale).
|
|
16
18
|
validation:
|
|
17
19
|
requiredSections: [Why, What Changes, Impact]
|
|
18
20
|
minSectionLength:
|
|
@@ -23,19 +25,34 @@ artifacts:
|
|
|
23
25
|
template: spec.md
|
|
24
26
|
requires: [proposal]
|
|
25
27
|
instruction: |
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Requirement:
|
|
29
|
-
#### Scenario:
|
|
30
|
-
MODIFIED
|
|
28
|
+
Write delta specs from the proposal. One file per capability.
|
|
29
|
+
Grammar: ## ADDED|MODIFIED|REMOVED|RENAMED Requirements /
|
|
30
|
+
### Requirement: <name> (the body must contain SHALL or MUST) /
|
|
31
|
+
#### Scenario: <name> (four #, WHEN/THEN/AND bullets).
|
|
32
|
+
MODIFIED must paste the full updated requirement block.
|
|
33
|
+
A new capability's delta must open with ## Purpose (one sentence on why this
|
|
34
|
+
capability exists); archive carries it into the newly created main spec. Do
|
|
35
|
+
not add Purpose to an existing capability's delta (edit the main spec's
|
|
36
|
+
Purpose directly instead).
|
|
31
37
|
- id: design
|
|
32
38
|
generates: design.md
|
|
33
39
|
description: Technical design and testing seams
|
|
34
40
|
template: design.md
|
|
35
41
|
requires: [proposal]
|
|
36
42
|
instruction: |
|
|
37
|
-
|
|
38
|
-
(
|
|
43
|
+
Technical design: Context, Goals/Non-Goals, Decisions, the chosen testing
|
|
44
|
+
seam (reuse an existing seam, the highest layer possible, as few as possible),
|
|
45
|
+
Migration Plan, Risks, Open Questions.
|
|
46
|
+
Decisions: one sub-block per decision, numbered `### D{index}: <title>`
|
|
47
|
+
(D1, D2, ...). Each opens with a short summary of what was decided, then adds
|
|
48
|
+
**Why** / **Trade-off** / **Alternative (rejected)** bullets as the decision
|
|
49
|
+
warrants — not every decision needs all three.
|
|
50
|
+
Migration Plan: only when the change alters existing data, config, or behavior;
|
|
51
|
+
otherwise write "No migration needed."
|
|
52
|
+
proposal covers why and what, design covers how: reference proposal.md, don't
|
|
53
|
+
restate it. Context holds only the current state and constraints the approach
|
|
54
|
+
needs (motivation lives in proposal.md - Why); Goals/Non-Goals add design-level
|
|
55
|
+
boundaries only, not a restatement of the proposal's scope.
|
|
39
56
|
validation:
|
|
40
57
|
requiredSections: [Context, Decisions, Testing Seams]
|
|
41
58
|
- id: tasks
|
|
@@ -44,12 +61,14 @@ artifacts:
|
|
|
44
61
|
template: tasks.md
|
|
45
62
|
requires: [specs, design]
|
|
46
63
|
instruction: |
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
Cut specs + design into tracer-bullet vertical slices.
|
|
65
|
+
Each task group = one narrow, complete path (independently verifiable).
|
|
66
|
+
Every implementation task is preceded by its own "write the test first" task
|
|
67
|
+
(TDD red before green).
|
|
50
68
|
apply:
|
|
51
69
|
requires: [tasks]
|
|
52
70
|
tracks: tasks.md
|
|
53
71
|
instruction: |
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
Execute tasks.md with TDD: each slice writes a failing test first (red), then
|
|
73
|
+
implements until it passes (green), testing only the seam design.md chose.
|
|
74
|
+
When done, verify behavior against the specs.
|
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
# Design: [change
|
|
1
|
+
# Design: [change name]
|
|
2
2
|
|
|
3
3
|
## Context
|
|
4
|
+
[Current state and constraints that shape the approach; see proposal.md - Why for motivation, don't restate it]
|
|
4
5
|
|
|
5
6
|
## Goals / Non-Goals
|
|
6
7
|
|
|
8
|
+
**Goals:**
|
|
9
|
+
[What this design aims to achieve]
|
|
10
|
+
|
|
11
|
+
**Non-Goals:**
|
|
12
|
+
[What is explicitly out of scope — design-level boundaries only, don't restate the proposal's scope]
|
|
13
|
+
|
|
7
14
|
## Decisions
|
|
8
|
-
|
|
15
|
+
<!-- One sub-block per decision, numbered D1, D2, ... Each opens with a short summary of what was
|
|
16
|
+
decided, then adds **Why** / **Trade-off** / **Alternative (rejected)** bullets as the
|
|
17
|
+
decision warrants (not every decision needs all three). Inline a trimmed code/type/schema
|
|
18
|
+
snippet only when it pins the decision more precisely than prose. -->
|
|
19
|
+
|
|
20
|
+
### D1: [short title stating the decision]
|
|
21
|
+
[Summary: what was chosen and what it does.]
|
|
22
|
+
|
|
23
|
+
- **Why**: [rationale]
|
|
24
|
+
- **Trade-off**: [cost accepted — only if there is one]
|
|
25
|
+
- **Alternative (rejected)**: [option considered and why it lost — when a real one existed]
|
|
9
26
|
|
|
10
27
|
## Testing Seams
|
|
11
|
-
[
|
|
28
|
+
[The seam(s) tospec-apply will test at: reuse an existing seam over a new one, the highest layer that still catches the behavior, as few as possible (ideally one); say why this layer]
|
|
29
|
+
|
|
30
|
+
## Migration Plan
|
|
31
|
+
[Only when the change alters existing data, config, or behavior: migration steps, backward-compat handling, rollout order. Otherwise: "No migration needed."]
|
|
12
32
|
|
|
13
33
|
## Risks / Trade-offs
|
|
14
34
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
## Why
|
|
2
|
-
<!--
|
|
2
|
+
<!-- Motivation: what problem does this solve, why now (>= 50 chars) -->
|
|
3
3
|
|
|
4
4
|
## What Changes
|
|
5
|
-
<!--
|
|
5
|
+
<!-- Concrete changes: what is added / modified / removed -->
|
|
6
6
|
|
|
7
7
|
## Capabilities
|
|
8
8
|
### New Capabilities
|
|
9
|
-
- `<name>`:
|
|
9
|
+
- `<name>`: <description> (maps to specs/<name>/spec.md)
|
|
10
10
|
|
|
11
11
|
### Modified Capabilities
|
|
12
|
-
- `<existing-name>`:
|
|
12
|
+
- `<existing-name>`: <the requirement that changes>
|
|
13
13
|
|
|
14
14
|
## Impact
|
|
15
|
-
<!--
|
|
15
|
+
<!-- Affected code / APIs / dependencies / systems -->
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
## ADDED Requirements
|
|
2
2
|
|
|
3
|
-
### Requirement: [
|
|
4
|
-
[
|
|
3
|
+
### Requirement: [name]
|
|
4
|
+
[Behavior the system SHALL/MUST ... — the keyword must appear in the body, not only in the heading]
|
|
5
5
|
|
|
6
|
-
#### Scenario: [
|
|
7
|
-
- **WHEN** [
|
|
8
|
-
- **THEN** [
|
|
9
|
-
- **AND** [
|
|
6
|
+
#### Scenario: [scenario name]
|
|
7
|
+
- **WHEN** [condition]
|
|
8
|
+
- **THEN** [outcome]
|
|
9
|
+
- **AND** [additional outcome]
|
|
10
10
|
|
|
11
|
-
<!--
|
|
12
|
-
MODIFIED
|
|
13
|
-
REMOVED
|
|
11
|
+
<!-- MODIFIED, REMOVED, and RENAMED Requirements may also be used.
|
|
12
|
+
MODIFIED must contain the full updated requirement block.
|
|
13
|
+
REMOVED must include Reason and Migration; RENAMED uses a FROM/TO pair. -->
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Tasks: [change
|
|
1
|
+
# Tasks: [change name]
|
|
2
2
|
|
|
3
|
-
## 1. [
|
|
4
|
-
- [ ] 1.1
|
|
5
|
-
- [ ] 1.2
|
|
6
|
-
- [ ] 1.3
|
|
3
|
+
## 1. [slice name — one vertical path]
|
|
4
|
+
- [ ] 1.1 Write a failing test: [corresponding Scenario name]
|
|
5
|
+
- [ ] 1.2 Implement until the test passes
|
|
6
|
+
- [ ] 1.3 Verify behavior against the spec
|
|
7
7
|
|
|
8
|
-
## 2. [
|
|
9
|
-
- [ ] 2.1
|
|
10
|
-
- [ ] 2.2
|
|
11
|
-
- [ ] 2.3
|
|
8
|
+
## 2. [next slice]
|
|
9
|
+
- [ ] 2.1 Write a failing test
|
|
10
|
+
- [ ] 2.2 Implement until the test passes
|
|
11
|
+
- [ ] 2.3 Verify behavior against the spec
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
## Summary
|
|
2
|
-
[
|
|
2
|
+
[One sentence describing what this change does — detailed why/what/capabilities/impact live in proposal.md]
|