AgentSkillsCN

syncing-to-specs

利用智能合并技术,将变更的增量规格同步至当前最新状态。

SKILL.md
--- frontmatter
name: syncing-to-specs
description: Sync change delta specs into current truth using intelligent merge.

Syncing to Specs

Use when you want to update docs/specs/ with deltas from a change without archiving it.

Inputs

  • docs/changes/<slug>/specs/<capability>/spec.md
  • docs/specs/<capability>/spec.md (create if missing)

Behavior

  1. If change slug is not provided, ask which change to sync.
  2. For each delta spec under docs/changes/<slug>/specs/:
    • Read the delta spec.
    • Read the current spec (or create if missing).
  3. Apply changes with intelligent merge:
    • ADDED: add the requirement if it does not exist; if it exists, treat as MODIFIED.
    • MODIFIED: update only what the delta specifies (add scenarios, tweak text) while preserving existing scenarios and content not mentioned.
    • REMOVED: remove the entire requirement block.
    • RENAMED: rename the requirement header (if content changes, also apply MODIFIED).
  4. Normalize current truth format:
    • Ensure a single top-level ## Requirements heading.
    • Remove delta section headers (ADDED/MODIFIED/REMOVED/RENAMED) from docs/specs/.
  5. Ensure every requirement still has at least one #### Scenario:.
  6. Summarize changes by capability.
  7. If all requirements for the change are implemented, suggest archiving the change.

Notes

  • The delta expresses intent, not full replacement.
  • Preserve existing content unless explicitly changed.
  • If unclear, ask before editing.