{"data":{"slug":"discovered-0f9eb064aca0356bf76c88a09e4af6ae5cb6362aecef4f2c","title":"Openspec Sync Specs","summary":"Sync delta specs from a change to main specs, allowing intelligent merging of new, modified, and renamed requirements without archiving the change.","url":"https:\/\/skillshunter.net\/skills\/discovered-0f9eb064aca0356bf76c88a09e4af6ae5cb6362aecef4f2c","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-0f9eb064aca0356bf76c88a09e4af6ae5cb6362aecef4f2c","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-0f9eb064aca0356bf76c88a09e4af6ae5cb6362aecef4f2c.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-0f9eb064aca0356bf76c88a09e4af6ae5cb6362aecef4f2c\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running the sync, ensure the store is selected using `openspec store list --json` and pass `--store <id>` to commands that read or write specs. Always let the user explicitly choose a change; do not guess or auto-select. Use the `mainSpecsRoot` derived from the store's status JSON for all main-spec operations.","instructions":"---\nname: openspec-sync-specs\ndescription: Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.\nallowed-tools: Bash(openspec:*)\nlicense: MIT\ncompatibility: Requires openspec CLI.\nmetadata:\n  author: openspec\n  version: \"1.0\"\n  generatedBy: \"1.6.0\"\n---\n\nSync delta specs from a change to main specs.\n\nThis 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).\n\n**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec\/` root.\n\n**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.\n\n**Steps**\n\n1. **If no change name provided, prompt for selection**\n\n   Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.\n\n   Show changes that have delta specs (under `specs\/` directory).\n\n   **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.\n\n2. **Resolve change context**\n\n   Run:\n   ```bash\n   openspec status --change \"<name>\" --json\n   ```\n\n   Retain the selected store id (or explicit local context), `planningHome`,\n   `changeRoot` and `artifactPaths`. Set `mainSpecsRoot` to\n   `<planningHome.root>\/openspec\/specs\/` using the absolute root from status JSON.\n   With `--store <id>`, this is the store's root, not the caller's repository.\n   If `planningHome.root` is missing or ambiguous, stop and report the missing\n   context; never substitute the caller's `openspec\/specs\/` for a selected store.\n   Use this same root for every main-spec read and write.\n\n3. **Find delta specs**\n\n   Use `artifactPaths.specs.existingOutputPaths` from the status JSON as the list of delta spec files.\n\n   Each delta spec file contains sections like:\n   - `## ADDED Requirements` - New requirements to add\n   - `## MODIFIED Requirements` - Changes to existing requirements\n   - `## REMOVED Requirements` - Requirements to remove\n   - `## RENAMED Requirements` - Requirements to rename (FROM:\/TO: format)\n\n   If no delta specs found, inform user and stop.\n\n4. **For each delta spec, apply changes to main specs**\n\n   For each capability delta spec path returned by the CLI for the selected planning home:\n\n   a. **Read the delta spec** to understand the intended changes\n\n   b. **Read the main spec** at `<mainSpecsRoot>\/<capability>\/spec.md` (may not exist yet)\n\n   c. **Apply changes intelligently**:\n\n      **ADDED Requirements:**\n      - If requirement doesn't exist in main spec \u2192 add it\n      - If requirement already exists \u2192 update it to match (treat as implicit MODIFIED)\n\n      **MODIFIED Requirements:**\n      - Find the requirement in main spec\n      - Apply the changes - this can be:\n        - Adding new scenarios (don't need to copy existing ones)\n        - Modifying existing scenarios\n        - Changing the requirement description\n      - Preserve scenarios\/content not mentioned in the delta\n\n      **REMOVED Requirements:**\n      - Remove the entire requirement block from main spec\n\n      **RENAMED Requirements:**\n      - Find the FROM requirement, rename to TO\n\n   d. **Create new main spec** if capability doesn't exist yet:\n      - Create `<mainSpecsRoot>\/<capability>\/spec.md`\n      - Add Purpose section (can be brief, mark as TBD)\n      - Add Requirements section with the ADDED requirements\n\n5. **Show summary**\n\n   After applying all changes, summarize:\n   - Which capabilities were updated\n   - What changes were made (requirements added\/modified\/removed\/renamed)\n\n**Delta Spec Format Reference**\n\n```markdown\n## ADDED Requirements\n\n### Requirement: New Feature\nThe system SHALL do something new.\n\n#### Scenario: Basic case\n- **WHEN** user does X\n- **THEN** system does Y\n\n## MODIFIED Requirements\n\n### Requirement: Existing Feature\n#### Scenario: New scenario to add\n- **WHEN** user does A\n- **THEN** system does B\n\n## REMOVED Requirements\n\n### Requirement: Deprecated Feature\n\n## RENAMED Requirements\n\n- FROM: `### Requirement: Old Name`\n- TO: `### Requirement: New Name`\n```\n\n**Key Principle: Intelligent Merging**\n\nUnlike programmatic merging, you can apply **partial updates**:\n- To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios\n- The delta represents *intent*, not a wholesale replacement\n- Use your judgment to merge changes sensibly\n\n**Output On Success**\n\n```\n## Specs Synced: <change-name>\n\nUpdated main specs:\n\n**<capability-1>**:\n- Added requirement: \"New Feature\"\n- Modified requirement: \"Existing Feature\" (added 1 scenario)\n\n**<capability-2>**:\n- Created new spec file\n- Added requirement: \"Another Feature\"\n\nMain specs are now updated. The change remains active - archive when implementation is complete.\n```\n\n**Guardrails**\n- Read both delta and main specs before making changes\n- Preserve existing content not mentioned in delta\n- If something is unclear, ask for clarification\n- Show what you're changing as you go\n- The operation should be idempotent - running twice should give same result\n","use_cases":["Merge new scenarios into existing requirements without duplicating content","Update main specs with changes from a delta spec","Rename or remove requirements based on delta spec changes","Apply partial updates to requirements while preserving unmodified content"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/damacus\/skills\/blob\/5706f70c0058822adf29da9bd7620c7ea780b9d6\/skills\/workflow\/openspec-sync-specs\/SKILL.md","source_commit":"5706f70c0058822adf29da9bd7620c7ea780b9d6","license":null,"version":null,"listing_approved_at":"2026-12-02","created_at":"2026-11-30T08:55:05.000000Z","updated_at":"2026-12-02T09:15:01.000000Z","seo_title":"Openspec Sync Specs - Sync Delta Specs to Main Specs","seo_description":"Intelligently merge delta specs into main specs using the Openspec CLI, preserving existing content and allowing partial updates without archiving changes.","seo_keywords":["openspec sync specs","delta spec merging","openspec cli","spec synchronization","requirement updates"]}}