@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.
Files changed (115) hide show
  1. package/dist/commands/config.d.ts.map +1 -1
  2. package/dist/commands/config.js +18 -8
  3. package/dist/commands/config.js.map +1 -1
  4. package/dist/commands/decision.js +4 -4
  5. package/dist/commands/decision.js.map +1 -1
  6. package/dist/core/archive.d.ts +3 -3
  7. package/dist/core/archive.js +8 -8
  8. package/dist/core/archive.js.map +1 -1
  9. package/dist/core/artifact-graph/resolver.d.ts +10 -0
  10. package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
  11. package/dist/core/artifact-graph/resolver.js +28 -6
  12. package/dist/core/artifact-graph/resolver.js.map +1 -1
  13. package/dist/core/config-schema.d.ts +6 -0
  14. package/dist/core/config-schema.d.ts.map +1 -1
  15. package/dist/core/config-schema.js +36 -0
  16. package/dist/core/config-schema.js.map +1 -1
  17. package/dist/core/dashboard-data.d.ts +1 -1
  18. package/dist/core/dashboard-data.js +1 -1
  19. package/dist/core/init.d.ts.map +1 -1
  20. package/dist/core/init.js +2 -3
  21. package/dist/core/init.js.map +1 -1
  22. package/dist/core/migrate.d.ts.map +1 -1
  23. package/dist/core/migrate.js +2 -1
  24. package/dist/core/migrate.js.map +1 -1
  25. package/dist/core/parsers/change-parser.d.ts +11 -2
  26. package/dist/core/parsers/change-parser.d.ts.map +1 -1
  27. package/dist/core/parsers/change-parser.js +14 -0
  28. package/dist/core/parsers/change-parser.js.map +1 -1
  29. package/dist/core/parsers/requirement-blocks.d.ts +8 -0
  30. package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
  31. package/dist/core/parsers/requirement-blocks.js +10 -0
  32. package/dist/core/parsers/requirement-blocks.js.map +1 -1
  33. package/dist/core/shared/index.d.ts +1 -1
  34. package/dist/core/shared/index.d.ts.map +1 -1
  35. package/dist/core/shared/index.js +1 -1
  36. package/dist/core/shared/index.js.map +1 -1
  37. package/dist/core/shared/rules-generation.js +2 -2
  38. package/dist/core/shared/rules-generation.js.map +1 -1
  39. package/dist/core/shared/skill-generation.d.ts +7 -0
  40. package/dist/core/shared/skill-generation.d.ts.map +1 -1
  41. package/dist/core/shared/skill-generation.js +13 -1
  42. package/dist/core/shared/skill-generation.js.map +1 -1
  43. package/dist/core/specs-apply.d.ts +3 -2
  44. package/dist/core/specs-apply.d.ts.map +1 -1
  45. package/dist/core/specs-apply.js +127 -15
  46. package/dist/core/specs-apply.js.map +1 -1
  47. package/dist/core/templates/fragments/interview.d.ts +10 -0
  48. package/dist/core/templates/fragments/interview.d.ts.map +1 -0
  49. package/dist/core/templates/fragments/interview.js +13 -0
  50. package/dist/core/templates/fragments/interview.js.map +1 -0
  51. package/dist/core/templates/fragments/next-step.d.ts +14 -0
  52. package/dist/core/templates/fragments/next-step.d.ts.map +1 -0
  53. package/dist/core/templates/fragments/next-step.js +14 -0
  54. package/dist/core/templates/fragments/next-step.js.map +1 -0
  55. package/dist/core/templates/fragments/verify.d.ts +19 -0
  56. package/dist/core/templates/fragments/verify.d.ts.map +1 -0
  57. package/dist/core/templates/{workflows → fragments}/verify.js +25 -4
  58. package/dist/core/templates/fragments/verify.js.map +1 -0
  59. package/dist/core/templates/types.d.ts +6 -0
  60. package/dist/core/templates/types.d.ts.map +1 -1
  61. package/dist/core/templates/workflows/apply.d.ts.map +1 -1
  62. package/dist/core/templates/workflows/apply.js +29 -23
  63. package/dist/core/templates/workflows/apply.js.map +1 -1
  64. package/dist/core/templates/workflows/archive.d.ts.map +1 -1
  65. package/dist/core/templates/workflows/archive.js +6 -8
  66. package/dist/core/templates/workflows/archive.js.map +1 -1
  67. package/dist/core/templates/workflows/decision.d.ts.map +1 -1
  68. package/dist/core/templates/workflows/decision.js +21 -18
  69. package/dist/core/templates/workflows/decision.js.map +1 -1
  70. package/dist/core/templates/workflows/explore.d.ts +6 -3
  71. package/dist/core/templates/workflows/explore.d.ts.map +1 -1
  72. package/dist/core/templates/workflows/explore.js +29 -33
  73. package/dist/core/templates/workflows/explore.js.map +1 -1
  74. package/dist/core/templates/workflows/grill.d.ts.map +1 -1
  75. package/dist/core/templates/workflows/grill.js +14 -21
  76. package/dist/core/templates/workflows/grill.js.map +1 -1
  77. package/dist/core/templates/workflows/issue.js +2 -2
  78. package/dist/core/templates/workflows/issue.js.map +1 -1
  79. package/dist/core/templates/workflows/propose.js +2 -2
  80. package/dist/core/templates/workflows/propose.js.map +1 -1
  81. package/dist/core/templates/workflows/sync.js +12 -12
  82. package/dist/core/templates/workflows/sync.js.map +1 -1
  83. package/dist/core/templates/workflows/update.d.ts.map +1 -1
  84. package/dist/core/templates/workflows/update.js +18 -27
  85. package/dist/core/templates/workflows/update.js.map +1 -1
  86. package/dist/core/update.d.ts.map +1 -1
  87. package/dist/core/update.js +2 -3
  88. package/dist/core/update.js.map +1 -1
  89. package/dist/core/validation/validator.d.ts.map +1 -1
  90. package/dist/core/validation/validator.js +23 -2
  91. package/dist/core/validation/validator.js.map +1 -1
  92. package/dist/utils/change-utils.d.ts +9 -4
  93. package/dist/utils/change-utils.d.ts.map +1 -1
  94. package/dist/utils/change-utils.js +13 -13
  95. package/dist/utils/change-utils.js.map +1 -1
  96. package/dist/utils/timestamp.d.ts +6 -0
  97. package/dist/utils/timestamp.d.ts.map +1 -1
  98. package/dist/utils/timestamp.js +9 -0
  99. package/dist/utils/timestamp.js.map +1 -1
  100. package/package.json +2 -1
  101. package/schemas/decision/schema.yaml +10 -7
  102. package/schemas/decision/templates/decision.md +22 -22
  103. package/schemas/issue/schema.yaml +15 -11
  104. package/schemas/issue/templates/spec.md +9 -9
  105. package/schemas/issue/templates/task.md +11 -11
  106. package/schemas/issue/templates/ticket.md +1 -1
  107. package/schemas/sdd/schema.yaml +36 -17
  108. package/schemas/sdd/templates/design.md +23 -3
  109. package/schemas/sdd/templates/proposal.md +5 -5
  110. package/schemas/sdd/templates/spec.md +9 -9
  111. package/schemas/sdd/templates/tasks.md +9 -9
  112. package/schemas/sdd/templates/ticket.md +1 -1
  113. package/dist/core/templates/workflows/verify.d.ts +0 -9
  114. package/dist/core/templates/workflows/verify.d.ts.map +0 -1
  115. package/dist/core/templates/workflows/verify.js.map +0 -1
