@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
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VERIFY_DOC, VERIFY_POINTER, VERIFY_INLINE } from '../fragments/verify.js';
|
|
2
|
+
/**
|
|
3
|
+
* @param verifySection Skills pass `VERIFY_POINTER` (methodology disclosed to a
|
|
4
|
+
* sibling `VERIFY.md`); commands pass `VERIFY_INLINE`, having no sibling file.
|
|
5
|
+
*/
|
|
2
6
|
// ponytail: one parameterized template literal, not a template engine.
|
|
3
|
-
function buildApplyBody(v) {
|
|
7
|
+
function buildApplyBody(v, verifySection) {
|
|
4
8
|
return `**Task tracking is file-based only.** The tracks file's checkboxes (\`- [ ]\` / \`- [x]\`) are the single source of truth for progress. Never use a built-in todo or task-tracking tool — editing the checkbox in the file is the only way progress gets recorded.
|
|
5
9
|
|
|
6
10
|
**Steps**
|
|
@@ -32,7 +36,7 @@ function buildApplyBody(v) {
|
|
|
32
36
|
|
|
33
37
|
5. **Work the tracks file one item at a time**
|
|
34
38
|
|
|
35
|
-
The tracks file is \`tasks.md\` (sdd) or \`task.md\` (issue). ${v.
|
|
39
|
+
The tracks file is \`tasks.md\` (sdd) or \`task.md\` (issue). ${v.checkOffRule} Never batch multiple items into one pass.
|
|
36
40
|
|
|
37
41
|
Before starting an item, re-read the parts of design/specs that cover its scope — don't rely on memory from earlier in the conversation, context may have been compressed since.
|
|
38
42
|
|
|
@@ -50,11 +54,7 @@ ${v.issueBranch}
|
|
|
50
54
|
\`\`\`
|
|
51
55
|
Implementation sometimes touches tasks.md/specs directly (adding a discovered edge case, correcting an estimate) — confirm the change's artifacts are still structurally valid before handing off. Fix and re-run until it passes.
|
|
52
56
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Once every task is checked off and \`tospec validate\` passes, run the two-axis review **automatically**. This is not a separate command the user has to invoke — verify is folded into apply and runs here as its last step, before the change is handed to \`tospec-archive\`.
|
|
56
|
-
|
|
57
|
-
${VERIFY_METHODOLOGY}
|
|
57
|
+
${verifySection}
|
|
58
58
|
|
|
59
59
|
**Output**
|
|
60
60
|
|
|
@@ -73,8 +73,8 @@ ${v.guardrailsHead}
|
|
|
73
73
|
// -----------------------------------------------------------------------------
|
|
74
74
|
// Default apply — implement per slice; tests are optional, not mandated
|
|
75
75
|
// -----------------------------------------------------------------------------
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const APPLY_VARIANT = {
|
|
77
|
+
checkOffRule: 'Take the next unchecked item, implement it, confirm it works against its specs, check it off (\`- [ ]\` → \`- [x]\`), then move to the next.',
|
|
78
78
|
sddBranch: `### sdd branch — implement per slice
|
|
79
79
|
|
|
80
80
|
For each tracer-bullet slice in \`tasks.md\`:
|
|
@@ -82,20 +82,22 @@ For each tracer-bullet slice in \`tasks.md\`:
|
|
|
82
82
|
2. Verify the result matches the behavior the slice's specs describe, and that the existing test suite still passes.
|
|
83
83
|
3. Check off the slice, then move to the next one — one slice per cycle. Refactoring is not part of this loop; it belongs to the verify step at the end of this workflow.
|
|
84
84
|
|
|
85
|
-
Writing a new test is **not required** in this loop — add one when it earns its keep. If you do, put it at the seam \`design.md\` named and don't test internals or add implementation-coupled assertions (mocking internal collaborators, reaching into private state, checking the database instead of the interface)
|
|
85
|
+
Writing a new test is **not required** in this loop — add one when it earns its keep. If you do, put it at the seam \`design.md\` named and don't test internals or add implementation-coupled assertions (mocking internal collaborators, reaching into private state, checking the database instead of the interface).`,
|
|
86
86
|
issueBranch: `### issue branch — fix root cause
|
|
87
87
|
|
|
88
88
|
Read \`task.md\`'s feedback loop, then fix the root cause, not the symptom — if the same defect is reachable through multiple callers of a shared function, the fix belongs in the shared function, not patched into just the caller the ticket named (grep every caller of the function you're touching). Confirm the fix with \`task.md\`'s feedback loop and keep the existing suite green.
|
|
89
89
|
|
|
90
|
-
A regression test is **not required** here — add one when the bug is likely to recur, extending the existing test if there's one at the right seam
|
|
90
|
+
A regression test is **not required** here — add one when the bug is likely to recur, extending the existing test if there's one at the right seam.`,
|
|
91
91
|
guardrailsHead: `- One slice/task at a time — no batching
|
|
92
92
|
- Tests are optional in this loop — write one when it earns its keep, and never let a missing test block progress; \`tospec-apply-with-tdd\` is the variant that mandates them
|
|
93
93
|
- Never delete, skip, or weaken an existing test to get to green — fix the code instead`,
|
|
94
|
-
}
|
|
94
|
+
};
|
|
95
|
+
const APPLY_BODY = buildApplyBody(APPLY_VARIANT, VERIFY_POINTER);
|
|
96
|
+
const APPLY_BODY_COMMAND = buildApplyBody(APPLY_VARIANT, VERIFY_INLINE);
|
|
95
97
|
export function getTospecApplySkillTemplate() {
|
|
96
98
|
return {
|
|
97
99
|
name: 'tospec-apply',
|
|
98
|
-
description:
|
|
100
|
+
description: "Implement a tospec change's tasks slice by slice (tests optional), auto-verifying at the end. Use when the user wants to start or continue implementing a change.",
|
|
99
101
|
instructions: `Implement a change's tasks one slice at a time, branching by schema, then automatically run the two-axis verify review — ready for \`tospec-archive\` when done.
|
|
100
102
|
|
|
101
103
|
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
@@ -103,8 +105,9 @@ export function getTospecApplySkillTemplate() {
|
|
|
103
105
|
${APPLY_BODY}`,
|
|
104
106
|
license: 'MIT',
|
|
105
107
|
compatibility: 'Requires tospec CLI.',
|
|
106
|
-
metadata: { author: 'tospec'
|
|
107
|
-
allowedTools: ['Bash
|
|
108
|
+
metadata: { author: 'tospec' },
|
|
109
|
+
allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Agent', 'AskUserQuestion'],
|
|
110
|
+
extraFiles: { 'VERIFY.md': VERIFY_DOC },
|
|
108
111
|
};
|
|
109
112
|
}
|
|
110
113
|
export function getTospecApplyCommandTemplate() {
|
|
@@ -117,14 +120,14 @@ export function getTospecApplyCommandTemplate() {
|
|
|
117
120
|
|
|
118
121
|
**Input**: Optionally specify a change name after \`tospec-apply\` (e.g., \`tospec-apply add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
119
122
|
|
|
120
|
-
${
|
|
123
|
+
${APPLY_BODY_COMMAND}`,
|
|
121
124
|
};
|
|
122
125
|
}
|
|
123
126
|
// -----------------------------------------------------------------------------
|
|
124
127
|
// TDD apply — strict red → green per slice
|
|
125
128
|
// -----------------------------------------------------------------------------
|
|
126
|
-
const
|
|
127
|
-
|
|
129
|
+
const APPLY_TDD_VARIANT = {
|
|
130
|
+
checkOffRule: 'Take the next unchecked item, implement it, check it off (\`- [ ]\` → \`- [x]\`) only once its test is green, then move to the next.',
|
|
128
131
|
sddBranch: `### sdd branch — TDD per slice
|
|
129
132
|
|
|
130
133
|
For each tracer-bullet slice in \`tasks.md\`:
|
|
@@ -142,7 +145,9 @@ Read \`task.md\`'s feedback loop. Then:
|
|
|
142
145
|
Fix root cause, not symptom — if the same defect is reachable through multiple callers of a shared function, the fix belongs in the shared function, not patched into just the caller the ticket named.`,
|
|
143
146
|
guardrailsHead: `- Red before green, always — never write the implementation before its failing test
|
|
144
147
|
- One slice/task at a time — no batching`,
|
|
145
|
-
}
|
|
148
|
+
};
|
|
149
|
+
const APPLY_TDD_BODY = buildApplyBody(APPLY_TDD_VARIANT, VERIFY_POINTER);
|
|
150
|
+
const APPLY_TDD_BODY_COMMAND = buildApplyBody(APPLY_TDD_VARIANT, VERIFY_INLINE);
|
|
146
151
|
export function getTospecApplyWithTDDSkillTemplate() {
|
|
147
152
|
return {
|
|
148
153
|
name: 'tospec-apply-with-tdd',
|
|
@@ -154,8 +159,9 @@ export function getTospecApplyWithTDDSkillTemplate() {
|
|
|
154
159
|
${APPLY_TDD_BODY}`,
|
|
155
160
|
license: 'MIT',
|
|
156
161
|
compatibility: 'Requires tospec CLI.',
|
|
157
|
-
metadata: { author: 'tospec'
|
|
158
|
-
allowedTools: ['Bash
|
|
162
|
+
metadata: { author: 'tospec' },
|
|
163
|
+
allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Agent', 'AskUserQuestion'],
|
|
164
|
+
extraFiles: { 'VERIFY.md': VERIFY_DOC },
|
|
159
165
|
};
|
|
160
166
|
}
|
|
161
167
|
export function getTospecApplyWithTDDCommandTemplate() {
|
|
@@ -168,7 +174,7 @@ export function getTospecApplyWithTDDCommandTemplate() {
|
|
|
168
174
|
|
|
169
175
|
**Input**: Optionally specify a change name after \`tospec-apply-with-tdd\` (e.g., \`tospec-apply-with-tdd add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
170
176
|
|
|
171
|
-
${
|
|
177
|
+
${APPLY_TDD_BODY_COMMAND}`,
|
|
172
178
|
};
|
|
173
179
|
}
|
|
174
180
|
//# sourceMappingURL=apply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/apply.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/apply.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAiBnF;;;GAGG;AACH,uEAAuE;AACvE,SAAS,cAAc,CAAC,CAAe,EAAE,aAAqB;IAC5D,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEA+B0D,CAAC,CAAC,YAAY;;;;;;;;EAQ/E,CAAC,CAAC,SAAS;;EAEX,CAAC,CAAC,WAAW;;;;;;;;EAQb,aAAa;;;;;;;EAOb,CAAC,CAAC,cAAc;;;;;;;sGAOoF,CAAC;AACvG,CAAC;AAED,gFAAgF;AAChF,wEAAwE;AACxE,gFAAgF;AAEhF,MAAM,aAAa,GAAiB;IAClC,YAAY,EACV,8IAA8I;IAChJ,SAAS,EAAE;;;;;;;yTAO4S;IACvT,WAAW,EAAE;;;;oJAIqI;IAClJ,cAAc,EAAE;;wFAEsE;CACvF,CAAC;AAEF,MAAM,UAAU,GAAG,cAAc,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AACjE,MAAM,kBAAkB,GAAG,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAExE,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,mKAAmK;QAChL,YAAY,EAAE;;;;EAIhB,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC;QAC3F,UAAU,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;KACxC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,oDAAoD;QACjE,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC;QACpC,OAAO,EAAE;;;;EAIX,kBAAkB,EAAE;KACnB,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,2CAA2C;AAC3C,gFAAgF;AAEhF,MAAM,iBAAiB,GAAiB;IACtC,YAAY,EACV,sIAAsI;IACxI,SAAS,EAAE;;;;;;0KAM6J;IACxK,WAAW,EAAE;;;;;;;wMAOyL;IACtM,cAAc,EAAE;yCACuB;CACxC,CAAC;AAEF,MAAM,cAAc,GAAG,cAAc,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AACzE,MAAM,sBAAsB,GAAG,cAAc,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAEhF,MAAM,UAAU,kCAAkC;IAChD,OAAO;QACL,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,oJAAoJ;QACjK,YAAY,EAAE;;;;EAIhB,cAAc,EAAE;QACd,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC;QAC3F,UAAU,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;KACxC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC;IAClD,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,wDAAwD;QACrE,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,gBAAgB,CAAC;QAC3C,OAAO,EAAE;;;;EAIX,sBAAsB,EAAE;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAiDlE,wBAAgB,6BAA6B,IAAI,aAAa,CAc7D;AAED,wBAAgB,+BAA+B,IAAI,eAAe,CAYjE"}
|
|
@@ -15,16 +15,16 @@ If a sync is warranted, **ask the user one question** (make clear both answers a
|
|
|
15
15
|
|
|
16
16
|
> "This change has spec deltas. Run \`tospec-sync\` to reconcile the specs against the code before archiving? (recommended, but you can archive without it.)"
|
|
17
17
|
|
|
18
|
-
- **User says yes** → run the \`tospec-sync\` workflow now. It reconciles each Requirement against the code (code wins) and writes \`sync-report.md\` with
|
|
18
|
+
- **User says yes** → run the \`tospec-sync\` workflow now. It reconciles each Requirement against the code (code wins) and writes \`sync-report.md\` with \`Conclusion: PASS\`. If it ends in \`Conclusion: FAIL\` (a real CODE-BUG), **stop** and return to \`tospec-apply\` to fix the code — do not archive. On PASS, archive **with** \`--require-sync\` (Step 2, synced branch).
|
|
19
19
|
- **User says no** → that's allowed. Skip the sync and archive **without** \`--require-sync\` (Step 2, not-synced branch). Declining does not block archiving.
|
|
20
20
|
|
|
21
21
|
**Step 2 — archive**
|
|
22
22
|
|
|
23
|
-
Synced branch (user chose to sync and \`sync-report.md\` says
|
|
23
|
+
Synced branch (user chose to sync and \`sync-report.md\` says \`Conclusion: PASS\`):
|
|
24
24
|
\`\`\`bash
|
|
25
25
|
tospec archive "<name>" --json --require-sync
|
|
26
26
|
\`\`\`
|
|
27
|
-
\`--require-sync\` is the CLI's own machine-checkable half of the sync gate: it refuses unless \`sync-report.md\` exists with a
|
|
27
|
+
\`--require-sync\` is the CLI's own machine-checkable half of the sync gate: it refuses unless \`sync-report.md\` exists with a \`Conclusion: PASS\` line (\`SYNC_REPORT_MISSING\` / \`SYNC_REPORT_FAILED\`). If \`tospec-sync\` actually ran and passed, this succeeds for free — a CLI-enforced backstop behind the instruction-level order above. Only pass \`--require-sync\` when a sync actually ran; otherwise the CLI will (correctly) refuse.
|
|
28
28
|
|
|
29
29
|
Not-synced branch (sync wasn't needed, or the user declined):
|
|
30
30
|
\`\`\`bash
|
|
@@ -38,9 +38,7 @@ Either way, the CLI then: re-validates the delta specs (blocking), checks tasks/
|
|
|
38
38
|
**Guardrails — explicit and non-negotiable**
|
|
39
39
|
- Judge whether a sync is warranted before archiving; only ask the user when the change has spec deltas — and honor a "no" (archive still proceeds, just without \`--require-sync\`)
|
|
40
40
|
- Only pass \`--require-sync\` when \`tospec-sync\` actually produced a passing \`sync-report.md\` this run
|
|
41
|
-
-
|
|
42
|
-
- **Never** create the archive directory yourself
|
|
43
|
-
- **Never** manually move, copy, or rename the change directory
|
|
41
|
+
- **\`tospec archive\` owns the archive directory** — it generates the \`yyyyMMdd_HHmmss-<name>\` name and moves the change there. Let the command do it: the timestamp comes from internals you cannot reproduce, so a hand-built name risks a collision or a wrong sort order
|
|
44
42
|
- If \`tospec archive\` reports a validation failure or asks for confirmation on incomplete tasks, resolve the underlying issue (or explicitly confirm with the user) — do not route around it with manual file operations
|
|
45
43
|
|
|
46
44
|
**Output**
|
|
@@ -49,7 +47,7 @@ Report the archived name and path from \`tospec archive\`'s output, whether a sy
|
|
|
49
47
|
export function getTospecArchiveSkillTemplate() {
|
|
50
48
|
return {
|
|
51
49
|
name: 'tospec-archive',
|
|
52
|
-
description: 'Finish and archive a completed change
|
|
50
|
+
description: 'Finish and archive a completed tospec change via `tospec archive`, deciding first whether a spec/code sync is needed. Use when the user wants to finalize an implemented change.',
|
|
53
51
|
instructions: `Finish a completed change: confirm verify (done in apply), decide about sync (run \`tospec-sync\` if warranted and the user agrees), then \`tospec archive\` — the only path to a merged, archived change.
|
|
54
52
|
|
|
55
53
|
**Input**: The user's request should name the change to archive.
|
|
@@ -57,7 +55,7 @@ export function getTospecArchiveSkillTemplate() {
|
|
|
57
55
|
${ARCHIVE_BODY}`,
|
|
58
56
|
license: 'MIT',
|
|
59
57
|
compatibility: 'Requires tospec CLI.',
|
|
60
|
-
metadata: { author: 'tospec'
|
|
58
|
+
metadata: { author: 'tospec' },
|
|
61
59
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
62
60
|
};
|
|
63
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sJA6CiI,CAAC;AAEvJ,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kLAAkL;QAC/L,YAAY,EAAE;;;;EAIhB,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,oGAAoG;QACjH,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;QAC7B,OAAO,EAAE;;;;EAIX,YAAY,EAAE;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/decision.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/decision.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAiDlE,wBAAgB,8BAA8B,IAAI,aAAa,CAe9D;AAED,wBAAgB,gCAAgC,IAAI,eAAe,CAYlE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nextStepLabelRule } from '../fragments/next-step.js';
|
|
1
2
|
const DECISION_BODY = `Capture a decision that has already been made or is ready to be adopted — the reasoning, the alternatives weighed, and what it affects. A decision left only in chat is a decision that gets re-litigated next week.
|
|
2
3
|
|
|
3
4
|
**Steps**
|
|
@@ -6,23 +7,26 @@ const DECISION_BODY = `Capture a decision that has already been made or is ready
|
|
|
6
7
|
Read \`tospec/decisions/index.md\` (if it exists) — its timestamp / title / summary rows are the history of what was already decided. Use it to spot a decision this one extends or supersedes, and to avoid contradicting an accepted one.
|
|
7
8
|
|
|
8
9
|
2. **Converge on the decision first — and keep the exchange**
|
|
9
|
-
Before writing anything, make sure you can state: what was decided, why (the driving forces), which alternatives were evaluated, and what it impacts. If any of these is fuzzy, ask the user — don't invent them. As you interview, keep the material questions you asked and the user's answers; you'll record them in
|
|
10
|
+
Before writing anything, make sure you can state: what was decided, why (the driving forces), which alternatives were evaluated, and what it impacts. If any of these is fuzzy, ask the user — don't invent them. As you interview, keep the material questions you asked and the user's answers; you'll record them in Decision Process (step 4) so the reasoning trail survives the chat.
|
|
10
11
|
|
|
11
12
|
3. **Create the record**
|
|
12
13
|
\`\`\`bash
|
|
13
|
-
tospec decision new "<topic>" --title "
|
|
14
|
+
tospec decision new "<topic>" --title "<title>" --summary "<one-line summary>" --status proposed
|
|
14
15
|
\`\`\`
|
|
15
|
-
Derive a kebab-case \`<topic>\` from the subject. The CLI produces both files: it writes \`tospec/decisions/<yyyyMMdd_HHmmss>-<topic>.md\` from its template (
|
|
16
|
+
Derive a kebab-case \`<topic>\` from the subject. The CLI produces both files: it writes \`tospec/decisions/<yyyyMMdd_HHmmss>-<topic>.md\` from its template (Status/Date/title pre-filled) and appends a row to \`tospec/decisions/index.md\` (seeding that ledger on first use). **The CLI owns the dated filename and the index — never create/rename decision files or hand-edit \`index.md\` yourself.** Use \`--status accepted\` if already agreed, or \`--status superseded\` (and name the successor) when replacing an older decision; pass \`--date\` only to backfill a past decision.
|
|
16
17
|
|
|
17
|
-
4. **Fill the
|
|
18
|
-
Open the created file
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
18
|
+
4. **Fill the sections**
|
|
19
|
+
Open the created file. Six sections are required — they are the structure the schema validates against:
|
|
20
|
+
- **Status** — proposed / accepted / superseded (+ Date); if superseded, name the decision that replaces it.
|
|
21
|
+
- **Context** — the situation and forces that made this decision necessary.
|
|
22
|
+
- **Decision** — what was chosen, the canonical terms, and why this over the alternatives.
|
|
23
|
+
- **Impact** — the modules / APIs / docs / tests this touches.
|
|
24
|
+
- **Alternatives** — each option considered, its trade-offs, and the conclusion.
|
|
25
|
+
- **Follow-up** — the follow-up implementation items, phased if useful.
|
|
26
|
+
|
|
27
|
+
The template carries two more that are optional:
|
|
28
|
+
- **Decision Process** — the key questions you asked and the user's answers that shaped this decision. Format each pair as a \`**Q:** question\` line followed by the answer in the next paragraph, one pair per block. Summarize each Q&A; don't paste a full transcript. Omit the section entirely if there was no interactive discussion.
|
|
29
|
+
- **Related Changes** — leave it empty. It fills in later, as changes link back via \`tospec new change --decisions\`.
|
|
26
30
|
|
|
27
31
|
5. **Verify**
|
|
28
32
|
\`\`\`bash
|
|
@@ -32,19 +36,18 @@ const DECISION_BODY = `Capture a decision that has already been made or is ready
|
|
|
32
36
|
|
|
33
37
|
**Output**
|
|
34
38
|
|
|
35
|
-
Summarize the decision, its status, and the follow-up work. If it supersedes an older decision, state which one and flip that older file's
|
|
39
|
+
Summarize the decision, its status, and the follow-up work. If it supersedes an older decision, state which one and flip that older file's Status to \`superseded\`. Report the created filename explicitly — when a change later implements this decision, that filename is what \`tospec new change --decisions\` records to link the change back here (the file's optional \`## Related Changes\` section can list those changes in return).
|
|
36
40
|
|
|
37
|
-
Then point at the next step
|
|
41
|
+
Then point at the next step. ${nextStepLabelRule('the decision you just recorded', '\`(update)\`, \`(propose)\`/\`(issue)\`')} If the decision came out of grilling or exploring an **existing** change, offer **(update)** via \`tospec-update\` to fold it into that change's artifacts; if no change exists yet, offer **(propose)** / **(issue)** via \`tospec-propose\`/\`tospec-issue\` and carry the filename into \`--decisions\`.
|
|
38
42
|
|
|
39
43
|
**Guardrails**
|
|
40
44
|
- The decision file, its date-prefixed filename, and the ledger row are all CLI-generated — pass \`--summary\`, and never create/rename decision files or hand-edit \`index.md\` yourself; only edit the decision file's section contents
|
|
41
45
|
- Don't record a decision whose rationale or alternatives you can't state — clarify with the user first
|
|
42
|
-
- \`superseded\` must name its successor; the superseded record's
|
|
43
|
-
- Keep the six required sections — they are the structure the schema validates against; 決策過程 is an optional seventh for the Q&A trail (each pair starts with a \`**Q:**\` line, answer in the next paragraph)`;
|
|
46
|
+
- \`superseded\` must name its successor; the superseded record's Status must be updated too`;
|
|
44
47
|
export function getTospecDecisionSkillTemplate() {
|
|
45
48
|
return {
|
|
46
49
|
name: 'tospec-decision',
|
|
47
|
-
description: 'Record an architecture decision as a permanent ADR
|
|
50
|
+
description: 'Record an architecture decision as a permanent ADR. Use when a design/architecture choice has been made or is ready to adopt and should be documented with its rationale, alternatives, and impact instead of left in chat.',
|
|
48
51
|
instructions: `Turn a made (or ready-to-adopt) decision into a permanent ADR record via the \`tospec decision\` command.
|
|
49
52
|
|
|
50
53
|
**Input**: The user's request should describe the decision and, ideally, the reasoning and the alternatives that were considered.
|
|
@@ -52,7 +55,7 @@ export function getTospecDecisionSkillTemplate() {
|
|
|
52
55
|
${DECISION_BODY}`,
|
|
53
56
|
license: 'MIT',
|
|
54
57
|
compatibility: 'Requires tospec CLI.',
|
|
55
|
-
metadata: { author: 'tospec'
|
|
58
|
+
metadata: { author: 'tospec' },
|
|
56
59
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
57
60
|
};
|
|
58
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/decision.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/decision.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAuCS,iBAAiB,CAAC,gCAAgC,EAAE,yCAAyC,CAAC;;;;;6FAKhC,CAAC;AAE9F,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,6NAA6N;QAC/N,YAAY,EAAE;;;;EAIhB,aAAa,EAAE;QACb,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,6FAA6F;QAC1G,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC;QACrC,OAAO,EAAE;;;;EAIX,aAAa,EAAE;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Explore Workflow Template
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Pre-change requirement convergence: interview a fuzzy idea or problem until
|
|
5
|
+
* it is concrete enough to hand to propose/issue. Read-only, and obliged to end
|
|
6
|
+
* by asking the user for the next step. Its sibling `tospec-grill` pressure-tests
|
|
7
|
+
* something already on the table — explore deliberately avoids leading with the
|
|
8
|
+
* word "grill" so the two don't compete for the same trigger.
|
|
6
9
|
*/
|
|
7
10
|
import type { SkillTemplate, CommandTemplate } from '../types.js';
|
|
8
11
|
export declare function getExploreSkillTemplate(): SkillTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/explore.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"explore.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/explore.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA4DlE,wBAAgB,uBAAuB,IAAI,aAAa,CAcvD;AAED,wBAAgB,+BAA+B,IAAI,eAAe,CAYjE"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { INTERVIEW_MECHANICS } from '../fragments/interview.js';
|
|
2
|
+
import { nextStepLabelRule } from '../fragments/next-step.js';
|
|
1
3
|
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
4
|
|
|
3
|
-
This is a
|
|
5
|
+
This is a relentless interview, not a freeform chat. Interrogate the idea or problem until you and the user share the same understanding, walking every branch of the decision tree.
|
|
6
|
+
|
|
7
|
+
**Interview mechanics**
|
|
8
|
+
|
|
9
|
+
${INTERVIEW_MECHANICS}
|
|
4
10
|
|
|
5
11
|
**Steps**
|
|
6
12
|
|
|
@@ -10,11 +16,9 @@ This is a grilling interview, not a freeform chat. Interview the user relentless
|
|
|
10
16
|
\`\`\`
|
|
11
17
|
Read \`tospec/specs/\` for the capabilities this touches and \`tospec/config.yaml\` for project context. Do this BEFORE asking anything — questions you can answer yourself by reading the codebase are questions you should never ask the user.
|
|
12
18
|
|
|
13
|
-
2. **
|
|
14
|
-
|
|
15
|
-
Ask unrelated questions together in a single turn (use \`AskUserQuestion\` — up to 4 at once) so the user answers in one pass instead of a slow drip. A question whose answer depends on another still-open question isn't independent — it belongs to a *later* turn, once the question it hangs off is settled. Batch everything that stands on its own now; hold back only what's waiting on an answer you haven't heard yet, and when you do sequence, wait for that answer before continuing. Each question carries your suggested answer and the reasoning, so the user can just say "yes" instead of writing an essay.
|
|
19
|
+
2. **Work the question priority order**
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
Take these in order, skipping anything the conversation or the codebase already answered:
|
|
18
22
|
1. Goal and success condition — what does "done" look like?
|
|
19
23
|
2. Who the user/actor is
|
|
20
24
|
3. Boundaries — what's explicitly out of scope
|
|
@@ -22,65 +26,57 @@ This is a grilling interview, not a freeform chat. Interview the user relentless
|
|
|
22
26
|
5. Data and state — what persists, what's transient
|
|
23
27
|
6. Unstated assumptions — the things nobody said out loud
|
|
24
28
|
|
|
25
|
-
3. **
|
|
29
|
+
3. **Converge**
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
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 going.
|
|
28
32
|
|
|
29
|
-
4. **
|
|
30
|
-
- **Factual** ("does X already exist", "what does Y currently do") → look it up in the codebase yourself, never ask the user
|
|
31
|
-
- **Decision** (behavior, scope, tradeoffs) → always ask, and wait for the answer before proceeding
|
|
33
|
+
4. **Restate**
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
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.
|
|
35
|
+
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).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
5. **Record any settled decision — don't ask first**
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
If the interview settled a **material** decision — a choice between real alternatives with lasting architecture/design impact that will get re-litigated if left in chat — record it now via \`tospec-decision\` with \`--status proposed\`. Don't put this to the user as an option: the restatement they just confirmed is the consent, and \`proposed\` is a draft status they can still reject. An answered factual lookup or a trivial preference is not material — record nothing when nothing material was settled. If you can't state the decision's rationale and the alternatives weighed, don't invent them — ask the user, per \`tospec-decision\`'s own rule. Run it as a sub-step and skip \`tospec-decision\`'s own next-step handoff; step 6 covers it. Report the created filename.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
6. **Always ask for the next step — never pick it yourself**
|
|
42
42
|
|
|
43
|
-
Once you've restated the understanding, you MUST put the next step to the user with \`AskUserQuestion\`. This is unconditional: explore never proceeds to the next action on its own, and never ends without asking.
|
|
43
|
+
Once you've restated the understanding (and recorded any decision), you MUST put the next step to the user with \`AskUserQuestion\`. This is unconditional: apart from that ADR, explore never proceeds to the next action on its own, and never ends without asking.
|
|
44
44
|
|
|
45
|
-
One question, always these options, with your recommended one **first** and labelled "(Recommended)":
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- **\`tospec-grill\`** — keep digging with a four-quadrant deep dive on what was just explored.
|
|
45
|
+
One question, always these options, with your recommended one **first** and labelled "(Recommended)". ${nextStepLabelRule('the situation you just explored', '\`(propose)\`/\`(issue)\`, \`(grill)\`')} E.g. after settling a retry policy the first option might read "Write up the retry-limit change (propose)":
|
|
46
|
+
- **(propose)** (or **(issue)** when something is broken) — start writing the proposal via \`tospec-propose\`/\`tospec-issue\`.
|
|
47
|
+
- **(grill)** — keep digging with a four-quadrant deep dive on what was just explored via \`tospec-grill\`.
|
|
49
48
|
|
|
50
|
-
Recommend \`tospec-
|
|
49
|
+
Recommend \`tospec-propose\`/\`tospec-issue\` when the requirement is ready to build, and \`tospec-grill\` when it still feels fuzzy or under-tested.
|
|
51
50
|
|
|
52
|
-
\`tospec-propose\`/\`tospec-issue\` synthesize the requirement straight from the conversation and write the change artifacts;
|
|
51
|
+
\`tospec-propose\`/\`tospec-issue\` synthesize the requirement straight from the conversation and write the change artifacts; apart from the ADR in step 5, explore persists nothing itself. Carry the recorded decision filename(s) (reported by \`tospec decision new\`) into that handoff: the propose/issue step passes them via \`tospec new change --decisions\` so the change's metadata links back to its ADRs.
|
|
53
52
|
|
|
54
53
|
**Guardrails**
|
|
55
|
-
- **Always end with the next-step question** — never choose the follow-up action yourself, and never finish explore without asking
|
|
54
|
+
- **Always end with the next-step question** — never choose the follow-up action yourself, and never finish explore without asking. Recording a settled decision (step 5) is the one exception: that one you do unasked
|
|
56
55
|
- **Don't implement** — never write application code or edit source files during explore
|
|
57
|
-
- **Record decisions before proposing** —
|
|
58
|
-
- **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
|
|
59
|
-
- **Don't ask what you can look up** — codebase facts are yours to find, not the user's to recite
|
|
60
|
-
- **Don't stop at the first plausible answer** — dig for the implied premise behind it
|
|
56
|
+
- **Record decisions before proposing** — a settled material decision gets recorded via \`tospec-decision\` before \`tospec-propose\`/\`tospec-issue\`, not offered as a choice; a real decision must not survive only in chat
|
|
61
57
|
- **Don't force convergence** — if the user wants to keep exploring after you've restated where things stand, keep going`;
|
|
62
58
|
export function getExploreSkillTemplate() {
|
|
63
59
|
return {
|
|
64
60
|
name: 'tospec-explore',
|
|
65
|
-
description: '
|
|
66
|
-
instructions: `
|
|
61
|
+
description: 'Interview the user until a fuzzy idea or problem converges into a concrete requirement. Use before a change exists — when the idea is still fuzzy, or the user wants to think something through rather than build it. To pressure-test something already written, use tospec-grill.',
|
|
62
|
+
instructions: `Interview the user about their idea or problem until it converges into something concrete enough to become a \`tospec-propose\` or \`tospec-issue\`.
|
|
67
63
|
|
|
68
64
|
**Input**: The user's request is whatever they want to think through — a vague idea, a specific problem, or a change name to explore in context of.
|
|
69
65
|
|
|
70
66
|
${EXPLORE_BODY}`,
|
|
71
67
|
license: 'MIT',
|
|
72
68
|
compatibility: 'Requires tospec CLI.',
|
|
73
|
-
metadata: { author: 'tospec'
|
|
69
|
+
metadata: { author: 'tospec' },
|
|
74
70
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
75
71
|
};
|
|
76
72
|
}
|
|
77
73
|
export function getTospecExploreCommandTemplate() {
|
|
78
74
|
return {
|
|
79
75
|
name: 'TOSPEC: Explore',
|
|
80
|
-
description: '
|
|
76
|
+
description: 'Interview the user to converge a fuzzy idea or problem into a concrete requirement',
|
|
81
77
|
category: 'Workflow',
|
|
82
78
|
tags: ['workflow', 'explore'],
|
|
83
|
-
content: `
|
|
79
|
+
content: `Interview the user about their idea or problem until it converges into something concrete enough to become a \`tospec-propose\` or \`tospec-issue\`.
|
|
84
80
|
|
|
85
81
|
**Input**: The argument after \`tospec-explore\` is whatever the user wants to think through — a vague idea, a specific problem, or a change name to explore in context of. May be empty.
|
|
86
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/explore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"explore.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/explore.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,YAAY,GAAG;;;;;;EAMnB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2GAoCsF,iBAAiB,CAAC,iCAAiC,EAAE,wCAAwC,CAAC;;;;;;;;;;;;yHAYhF,CAAC;AAE1H,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,qRAAqR;QAClS,YAAY,EAAE;;;;EAIhB,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,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,oFAAoF;QACjG,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;QAC7B,OAAO,EAAE;;;;EAIX,YAAY,EAAE;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +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;
|
|
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;AAmDlE,wBAAgB,qBAAqB,IAAI,aAAa,CAcrD;AAED,wBAAgB,6BAA6B,IAAI,eAAe,CAY/D"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { INTERVIEW_MECHANICS } from '../fragments/interview.js';
|
|
2
|
+
import { nextStepLabelRule } from '../fragments/next-step.js';
|
|
3
|
+
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 writes nothing itself — when the interrogation lands something worth persisting, it delegates to the skill that owns that write (\`tospec-decision\` for a settled decision, \`tospec-update\` for a change's artifacts).
|
|
2
4
|
|
|
3
|
-
This is a relentless interrogation of whatever is 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.
|
|
5
|
+
This is a relentless interrogation of whatever is 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.
|
|
4
6
|
|
|
5
7
|
**Pick the target first — never assume one**
|
|
6
8
|
|
|
@@ -24,10 +26,7 @@ Sweep all four — the last two are where the real risk hides:
|
|
|
24
26
|
|
|
25
27
|
**Interview mechanics**
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
- **Every question carries a suggested answer** and the reasoning behind it, so the user can confirm instead of writing an essay.
|
|
29
|
-
- **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.
|
|
30
|
-
- **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.
|
|
29
|
+
${INTERVIEW_MECHANICS}
|
|
31
30
|
|
|
32
31
|
**Converge**
|
|
33
32
|
|
|
@@ -35,28 +34,22 @@ You're done only when you can fully restate the shared understanding — the cla
|
|
|
35
34
|
|
|
36
35
|
**Hand off once the understanding is confirmed**
|
|
37
36
|
|
|
38
|
-
A grill that shifts the picture leaves work behind.
|
|
37
|
+
A grill that shifts the picture leaves work behind. Once the user confirms the restatement:
|
|
39
38
|
|
|
40
|
-
1. **Record
|
|
41
|
-
2. **Then
|
|
42
|
-
- **Target was an existing written proposal**
|
|
43
|
-
- **Target was a raw idea or an explore**
|
|
39
|
+
1. **Record any decision the grill produced — don't ask first.** A choice between real alternatives with lasting architecture/design impact belongs in an ADR before anything else: record it via \`tospec-decision\` with \`--status proposed\`. Don't offer this as an option — the confirmation you just got is the consent, and \`proposed\` is a draft status the user can still reject. Record nothing when nothing material moved; a confirmed assumption is not a decision. If you can't state the rationale and the alternatives weighed, don't invent them — ask the user, per \`tospec-decision\`'s own rule. Run it as a sub-step and skip \`tospec-decision\`'s own next-step handoff; step 2 covers it. Report the created filename.
|
|
40
|
+
2. **Then offer the next step,** routed by target kind. ${nextStepLabelRule('what this grill actually surfaced', '\`(update)\`, \`(propose)\`/\`(issue)\`, \`(grill)\`')}
|
|
41
|
+
- **Target was an existing written proposal** → **(update)** via \`tospec-update\` to fold the outcome into that change's artifacts. Name the change so update doesn't have to re-ask, and carry any recorded decision filename with it.
|
|
42
|
+
- **Target was a raw idea or an explore** → nothing is written yet; offer **(propose)** (or **(issue)** when something is broken) via \`tospec-propose\`/\`tospec-issue\`, or **(grill)** if it's still fuzzy.
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
Apart from that ADR, grill writes nothing — \`tospec-decision\` and \`tospec-update\` own those files.
|
|
46
45
|
|
|
47
46
|
**Guardrails**
|
|
48
|
-
- **Don't implement** — never write application code, edit sources, or create artifact files during a grill
|
|
49
|
-
- **Don't pick the target yourself** — when the subject isn't explicit or unambiguous, ask; when there's no subject at all, stop
|
|
50
47
|
- **Don't act before consensus** — take no action, including any handoff, until the user has confirmed the restated understanding
|
|
51
|
-
- **Don't
|
|
52
|
-
- **Don't stop at the first plausible answer** — dig for the implied premise behind it
|
|
53
|
-
- **Don't force closure** — if the user wants to keep grilling after you've restated where things stand, keep going
|
|
54
|
-
|
|
55
|
-
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, only handoffs.`;
|
|
48
|
+
- **Don't force closure** — if the user wants to keep grilling after you've restated where things stand, keep going`;
|
|
56
49
|
export function getGrillSkillTemplate() {
|
|
57
50
|
return {
|
|
58
51
|
name: 'tospec-grill',
|
|
59
|
-
description: "Pressure-test any artifact — a plan, a decision, an idea, a design — through a relentless four-quadrant Known/Unknown interrogation. Trigger
|
|
52
|
+
description: "Pressure-test any artifact — a plan, a decision, an idea, a design — through a relentless four-quadrant Known/Unknown interrogation. Trigger when the user says 'grill', 'grill me' or 'grilling', or wants to surface unspoken assumptions and hunt blind spots before committing. To converge an idea not yet written down, use tospec-explore.",
|
|
60
53
|
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.
|
|
61
54
|
|
|
62
55
|
**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 resolve the target per "Pick the target first" below — never assume one.
|
|
@@ -64,7 +57,7 @@ export function getGrillSkillTemplate() {
|
|
|
64
57
|
${GRILL_BODY}`,
|
|
65
58
|
license: 'MIT',
|
|
66
59
|
compatibility: 'Requires tospec CLI.',
|
|
67
|
-
metadata: { author: 'tospec'
|
|
60
|
+
metadata: { author: 'tospec' },
|
|
68
61
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
69
62
|
};
|
|
70
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grill.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/grill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grill.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/grill.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BjB,mBAAmB;;;;;;;;;;;0DAWqC,iBAAiB,CAAC,mCAAmC,EAAE,sDAAsD,CAAC;;;;;;;;oHAQpD,CAAC;AAErH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,mVAAmV;QAChW,YAAY,EAAE;;;;EAIhB,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,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"}
|
|
@@ -69,8 +69,8 @@ export function getTospecIssueSkillTemplate() {
|
|
|
69
69
|
${ISSUE_BODY}`,
|
|
70
70
|
license: 'MIT',
|
|
71
71
|
compatibility: 'Requires tospec CLI.',
|
|
72
|
-
metadata: { author: 'tospec'
|
|
73
|
-
allowedTools: ['Bash
|
|
72
|
+
metadata: { author: 'tospec' },
|
|
73
|
+
allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
export function getTospecIssueCommandTemplate() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/issue.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EA2DuD,CAAC;AAE3E,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,6NAA6N;QAC1O,YAAY,EAAE;;;;EAIhB,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"issue.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/issue.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EA2DuD,CAAC;AAE3E,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,6NAA6N;QAC1O,YAAY,EAAE;;;;EAIhB,UAAU,EAAE;QACV,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KACnF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,8EAA8E;QAC3F,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC;QACxC,OAAO,EAAE;;;;EAIX,UAAU,EAAE;KACX,CAAC;AACJ,CAAC"}
|