spec-merger

GitHub

在变更关闭前,将增量规范合并至主规范基线。执行状态守卫确保仅在executing状态下运行,检测冲突并应用增删改操作,保留原始记录以确保持久一致性。

skills/spec-merger/SKILL.md MageByte-Zero/spec-superflow

Trigger Scenarios

变更处于executing状态且存在待合并的增量规范 检测到多个变更间的规范漂移

Install

npx skills add MageByte-Zero/spec-superflow --skill spec-merger -g -y
More Options

Use without installing

npx skills use MageByte-Zero/spec-superflow@spec-merger

指定 Agent (Claude Code)

npx skills add MageByte-Zero/spec-superflow --skill spec-merger -a claude-code -g -y

安装 repo 全部 skill

npx skills add MageByte-Zero/spec-superflow --all -g -y

预览 repo 内 skill

npx skills add MageByte-Zero/spec-superflow --list

SKILL.md

Frontmatter
{
    "name": "spec-merger",
    "description": "Sync delta specs to main specs before closure. Invoke while an executing change has delta specs to merge into the main spec base, or when detecting spec drift across multiple changes."
}

Spec Merger

Before the final executing → closing transition, delta specs (ADDED/MODIFIED/REMOVED/RENAMED) must be published into the main spec base. changes/<change>/ remains the active workflow source; root specs/ is only the published baseline. Specs that aren't synced become lies. A change already in closing must not be routed to spec-merger.

Execution-State Guard

Before ssf sync or any other write, run npx --yes --package spec-superflow@0.12.1 ssf state get <change-dir> state. Continue only when the persisted state is exactly executing. If it is closing → STOP: "Closing is terminal. Do not route this change to spec-merger; synchronization belongs before the final executing → closing transition." For any other state, or if the state cannot be read → STOP and route through workflow-start; do not perform side effects.

Pre-Flight Checks

Conflict Detection

Run npx --yes --package spec-superflow@0.12.1 ssf sync <change-dir>. If conflicts are detected (same requirement modified by multiple changes), present the conflict list to the user for resolution order.

Sync Process

Step 1: Identify Deltas

Each specs/<capability>/spec.md under the change folder contains delta operations under ## ADDED/MODIFIED/REMOVED/RENAMED Requirements.

Step 2: Apply by Operation

ADDED: Append the requirement to the published baseline's ## Requirements. Create a canonical main spec if it does not exist.

MODIFIED: Match on ### Requirement: <name> and replace its description and scenarios. Flag if the requirement does not exist in the canonical baseline.

REMOVED: Remove the matched requirement from the published baseline. Flag if it does not exist.

RENAMED: Match the old name and change its header to the new name. Flag if the new name collides with an existing requirement.

Step 3: Conflict Detection

Before executing, detect:

  • Same requirement modified by multiple unsynced changes → manual resolution
  • RENAMED target collides with existing requirement → manual resolution
  • MODIFIED/REMOVED targeting nonexistent requirements → flag

Step 4: Execute Merge

Apply changes. Do NOT delete delta specs — they remain for traceability. The root baseline must contain ## Requirements, never ## ADDED/MODIFIED/REMOVED/RENAMED Requirements headers. Unsafe legacy delta-only baselines that cannot be interpreted are rejected instead of guessed.

Step 5: Report

Output sync report table: Capability, ADDED/MODIFIED/REMOVED/RENAMED counts, Status (✓/⚠). Summary with totals and unresolved conflicts.

Guardrails

  • Do not delete delta spec files (historical record)
  • Do not auto-resolve conflicts across changes
  • Do not merge specs for unverified changes
  • Validate main spec consistency after each capability merge

Post-Sync

  1. Report results. If no conflicts → ready to archive. If conflicts → user resolves before archive.
  2. Change folder (including deltas) remains for traceability.
  3. ssf sync automatically writes a publication receipt to the active change state. Do not manually set spec_merged: that legacy marker is not closing evidence. The closing guard recomputes the delta and published-baseline hashes, so any later edit requires another sync.
  4. If the change has no delta sections, no publication receipt is required.

Exception Handling

  • Parse failures: Report file and section. Do not attempt partial merges.
  • No deltas: If change has no delta sections, report nothing to merge and exit cleanly.
  • User interruption: On resume, check for merge conflict markers before proceeding.

Version History

  • 1970fe7 Current 2026-07-30 20:20

Same Skill Collection

skills/bug-investigator/SKILL.md
skills/build-executor/SKILL.md
skills/code-reviewer/SKILL.md
skills/contract-builder/SKILL.md
skills/need-explorer/SKILL.md
skills/release-archivist/SKILL.md
skills/spec-writer/SKILL.md
skills/workflow-start/SKILL.md

Metadata

Files
0
Version
1970fe7
Hash
139afffa
Indexed
2026-07-30 20:20

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-31 03:16
浙ICP备14020137号-1 $방문자$