@codewalla_india/openspec 1.0.2 → 1.0.4
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/README.md +7 -2
- package/dist/commands/workflow/instructions.js +1 -1
- package/dist/core/templates/workflows/apply-change.js +3 -2
- package/dist/core/templates/workflows/archive-change.js +5 -4
- package/dist/core/templates/workflows/bulk-archive-change.js +5 -4
- package/dist/core/templates/workflows/comprehension-guidance.d.ts +2 -2
- package/dist/core/templates/workflows/comprehension-guidance.js +20 -12
- package/dist/core/templates/workflows/continue-change.js +3 -2
- package/dist/core/templates/workflows/ff-change.js +5 -4
- package/dist/core/templates/workflows/new-change.js +3 -2
- package/dist/core/templates/workflows/propose.js +5 -4
- package/dist/core/templates/workflows/sync-specs.js +3 -2
- package/dist/core/templates/workflows/user-prompt-guidance.d.ts +14 -0
- package/dist/core/templates/workflows/user-prompt-guidance.js +39 -0
- package/dist/core/templates/workflows/verify-change.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,9 @@ AI: Created openspec/changes/add-dark-mode/
|
|
|
64
64
|
Ready for implementation!
|
|
65
65
|
|
|
66
66
|
You: /opsx:apply
|
|
67
|
-
AI:
|
|
67
|
+
AI: Comprehension check — 6 questions on your proposal, design, specs, and tasks...
|
|
68
|
+
✓ 83% — ready to implement.
|
|
69
|
+
Implementing tasks...
|
|
68
70
|
✓ 1.1 Add theme context provider
|
|
69
71
|
✓ 1.2 Create toggle component
|
|
70
72
|
✓ 2.1 Add CSS variables
|
|
@@ -106,8 +108,9 @@ Now talk to your AI:
|
|
|
106
108
|
|
|
107
109
|
- **Not sure what to build yet?** Start with `/opsx:explore`, a no-stakes thinking partner that reads your code, weighs options, and shapes a plan before anything is written. ([Explore guide](docs/explore.md))
|
|
108
110
|
- **Already know what you want?** Go straight to `/opsx:propose <what-you-want-to-build>`.
|
|
111
|
+
- **Ready to implement?** Run `/opsx:apply` — a short comprehension quiz checks you understand the proposal, design, specs, and tasks before any code is written.
|
|
109
112
|
|
|
110
|
-
|
|
113
|
+
The default `core` profile includes `/opsx:explore`, `/opsx:propose`, `/opsx:apply`, `/opsx:sync`, and `/opsx:archive`. If you want the expanded workflow (`/opsx:new`, `/opsx:continue`, `/opsx:ff`, `/opsx:verify`, `/opsx:bulk-archive`, `/opsx:onboard`), select it with `openspec config profile` and apply with `openspec update`.
|
|
111
114
|
|
|
112
115
|
> [!NOTE]
|
|
113
116
|
> Not sure if your tool is supported? [View the full list](docs/supported-tools.md) – we support 25+ tools and growing.
|
|
@@ -182,6 +185,8 @@ openspec update
|
|
|
182
185
|
|
|
183
186
|
**Context hygiene**: OpenSpec benefits from a clean context window. Clear your context before starting implementation and maintain good context hygiene throughout your session.
|
|
184
187
|
|
|
188
|
+
**Comprehension check**: `/opsx:apply` runs a short quiz (enabled by default) on proposal, design, specs, and pending tasks before implementation. Questions test holistic understanding of the change, not task numbers or checklist trivia. Disable with `comprehension.enabled: false` in `openspec/config.yaml`. See [Workflows](docs/workflows.md#comprehension-quiz-before-apply).
|
|
189
|
+
|
|
185
190
|
## Contributing
|
|
186
191
|
|
|
187
192
|
**Small fixes** — Bug fixes, typo corrections, and minor improvements can be submitted directly as PRs.
|
|
@@ -304,7 +304,7 @@ export async function generateApplyInstructions(projectRoot, changeName, schemaN
|
|
|
304
304
|
state = 'blocked';
|
|
305
305
|
missingComprehension = true;
|
|
306
306
|
comprehension = gate.info;
|
|
307
|
-
instruction = `Complete the comprehension quiz in /opsx:apply before implementation (score ≥ ${gate.info.thresholdPercent}% on specs and tasks).`;
|
|
307
|
+
instruction = `Complete the comprehension quiz in /opsx:apply before implementation (score ≥ ${gate.info.thresholdPercent}% on proposal, design, specs, and tasks).`;
|
|
308
308
|
}
|
|
309
309
|
else if (gate.active && gate.info) {
|
|
310
310
|
comprehension = gate.info;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ATLASSIAN_ENRICHMENT_GUIDANCE, CONTEXT7_LOOKUP_GUIDANCE, PLAYWRIGHT_APPLY_GUARDRAIL, } from './mcp-guidance.js';
|
|
2
2
|
import { COMPREHENSION_APPLY_GUARDRAIL, COMPREHENSION_QUIZ_GUIDANCE, } from './comprehension-guidance.js';
|
|
3
3
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
4
|
+
import { PROMPT_SELECT_CHANGE } from './user-prompt-guidance.js';
|
|
4
5
|
export function getApplyChangeSkillTemplate() {
|
|
5
6
|
return {
|
|
6
7
|
name: 'openspec-apply-change',
|
|
@@ -18,7 +19,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
18
19
|
If a name is provided, use it. Otherwise:
|
|
19
20
|
- Infer from conversation context if the user mentioned a change
|
|
20
21
|
- Auto-select if only one active change exists
|
|
21
|
-
- If ambiguous,
|
|
22
|
+
- If ambiguous, ${PROMPT_SELECT_CHANGE}
|
|
22
23
|
|
|
23
24
|
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
24
25
|
|
|
@@ -187,7 +188,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
187
188
|
If a name is provided, use it. Otherwise:
|
|
188
189
|
- Infer from conversation context if the user mentioned a change
|
|
189
190
|
- Auto-select if only one active change exists
|
|
190
|
-
- If ambiguous,
|
|
191
|
+
- If ambiguous, ${PROMPT_SELECT_CHANGE}
|
|
191
192
|
|
|
192
193
|
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
|
|
193
194
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
+
import { PROMPT_CONFIRM, PROMPT_SELECT_CHANGE } from './user-prompt-guidance.js';
|
|
2
3
|
export function getArchiveChangeSkillTemplate() {
|
|
3
4
|
return {
|
|
4
5
|
name: 'openspec-archive-change',
|
|
@@ -13,7 +14,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
13
14
|
|
|
14
15
|
1. **If no change name provided, prompt for selection**
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
${PROMPT_SELECT_CHANGE}
|
|
17
18
|
|
|
18
19
|
Show only active changes (not already archived).
|
|
19
20
|
Include the schema used for each change if available.
|
|
@@ -31,7 +32,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
31
32
|
|
|
32
33
|
**If any artifacts are not \`done\`:**
|
|
33
34
|
- Display warning listing incomplete artifacts
|
|
34
|
-
-
|
|
35
|
+
- ${PROMPT_CONFIRM}
|
|
35
36
|
- Proceed if user confirms
|
|
36
37
|
|
|
37
38
|
3. **Check task completion status**
|
|
@@ -42,7 +43,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
42
43
|
|
|
43
44
|
**If incomplete tasks found:**
|
|
44
45
|
- Display warning showing count of incomplete tasks
|
|
45
|
-
-
|
|
46
|
+
- ${PROMPT_CONFIRM}
|
|
46
47
|
- Proceed if user confirms
|
|
47
48
|
|
|
48
49
|
**If no tasks file exists:** Proceed without task-related warning.
|
|
@@ -130,7 +131,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
130
131
|
|
|
131
132
|
1. **If no change name provided, prompt for selection**
|
|
132
133
|
|
|
133
|
-
|
|
134
|
+
${PROMPT_SELECT_CHANGE}
|
|
134
135
|
|
|
135
136
|
Show only active changes (not already archived).
|
|
136
137
|
Include the schema used for each change if available.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
+
import { PROMPT_CONFIRM, PROMPT_MULTI_SELECT_CHANGES } from './user-prompt-guidance.js';
|
|
2
3
|
export function getBulkArchiveChangeSkillTemplate() {
|
|
3
4
|
return {
|
|
4
5
|
name: 'openspec-bulk-archive-change',
|
|
@@ -21,7 +22,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
21
22
|
|
|
22
23
|
2. **Prompt for change selection**
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
${PROMPT_MULTI_SELECT_CHANGES}
|
|
25
26
|
- Show each change with its schema
|
|
26
27
|
- Include an option for "All changes"
|
|
27
28
|
- Allow any number of selections (1+ works, 2+ is the typical use case)
|
|
@@ -102,7 +103,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
102
103
|
|
|
103
104
|
7. **Confirm batch operation**
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
${PROMPT_CONFIRM}
|
|
106
107
|
|
|
107
108
|
- "Archive N changes?" with options based on status
|
|
108
109
|
- Options might include:
|
|
@@ -269,7 +270,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
269
270
|
|
|
270
271
|
2. **Prompt for change selection**
|
|
271
272
|
|
|
272
|
-
|
|
273
|
+
${PROMPT_MULTI_SELECT_CHANGES}
|
|
273
274
|
- Show each change with its schema
|
|
274
275
|
- Include an option for "All changes"
|
|
275
276
|
- Allow any number of selections (1+ works, 2+ is the typical use case)
|
|
@@ -350,7 +351,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
350
351
|
|
|
351
352
|
7. **Confirm batch operation**
|
|
352
353
|
|
|
353
|
-
|
|
354
|
+
${PROMPT_CONFIRM}
|
|
354
355
|
|
|
355
356
|
- "Archive N changes?" with options based on status
|
|
356
357
|
- Options might include:
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* Interpolated into apply skill and slash command templates so agents run
|
|
5
5
|
* a spec comprehension gate before implementation.
|
|
6
6
|
*/
|
|
7
|
-
export declare const COMPREHENSION_QUIZ_GUIDANCE = "4. **Comprehension quiz (required before implementation)**\n\n After `openspec instructions apply --change \"<name>\" --json`, check comprehension status:\n\n - If `missingComprehension` is true OR `comprehension.required && !comprehension.passed`:\n - Do NOT edit application source code or mark task checkboxes yet\n - Read `contextFiles.specs`, `contextFiles.tasks` (or the `tasks` array in apply JSON)
|
|
8
|
-
export declare const COMPREHENSION_APPLY_GUARDRAIL = "- NEVER implement code or mark tasks while `missingComprehension` is true\n- NEVER skip the comprehension quiz when the apply JSON requires it\n- If the user asks to skip the quiz, refuse and explain they must pass or set comprehension.enabled: false in openspec/config.yaml";
|
|
7
|
+
export declare const COMPREHENSION_QUIZ_GUIDANCE = "4. **Comprehension quiz (required before implementation)**\n\n After `openspec instructions apply --change \"<name>\" --json`, check comprehension status:\n\n - If `missingComprehension` is true OR `comprehension.required && !comprehension.passed`:\n - Do NOT edit application source code or mark task checkboxes yet\n - Read `contextFiles.proposal`, `contextFiles.design`, `contextFiles.specs`, and `contextFiles.tasks` (or the `tasks` array in apply JSON)\n - Use `comprehension.questionCount` from the JSON as the number of questions\n\n **Generate questions**\n - Create exactly `comprehension.questionCount` multiple-choice questions\n - Each question MUST map to one artifact category:\n - **Proposal**: motivation, scope, or impact from `proposal.md`\n - **Design**: decisions, trade-offs, or approach from `design.md`\n - **Specs**: a `### Requirement:` or `#### Scenario:` from delta specs\n - **Tasks**: conceptual understanding of the implementation plan from pending (unchecked) tasks\n - When proposal, design, specs (with requirements), and pending tasks all exist, include at least one question from each category; fill remaining slots from any category\n - Do NOT use completed tasks as question sources\n - Each question: 4 options (1 correct from the source substance, 3 plausible distractors from other proposal/design/requirements/scenarios/task substance in the change)\n\n **Task question quality**\n - Test scope, approach, dependencies, sequencing rationale, or alignment with proposal/design\n - **Forbidden**: task numbers, checklist order, \"which task says X verbatim\", or answers identifiable only by task index or checkbox position\n - Good: \"What is the primary file where quiz rules are centralized?\" (answer from task substance)\n - Bad: \"Which task number updates `comprehension-guidance.ts`?\" or \"What is the exact text of task 2.1?\"\n\n **Present and grade**\n - Present each question in chat with labeled options (A/B/C/D or 1\u20134)\n - Ask ONE question at a time; after each, STOP and wait for the user's answer before the next question\n - NEVER select answers yourself, infer what the user would pick, or call `--record-comprehension-pass` until the user has answered every question\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.\n - Grade: `score_percent = round(correct / question_count * 100)`\n - Pass when `score_percent >= comprehension.thresholdPercent` (default 80)\n\n **On failure (score below threshold)**\n - Announce score and that a new quiz is required\n - Update `.comprehension-session.yaml` in the change dir with `used_sources` from this attempt\n - Generate a NEW question set using different proposal/design/requirement/scenario/task sources (avoid `used_sources`)\n - Retry until pass\n\n **On pass**\n ```bash\n openspec instructions apply --change \"<name>\" --record-comprehension-pass --score <score> --attempt <n> --question-count <count> --json\n ```\n - Re-run `openspec instructions apply --change \"<name>\" --json`\n - Confirm `state` is `\"ready\"` and `comprehension.passed` is true before continuing\n\n **Output template**\n ```\n ## Applying: <change-name> \u2014 comprehension check\n\n Proposal, design, specs (<requirementCount> requirements, <scenarioCount> scenarios), tasks (<pendingTaskCount> pending) \u2192 <questionCount> questions\n\n Question 1/N: ...\n ...\n \u2713 Comprehension passed (<score>%, attempt <n>)\n ```\n\n Then continue to step 5 (show progress) and implementation.";
|
|
8
|
+
export declare const COMPREHENSION_APPLY_GUARDRAIL = "- NEVER implement code or mark tasks while `missingComprehension` is true\n- NEVER skip the comprehension quiz when the apply JSON requires it\n- NEVER answer comprehension quiz questions yourself \u2014 the human developer must answer every question\n- NEVER call `--record-comprehension-pass` until the user has answered every question\n- If the user asks to skip the quiz, refuse and explain they must pass or set comprehension.enabled: false in openspec/config.yaml";
|
|
9
9
|
//# sourceMappingURL=comprehension-guidance.d.ts.map
|
|
@@ -4,33 +4,39 @@
|
|
|
4
4
|
* Interpolated into apply skill and slash command templates so agents run
|
|
5
5
|
* a spec comprehension gate before implementation.
|
|
6
6
|
*/
|
|
7
|
+
import { COMPREHENSION_PRESENT_AND_GRADE } from './user-prompt-guidance.js';
|
|
7
8
|
export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required before implementation)**
|
|
8
9
|
|
|
9
10
|
After \`openspec instructions apply --change "<name>" --json\`, check comprehension status:
|
|
10
11
|
|
|
11
12
|
- If \`missingComprehension\` is true OR \`comprehension.required && !comprehension.passed\`:
|
|
12
13
|
- Do NOT edit application source code or mark task checkboxes yet
|
|
13
|
-
- Read \`contextFiles.specs\`, \`contextFiles.tasks\` (or the \`tasks\` array in apply JSON)
|
|
14
|
+
- Read \`contextFiles.proposal\`, \`contextFiles.design\`, \`contextFiles.specs\`, and \`contextFiles.tasks\` (or the \`tasks\` array in apply JSON)
|
|
14
15
|
- Use \`comprehension.questionCount\` from the JSON as the number of questions
|
|
15
16
|
|
|
16
17
|
**Generate questions**
|
|
17
18
|
- Create exactly \`comprehension.questionCount\` multiple-choice questions
|
|
18
|
-
- Each question MUST map to one
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
19
|
+
- Each question MUST map to one artifact category:
|
|
20
|
+
- **Proposal**: motivation, scope, or impact from \`proposal.md\`
|
|
21
|
+
- **Design**: decisions, trade-offs, or approach from \`design.md\`
|
|
22
|
+
- **Specs**: a \`### Requirement:\` or \`#### Scenario:\` from delta specs
|
|
23
|
+
- **Tasks**: conceptual understanding of the implementation plan from pending (unchecked) tasks
|
|
24
|
+
- When proposal, design, specs (with requirements), and pending tasks all exist, include at least one question from each category; fill remaining slots from any category
|
|
22
25
|
- Do NOT use completed tasks as question sources
|
|
23
|
-
- Each question: 4 options (1 correct from the source
|
|
26
|
+
- Each question: 4 options (1 correct from the source substance, 3 plausible distractors from other proposal/design/requirements/scenarios/task substance in the change)
|
|
24
27
|
|
|
25
|
-
**
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
28
|
+
**Task question quality**
|
|
29
|
+
- Test scope, approach, dependencies, sequencing rationale, or alignment with proposal/design
|
|
30
|
+
- **Forbidden**: task numbers, checklist order, "which task says X verbatim", or answers identifiable only by task index or checkbox position
|
|
31
|
+
- Good: "What is the primary file where quiz rules are centralized?" (answer from task substance)
|
|
32
|
+
- Bad: "Which task number updates \`comprehension-guidance.ts\`?" or "What is the exact text of task 2.1?"
|
|
33
|
+
|
|
34
|
+
${COMPREHENSION_PRESENT_AND_GRADE}
|
|
29
35
|
|
|
30
36
|
**On failure (score below threshold)**
|
|
31
37
|
- Announce score and that a new quiz is required
|
|
32
38
|
- Update \`.comprehension-session.yaml\` in the change dir with \`used_sources\` from this attempt
|
|
33
|
-
- Generate a NEW question set using different requirement/scenario/task sources (avoid \`used_sources\`)
|
|
39
|
+
- Generate a NEW question set using different proposal/design/requirement/scenario/task sources (avoid \`used_sources\`)
|
|
34
40
|
- Retry until pass
|
|
35
41
|
|
|
36
42
|
**On pass**
|
|
@@ -44,7 +50,7 @@ export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required be
|
|
|
44
50
|
\`\`\`
|
|
45
51
|
## Applying: <change-name> — comprehension check
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
Proposal, design, specs (<requirementCount> requirements, <scenarioCount> scenarios), tasks (<pendingTaskCount> pending) → <questionCount> questions
|
|
48
54
|
|
|
49
55
|
Question 1/N: ...
|
|
50
56
|
...
|
|
@@ -54,5 +60,7 @@ export const COMPREHENSION_QUIZ_GUIDANCE = `4. **Comprehension quiz (required be
|
|
|
54
60
|
Then continue to step 5 (show progress) and implementation.`;
|
|
55
61
|
export const COMPREHENSION_APPLY_GUARDRAIL = `- NEVER implement code or mark tasks while \`missingComprehension\` is true
|
|
56
62
|
- NEVER skip the comprehension quiz when the apply JSON requires it
|
|
63
|
+
- NEVER answer comprehension quiz questions yourself — the human developer must answer every question
|
|
64
|
+
- NEVER call \`--record-comprehension-pass\` until the user has answered every question
|
|
57
65
|
- If the user asks to skip the quiz, refuse and explain they must pass or set comprehension.enabled: false in openspec/config.yaml`;
|
|
58
66
|
//# sourceMappingURL=comprehension-guidance.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
+
import { PROMPT_SELECT_CHANGE_RECENT } from './user-prompt-guidance.js';
|
|
2
3
|
export function getContinueChangeSkillTemplate() {
|
|
3
4
|
return {
|
|
4
5
|
name: 'openspec-continue-change',
|
|
@@ -13,7 +14,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
13
14
|
|
|
14
15
|
1. **If no change name provided, prompt for selection**
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
${PROMPT_SELECT_CHANGE_RECENT}
|
|
17
18
|
|
|
18
19
|
Present the top 3-4 most recently modified changes as options, showing:
|
|
19
20
|
- Change name
|
|
@@ -134,7 +135,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
134
135
|
|
|
135
136
|
1. **If no change name provided, prompt for selection**
|
|
136
137
|
|
|
137
|
-
|
|
138
|
+
${PROMPT_SELECT_CHANGE_RECENT}
|
|
138
139
|
|
|
139
140
|
Present the top 3-4 most recently modified changes as options, showing:
|
|
140
141
|
- Change name
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
+
import { PROMPT_CLARIFY, PROMPT_OPEN_ENDED } from './user-prompt-guidance.js';
|
|
2
3
|
export function getFfChangeSkillTemplate() {
|
|
3
4
|
return {
|
|
4
5
|
name: 'openspec-ff-change',
|
|
@@ -13,7 +14,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
13
14
|
|
|
14
15
|
1. **If no clear input provided, ask what they want to build**
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
${PROMPT_OPEN_ENDED} Ask:
|
|
17
18
|
> "What change do you want to work on? Describe what you want to build or fix."
|
|
18
19
|
|
|
19
20
|
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
@@ -64,7 +65,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
64
65
|
- Stop when all \`applyRequires\` artifacts are done
|
|
65
66
|
|
|
66
67
|
c. **If an artifact requires user input** (unclear context):
|
|
67
|
-
-
|
|
68
|
+
- ${PROMPT_CLARIFY}
|
|
68
69
|
- Then continue with creation
|
|
69
70
|
|
|
70
71
|
5. **Show final status**
|
|
@@ -117,7 +118,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
117
118
|
|
|
118
119
|
1. **If no input provided, ask what they want to build**
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
${PROMPT_OPEN_ENDED} Ask:
|
|
121
122
|
> "What change do you want to work on? Describe what you want to build or fix."
|
|
122
123
|
|
|
123
124
|
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
@@ -168,7 +169,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
168
169
|
- Stop when all \`applyRequires\` artifacts are done
|
|
169
170
|
|
|
170
171
|
c. **If an artifact requires user input** (unclear context):
|
|
171
|
-
-
|
|
172
|
+
- ${PROMPT_CLARIFY}
|
|
172
173
|
- Then continue with creation
|
|
173
174
|
|
|
174
175
|
5. **Show final status**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
+
import { PROMPT_OPEN_ENDED } from './user-prompt-guidance.js';
|
|
2
3
|
export function getNewChangeSkillTemplate() {
|
|
3
4
|
return {
|
|
4
5
|
name: 'openspec-new-change',
|
|
@@ -13,7 +14,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
13
14
|
|
|
14
15
|
1. **If no clear input provided, ask what they want to build**
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
${PROMPT_OPEN_ENDED} Ask:
|
|
17
18
|
> "What change do you want to work on? Describe what you want to build or fix."
|
|
18
19
|
|
|
19
20
|
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
@@ -89,7 +90,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
89
90
|
|
|
90
91
|
1. **If no input provided, ask what they want to build**
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
${PROMPT_OPEN_ENDED} Ask:
|
|
93
94
|
> "What change do you want to work on? Describe what you want to build or fix."
|
|
94
95
|
|
|
95
96
|
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ATLASSIAN_PROPOSE_GUIDANCE } from './mcp-guidance.js';
|
|
2
2
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
3
|
+
import { PROMPT_CLARIFY, PROMPT_OPEN_ENDED } from './user-prompt-guidance.js';
|
|
3
4
|
export function getOpsxProposeSkillTemplate() {
|
|
4
5
|
return {
|
|
5
6
|
name: 'openspec-propose',
|
|
@@ -25,7 +26,7 @@ ${ATLASSIAN_PROPOSE_GUIDANCE}
|
|
|
25
26
|
|
|
26
27
|
1. **If no clear input provided, ask what they want to build**
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
${PROMPT_OPEN_ENDED} Ask:
|
|
29
30
|
> "What change do you want to work on? Describe what you want to build or fix."
|
|
30
31
|
|
|
31
32
|
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
@@ -76,7 +77,7 @@ ${ATLASSIAN_PROPOSE_GUIDANCE}
|
|
|
76
77
|
- Stop when all \`applyRequires\` artifacts are done
|
|
77
78
|
|
|
78
79
|
c. **If an artifact requires user input** (unclear context):
|
|
79
|
-
-
|
|
80
|
+
- ${PROMPT_CLARIFY}
|
|
80
81
|
- Then continue with creation
|
|
81
82
|
|
|
82
83
|
5. **Show final status**
|
|
@@ -140,7 +141,7 @@ ${ATLASSIAN_PROPOSE_GUIDANCE}
|
|
|
140
141
|
|
|
141
142
|
1. **If no input provided, ask what they want to build**
|
|
142
143
|
|
|
143
|
-
|
|
144
|
+
${PROMPT_OPEN_ENDED} Ask:
|
|
144
145
|
> "What change do you want to work on? Describe what you want to build or fix."
|
|
145
146
|
|
|
146
147
|
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
@@ -191,7 +192,7 @@ ${ATLASSIAN_PROPOSE_GUIDANCE}
|
|
|
191
192
|
- Stop when all \`applyRequires\` artifacts are done
|
|
192
193
|
|
|
193
194
|
c. **If an artifact requires user input** (unclear context):
|
|
194
|
-
-
|
|
195
|
+
- ${PROMPT_CLARIFY}
|
|
195
196
|
- Then continue with creation
|
|
196
197
|
|
|
197
198
|
5. **Show final status**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
2
|
+
import { PROMPT_SELECT_CHANGE } from './user-prompt-guidance.js';
|
|
2
3
|
export function getSyncSpecsSkillTemplate() {
|
|
3
4
|
return {
|
|
4
5
|
name: 'openspec-sync-specs',
|
|
@@ -15,7 +16,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
15
16
|
|
|
16
17
|
1. **If no change name provided, prompt for selection**
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
${PROMPT_SELECT_CHANGE}
|
|
19
20
|
|
|
20
21
|
Show changes that have delta specs (under \`specs/\` directory).
|
|
21
22
|
|
|
@@ -162,7 +163,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
162
163
|
|
|
163
164
|
1. **If no change name provided, prompt for selection**
|
|
164
165
|
|
|
165
|
-
|
|
166
|
+
${PROMPT_SELECT_CHANGE}
|
|
166
167
|
|
|
167
168
|
Show changes that have delta specs (under \`specs/\` directory).
|
|
168
169
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool-agnostic user interaction guidance for agent workflows.
|
|
3
|
+
*
|
|
4
|
+
* Cursor's AskUserQuestion is an optional enhancement, not a requirement.
|
|
5
|
+
* All editors (Windsurf, Claude Code, etc.) use plain chat with stop-and-wait.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PROMPT_SELECT_CHANGE = "Prompt the user to select a change:\n - Run `openspec list --json` to get available changes\n - Present the options clearly in chat (numbered or labeled)\n - Ask ONE selection question; STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.";
|
|
8
|
+
export declare const PROMPT_SELECT_CHANGE_RECENT = "Run `openspec list --json` to get available changes sorted by most recently modified. Then prompt the user to select which change to work on in chat. Ask ONE selection question; STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.";
|
|
9
|
+
export declare const PROMPT_MULTI_SELECT_CHANGES = "Prompt the user to select one or more changes in chat:\n - Show each change with its schema\n - Allow multiple selections (e.g., \"select all that apply\" or comma-separated names)\n - STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.";
|
|
10
|
+
export declare const PROMPT_CONFIRM = "Ask the user to confirm before proceeding in chat:\n - State what they are confirming and the consequences\n - Present clear yes/no options\n - STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.";
|
|
11
|
+
export declare const PROMPT_OPEN_ENDED = "Ask the user an open-ended question in chat (no preset multiple-choice options):\n - STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.";
|
|
12
|
+
export declare const PROMPT_CLARIFY = "Ask the user a clarifying question in chat:\n - STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.";
|
|
13
|
+
export declare const COMPREHENSION_PRESENT_AND_GRADE = "**Present and grade**\n - Present each question in chat with labeled options (A/B/C/D or 1\u20134)\n - Ask ONE question at a time; after each, STOP and wait for the user's answer before the next question\n - NEVER select answers yourself, infer what the user would pick, or call `--record-comprehension-pass` until the user has answered every question\n - On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.\n - Grade: `score_percent = round(correct / question_count * 100)`\n - Pass when `score_percent >= comprehension.thresholdPercent` (default 80)";
|
|
14
|
+
//# sourceMappingURL=user-prompt-guidance.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool-agnostic user interaction guidance for agent workflows.
|
|
3
|
+
*
|
|
4
|
+
* Cursor's AskUserQuestion is an optional enhancement, not a requirement.
|
|
5
|
+
* All editors (Windsurf, Claude Code, etc.) use plain chat with stop-and-wait.
|
|
6
|
+
*/
|
|
7
|
+
const WAIT_FOR_USER = "STOP and wait for the user's reply before continuing. NEVER answer, infer, or choose on the user's behalf.";
|
|
8
|
+
const CURSOR_HINT = 'On Cursor, you may use the **AskUserQuestion tool** instead of plain chat for this step.';
|
|
9
|
+
export const PROMPT_SELECT_CHANGE = `Prompt the user to select a change:
|
|
10
|
+
- Run \`openspec list --json\` to get available changes
|
|
11
|
+
- Present the options clearly in chat (numbered or labeled)
|
|
12
|
+
- Ask ONE selection question; ${WAIT_FOR_USER}
|
|
13
|
+
- ${CURSOR_HINT}`;
|
|
14
|
+
export const PROMPT_SELECT_CHANGE_RECENT = `Run \`openspec list --json\` to get available changes sorted by most recently modified. Then prompt the user to select which change to work on in chat. Ask ONE selection question; ${WAIT_FOR_USER}
|
|
15
|
+
- ${CURSOR_HINT}`;
|
|
16
|
+
export const PROMPT_MULTI_SELECT_CHANGES = `Prompt the user to select one or more changes in chat:
|
|
17
|
+
- Show each change with its schema
|
|
18
|
+
- Allow multiple selections (e.g., "select all that apply" or comma-separated names)
|
|
19
|
+
- ${WAIT_FOR_USER}
|
|
20
|
+
- ${CURSOR_HINT}`;
|
|
21
|
+
export const PROMPT_CONFIRM = `Ask the user to confirm before proceeding in chat:
|
|
22
|
+
- State what they are confirming and the consequences
|
|
23
|
+
- Present clear yes/no options
|
|
24
|
+
- ${WAIT_FOR_USER}
|
|
25
|
+
- ${CURSOR_HINT}`;
|
|
26
|
+
export const PROMPT_OPEN_ENDED = `Ask the user an open-ended question in chat (no preset multiple-choice options):
|
|
27
|
+
- ${WAIT_FOR_USER}
|
|
28
|
+
- ${CURSOR_HINT}`;
|
|
29
|
+
export const PROMPT_CLARIFY = `Ask the user a clarifying question in chat:
|
|
30
|
+
- ${WAIT_FOR_USER}
|
|
31
|
+
- ${CURSOR_HINT}`;
|
|
32
|
+
export const COMPREHENSION_PRESENT_AND_GRADE = `**Present and grade**
|
|
33
|
+
- Present each question in chat with labeled options (A/B/C/D or 1–4)
|
|
34
|
+
- Ask ONE question at a time; after each, STOP and wait for the user's answer before the next question
|
|
35
|
+
- NEVER select answers yourself, infer what the user would pick, or call \`--record-comprehension-pass\` until the user has answered every question
|
|
36
|
+
- ${CURSOR_HINT}
|
|
37
|
+
- Grade: \`score_percent = round(correct / question_count * 100)\`
|
|
38
|
+
- Pass when \`score_percent >= comprehension.thresholdPercent\` (default 80)`;
|
|
39
|
+
//# sourceMappingURL=user-prompt-guidance.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PLAYWRIGHT_VERIFY_GUIDANCE } from './mcp-guidance.js';
|
|
2
2
|
import { STORE_SELECTION_GUIDANCE } from './store-selection.js';
|
|
3
|
+
import { PROMPT_SELECT_CHANGE } from './user-prompt-guidance.js';
|
|
3
4
|
export function getVerifyChangeSkillTemplate() {
|
|
4
5
|
return {
|
|
5
6
|
name: 'openspec-verify-change',
|
|
@@ -14,7 +15,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
14
15
|
|
|
15
16
|
1. **If no change name provided, prompt for selection**
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
${PROMPT_SELECT_CHANGE}
|
|
18
19
|
|
|
19
20
|
Show changes that have implementation tasks (tasks artifact exists).
|
|
20
21
|
Include the schema used for each change if available.
|
|
@@ -188,7 +189,7 @@ ${STORE_SELECTION_GUIDANCE}
|
|
|
188
189
|
|
|
189
190
|
1. **If no change name provided, prompt for selection**
|
|
190
191
|
|
|
191
|
-
|
|
192
|
+
${PROMPT_SELECT_CHANGE}
|
|
192
193
|
|
|
193
194
|
Show changes that have implementation tasks (tasks artifact exists).
|
|
194
195
|
Include the schema used for each change if available.
|