@@ -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.10.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 由專屬 `tospec decision` 指令建立於 tospec/decisions/<yyyy-MM-dd>-<topic>.md,
6
- # 不走 change 目錄; artifact 只作為 template 與段落驗證的資料契約。
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: 單一 ADR 文件 狀態 / 背景 / 決策 / 影響 / 替代方案 / 後續工作
11
+ description: A single ADR — Status / Context / Decision / Impact / Alternatives / Follow-up
10
12
  template: decision.md
11
13
  requires: []
12
14
  instruction: |
13
- ADR 規範撰寫一份決策文件。狀態使用 proposed / accepted / superseded;
14
- superseded 需註明取代者。決策段要寫清楚選了什麼與為什麼, 替代方案列出評估過的
15
- 選項與各自優缺點, 影響段列出受影響的模組 / API / 文件 / 測試。
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
- - 日期:[yyyyMMdd_HHmmss]
6
+ - Date: [yyyyMMdd_HHmmss]
7
7
 
8
- <!-- 狀態: proposed(已提出) / accepted(已採用) / superseded(已被取代, 需註明取代者) -->
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
- <!-- 選了什麼方案; canonical 術語; 為什麼這樣選而非其他方案 -->
13
+ ## Decision
14
+ <!-- What was chosen; the canonical terms; why this over the other options -->
15
15
 
