@seanmars/tospec 0.11.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/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/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/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/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 +3 -5
- 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 +11 -8
- 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 +27 -31
- 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 +1 -1
- package/dist/core/templates/workflows/propose.js.map +1 -1
- package/dist/core/templates/workflows/sync.js +2 -2
- 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 -28
- 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/package.json +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
|
@@ -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**
|
|
@@ -14,15 +15,18 @@ const DECISION_BODY = `Capture a decision that has already been made or is ready
|
|
|
14
15
|
\`\`\`
|
|
15
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
|
|
18
|
+
4. **Fill the sections**
|
|
19
|
+
Open the created file. Six sections are required — they are the structure the schema validates against:
|
|
19
20
|
- **Status** — proposed / accepted / superseded (+ Date); if superseded, name the decision that replaces it.
|
|
20
21
|
- **Context** — the situation and forces that made this decision necessary.
|
|
21
22
|
- **Decision** — what was chosen, the canonical terms, and why this over the alternatives.
|
|
22
23
|
- **Impact** — the modules / APIs / docs / tests this touches.
|
|
23
24
|
- **Alternatives** — each option considered, its trade-offs, and the conclusion.
|
|
24
25
|
- **Follow-up** — the follow-up implementation items, phased if useful.
|
|
25
|
-
|
|
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
|
|
@@ -34,17 +38,16 @@ const DECISION_BODY = `Capture a decision that has already been made or is ready
|
|
|
34
38
|
|
|
35
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 Status must be updated too
|
|
43
|
-
- Keep the six required sections — they are the structure the schema validates against; Decision Process 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
|
-
- **(decision)** — record a material decision as an ADR via \`tospec-decision\`. Offer this only when the interview actually settled one: a choice between real alternatives with lasting architecture/design impact that will get re-litigated if left in chat. An answered factual lookup or a trivial preference is not material — drop this option when nothing material was settled.
|
|
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)":
|
|
47
46
|
- **(propose)** (or **(issue)** when something is broken) — start writing the proposal via \`tospec-propose\`/\`tospec-issue\`.
|
|
48
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. **
|
|
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"}
|
|
@@ -59,7 +59,7 @@ export function getTospecProposeSkillTemplate() {
|
|
|
59
59
|
${PROPOSE_BODY}`,
|
|
60
60
|
license: 'MIT',
|
|
61
61
|
compatibility: 'Requires tospec CLI.',
|
|
62
|
-
metadata: { author: 'tospec'
|
|
62
|
+
metadata: { author: 'tospec' },
|
|
63
63
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
64
64
|
};
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propose.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/propose.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAiD2G,CAAC;AAEjI,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kRAAkR;QAC/R,YAAY,EAAE;;;;EAIhB,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE
|
|
1
|
+
{"version":3,"file":"propose.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/propose.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAiD2G,CAAC;AAEjI,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kRAAkR;QAC/R,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,wEAAwE;QACrF,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC;QACtC,OAAO,EAAE;;;;EAIX,YAAY,EAAE;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -59,7 +59,7 @@ Summarize how many Requirements were in sync, how many specs were updated, and w
|
|
|
59
59
|
export function getTospecSyncSkillTemplate() {
|
|
60
60
|
return {
|
|
61
61
|
name: 'tospec-sync',
|
|
62
|
-
description: '
|
|
62
|
+
description: 'Reconcile a change\'s Requirements against the actual implementation — code wins on any mismatch — and write sync-report.md. Use before archiving a change whose specs may have drifted from the code.',
|
|
63
63
|
instructions: `Reconcile \`specs/\` against the implementation for every Requirement this change touched — code wins on any mismatch. Run this before \`tospec-archive\` when the change's specs may have drifted from the code.
|
|
64
64
|
|
|
65
65
|
**Input**: The user's request should name the change to sync.
|
|
@@ -67,7 +67,7 @@ export function getTospecSyncSkillTemplate() {
|
|
|
67
67
|
${SYNC_BODY}`,
|
|
68
68
|
license: 'MIT',
|
|
69
69
|
compatibility: 'Requires tospec CLI.',
|
|
70
|
-
metadata: { author: 'tospec'
|
|
70
|
+
metadata: { author: 'tospec' },
|
|
71
71
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob'],
|
|
72
72
|
};
|
|
73
73
|
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,wMAAwM;QACrN,YAAY,EAAE;;;;EAIhB,SAAS,EAAE;QACT,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,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/update.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/update.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgElE,wBAAgB,4BAA4B,IAAI,aAAa,CAc5D;AAED,wBAAgB,8BAA8B,IAAI,eAAe,CAYhE"}
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { nextStepLabelRule } from '../fragments/next-step.js';
|
|
2
|
+
const UPDATE_BODY = `**Steps**
|
|
2
3
|
|
|
3
|
-
**
|
|
4
|
+
1. **Select the change**
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Run \`tospec list --json\` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to update.
|
|
8
|
-
|
|
9
|
-
Present the top 3-4 most recently modified changes as options, showing:
|
|
10
|
-
- Change name
|
|
11
|
-
- Status (e.g., "0/5 tasks", "complete", "no tasks" from \`completedTasks\`/\`totalTasks\`/\`status\`)
|
|
12
|
-
- How recently it was modified (from \`lastModified\`)
|
|
13
|
-
|
|
14
|
-
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
|
|
15
|
-
|
|
16
|
-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
6
|
+
If the user named one, use it. Otherwise run \`tospec list --json\` and let the user pick with \`AskUserQuestion\` — never guess, never auto-select. Offer the 3-4 most recently modified, each labelled with its name, its status (from \`completedTasks\`/\`totalTasks\`/\`status\`) and how recently it changed (from \`lastModified\`), with the most recent marked "(Recommended)".
|
|
17
7
|
|
|
18
8
|
2. **Get the change's artifacts**
|
|
19
9
|
\`\`\`bash
|
|
@@ -25,9 +15,9 @@ const UPDATE_BODY = `Revise a change's existing planning artifacts and keep them
|
|
|
25
15
|
- \`isComplete\`: Boolean indicating if all required artifacts are complete
|
|
26
16
|
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
|
|
27
17
|
|
|
28
|
-
The artifact ids and paths come from the active schema
|
|
18
|
+
The artifact ids and paths come from the active schema — never assume them, and never branch on hardcoded artifact names. Custom schemas must work unchanged.
|
|
29
19
|
|
|
30
|
-
The files to edit are \`artifactPaths.<id>.existingOutputPaths\`
|
|
20
|
+
The files to edit are \`artifactPaths.<id>.existingOutputPaths\` — the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. \`specs/**/*.md\`). Do NOT write to \`resolvedOutputPath\`: for a glob artifact it is still the glob pattern, not a real file.
|
|
31
21
|
|
|
32
22
|
3. **Understand the request**
|
|
33
23
|
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
|
|
@@ -35,14 +25,14 @@ const UPDATE_BODY = `Revise a change's existing planning artifacts and keep them
|
|
|
35
25
|
|
|
36
26
|
4. **Read and reconcile**
|
|
37
27
|
- Read the artifact(s) the request touches and the change's other existing artifacts.
|
|
38
|
-
- Apply the requested edit. Then check every other existing artifact against it
|
|
28
|
+
- Apply the requested edit. Then check every other existing artifact against it — in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
|
|
39
29
|
- Note everything that is now inconsistent, missing, or contradictory.
|
|
40
|
-
- Revise only files that already exist (\`existingOutputPaths\`).
|
|
30
|
+
- Revise only files that already exist (\`existingOutputPaths\`). Creating an artifact that doesn't exist yet, or a new file under a glob artifact, is \`tospec-propose\`/\`tospec-issue\`'s job — note what's missing and point the user there.
|
|
41
31
|
- If the change is already coherent, say so and make no edits.
|
|
42
32
|
|
|
43
33
|
5. **Confirm and apply, one artifact at a time**
|
|
44
34
|
- Show each proposed revision and why. Write only after the user confirms.
|
|
45
|
-
- If the user rejects a revision,
|
|
35
|
+
- If the user rejects a revision, leave that artifact unchanged.
|
|
46
36
|
- When a substantial rewrite is needed, get that artifact's rules and template first:
|
|
47
37
|
\`\`\`bash
|
|
48
38
|
tospec instructions <artifact-id> --change "<name>" --json
|
|
@@ -50,23 +40,23 @@ const UPDATE_BODY = `Revise a change's existing planning artifacts and keep them
|
|
|
50
40
|
Read \`rules\` and \`template\` from the response.
|
|
51
41
|
|
|
52
42
|
6. **Point to the next step (guidance only - NEVER act on it)**
|
|
53
|
-
|
|
54
|
-
- Artifacts still missing
|
|
55
|
-
- Change already implemented (tasks checked off / already applied)
|
|
56
|
-
- Everything done and implemented
|
|
43
|
+
${nextStepLabelRule('where this change actually stands', '\`(propose)\`/\`(issue)\`, \`(apply)\`, \`(archive)\`')}
|
|
44
|
+
- Artifacts still missing → suggest **(propose)** (sdd) or **(issue)** via \`tospec-propose\`/\`tospec-issue\` to create them.
|
|
45
|
+
- Change already implemented (tasks checked off / already applied) → the code may no longer match the revised plan; suggest **(apply)** via \`tospec-apply\`.
|
|
46
|
+
- Everything done and implemented → suggest **(archive)** via \`tospec-archive\`.
|
|
57
47
|
|
|
58
48
|
**Output**
|
|
59
49
|
|
|
60
50
|
After each invocation, show:
|
|
61
51
|
- Which artifacts were revised (and which proposed revisions were rejected)
|
|
62
|
-
- Anything deferred to artifact creation (not-yet-created artifacts or files
|
|
52
|
+
- Anything deferred to artifact creation (not-yet-created artifacts or files → \`tospec-propose\`/\`tospec-issue\`)
|
|
63
53
|
- Where the change stands and the recommended next command
|
|
64
54
|
|
|
65
55
|
**Guardrails**
|
|
66
|
-
- Planning artifacts only
|
|
56
|
+
- Planning artifacts only — NEVER edit implementation code. If the revised plan implies code changes, stop and point to \`tospec-apply\`.
|
|
67
57
|
- Use the artifact ids and paths reported by \`tospec status\`; never branch on hardcoded artifact names.
|
|
68
58
|
- Edit only the concrete files in \`existingOutputPaths\`; never write to a glob \`resolvedOutputPath\`.
|
|
69
|
-
-
|
|
59
|
+
- Stay behind the build frontier: revise what exists, and leave new artifacts and new glob files to \`tospec-propose\`/\`tospec-issue\`.
|
|
70
60
|
- Confirm every edit with the user before writing.
|
|
71
61
|
- If the request changes the change's *intent* rather than refining it, recommend starting fresh with \`tospec-propose\`/\`tospec-issue\` (the "Update vs. Start Fresh" heuristic).`;
|
|
72
62
|
export function getTospecUpdateSkillTemplate() {
|
|
@@ -80,8 +70,8 @@ export function getTospecUpdateSkillTemplate() {
|
|
|
80
70
|
${UPDATE_BODY}`,
|
|
81
71
|
license: 'MIT',
|
|
82
72
|
compatibility: 'Requires tospec CLI.',
|
|
83
|
-
metadata: { author: 'tospec'
|
|
84
|
-
allowedTools: ['Bash(tospec:*)', '
|
|
73
|
+
metadata: { author: 'tospec' },
|
|
74
|
+
allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
|
|
85
75
|
};
|
|
86
76
|
}
|
|
87
77
|
export function getTospecUpdateCommandTemplate() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/update.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyCf,iBAAiB,CAAC,mCAAmC,EAAE,uDAAuD,CAAC;;;;;;;;;;;;;;;;;;oLAkBgE,CAAC;AAErL,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,oPAAoP;QACjQ,YAAY,EAAE;;;;EAIhB,WAAW,EAAE;QACX,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,8BAA8B;IAC5C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,6EAA6E;QAC1F,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;QAC/B,OAAO,EAAE;;;;EAIX,WAAW,EAAE;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmCH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,OAAO,GAAE,oBAAyB;IAIxC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmCH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,OAAO,GAAE,oBAAyB;IAIxC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoKjD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAkBvC;;;;OAIG;YACW,yBAAyB;CA0BxC"}
|
package/dist/core/update.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as fs from 'fs';
|
|
|
8
8
|
import { createRequire } from 'module';
|
|
9
9
|
import { FileSystemUtils } from '../utils/file-system.js';
|
|
10
10
|
import { AI_TOOLS, TOSPEC_DIR_NAME } from './config.js';
|
|
11
|
-
import { getToolVersionStatus, getSkillTemplates,
|
|
11
|
+
import { getToolVersionStatus, getSkillTemplates, writeSkillDir, getConfiguredTools, removeLegacySkillDirs, removeLegacyToolSkillLayout, writeToolCommands, } from './shared/index.js';
|
|
12
12
|
import { getGlobalConfig } from './global-config.js';
|
|
13
13
|
import { getProfileWorkflows, ALL_WORKFLOWS } from './profiles.js';
|
|
14
14
|
import { getAvailableTools } from './available-tools.js';
|
|
@@ -83,8 +83,7 @@ export class UpdateCommand {
|
|
|
83
83
|
// formats). Always rewritten on update, same as init.
|
|
84
84
|
const agentsSkillsDir = path.join(resolvedProjectPath, '.agents', 'skills');
|
|
85
85
|
for (const { template, dirName } of skillTemplates) {
|
|
86
|
-
|
|
87
|
-
await FileSystemUtils.writeFile(path.join(agentsSkillsDir, dirName, 'SKILL.md'), skillContent);
|
|
86
|
+
await writeSkillDir(agentsSkillsDir, dirName, template, TOSPEC_VERSION);
|
|
88
87
|
}
|
|
89
88
|
await removeLegacySkillDirs(agentsSkillsDir);
|
|
90
89
|
await fs.promises.rm(path.join(resolvedProjectPath, '.agents', 'commands'), { recursive: true, force: true });
|