@seanmars/tospec 0.10.0 → 0.12.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/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +18 -8
- 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/init.d.ts.map +1 -1
- package/dist/core/init.js +2 -3
- package/dist/core/init.js.map +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/index.d.ts +1 -1
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +1 -1
- package/dist/core/shared/index.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/shared/skill-generation.d.ts +7 -0
- package/dist/core/shared/skill-generation.d.ts.map +1 -1
- package/dist/core/shared/skill-generation.js +13 -1
- package/dist/core/shared/skill-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/fragments/interview.d.ts +10 -0
- package/dist/core/templates/fragments/interview.d.ts.map +1 -0
- package/dist/core/templates/fragments/interview.js +13 -0
- package/dist/core/templates/fragments/interview.js.map +1 -0
- package/dist/core/templates/fragments/next-step.d.ts +14 -0
- package/dist/core/templates/fragments/next-step.d.ts.map +1 -0
- package/dist/core/templates/fragments/next-step.js +14 -0
- package/dist/core/templates/fragments/next-step.js.map +1 -0
- package/dist/core/templates/fragments/verify.d.ts +19 -0
- package/dist/core/templates/fragments/verify.d.ts.map +1 -0
- package/dist/core/templates/{workflows → fragments}/verify.js +25 -4
- package/dist/core/templates/fragments/verify.js.map +1 -0
- package/dist/core/templates/types.d.ts +6 -0
- package/dist/core/templates/types.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +29 -23
- package/dist/core/templates/workflows/apply.js.map +1 -1
- package/dist/core/templates/workflows/archive.d.ts.map +1 -1
- package/dist/core/templates/workflows/archive.js +6 -8
- package/dist/core/templates/workflows/archive.js.map +1 -1
- package/dist/core/templates/workflows/decision.d.ts.map +1 -1
- package/dist/core/templates/workflows/decision.js +21 -18
- package/dist/core/templates/workflows/decision.js.map +1 -1
- package/dist/core/templates/workflows/explore.d.ts +6 -3
- package/dist/core/templates/workflows/explore.d.ts.map +1 -1
- package/dist/core/templates/workflows/explore.js +29 -33
- 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 +14 -21
- package/dist/core/templates/workflows/grill.js.map +1 -1
- package/dist/core/templates/workflows/issue.js +2 -2
- package/dist/core/templates/workflows/issue.js.map +1 -1
- package/dist/core/templates/workflows/propose.js +2 -2
- package/dist/core/templates/workflows/propose.js.map +1 -1
- package/dist/core/templates/workflows/sync.js +12 -12
- package/dist/core/templates/workflows/sync.js.map +1 -1
- package/dist/core/templates/workflows/update.d.ts.map +1 -1
- package/dist/core/templates/workflows/update.js +18 -27
- package/dist/core/templates/workflows/update.js.map +1 -1
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +2 -3
- package/dist/core/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
- package/dist/core/templates/workflows/verify.d.ts +0 -9
- package/dist/core/templates/workflows/verify.d.ts.map +0 -1
- package/dist/core/templates/workflows/verify.js.map +0 -1
package/dist/utils/timestamp.js
CHANGED
|
@@ -15,4 +15,13 @@ export function formatTimestamp(date) {
|
|
|
15
15
|
const seconds = pad(date.getSeconds());
|
|
16
16
|
return `${year}${month}${day}_${hours}${minutes}${seconds}`;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Formats a Date as `yyyy-MM-dd` in local time. Use this for date-only metadata
|
|
20
|
+
* instead of `toISOString().split('T')[0]`, which truncates in UTC and records
|
|
21
|
+
* the wrong calendar day near local midnight.
|
|
22
|
+
*/
|
|
23
|
+
export function formatLocalDate(date = new Date()) {
|
|
24
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
25
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
26
|
+
}
|
|
18
27
|
//# sourceMappingURL=timestamp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../src/utils/timestamp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACvC,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;AAC9D,CAAC"}
|
|
1
|
+
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../src/utils/timestamp.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACvC,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAa,IAAI,IAAI,EAAE;IACrD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AACpF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanmars/tospec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Spec-driven development CLI for structured requirements and issue workflows",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "node build.js",
|
|
50
50
|
"skills": "node build.js && node scripts/gen-skills.mjs",
|
|
51
|
+
"templates": "node scripts/gen-templates.mjs",
|
|
51
52
|
"dev": "tsc --watch",
|
|
52
53
|
"test": "vitest run",
|
|
53
54
|
"prepublish": "node build.js"
|
|
@@ -2,16 +2,19 @@ name: decision
|
|
|
2
2
|
version: 1
|
|
3
3
|
description: Architecture Decision Record (ADR) workflow
|
|
4
4
|
artifacts:
|
|
5
|
-
# decision
|
|
6
|
-
#
|
|
5
|
+
# decision is created by the dedicated `tospec decision` command at
|
|
6
|
+
# tospec/decisions/<yyyy-MM-dd>-<topic>.md; it does not go through the change
|
|
7
|
+
# directory. This artifact only serves as the template and section-validation
|
|
8
|
+
# data contract.
|
|
7
9
|
- id: decision
|
|
8
10
|
generates: decision.md
|
|
9
|
-
description:
|
|
11
|
+
description: A single ADR — Status / Context / Decision / Impact / Alternatives / Follow-up
|
|
10
12
|
template: decision.md
|
|
11
13
|
requires: []
|
|
12
14
|
instruction: |
|
|
13
|
-
|
|
14
|
-
superseded
|
|
15
|
-
|
|
15
|
+
Write one decision record per ADR conventions. Status is proposed / accepted /
|
|
16
|
+
superseded; superseded must name its successor. The Decision section states
|
|
17
|
+
clearly what was chosen and why; Alternatives lists the options evaluated with
|
|
18
|
+
their trade-offs; Impact lists the affected modules / APIs / docs / tests.
|
|
16
19
|
validation:
|
|
17
|
-
requiredSections: [
|
|
20
|
+
requiredSections: [Status, Context, Decision, Impact, Alternatives, Follow-up]
|
|
@@ -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]
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Verify methodology (embedded into apply's final step).
|
|
3
|
-
*
|
|
4
|
-
* verify is no longer a standalone skill/command — it runs automatically at
|
|
5
|
-
* the end of `tospec-apply`. This module exports the methodology text so
|
|
6
|
-
* `apply.ts` can inline it; there is no skill/command template here anymore.
|
|
7
|
-
*/
|
|
8
|
-
export declare const VERIFY_METHODOLOGY = "Two-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings \u2014 a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.\n\n**Scope \u2014 two subagents, one pass each, and that is the whole review.** The subject under review is always the *code diff*, never another review's output. Do not spawn a third agent to grade the two axes' findings, do not re-review a report you have already written, do not audit the audit. Right-sized review beats deep review: enough eyes to catch real problems, no recursion for its own sake.\n\n**Steps**\n\n1. **Gather context**\n ```bash\n tospec status --change \"<name>\" --json\n ```\n Note `schemaName` (sdd \u2192 compare against `specs/`; issue \u2192 compare against `task.md`) and the files this change touched (from `tasks.md`/`task.md`, or `git diff` against the commit before the change started).\n\n2. **Spawn both axes in parallel** \u2014 a single message with two `Agent` tool calls, both `general-purpose`:\n\n **Standards axis prompt** \u2014 include the diff and the brief: \"Report every place the diff violates this repo's documented conventions (cite the file/rule), plus any of Fowler's code smells you spot (Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, Refused Bequest) \u2014 name the smell, quote the hunk, and treat documented repo conventions as overriding the baseline. Distinguish hard violations from judgement calls. Skip anything tooling already enforces.\"\n\n **Spec axis prompt** \u2014 include the diff plus, for sdd, the relevant `specs/<capability>/spec.md` delta content (`tospec show \"<name>\" --json`) and `design.md`'s decisions; for issue, `task.md`'s root cause and fix plan. Brief: \"Report (a) requirements/task items that are missing or partially implemented; (b) behavior in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but the implementation looks wrong, or that deviate from design.md's stated decisions. Quote the spec/task line for each finding.\"\n\n3. **Run the full test suite.** This is a hard gate alongside both axes \u2014 a change with green axes but red tests isn't verified.\n\n4. **Re-validate artifacts**\n ```bash\n tospec validate \"<name>\" --json\n ```\n If validation reports an artifact-format or structural problem, fix that artifact and re-run the command until it passes. A review is not complete while artifact validation is red.\n\n5. **Aggregate \u2014 do not merge or rerank**\n\n Present the two reports under `## Standards` and `## Spec` headings. End with one line per axis: total findings and the worst issue within that axis. Do not pick a single overall verdict across axes.\n\n This is a **mechanical collation you do yourself** \u2014 collect, label, count. It is not another review pass and not a job for a subagent: nothing reviews these two reports.\n\n**Verify output**\n\nReport the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified \u2014 tell the user it's ready for `tospec-archive`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply) and re-run **only the affected axis against the fixed code** until it's clean \u2014 you are re-reviewing the changed code, not the previous report, and a passing axis is done, so don't re-run it \"to be sure\".\n\n**Verify guardrails**\n- Standards and Spec axes are independent \u2014 never let one axis's findings influence the other's report\n- Full test suite must be green; a clean review with red tests is not verified\n- Quote the specific spec/task line or hunk for every finding \u2014 no unsupported claims\n- **One review pass per axis \u2014 never review the review.** No agent audits another agent's findings, no re-reviewing a report you already wrote; a re-run after a fix targets the changed code, and a clean axis is not re-run for extra confidence";
|
|
9
|
-
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,ymIAwCoN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mPAwCiN,CAAC"}
|