@seanmars/tospec 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/dashboard/style.css +8 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +40 -17
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +0 -9
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/dashboard.d.ts +95 -8
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +253 -32
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +1 -13
- package/dist/commands/decision.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +36 -41
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/workflow/instructions.d.ts +0 -2
- package/dist/commands/workflow/instructions.d.ts.map +1 -1
- package/dist/commands/workflow/instructions.js +2 -37
- package/dist/commands/workflow/instructions.js.map +1 -1
- package/dist/commands/workflow/shared.d.ts +0 -3
- package/dist/commands/workflow/shared.d.ts.map +1 -1
- package/dist/commands/workflow/shared.js.map +1 -1
- package/dist/core/archive.d.ts +13 -4
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +89 -117
- package/dist/core/archive.js.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +0 -5
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +31 -37
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
- package/dist/core/artifact-graph/resolver.d.ts +6 -0
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +79 -124
- package/dist/core/artifact-graph/resolver.js.map +1 -1
- package/dist/core/change-presenter.d.ts +0 -1
- package/dist/core/change-presenter.d.ts.map +1 -1
- package/dist/core/change-presenter.js +3 -20
- package/dist/core/change-presenter.js.map +1 -1
- package/dist/core/command-generation/adapters/index.d.ts +9 -1
- package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
- package/dist/core/command-generation/adapters/index.js +10 -1
- package/dist/core/command-generation/adapters/index.js.map +1 -1
- package/dist/core/command-generation/index.d.ts +2 -2
- package/dist/core/command-generation/index.d.ts.map +1 -1
- package/dist/core/command-generation/index.js +2 -2
- package/dist/core/command-generation/index.js.map +1 -1
- package/dist/core/config.d.ts +0 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +0 -4
- package/dist/core/config.js.map +1 -1
- package/dist/core/converters/json-converter.d.ts +0 -1
- package/dist/core/converters/json-converter.d.ts.map +1 -1
- package/dist/core/converters/json-converter.js +3 -17
- package/dist/core/converters/json-converter.js.map +1 -1
- package/dist/core/dashboard-activity.d.ts.map +1 -1
- package/dist/core/dashboard-activity.js +2 -8
- package/dist/core/dashboard-activity.js.map +1 -1
- package/dist/core/dashboard-data.d.ts +7 -7
- package/dist/core/dashboard-data.d.ts.map +1 -1
- package/dist/core/dashboard-data.js +15 -54
- package/dist/core/dashboard-data.js.map +1 -1
- package/dist/core/id.d.ts +0 -8
- package/dist/core/id.d.ts.map +1 -1
- package/dist/core/id.js +0 -19
- package/dist/core/id.js.map +1 -1
- package/dist/core/init.d.ts +0 -1
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +11 -26
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +3 -34
- package/dist/core/list.js.map +1 -1
- package/dist/core/migrate.js +9 -15
- package/dist/core/migrate.js.map +1 -1
- package/dist/core/parsers/markdown-parser.d.ts +11 -1
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
- package/dist/core/parsers/markdown-parser.js +25 -13
- package/dist/core/parsers/markdown-parser.js.map +1 -1
- package/dist/core/planning-home.d.ts +6 -0
- package/dist/core/planning-home.d.ts.map +1 -1
- package/dist/core/planning-home.js +6 -1
- package/dist/core/planning-home.js.map +1 -1
- package/dist/core/project-config.d.ts +5 -19
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +11 -130
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/root-selection.d.ts.map +1 -1
- package/dist/core/root-selection.js +2 -15
- package/dist/core/root-selection.js.map +1 -1
- package/dist/core/shared/index.d.ts +2 -2
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +2 -2
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/skill-generation.d.ts +11 -4
- package/dist/core/shared/skill-generation.d.ts.map +1 -1
- package/dist/core/shared/skill-generation.js +18 -6
- package/dist/core/shared/skill-generation.js.map +1 -1
- package/dist/core/shared/tool-detection.d.ts +3 -6
- package/dist/core/shared/tool-detection.d.ts.map +1 -1
- package/dist/core/shared/tool-detection.js +3 -9
- package/dist/core/shared/tool-detection.js.map +1 -1
- package/dist/core/spec-presenter.d.ts.map +1 -1
- package/dist/core/spec-presenter.js.map +1 -1
- package/dist/core/specs-apply.d.ts +0 -31
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +0 -102
- 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 +20 -0
- package/dist/core/templates/fragments/verify.d.ts.map +1 -0
- package/dist/core/templates/{workflows → fragments}/verify.js +34 -6
- package/dist/core/templates/fragments/verify.js.map +1 -0
- package/dist/core/templates/skill-templates.d.ts +1 -1
- package/dist/core/templates/skill-templates.d.ts.map +1 -1
- package/dist/core/templates/skill-templates.js +1 -1
- package/dist/core/templates/skill-templates.js.map +1 -1
- 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 +2 -2
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +38 -32
- 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 +23 -29
- 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/reconcile.d.ts +14 -0
- package/dist/core/templates/workflows/reconcile.d.ts.map +1 -0
- package/dist/core/templates/workflows/{sync.js → reconcile.js} +29 -22
- package/dist/core/templates/workflows/reconcile.js.map +1 -0
- 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 +8 -18
- package/dist/core/update.js.map +1 -1
- package/dist/core/validation/section-validator.d.ts.map +1 -1
- package/dist/core/validation/section-validator.js +3 -16
- package/dist/core/validation/section-validator.js.map +1 -1
- package/dist/core/validation/validator.d.ts +0 -2
- package/dist/core/validation/validator.d.ts.map +1 -1
- package/dist/core/validation/validator.js +36 -74
- package/dist/core/validation/validator.js.map +1 -1
- package/dist/utils/change-utils.d.ts.map +1 -1
- package/dist/utils/change-utils.js +3 -6
- package/dist/utils/change-utils.js.map +1 -1
- package/dist/utils/file-system.d.ts +17 -19
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +41 -189
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +22 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +39 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/item-discovery.d.ts +7 -0
- package/dist/utils/item-discovery.d.ts.map +1 -1
- package/dist/utils/item-discovery.js +13 -23
- package/dist/utils/item-discovery.js.map +1 -1
- package/dist/utils/link.d.ts +3 -1
- package/dist/utils/link.d.ts.map +1 -1
- package/dist/utils/link.js +4 -14
- package/dist/utils/link.js.map +1 -1
- package/dist/utils/task-progress.d.ts +0 -1
- package/dist/utils/task-progress.d.ts.map +1 -1
- package/dist/utils/task-progress.js +5 -6
- package/dist/utils/task-progress.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/references.d.ts +0 -40
- package/dist/core/references.d.ts.map +0 -1
- package/dist/core/references.js +0 -11
- package/dist/core/references.js.map +0 -1
- package/dist/core/templates/workflows/sync.d.ts +0 -14
- package/dist/core/templates/workflows/sync.d.ts.map +0 -1
- package/dist/core/templates/workflows/sync.js.map +0 -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
- package/dist/utils/command-references.d.ts +0 -18
- package/dist/utils/command-references.d.ts.map +0 -1
- package/dist/utils/command-references.js +0 -20
- package/dist/utils/command-references.js.map +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -9
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/shell-detection.d.ts +0 -20
- package/dist/utils/shell-detection.d.ts.map +0 -1
- package/dist/utils/shell-detection.js +0 -41
- package/dist/utils/shell-detection.js.map +0 -1
|
@@ -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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Template Workflow Modules
|
|
3
|
+
*
|
|
4
|
+
* This file is generated by splitting the legacy monolithic
|
|
5
|
+
* templates file into workflow-focused modules.
|
|
6
|
+
*
|
|
7
|
+
* reconcile is a standalone skill again. The archive workflow proactively
|
|
8
|
+
* decides whether a reconcile is warranted and asks the user before archiving;
|
|
9
|
+
* when the user agrees, this is the procedure that runs.
|
|
10
|
+
*/
|
|
11
|
+
import type { SkillTemplate, CommandTemplate } from '../types.js';
|
|
12
|
+
export declare function getTospecReconcileSkillTemplate(): SkillTemplate;
|
|
13
|
+
export declare function getTospecReconcileCommandTemplate(): CommandTemplate;
|
|
14
|
+
//# sourceMappingURL=reconcile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAoElE,wBAAgB,+BAA+B,IAAI,aAAa,CAc/D;AAED,wBAAgB,iCAAiC,IAAI,eAAe,CAYnE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const RECONCILE_BODY = `Whether a spec still matches the source code is a semantic judgment no CLI can make — that's why this is agent work, not a \`tospec\` subcommand. The CLI's job is the part that IS machine-checkable: the reconciled spec must still pass full validation, and \`tospec archive --require-reconcile\` refuses unless \`reconcile-report.md\` reports PASS.
|
|
2
2
|
|
|
3
3
|
**Steps**
|
|
4
4
|
|
|
@@ -14,7 +14,13 @@ const SYNC_BODY = `Whether a spec still matches the source code is a semantic ju
|
|
|
14
14
|
|
|
15
15
|
**Can't find any corresponding implementation at all**: that's a CODE-BUG, same severity as a behavioral mismatch — the Requirement was agreed to and never built. Don't wave it through as MATCH.
|
|
16
16
|
|
|
17
|
-
3. **
|
|
17
|
+
3. **Sweep the other direction — behavior nobody asked for**
|
|
18
|
+
|
|
19
|
+
Step 2 walks Requirements to code, so it can only find what is *missing*. It cannot see the opposite: behavior in the diff that **maps to no Requirement** at all. Walk the change's diff once and flag anything the specs never asked for.
|
|
20
|
+
|
|
21
|
+
**Report it, never spec it.** "Code wins" settles how a Requirement is *worded*, not whether behavior *belongs* — it is not a licence to make unrequested work look agreed after the fact. Never add a Requirement to cover scope creep: tell the user what you found and let them decide to keep it, drop it, or plan it properly.
|
|
22
|
+
|
|
23
|
+
4. **Resolve every mismatch — code wins**
|
|
18
24
|
|
|
19
25
|
- If the spec is stale relative to the code (the code is correct, the spec described the old behavior): update the delta spec's Requirement with **MODIFIED**, pasting the complete, corrected Requirement block. Then:
|
|
20
26
|
\`\`\`bash
|
|
@@ -23,12 +29,12 @@ const SYNC_BODY = `Whether a spec still matches the source code is a semantic ju
|
|
|
23
29
|
Must pass before moving to the next Requirement — record the validate result in that Requirement's report entry.
|
|
24
30
|
- If the code itself is wrong (it doesn't do what was actually agreed in ticket/design, or is missing entirely): **stop**. Do not touch the spec to paper over a bug. Report the mismatch to the user and suggest returning to \`tospec-apply\` to fix the code before archiving.
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
5. **Write the reconcile report**
|
|
27
33
|
|
|
28
|
-
Create \`
|
|
34
|
+
Create \`reconcile-report.md\` in the change directory in exactly this format — \`tospec archive --require-reconcile\` parses the first \`Conclusion:\` line, so the heading and label text must match:
|
|
29
35
|
|
|
30
36
|
\`\`\`markdown
|
|
31
|
-
#
|
|
37
|
+
# Reconcile Report: <change-name>
|
|
32
38
|
## Summary
|
|
33
39
|
Conclusion: <PASS or FAIL>
|
|
34
40
|
## Requirements
|
|
@@ -38,9 +44,9 @@ const SYNC_BODY = `Whether a spec still matches the source code is a semantic ju
|
|
|
38
44
|
- Notes: <the difference and how it was handled; SPEC-UPDATED must include the validate result>
|
|
39
45
|
\`\`\`
|
|
40
46
|
|
|
41
|
-
Fill the \`Conclusion:\` line with exactly one literal — \`Conclusion: PASS\` or \`Conclusion: FAIL\` (FAIL may append a \`(reason)\` note); never leave both options in one line, or \`tospec archive --require-
|
|
47
|
+
Fill the \`Conclusion:\` line with exactly one literal — \`Conclusion: PASS\` or \`Conclusion: FAIL\` (FAIL may append a \`(reason)\` note); never leave both options in one line, or \`tospec archive --require-reconcile\` can't parse it. \`Conclusion:\` is **FAIL** if even one Requirement is CODE-BUG — a single unresolved defect blocks the whole change, not just that Requirement. It's **PASS** only when every Requirement resolved to MATCH or SPEC-UPDATED (with validate passing). For the no-delta case, still emit the Summary and a single Requirements entry describing the task.md-vs-code comparison (module described, not a Requirement name).
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
6. **Final artifact validation**
|
|
44
50
|
\`\`\`bash
|
|
45
51
|
tospec validate "<name>" --json
|
|
46
52
|
\`\`\`
|
|
@@ -48,40 +54,41 @@ const SYNC_BODY = `Whether a spec still matches the source code is a semantic ju
|
|
|
48
54
|
|
|
49
55
|
**Output**
|
|
50
56
|
|
|
51
|
-
Summarize how many Requirements
|
|
57
|
+
Summarize how many Requirements matched, how many specs were updated, whether anything was flagged as a code defect, and anything found that no Requirement asked for. If \`Conclusion: PASS\`, prompt: "Run \`tospec-archive\` to finish up — it passes \`--require-reconcile\` for free now that \`reconcile-report.md\` reports PASS." If \`Conclusion: FAIL\`, prompt to return to \`tospec-apply\` first — do not proceed to archive.
|
|
52
58
|
|
|
53
59
|
**Guardrails**
|
|
54
60
|
- Code is the source of truth for behavior — spec updates always follow code, never the other way around
|
|
61
|
+
- Scope creep is reported, never specced — "code wins" settles a Requirement's wording, never whether unrequested behavior belongs
|
|
55
62
|
- Never edit source code from this workflow — a code-side mismatch is diagnosis, not a license to patch here
|
|
56
63
|
- Every MODIFIED delta must re-pass \`tospec validate\` before moving to the next Requirement
|
|
57
|
-
- \`
|
|
58
|
-
- One comparison pass per Requirement — check it against the code once and record the verdict. \`
|
|
59
|
-
export function
|
|
64
|
+
- \`reconcile-report.md\` is required output, in the exact format above — \`tospec archive --require-reconcile\` depends on both its existence and its \`Conclusion:\` line
|
|
65
|
+
- One comparison pass per Requirement — check it against the code once and record the verdict. \`reconcile-report.md\` is the deliverable, not another review target: don't re-audit the report after writing it, and don't re-check a Requirement already judged MATCH`;
|
|
66
|
+
export function getTospecReconcileSkillTemplate() {
|
|
60
67
|
return {
|
|
61
|
-
name: 'tospec-
|
|
62
|
-
description: '
|
|
68
|
+
name: 'tospec-reconcile',
|
|
69
|
+
description: 'Reconcile a change\'s Requirements against the actual implementation — code wins on any mismatch — and write reconcile-report.md. Use before archiving a change whose specs may have drifted from the code.',
|
|
63
70
|
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
71
|
|
|
65
|
-
**Input**: The user's request should name the change to
|
|
72
|
+
**Input**: The user's request should name the change to reconcile.
|
|
66
73
|
|
|
67
|
-
${
|
|
74
|
+
${RECONCILE_BODY}`,
|
|
68
75
|
license: 'MIT',
|
|
69
76
|
compatibility: 'Requires tospec CLI.',
|
|
70
|
-
metadata: { author: 'tospec'
|
|
77
|
+
metadata: { author: 'tospec' },
|
|
71
78
|
allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob'],
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
|
-
export function
|
|
81
|
+
export function getTospecReconcileCommandTemplate() {
|
|
75
82
|
return {
|
|
76
|
-
name: 'TOSPEC:
|
|
83
|
+
name: 'TOSPEC: Reconcile',
|
|
77
84
|
description: 'Reconcile specs against the implementation, code as source of truth',
|
|
78
85
|
category: 'Workflow',
|
|
79
|
-
tags: ['workflow', '
|
|
86
|
+
tags: ['workflow', 'reconcile', 'archive-gate'],
|
|
80
87
|
content: `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.
|
|
81
88
|
|
|
82
|
-
**Input**: The argument after \`tospec-
|
|
89
|
+
**Input**: The argument after \`tospec-reconcile\` is the change name to reconcile.
|
|
83
90
|
|
|
84
|
-
${
|
|
91
|
+
${RECONCILE_BODY}`,
|
|
85
92
|
};
|
|
86
93
|
}
|
|
87
|
-
//# sourceMappingURL=
|
|
94
|
+
//# sourceMappingURL=reconcile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/reconcile.ts"],"names":[],"mappings":"AAYA,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wQAgEiP,CAAC;AAEzQ,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,6MAA6M;QAC1N,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,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KAC1E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,qEAAqE;QAClF,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC;QAC/C,OAAO,EAAE;;;;EAIX,cAAc,EAAE;KACf,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;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6BH;;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;IAgKjD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAoBzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAkBvC;;;;OAIG;YACW,yBAAyB;CA0BxC"}
|