@seanmars/tospec 0.5.0 → 0.7.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/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +57 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +9 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/dashboard.d.ts +55 -5
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +209 -19
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +41 -0
- package/dist/commands/decision.d.ts.map +1 -0
- package/dist/commands/decision.js +282 -0
- package/dist/commands/decision.js.map +1 -0
- package/dist/core/dashboard-activity.d.ts.map +1 -1
- package/dist/core/dashboard-activity.js +4 -2
- package/dist/core/dashboard-activity.js.map +1 -1
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +11 -3
- package/dist/core/init.js.map +1 -1
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
- package/dist/core/parsers/requirement-blocks.js +46 -33
- package/dist/core/parsers/requirement-blocks.js.map +1 -1
- package/dist/core/parsers/spec-structure.d.ts.map +1 -1
- package/dist/core/parsers/spec-structure.js +3 -29
- package/dist/core/parsers/spec-structure.js.map +1 -1
- package/dist/core/profiles.d.ts +1 -1
- package/dist/core/profiles.d.ts.map +1 -1
- package/dist/core/profiles.js +1 -1
- package/dist/core/profiles.js.map +1 -1
- package/dist/core/shared/index.d.ts +1 -0
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +1 -0
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/rules-generation.d.ts +11 -0
- package/dist/core/shared/rules-generation.d.ts.map +1 -0
- package/dist/core/shared/rules-generation.js +27 -0
- package/dist/core/shared/rules-generation.js.map +1 -0
- package/dist/core/shared/skill-generation.d.ts.map +1 -1
- package/dist/core/shared/skill-generation.js +9 -2
- package/dist/core/shared/skill-generation.js.map +1 -1
- package/dist/core/shared/tool-detection.d.ts +2 -2
- package/dist/core/shared/tool-detection.d.ts.map +1 -1
- package/dist/core/shared/tool-detection.js +4 -0
- package/dist/core/shared/tool-detection.js.map +1 -1
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +14 -2
- package/dist/core/specs-apply.js.map +1 -1
- package/dist/core/templates/skill-templates.d.ts +2 -1
- package/dist/core/templates/skill-templates.d.ts.map +1 -1
- package/dist/core/templates/skill-templates.js +2 -1
- package/dist/core/templates/skill-templates.js.map +1 -1
- package/dist/core/templates/types.d.ts +2 -0
- package/dist/core/templates/types.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.d.ts +8 -0
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +88 -8
- package/dist/core/templates/workflows/apply.js.map +1 -1
- package/dist/core/templates/workflows/decision.d.ts +11 -0
- package/dist/core/templates/workflows/decision.d.ts.map +1 -0
- package/dist/core/templates/workflows/decision.js +70 -0
- package/dist/core/templates/workflows/decision.js.map +1 -0
- package/dist/core/templates/workflows/explore.d.ts.map +1 -1
- package/dist/core/templates/workflows/explore.js +17 -4
- package/dist/core/templates/workflows/explore.js.map +1 -1
- package/dist/core/templates/workflows/sync.d.ts.map +1 -1
- package/dist/core/templates/workflows/sync.js +2 -1
- package/dist/core/templates/workflows/sync.js.map +1 -1
- package/dist/core/templates/workflows/update.js +1 -1
- package/dist/core/templates/workflows/verify.d.ts +1 -1
- package/dist/core/templates/workflows/verify.d.ts.map +1 -1
- package/dist/core/templates/workflows/verify.js +7 -2
- package/dist/core/templates/workflows/verify.js.map +1 -1
- package/package.json +2 -1
- package/schemas/decision/schema.yaml +17 -0
- package/schemas/decision/templates/decision.md +28 -0
- package/schemas/decision/templates/index.md +2 -0
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* the end of `tospec-apply`. This module exports the methodology text so
|
|
6
6
|
* `apply.ts` can inline it; there is no skill/command template here anymore.
|
|
7
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**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**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
|
|
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
9
|
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,
|
|
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"}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export const VERIFY_METHODOLOGY = `Two-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings — a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.
|
|
9
9
|
|
|
10
|
+
**Scope — 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.
|
|
11
|
+
|
|
10
12
|
**Steps**
|
|
11
13
|
|
|
12
14
|
1. **Gather context**
|
|
@@ -33,12 +35,15 @@ export const VERIFY_METHODOLOGY = `Two-axis review of the implementation, run as
|
|
|
33
35
|
|
|
34
36
|
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.
|
|
35
37
|
|
|
38
|
+
This is a **mechanical collation you do yourself** — collect, label, count. It is not another review pass and not a job for a subagent: nothing reviews these two reports.
|
|
39
|
+
|
|
36
40
|
**Verify output**
|
|
37
41
|
|
|
38
|
-
Report the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified — 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
|
|
42
|
+
Report the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified — 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 — 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".
|
|
39
43
|
|
|
40
44
|
**Verify guardrails**
|
|
41
45
|
- Standards and Spec axes are independent — never let one axis's findings influence the other's report
|
|
42
46
|
- Full test suite must be green; a clean review with red tests is not verified
|
|
43
|
-
- Quote the specific spec/task line or hunk for every finding — no unsupported claims
|
|
47
|
+
- Quote the specific spec/task line or hunk for every finding — no unsupported claims
|
|
48
|
+
- **One review pass per axis — 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`;
|
|
44
49
|
//# sourceMappingURL=verify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seanmars/tospec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Spec-driven development CLI for structured requirements and issue workflows",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "node build.js",
|
|
50
|
+
"skills": "node build.js && node scripts/gen-skills.mjs",
|
|
50
51
|
"dev": "tsc --watch",
|
|
51
52
|
"test": "vitest run",
|
|
52
53
|
"prepublish": "node build.js"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: decision
|
|
2
|
+
version: 1
|
|
3
|
+
description: Architecture Decision Record (ADR) workflow
|
|
4
|
+
artifacts:
|
|
5
|
+
# decision 由專屬 `tospec decision` 指令建立於 tospec/decisions/<yyyy-MM-dd>-<topic>.md,
|
|
6
|
+
# 不走 change 目錄; 此 artifact 只作為 template 與段落驗證的資料契約。
|
|
7
|
+
- id: decision
|
|
8
|
+
generates: decision.md
|
|
9
|
+
description: 單一 ADR 文件 — 狀態 / 背景 / 決策 / 影響 / 替代方案 / 後續工作
|
|
10
|
+
template: decision.md
|
|
11
|
+
requires: []
|
|
12
|
+
instruction: |
|
|
13
|
+
依 ADR 規範撰寫一份決策文件。狀態使用 proposed / accepted / superseded;
|
|
14
|
+
superseded 需註明取代者。決策段要寫清楚選了什麼與為什麼, 替代方案列出評估過的
|
|
15
|
+
選項與各自優缺點, 影響段列出受影響的模組 / API / 文件 / 測試。
|
|
16
|
+
validation:
|
|
17
|
+
requiredSections: [狀態, 背景, 決策, 影響, 替代方案, 後續工作]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# [決策主題]
|
|
2
|
+
|
|
3
|
+
## 狀態
|
|
4
|
+
|
|
5
|
+
- proposed
|
|
6
|
+
- 日期:[yyyyMMdd_HHmmss]
|
|
7
|
+
|
|
8
|
+
<!-- 狀態: proposed(已提出) / accepted(已採用) / superseded(已被取代, 需註明取代者) -->
|
|
9
|
+
|
|
10
|
+
## 背景
|
|
11
|
+
<!-- 為什麼要做這個決策: 現況、限制與需求目標 -->
|
|
12
|
+
|
|
13
|
+
## 決策
|
|
14
|
+
<!-- 選了什麼方案; canonical 術語; 為什麼這樣選而非其他方案 -->
|
|
15
|
+
|
|
16
|
+
## 影響
|
|
17
|
+
<!-- 受影響的模組 / API / 文件 / 測試 -->
|
|
18
|
+
|
|
19
|
+
## 替代方案
|
|
20
|
+
<!-- 評估過哪些方案, 各自優缺點與結論 -->
|
|
21
|
+
|
|
22
|
+
## 後續工作
|
|
23
|
+
<!-- 分階段的後續實作項目 -->
|
|
24
|
+
|
|
25
|
+
## 決策過程
|
|
26
|
+
<!-- 選配: 關鍵問答紀錄 (問了什麼、使用者怎麼回), 摘要即可, 不貼逐字稿; 無互動討論可省略 -->
|
|
27
|
+
- Q: [問題]
|
|
28
|
+
A: [回答]
|