Skip to content

Commit 2a441c4

Browse files
authored
Refine opsx archive sync assessment (Fission-AI#514)
* Refine opsx archive sync assessment * Simplify opsx archive sync instructions Replace verbose algorithmic instructions with intent-focused guidance. Trust the agent to figure out comparison logic rather than specifying the exact algorithm for each delta type (ADDED, MODIFIED, etc). Reduces section 4 from ~31 lines to ~13 lines per template. * Add explicit paths for delta spec locations Make it clear where agents should look for delta specs and main specs: - Delta specs: openspec/changes/<name>/specs/ - Main specs: openspec/specs/<capability>/spec.md
1 parent ed4d965 commit 2a441c4

1 file changed

Lines changed: 27 additions & 63 deletions

File tree

src/core/templates/skill-templates.ts

Lines changed: 27 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,38 +1563,20 @@ export function getArchiveChangeSkillTemplate(): SkillTemplate {
15631563
15641564
**If no tasks file exists:** Proceed without task-related warning.
15651565
1566-
4. **Check if delta specs need syncing**
1566+
4. **Assess delta spec sync state**
15671567
1568-
Check if \`specs/\` directory exists in the change with spec files.
1568+
Check for delta specs at \`openspec/changes/<name>/specs/\`. If none exist, proceed without sync prompt.
15691569
1570-
**If delta specs exist, perform a quick sync check:**
1570+
**If delta specs exist:**
1571+
- Compare each delta spec with its corresponding main spec at \`openspec/specs/<capability>/spec.md\`
1572+
- Determine what changes would be applied (adds, modifications, removals, renames)
1573+
- Show a combined summary before prompting
15711574
1572-
a. **For each delta spec** at \`openspec/changes/<name>/specs/<capability>/spec.md\`:
1573-
- Extract requirement names (lines matching \`### Requirement: <name>\`)
1574-
- Note which sections exist (ADDED, MODIFIED, REMOVED)
1575+
**Prompt options:**
1576+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
1577+
- If already synced: "Archive now", "Sync anyway", "Cancel"
15751578
1576-
b. **Check corresponding main spec** at \`openspec/specs/<capability>/spec.md\`:
1577-
- If main spec doesn't exist → needs sync
1578-
- If main spec exists, check if ADDED requirement names appear in it
1579-
- If any ADDED requirements are missing from main spec → needs sync
1580-
1581-
c. **Report findings:**
1582-
1583-
**If sync needed:**
1584-
\`\`\`
1585-
⚠️ Delta specs may not be synced:
1586-
- specs/auth/spec.md → Main spec missing requirement "Token Refresh"
1587-
- specs/api/spec.md → Main spec doesn't exist yet
1588-
1589-
Would you like to sync now before archiving?
1590-
\`\`\`
1591-
- Use **AskUserQuestion tool** with options: "Sync now", "Archive without syncing"
1592-
- If user chooses sync, execute /opsx:sync logic (use the openspec-sync-specs skill)
1593-
1594-
**If already synced (all requirements found):**
1595-
- Proceed without prompting (specs appear to be in sync)
1596-
1597-
**If no delta specs exist:** Proceed without sync-related checks.
1579+
If user chooses sync, execute /opsx:sync logic (use the openspec-sync-specs skill). Proceed to archive regardless of choice.
15981580
15991581
5. **Perform the archive**
16001582
@@ -1630,7 +1612,7 @@ export function getArchiveChangeSkillTemplate(): SkillTemplate {
16301612
**Change:** <change-name>
16311613
**Schema:** <schema-name>
16321614
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
1633-
**Specs:** ✓ Synced to main specs (or "No delta specs" or "⚠️ Not synced")
1615+
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
16341616
16351617
All artifacts complete. All tasks complete.
16361618
\`\`\`
@@ -1642,7 +1624,7 @@ All artifacts complete. All tasks complete.
16421624
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
16431625
- Show clear summary of what happened
16441626
- If sync is requested, use openspec-sync-specs approach (agent-driven)
1645-
- Quick sync check: look for requirement names in delta specs, verify they exist in main specs`
1627+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting`
16461628
};
16471629
}
16481630

@@ -2003,38 +1985,20 @@ export function getOpsxArchiveCommandTemplate(): CommandTemplate {
20031985
20041986
**If no tasks file exists:** Proceed without task-related warning.
20051987
2006-
4. **Check if delta specs need syncing**
2007-
2008-
Check if \`specs/\` directory exists in the change with spec files.
2009-
2010-
**If delta specs exist, perform a quick sync check:**
2011-
2012-
a. **For each delta spec** at \`openspec/changes/<name>/specs/<capability>/spec.md\`:
2013-
- Extract requirement names (lines matching \`### Requirement: <name>\`)
2014-
- Note which sections exist (ADDED, MODIFIED, REMOVED)
2015-
2016-
b. **Check corresponding main spec** at \`openspec/specs/<capability>/spec.md\`:
2017-
- If main spec doesn't exist → needs sync
2018-
- If main spec exists, check if ADDED requirement names appear in it
2019-
- If any ADDED requirements are missing from main spec → needs sync
2020-
2021-
c. **Report findings:**
1988+
4. **Assess delta spec sync state**
20221989
2023-
**If sync needed:**
2024-
\`\`\`
2025-
⚠️ Delta specs may not be synced:
2026-
- specs/auth/spec.md → Main spec missing requirement "Token Refresh"
2027-
- specs/api/spec.md → Main spec doesn't exist yet
1990+
Check for delta specs at \`openspec/changes/<name>/specs/\`. If none exist, proceed without sync prompt.
20281991
2029-
Would you like to sync now before archiving?
2030-
\`\`\`
2031-
- Use **AskUserQuestion tool** with options: "Sync now", "Archive without syncing"
2032-
- If user chooses sync, execute \`/opsx:sync\` logic
1992+
**If delta specs exist:**
1993+
- Compare each delta spec with its corresponding main spec at \`openspec/specs/<capability>/spec.md\`
1994+
- Determine what changes would be applied (adds, modifications, removals, renames)
1995+
- Show a combined summary before prompting
20331996
2034-
**If already synced (all requirements found):**
2035-
- Proceed without prompting (specs appear to be in sync)
1997+
**Prompt options:**
1998+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
1999+
- If already synced: "Archive now", "Sync anyway", "Cancel"
20362000
2037-
**If no delta specs exist:** Proceed without sync-related checks.
2001+
If user chooses sync, execute \`/opsx:sync\` logic. Proceed to archive regardless of choice.
20382002
20392003
5. **Perform the archive**
20402004
@@ -2059,7 +2023,7 @@ export function getOpsxArchiveCommandTemplate(): CommandTemplate {
20592023
- Change name
20602024
- Schema that was used
20612025
- Archive location
2062-
- Spec sync status (synced / not synced / no delta specs)
2026+
- Spec sync status (synced / sync skipped / no delta specs)
20632027
- Note about any warnings (incomplete artifacts/tasks)
20642028
20652029
**Output On Success**
@@ -2096,12 +2060,12 @@ All artifacts complete. All tasks complete.
20962060
**Change:** <change-name>
20972061
**Schema:** <schema-name>
20982062
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
2099-
**Specs:** ⚠️ Not synced
2063+
**Specs:** Sync skipped (user chose to skip)
21002064
21012065
**Warnings:**
21022066
- Archived with 2 incomplete artifacts
21032067
- Archived with 3 incomplete tasks
2104-
- Delta specs were not synced (user chose to skip)
2068+
- Delta spec sync was skipped (user chose to skip)
21052069
21062070
Review the archive if this was not intentional.
21072071
\`\`\`
@@ -2127,9 +2091,9 @@ Target archive directory already exists.
21272091
- Use artifact graph (openspec status --json) for completion checking
21282092
- Don't block archive on warnings - just inform and confirm
21292093
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
2130-
- Quick sync check: look for requirement names in delta specs, verify they exist in main specs
21312094
- Show clear summary of what happened
2132-
- If sync is requested, use /opsx:sync approach (agent-driven)`
2095+
- If sync is requested, use /opsx:sync approach (agent-driven)
2096+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting`
21332097
};
21342098
}
21352099

0 commit comments

Comments
 (0)