-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add sub-agent spec discovery step to proposal workflows #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,15 +31,26 @@ export function getFfChangeSkillTemplate(): SkillTemplate { | |
| \`\`\` | ||
| This creates a scaffolded change at \`openspec/changes/<name>/\`. | ||
|
|
||
| 3. **Get the artifact build order** | ||
| 3. **Discover existing specs (via sub-agent)** | ||
| Use the **Agent tool** to spawn a sub-agent for spec discovery. This keeps the catalog analysis in a separate context: | ||
| - **prompt**: "Run \`openspec list --specs --json --detail\` in the project directory. Parse the JSON output — each spec has id, title, overview, and requirementCount. The user wants to build: [paste the user's description here]. Compare each spec's overview against this description and return ONLY the specs that are related. Format your response as a JSON array: [{id, overview, reason}]. Do not return unrelated specs." | ||
| - The sub-agent analyzes all specs in its own context window and returns only the relevant ones. | ||
| - Use the sub-agent's results to classify the proposal's Capabilities section (New vs Modified). | ||
|
|
||
| If your tool does not support sub-agents, run the CLI directly instead: | ||
| \`\`\`bash | ||
| openspec list --specs --json --detail | ||
| \`\`\` | ||
|
|
||
| 4. **Get the artifact build order** | ||
| \`\`\`bash | ||
| openspec status --change "<name>" --json | ||
| \`\`\` | ||
| Parse the JSON to get: | ||
| - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`) | ||
| - \`artifacts\`: list of all artifacts with their status and dependencies | ||
|
|
||
| 4. **Create artifacts in sequence until apply-ready** | ||
| 5. **Create artifacts in sequence until apply-ready** | ||
|
Comment on lines
+45
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Final step label should be renumbered to 6 After adding the new discovery step, “Create artifacts” is now Step 5 (Line 53 and Line 166), but “Show final status” remains Proposed fix-5. **Show final status**
+6. **Show final status**Also applies to: 158-166 🤖 Prompt for AI Agents |
||
|
|
||
| Use the **TodoWrite tool** to track progress through the artifacts. | ||
|
|
||
|
|
@@ -133,15 +144,26 @@ export function getOpsxFfCommandTemplate(): CommandTemplate { | |
| \`\`\` | ||
| This creates a scaffolded change at \`openspec/changes/<name>/\`. | ||
|
|
||
| 3. **Get the artifact build order** | ||
| 3. **Discover existing specs (via sub-agent)** | ||
| Use the **Agent tool** to spawn a sub-agent for spec discovery. This keeps the catalog analysis in a separate context: | ||
| - **prompt**: "Run \`openspec list --specs --json --detail\` in the project directory. Parse the JSON output — each spec has id, title, overview, and requirementCount. The user wants to build: [paste the user's description here]. Compare each spec's overview against this description and return ONLY the specs that are related. Format your response as a JSON array: [{id, overview, reason}]. Do not return unrelated specs." | ||
| - The sub-agent analyzes all specs in its own context window and returns only the relevant ones. | ||
| - Use the sub-agent's results to classify the proposal's Capabilities section (New vs Modified). | ||
|
|
||
| If your tool does not support sub-agents, run the CLI directly instead: | ||
| \`\`\`bash | ||
| openspec list --specs --json --detail | ||
| \`\`\` | ||
|
|
||
| 4. **Get the artifact build order** | ||
| \`\`\`bash | ||
| openspec status --change "<name>" --json | ||
| \`\`\` | ||
| Parse the JSON to get: | ||
| - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`) | ||
| - \`artifacts\`: list of all artifacts with their status and dependencies | ||
|
|
||
| 4. **Create artifacts in sequence until apply-ready** | ||
| 5. **Create artifacts in sequence until apply-ready** | ||
|
|
||
| Use the **TodoWrite tool** to track progress through the artifacts. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,15 +40,26 @@ When ready to implement, run /opsx:apply | |
| \`\`\` | ||
| This creates a scaffolded change at \`openspec/changes/<name>/\` with \`.openspec.yaml\`. | ||
|
|
||
| 3. **Get the artifact build order** | ||
| 3. **Discover existing specs (via sub-agent)** | ||
| Use the **Agent tool** to spawn a sub-agent for spec discovery. This keeps the catalog analysis in a separate context: | ||
| - **prompt**: "Run \`openspec list --specs --json --detail\` in the project directory. Parse the JSON output — each spec has id, title, overview, and requirementCount. The user wants to build: [paste the user's description here]. Compare each spec's overview against this description and return ONLY the specs that are related. Format your response as a JSON array: [{id, overview, reason}]. Do not return unrelated specs." | ||
| - The sub-agent analyzes all specs in its own context window and returns only the relevant ones. | ||
| - Use the sub-agent's results to classify the proposal's Capabilities section (New vs Modified). | ||
|
|
||
| If your tool does not support sub-agents, run the CLI directly instead: | ||
| \`\`\`bash | ||
| openspec list --specs --json --detail | ||
| \`\`\` | ||
|
|
||
|
Comment on lines
+43
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 45 and Line 167 instruct Proposed fix (template guidance aligned to currently available data)- - **prompt**: "Run `openspec list --specs --json --detail` in the project directory. Parse the JSON output — each spec has id, title, overview, and requirementCount. The user wants to build: [paste the user's description here]. Compare each spec's overview against this description and return ONLY the specs that are related. Format your response as a JSON array: [{id, overview, reason}]. Do not return unrelated specs."
+ - **prompt**: "Run `openspec list --specs --json` in the project directory to get spec ids. Then read each spec's Purpose/overview (from `openspec/specs/<id>/spec.md`, or `openspec spec show <id> --json` if available). The user wants to build: [paste the user's description here]. Compare each spec overview against this description and return ONLY related specs as JSON: [{id, overview, reason}]. Do not return unrelated specs."
@@
- openspec list --specs --json --detail
+ openspec list --specs --json
+ # then inspect each listed spec's Purpose/overview before classifying capabilitiesAlso applies to: 165-175 🤖 Prompt for AI Agents |
||
| 4. **Get the artifact build order** | ||
| \`\`\`bash | ||
| openspec status --change "<name>" --json | ||
| \`\`\` | ||
| Parse the JSON to get: | ||
| - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`) | ||
| - \`artifacts\`: list of all artifacts with their status and dependencies | ||
|
|
||
| 4. **Create artifacts in sequence until apply-ready** | ||
| 5. **Create artifacts in sequence until apply-ready** | ||
|
Comment on lines
+54
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Step numbering is now inconsistent after insertion You renumbered creation to Step 5 (Line 62 and Line 184), but “Show final status” is still labeled Proposed fix-5. **Show final status**
+6. **Show final status**Also applies to: 176-184 🤖 Prompt for AI Agents |
||
|
|
||
| Use the **TodoWrite tool** to track progress through the artifacts. | ||
|
|
||
|
|
@@ -151,15 +162,26 @@ When ready to implement, run /opsx:apply | |
| \`\`\` | ||
| This creates a scaffolded change at \`openspec/changes/<name>/\` with \`.openspec.yaml\`. | ||
|
|
||
| 3. **Get the artifact build order** | ||
| 3. **Discover existing specs (via sub-agent)** | ||
| Use the **Agent tool** to spawn a sub-agent for spec discovery. This keeps the catalog analysis in a separate context: | ||
| - **prompt**: "Run \`openspec list --specs --json --detail\` in the project directory. Parse the JSON output — each spec has id, title, overview, and requirementCount. The user wants to build: [paste the user's description here]. Compare each spec's overview against this description and return ONLY the specs that are related. Format your response as a JSON array: [{id, overview, reason}]. Do not return unrelated specs." | ||
| - The sub-agent analyzes all specs in its own context window and returns only the relevant ones. | ||
| - Use the sub-agent's results to classify the proposal's Capabilities section (New vs Modified). | ||
|
|
||
| If your tool does not support sub-agents, run the CLI directly instead: | ||
| \`\`\`bash | ||
| openspec list --specs --json --detail | ||
| \`\`\` | ||
|
|
||
| 4. **Get the artifact build order** | ||
| \`\`\`bash | ||
| openspec status --change "<name>" --json | ||
| \`\`\` | ||
| Parse the JSON to get: | ||
| - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`) | ||
| - \`artifacts\`: list of all artifacts with their status and dependencies | ||
|
|
||
| 4. **Create artifacts in sequence until apply-ready** | ||
| 5. **Create artifacts in sequence until apply-ready** | ||
|
|
||
| Use the **TodoWrite tool** to track progress through the artifacts. | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spec discovery prompt depends on unsupported list output/flag
Line 36 and Line 149 require
--detailplustitle/overviewin list JSON, which is not guaranteed by current CLI/list behavior. This breaks the discovery prerequisite and can cascade into incorrect “New vs Modified” capability classification.Proposed fix (same adjustment as propose workflow)
Also applies to: 147-157
🤖 Prompt for AI Agents