Skip to content

Commit dd53fb7

Browse files
authored
OPSX apply: infer target change (Fission-AI#513)
* opsx: infer change for apply * opsx: prompt when apply ambiguous * opsx: use AskUserQuestion when ambiguous * Simplify opsx:apply change selection instructions Update all change selection instructions across all opsx commands (apply, continue, sync, archive, verify, ff) to use consistent wording: "If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes." For apply specifically, also simplifies Step 1 from ~180 to ~60 words while preserving the same behavior: infer from conversation, auto-select if single change, prompt via AskUserQuestion if ambiguous, always announce. Removes micromanagement details (validation commands, recommendation markers, presentation specifics) and trusts the LLM to figure out reasonable defaults.
1 parent 2a441c4 commit dd53fb7

2 files changed

Lines changed: 23 additions & 25 deletions

File tree

docs/experimental-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Creates all planning artifacts at once. Use when you have a clear picture of wha
119119
```
120120
/opsx:apply
121121
```
122-
Works through tasks, checking them off as you go. **Key difference:** if you discover issues during implementation, you can update your specs, design, or tasks — then continue. No phase gates.
122+
Works through tasks, checking them off as you go. **Key difference:** if you discover issues during implementation, you can update your specs, design, or tasks — then continue. No phase gates. If you're juggling multiple changes, you can run `/opsx:apply <name>`; otherwise it should infer from the conversation and prompt you to choose if it can’t tell.
123123

124124
### Finish up
125125
```

src/core/templates/skill-templates.ts

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export function getContinueChangeSkillTemplate(): SkillTemplate {
385385
description: 'Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.',
386386
instructions: `Continue working on a change by creating the next artifact.
387387
388-
**Input**: Optionally specify a change name. If omitted, MUST prompt for available changes.
388+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
389389
390390
**Steps**
391391
@@ -499,19 +499,18 @@ export function getApplyChangeSkillTemplate(): SkillTemplate {
499499
description: 'Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.',
500500
instructions: `Implement tasks from an OpenSpec change.
501501
502-
**Input**: Optionally specify a change name. If omitted, MUST prompt for available changes.
502+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
503503
504504
**Steps**
505505
506-
1. **If no change name provided, prompt for selection**
507-
508-
Run \`openspec list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
506+
1. **Select the change**
509507
510-
Show changes that are implementation-ready (have tasks artifact).
511-
Include the schema used for each change if available.
512-
Mark changes with incomplete tasks as "(In Progress)".
508+
If a name is provided, use it. Otherwise:
509+
- Infer from conversation context if the user mentioned a change
510+
- Auto-select if only one active change exists
511+
- If ambiguous, run \`openspec list --json\` to get available changes and use the **AskUserQuestion tool** to let the user select
513512
514-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
513+
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
515514
516515
2. **Check status to understand the schema**
517516
\`\`\`bash
@@ -754,7 +753,7 @@ export function getSyncSpecsSkillTemplate(): SkillTemplate {
754753
755754
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
756755
757-
**Input**: Optionally specify a change name. If omitted, MUST prompt for available changes.
756+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
758757
759758
**Steps**
760759
@@ -1154,7 +1153,7 @@ export function getOpsxContinueCommandTemplate(): CommandTemplate {
11541153
tags: ['workflow', 'artifacts', 'experimental'],
11551154
content: `Continue working on a change by creating the next artifact.
11561155
1157-
**Input**: Optionally specify \`--change <name>\` after \`/opsx:continue\`. If omitted, MUST prompt for available changes.
1156+
**Input**: Optionally specify a change name after \`/opsx:continue\` (e.g., \`/opsx:continue add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
11581157
11591158
**Steps**
11601159
@@ -1269,19 +1268,18 @@ export function getOpsxApplyCommandTemplate(): CommandTemplate {
12691268
tags: ['workflow', 'artifacts', 'experimental'],
12701269
content: `Implement tasks from an OpenSpec change.
12711270
1272-
**Input**: Optionally specify \`--change <name>\` after \`/opsx:apply\`. If omitted, MUST prompt for available changes.
1271+
**Input**: Optionally specify a change name (e.g., \`/opsx:apply add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
12731272
12741273
**Steps**
12751274
1276-
1. **If no change name provided, prompt for selection**
1277-
1278-
Run \`openspec list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
1275+
1. **Select the change**
12791276
1280-
Show changes that are implementation-ready (have tasks artifact).
1281-
Include the schema used for each change if available.
1282-
Mark changes with incomplete tasks as "(In Progress)".
1277+
If a name is provided, use it. Otherwise:
1278+
- Infer from conversation context if the user mentioned a change
1279+
- Auto-select if only one active change exists
1280+
- If ambiguous, run \`openspec list --json\` to get available changes and use the **AskUserQuestion tool** to let the user select
12831281
1284-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
1282+
Always announce: "Using change: <name>" and how to override (e.g., \`/opsx:apply <other>\`).
12851283
12861284
2. **Check status to understand the schema**
12871285
\`\`\`bash
@@ -1524,7 +1522,7 @@ export function getArchiveChangeSkillTemplate(): SkillTemplate {
15241522
description: 'Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.',
15251523
instructions: `Archive a completed change in the experimental workflow.
15261524
1527-
**Input**: Optionally specify a change name. If omitted, MUST prompt for available changes.
1525+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
15281526
15291527
**Steps**
15301528
@@ -1641,7 +1639,7 @@ export function getOpsxSyncCommandTemplate(): CommandTemplate {
16411639
16421640
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
16431641
1644-
**Input**: Optionally specify \`--change <name>\` after \`/opsx:sync\`. If omitted, MUST prompt for available changes.
1642+
**Input**: Optionally specify a change name after \`/opsx:sync\` (e.g., \`/opsx:sync add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
16451643
16461644
**Steps**
16471645
@@ -1777,7 +1775,7 @@ export function getVerifyChangeSkillTemplate(): SkillTemplate {
17771775
description: 'Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.',
17781776
instructions: `Verify that an implementation matches the change artifacts (specs, tasks, design).
17791777
1780-
**Input**: Optionally specify a change name. If omitted, MUST prompt for available changes.
1778+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
17811779
17821780
**Steps**
17831781
@@ -1946,7 +1944,7 @@ export function getOpsxArchiveCommandTemplate(): CommandTemplate {
19461944
tags: ['workflow', 'archive', 'experimental'],
19471945
content: `Archive a completed change in the experimental workflow.
19481946
1949-
**Input**: Optionally specify \`--change <name>\` after \`/opsx:archive\`. If omitted, MUST prompt for available changes.
1947+
**Input**: Optionally specify a change name after \`/opsx:archive\` (e.g., \`/opsx:archive add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
19501948
19511949
**Steps**
19521950
@@ -2108,7 +2106,7 @@ export function getOpsxVerifyCommandTemplate(): CommandTemplate {
21082106
tags: ['workflow', 'verify', 'experimental'],
21092107
content: `Verify that an implementation matches the change artifacts (specs, tasks, design).
21102108
2111-
**Input**: Optionally specify \`--change <name>\` after \`/opsx:verify\`. If omitted, MUST prompt for available changes.
2109+
**Input**: Optionally specify a change name after \`/opsx:verify\` (e.g., \`/opsx:verify add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
21122110
21132111
**Steps**
21142112

0 commit comments

Comments
 (0)