Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/core/templates/workflows/archive-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export function getArchiveChangeSkillTemplate(): SkillTemplate {

If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.

**Front matter consistency (after sync):**
Ensure newly synced specs follow existing front matter conventions. See sync-specs step 3e for full logic (monorepo detection, opt-out via \`monorepoAppLabel: false\` in \`openspec/config.yaml\`).

5. **Perform the archive**

Create the archive directory if it doesn't exist:
Expand Down Expand Up @@ -181,6 +184,9 @@ export function getOpsxArchiveCommandTemplate(): CommandTemplate {

If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.

**Front matter consistency (after sync):**
Ensure newly synced specs follow existing front matter conventions. See sync-specs step 3e for full logic (monorepo detection, opt-out via \`monorepoAppLabel: false\` in \`openspec/config.yaml\`).

5. **Perform the archive**

Create the archive directory if it doesn't exist:
Expand Down
2 changes: 2 additions & 0 deletions src/core/templates/workflows/bulk-archive-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
- For conflicts, apply in resolved order
- Track if sync was done
- Ensure front matter consistency on newly synced specs (see sync-specs step 3e)

b. **Perform the archive**:
\`\`\`bash
Expand Down Expand Up @@ -372,6 +373,7 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
- For conflicts, apply in resolved order
- Track if sync was done
- Ensure front matter consistency on newly synced specs (see sync-specs step 3e)

b. **Perform the archive**:
\`\`\`bash
Expand Down
22 changes: 22 additions & 0 deletions src/core/templates/workflows/sync-specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ This is an **agent-driven** operation - you will read delta specs and directly e
- Add Purpose section (can be brief, mark as TBD)
- Add Requirements section with the ADDED requirements

e. **Ensure front matter consistency** on newly synced specs (common in monorepos where specs need to indicate which app/package they belong to):
- If the project config (\`openspec/config.yaml\` or \`openspec/config.yml\`) contains \`monorepoAppLabel: false\` → skip
- Sample existing main specs in \`openspec/specs/\` for YAML front matter convention
- If existing specs use front matter → apply same pattern to newly created/updated specs
- If no existing specs have front matter AND project is single-app → skip
- If no existing specs have front matter AND project is a monorepo (multiple apps/packages detected):

**Prompt options:**
- "Establish front matter convention (recommended)" — suggest \`app: <name>\` based on project structure, apply to newly synced specs
- "Skip and don't ask again" — add \`monorepoAppLabel: false\` to the existing OpenSpec config file without overwriting other keys

Comment thread
coderabbitai[bot] marked this conversation as resolved.
4. **Show summary**

After applying all changes, summarize:
Expand Down Expand Up @@ -210,6 +221,17 @@ This is an **agent-driven** operation - you will read delta specs and directly e
- Add Purpose section (can be brief, mark as TBD)
- Add Requirements section with the ADDED requirements

e. **Ensure front matter consistency** on newly synced specs (common in monorepos where specs need to indicate which app/package they belong to):
- If the project config (\`openspec/config.yaml\` or \`openspec/config.yml\`) contains \`monorepoAppLabel: false\` → skip
- Sample existing main specs in \`openspec/specs/\` for YAML front matter convention
- If existing specs use front matter → apply same pattern to newly created/updated specs
- If no existing specs have front matter AND project is single-app → skip
- If no existing specs have front matter AND project is a monorepo (multiple apps/packages detected):

**Prompt options:**
- "Establish front matter convention (recommended)" — suggest \`app: <name>\` based on project structure, apply to newly synced specs
- "Skip and don't ask again" — add \`monorepoAppLabel: false\` to the existing OpenSpec config file without overwriting other keys

4. **Show summary**

After applying all changes, summarize:
Expand Down