@seanmars/tospec 0.6.0 → 0.8.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/assets/dashboard/app.js +157 -0
- package/assets/dashboard/index.html +4 -0
- package/assets/dashboard/style.css +158 -0
- package/bin/tospec.js +0 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +8 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +4 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +49 -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-data.d.ts +17 -0
- package/dist/core/dashboard-data.d.ts.map +1 -1
- package/dist/core/dashboard-data.js +23 -0
- package/dist/core/dashboard-data.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/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/templates/skill-templates.d.ts +2 -0
- package/dist/core/templates/skill-templates.d.ts.map +1 -1
- package/dist/core/templates/skill-templates.js +2 -0
- 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/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 +16 -3
- package/dist/core/templates/workflows/explore.js.map +1 -1
- package/dist/core/templates/workflows/grill.d.ts +12 -0
- package/dist/core/templates/workflows/grill.d.ts.map +1 -0
- package/dist/core/templates/workflows/grill.js +61 -0
- package/dist/core/templates/workflows/grill.js.map +1 -0
- 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 +9 -10
- package/schemas/decision/schema.yaml +17 -0
- package/schemas/decision/templates/decision.md +34 -0
- package/schemas/decision/templates/index.md +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const EXPLORE_BODY = `**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and run \`tospec\` read-only commands, but you must NEVER write code or create artifact files during explore. When the requirement converges, hand off to \`tospec-propose\` or \`tospec-issue\` — those write the files.
|
|
1
|
+
const EXPLORE_BODY = `**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and run \`tospec\` read-only commands, but you must NEVER write code or create artifact files during explore. When the requirement converges, record any material decisions via \`tospec-decision\` first, then hand off to \`tospec-propose\` or \`tospec-issue\` — those write the files.
|
|
2
2
|
|
|
3
3
|
This is a grilling interview, not a freeform chat. Interview the user relentlessly about the idea or problem until you both share the same understanding, walking every branch of the decision tree — batching questions that stand on their own, but following dependent threads one question at a time.
|
|
4
4
|
|
|
@@ -34,12 +34,25 @@ This is a grilling interview, not a freeform chat. Interview the user relentless
|
|
|
34
34
|
|
|
35
35
|
You're done when you can fully restate the requirement back to the user in your own words and they confirm it's correct — not when you run out of questions. If they correct your restatement, that's a sign there's still a hidden branch; keep grilling.
|
|
36
36
|
|
|
37
|
-
6. **Restate
|
|
37
|
+
6. **Restate**
|
|
38
38
|
|
|
39
|
-
Deliver the converged understanding back in the conversation — the problem, the decisions made (with reasoning), and anything explicitly ruled out — so \`tospec-propose\`/\`tospec-issue\` can synthesize it straight from context (that's exactly the input they expect).
|
|
39
|
+
Deliver the converged understanding back in the conversation — the problem, the decisions made (with reasoning), and anything explicitly ruled out — so \`tospec-propose\`/\`tospec-issue\` can synthesize it straight from context (that's exactly the input they expect).
|
|
40
|
+
|
|
41
|
+
7. **Recommend the next step — then hand off**
|
|
42
|
+
|
|
43
|
+
Explore back-and-forth almost always settles decisions; judge whether any is *material* — a choice between real alternatives that will shape the change and get re-litigated if left in chat (a material decision weighed alternatives and has lasting architecture/design impact; an answered factual lookup or a trivial preference does not). That judgment sets your recommendation.
|
|
44
|
+
|
|
45
|
+
Put the next step to the user with \`AskUserQuestion\` — one question, your recommended option **first** and labelled "(Recommended)", plus the real alternatives (including "keep exploring") so they can override:
|
|
46
|
+
- **A material decision was settled but isn't recorded** -> recommend \`tospec-decision\`; record the ADR **before** any proposal.
|
|
47
|
+
- **A new capability is ready to build** -> recommend \`tospec-propose\`.
|
|
48
|
+
- **Something is broken** -> recommend \`tospec-issue\`.
|
|
49
|
+
- **Still fuzzy** -> recommend keeping the exploration going.
|
|
50
|
+
|
|
51
|
+
\`tospec-propose\`/\`tospec-issue\` synthesize the requirement straight from the conversation and write the change artifacts; explore persists nothing itself. If the user picks \`tospec-decision\`, record it, then ask again — now recommending \`tospec-propose\`/\`tospec-issue\` — because a recorded decision still needs to flow into a change.
|
|
40
52
|
|
|
41
53
|
**Guardrails**
|
|
42
54
|
- **Don't implement** — never write application code or edit source files during explore
|
|
55
|
+
- **Record decisions before proposing** — if the interview settled a material decision, hand off to \`tospec-decision\` to record it before \`tospec-propose\`/\`tospec-issue\`; a real decision must not survive only in chat
|
|
43
56
|
- **Batch what's independent, sequence what's dependent** — ask unrelated questions together in one turn; split to one at a time only when A's answer decides B
|
|
44
57
|
- **Don't ask what you can look up** — codebase facts are yours to find, not the user's to recite
|
|
45
58
|
- **Don't stop at the first plausible answer** — dig for the implied premise behind it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/explore.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/explore.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yHA0DoG,CAAC;AAE1H,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,yQAAyQ;QACtR,YAAY,EAAE;;;;EAIhB,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAC9C,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,sFAAsF;QACnG,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;QAC7B,OAAO,EAAE;;;;EAIX,YAAY,EAAE;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grill Workflow Template
|
|
3
|
+
*
|
|
4
|
+
* On-demand deep-dive interrogation of any artifact (plan / decision / idea)
|
|
5
|
+
* using a Known/Unknown four-quadrant frame. Explicit-invocation only,
|
|
6
|
+
* read-only, and — unlike explore — under no obligation to hand off or persist
|
|
7
|
+
* anything.
|
|
8
|
+
*/
|
|
9
|
+
import type { SkillTemplate, CommandTemplate } from '../types.js';
|
|
10
|
+
export declare function getGrillSkillTemplate(): SkillTemplate;
|
|
11
|
+
export declare function getTospecGrillCommandTemplate(): CommandTemplate;
|
|
12
|
+
//# sourceMappingURL=grill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grill.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/grill.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmClE,wBAAgB,qBAAqB,IAAI,aAAa,CAcrD;AAED,wBAAgB,6BAA6B,IAAI,eAAe,CAY/D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const GRILL_BODY = `**IMPORTANT: Grill is read-only pressure-testing, not building.** You may read files, search code, and run \`tospec\` read-only commands, but you must NEVER write code, edit sources, or create artifact files during a grill. Grill persists nothing — it hands off to nothing. Its only output is a shared, confirmed understanding delivered back in the conversation.
|
|
2
|
+
|
|
3
|
+
This is a relentless interrogation of whatever the user put on the table — a plan, a decision, an idea, a design. Stress-test it until every assumption is named and every open question is either answered or explicitly parked. Work the four quadrants below, batching questions that stand on their own and following dependent threads one question at a time.
|
|
4
|
+
|
|
5
|
+
**The four quadrants**
|
|
6
|
+
|
|
7
|
+
Sweep all four — the last two are where the real risk hides:
|
|
8
|
+
|
|
9
|
+
1. **Known Knowns — what we think we know.** Restate the claims the artifact rests on, then *verify* them. If it's checkable in the codebase, check it — never assume a "known" is true just because it was asserted. A false Known Known is the most dangerous kind.
|
|
10
|
+
2. **Known Unknowns — the open questions already on the table.** Enumerate them and put them to the user, each with your suggested answer and reasoning so they can just confirm.
|
|
11
|
+
3. **Unknown Knowns — the unspoken assumptions.** Surface the premises nobody said out loud and *name them* — the implicit "of course X" that the whole thing quietly depends on. Drag each into the light and confirm it holds.
|
|
12
|
+
4. **Unknown Unknowns — the blind spots.** Probe adjacent territory and reach for analogies that failed elsewhere, to unearth the questions the user didn't know to ask. Ask "what would have to be true for this to blow up?" and chase the answers.
|
|
13
|
+
|
|
14
|
+
**Interview mechanics**
|
|
15
|
+
|
|
16
|
+
- **Batch independent questions; sequence dependent ones.** Ask unrelated questions together in a single turn (use \`AskUserQuestion\` — up to 4 at once). A question whose answer depends on another still-open question isn't independent — hold it for a later turn once the question it hangs off is settled.
|
|
17
|
+
- **Every question carries a suggested answer** and the reasoning behind it, so the user can confirm instead of writing an essay.
|
|
18
|
+
- **Look up what's checkable.** Factual questions ("does X already exist", "what does Y currently do") are yours to answer from the codebase — never ask the user something you can verify yourself.
|
|
19
|
+
- **Probe every answer for its hidden premise.** After each answer, ask what it implies that hasn't been said yet. Don't stop at the first plausible answer; keep pulling the thread until it stops giving new information.
|
|
20
|
+
|
|
21
|
+
**Converge**
|
|
22
|
+
|
|
23
|
+
You're done only when you can fully restate the shared understanding — the claims that held up, the assumptions now made explicit, the questions answered, and anything left deliberately open — and the user confirms it's right. Running out of questions is not convergence. If the user corrects your restatement, there's still a hidden branch; keep grilling.
|
|
24
|
+
|
|
25
|
+
**Guardrails**
|
|
26
|
+
- **Don't implement** — never write application code, edit sources, or create artifact files during a grill
|
|
27
|
+
- **Don't act before consensus** — take no action until the user has confirmed the restated understanding
|
|
28
|
+
- **Don't ask what you can look up** — codebase facts are yours to find, not the user's to recite
|
|
29
|
+
- **Don't stop at the first plausible answer** — dig for the implied premise behind it
|
|
30
|
+
- **Don't force closure** — if the user wants to keep grilling after you've restated where things stand, keep going
|
|
31
|
+
|
|
32
|
+
Grill is on-demand deep-dive for *any* artifact — not the pre-change requirement convergence that \`tospec-explore\` owns, and it lands no files of its own.`;
|
|
33
|
+
export function getGrillSkillTemplate() {
|
|
34
|
+
return {
|
|
35
|
+
name: 'tospec-grill',
|
|
36
|
+
description: "Pressure-test any artifact — a plan, a decision, an idea, a design — through a relentless four-quadrant Known/Unknown interrogation. Trigger whenever the user says 'grill', 'grill me', 'grilling', or 'grilling me', or otherwise wants to dig deeper, surface unspoken assumptions, and hunt blind spots before committing.",
|
|
37
|
+
instructions: `Grill any artifact the user hands you — a plan, decision, idea, or design — through the four-quadrant Known/Unknown frame until every assumption is named and the understanding is shared and confirmed.
|
|
38
|
+
|
|
39
|
+
**Input**: The user's request is whatever they want stress-tested — a plan file, a recorded decision, a raw idea, or a change name to interrogate in context of. May be empty, in which case ask what to grill.
|
|
40
|
+
|
|
41
|
+
${GRILL_BODY}`,
|
|
42
|
+
license: 'MIT',
|
|
43
|
+
compatibility: 'Requires tospec CLI.',
|
|
44
|
+
metadata: { author: 'tospec', version: '1.0' },
|
|
45
|
+
allowedTools: ['Bash(tospec:*)', 'Read', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function getTospecGrillCommandTemplate() {
|
|
49
|
+
return {
|
|
50
|
+
name: 'TOSPEC: Grill',
|
|
51
|
+
description: 'Pressure-test any artifact through a relentless four-quadrant Known/Unknown interrogation',
|
|
52
|
+
category: 'Workflow',
|
|
53
|
+
tags: ['workflow', 'grill'],
|
|
54
|
+
content: `Grill any artifact the user hands you — a plan, decision, idea, or design — through the four-quadrant Known/Unknown frame until every assumption is named and the understanding is shared and confirmed.
|
|
55
|
+
|
|
56
|
+
**Input**: The argument after \`tospec-grill\` is whatever the user wants stress-tested — a plan file, a recorded decision, a raw idea, or a change name to interrogate in context of. May be empty, in which case ask what to grill.
|
|
57
|
+
|
|
58
|
+
${GRILL_BODY}`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=grill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grill.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/grill.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6JA+B0I,CAAC;AAE9J,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,gUAAgU;QAC7U,YAAY,EAAE;;;;EAIhB,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAC9C,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KAC5E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,2FAA2F;QACxG,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;QAC3B,OAAO,EAAE;;;;EAIX,UAAU,EAAE;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6DlE,wBAAgB,0BAA0B,IAAI,aAAa,CAc1D;AAED,wBAAgB,4BAA4B,IAAI,eAAe,CAY9D"}
|
|
@@ -54,7 +54,8 @@ Summarize how many Requirements were in sync, how many specs were updated, and w
|
|
|
54
54
|
- Code is the source of truth for behavior — spec updates always follow code, never the other way around
|
|
55
55
|
- Never edit source code from this workflow — a code-side mismatch is diagnosis, not a license to patch here
|
|
56
56
|
- Every MODIFIED delta must re-pass \`tospec validate\` before moving to the next Requirement
|
|
57
|
-
- \`sync-report.md\` is required output, in the exact format above — \`tospec archive --require-sync\` depends on both its existence and its \`結論:\` line
|
|
57
|
+
- \`sync-report.md\` is required output, in the exact format above — \`tospec archive --require-sync\` depends on both its existence and its \`結論:\` line
|
|
58
|
+
- One comparison pass per Requirement — check it against the code once and record the verdict. \`sync-report.md\` is the deliverable, not another review target: don't re-audit the report after writing it, and don't re-check a Requirement already judged MATCH`;
|
|
58
59
|
export function getTospecSyncSkillTemplate() {
|
|
59
60
|
return {
|
|
60
61
|
name: 'tospec-sync',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/sync.ts"],"names":[],"mappings":"AAYA,MAAM,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/sync.ts"],"names":[],"mappings":"AAYA,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mQAyDiP,CAAC;AAEpQ,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,iTAAiT;QAC9T,YAAY,EAAE;;;;EAIhB,SAAS,EAAE;QACT,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAC9C,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,qEAAqE;QAClF,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,CAAC;QAC1C,OAAO,EAAE;;;;EAIX,SAAS,EAAE;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -31,7 +31,7 @@ const UPDATE_BODY = `Revise a change's existing planning artifacts and keep them
|
|
|
31
31
|
|
|
32
32
|
3. **Understand the request**
|
|
33
33
|
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
|
|
34
|
-
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
|
|
34
|
+
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts once and check them against each other for contradictions, gaps, and duplication. This is a single read-through, not a recursive audit — don't re-review your own reconciliation after making it.
|
|
35
35
|
|
|
36
36
|
4. **Read and reconcile**
|
|
37
37
|
- Read the artifact(s) the request touches and the change's other existing artifacts.
|
|
@@ -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.8.0",
|
|
4
4
|
"description": "Spec-driven development CLI for structured requirements and issue workflows",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -28,14 +28,6 @@
|
|
|
28
28
|
"schemas",
|
|
29
29
|
"assets"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "node build.js",
|
|
33
|
-
"skills": "node build.js && node scripts/gen-skills.mjs",
|
|
34
|
-
"dev": "tsc --watch",
|
|
35
|
-
"test": "vitest run",
|
|
36
|
-
"prepack": "node build.js",
|
|
37
|
-
"prepublish": "node build.js"
|
|
38
|
-
},
|
|
39
31
|
"engines": {
|
|
40
32
|
"node": ">=22.22.0"
|
|
41
33
|
},
|
|
@@ -52,5 +44,12 @@
|
|
|
52
44
|
"marked": "^18.0.6",
|
|
53
45
|
"yaml": "^2.9.0",
|
|
54
46
|
"zod": "^4.4.3"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "node build.js",
|
|
50
|
+
"skills": "node build.js && node scripts/gen-skills.mjs",
|
|
51
|
+
"dev": "tsc --watch",
|
|
52
|
+
"test": "vitest run",
|
|
53
|
+
"prepublish": "node build.js"
|
|
55
54
|
}
|
|
56
|
-
}
|
|
55
|
+
}
|
|
@@ -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,34 @@
|
|
|
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
|
+
<!-- 選配: 關鍵問答紀錄; 每組以 **Q:** 開頭, 下一段為回答; 摘要即可, 不貼逐字稿; 無互動討論可省略 -->
|
|
27
|
+
|
|
28
|
+
**Q:** [問題]
|
|
29
|
+
|
|
30
|
+
[回答]
|
|
31
|
+
|
|
32
|
+
**Q:** [問題]
|
|
33
|
+
|
|
34
|
+
[回答]
|