16
- ## 影響
17
- <!-- 受影響的模組 / API / 文件 / 測試 -->
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
- <!-- 選配: 實作此決策的 change ( tospec new change --decisions 反向連結); 列出 change 名稱, 歸檔後可補歸檔路徑; 尚無實作可省略 -->
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
- <!-- 選配: 關鍵問答紀錄; 每組以 **Q:** 開頭, 下一段為回答; 摘要即可, 不貼逐字稿; 無互動討論可省略 -->
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 CLI 管理的全域索引 (tospec/tickets/<yyyyMMdd_HHmmss>-<name>.md),
6
- # 不是 graph artifact: `tospec new change` 自動產生於 change 目錄之外, 故不列於此。
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
- 診斷並撰寫 issue task: 先建立 tight feedback loop (一個指令能讓
14
- 這個 bug red), 3-5 個可否證的假設並排序, 逐一驗證後寫下根因。
15
- 內容: 根因分析、修正方案、測試計畫 (既有測試為何沒抓到 / 缺哪些
16
- edge case)、任務 checkbox 清單。
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
- 僅當修正會改變對外行為時撰寫 delta specs (文法同 sdd)。
27
- bug 源於 spec 本身錯誤, MODIFIED 修正該 Requirement。
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
- task.md 修正: 先確認是否已有相關測試
33
- 有且失敗找出為何失敗; 有且通過 檢查 edge case 缺漏, 補測試;
34
- 沒有先寫會 red 的回歸測試。修到全綠, 並驗證符合 task.md 規範。
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
- [系統 SHALL/MUST ... 的行為描述 關鍵字必須在內文, 不能只在標題]
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
- <!-- 亦可使用 MODIFIED、REMOVEDRENAMED Requirements
12
- MODIFIED 必須包含完整更新後的 requirement 區塊。
13
- REMOVED 必須包含 Reason MigrationRENAMED 使用 FROM/TO 配對。 -->
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
- [能讓這個 bug red 的單一指令]
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
- - 需補的測試 / edge cases: [清單]
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 撰寫回歸測試 (red)
19
- - [ ] 1.2 實作修正至測試通過 (green)
20
- - [ ] 1.3 edge case 測試: [...]
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
- [一句話描述這個 issue 的現象 詳細根因/重現/修法見 task.md]
2
+ [One sentence describing the symptom of this issue — detailed root cause / repro / fix live in task.md]
@@ -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 CLI 管理的全域索引 (tospec/tickets/<yyyyMMdd_HHmmss>-<name>.md),
6
- # 不是 graph artifact: `tospec new change` 自動產生於 change 目錄之外, 故不列於此。
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
- 承載主要細節: Why (動機, 為什麼現在做)What Changes (具體新增/修改/移除)、
14
- Capabilities (New/Modified capability 與對應 specs)、Impact (受影響的程式/API/相依/系統)。
15
- 這是 specs design 展開的依據; 禁止寫入檔案路徑與程式碼片段 (會過時)。
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
- proposal 撰寫 delta specs。每個 capability 一個檔案。
27
- 文法: ## ADDED|MODIFIED|REMOVED|RENAMED Requirements /
28
- ### Requirement: <名稱> (內文必須含 SHALL MUST) /
29
- #### Scenario: <名稱> (四個 #, WHEN/THEN/AND bullet)
30
- MODIFIED 必須貼上完整更新後的 requirement 區塊。
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
- 技術設計: ContextGoals/Non-GoalsDecisions、測試 seam 的選定
38
- (優先沿用既有 seam, 越高層越好, 數量越少越好)、Risks、Open Questions。
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
- specs + design 切成 tracer-bullet 垂直切片任務。
48
- 每個任務群組 = 一條窄而完整的路徑 (可獨立驗證)
49
- 每個實作任務前面都要有對應的「先寫測試」任務 (TDD red 先行)。
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
- tasks.md TDD 執行: 每個切片先寫失敗測試 (red), 再實作到通過 (green),
55
- 只測 design.md 選定的 seam。完成後對照 specs 驗證行為一致。
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
- [測試切入點: 沿用哪個既有 seam, 或新增哪個; 為什麼是這一層]
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
- <!-- 動機: 解決什麼問題, 為什麼現在做 (>= 50 ) -->
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>`: <描述> (對應 specs/<name>/spec.md)
9
+ - `<name>`: <description> (maps to specs/<name>/spec.md)
10
10
 
11
11
  ### Modified Capabilities
12
- - `<existing-name>`: <改變的 requirement>
12
+ - `<existing-name>`: <the requirement that changes>
13
13
 
14
14
  ## Impact
15
- <!-- 受影響的程式 / API / 相依 / 系統 -->
15
+ <!-- Affected code / APIs / dependencies / systems -->
@@ -1,13 +1,13 @@
1
1
  ## ADDED Requirements
2
2
 
3
- ### Requirement: [名稱]
4
- [系統 SHALL/MUST ... 的行為描述 關鍵字必須在內文, 不能只在標題]
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
- <!-- 亦可使用 MODIFIED、REMOVEDRENAMED Requirements
12
- MODIFIED 必須包含完整更新後的 requirement 區塊。
13
- REMOVED 必須包含 Reason MigrationRENAMED 使用 FROM/TO 配對。 -->
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 撰寫失敗測試: [對應的 Scenario 名稱]
5
- - [ ] 1.2 實作至測試通過
6
- - [ ] 1.3 對照 spec 驗證行為
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 對照 spec 驗證行為
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
- [一句話描述這個 change 要做什麼詳細 why/what/capabilities/impact proposal.md]
2
+ [One sentence describing what this change doesdetailed 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"}