본문으로 건너뛰기
cccskills
무료GitHub에 공개

vibe-spec-sync

Keeps specification documents and code in agreement. Audit mode finds every divergence when an implementation is claimed complete; sync mode detects spec drift in staged changes and updates the spec after user approval, so each commit is a reconciled snapshot of spec, tests, and code. Use when an implementation is claimed complete against a spec, before committing changes that may drift from the spec, or after approving decisions that must flow back into it.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

vibe-spec-sync

Code changes. Specs don't update themselves. This skill closes the loop.

When to Use This Skill

  • Audit mode: implementation of a spec or design doc is claimed complete, after a major refactor, or when debugging behavior that may not match the spec
  • Sync mode: before committing, to detect spec drift from staged changes
  • Sync mode: after approving decisions (from vibe-decision-journal), to sync them back to the spec
  • Periodically, to confirm the spec still reflects reality

When NOT to Use This Skill

  • No spec exists (write one first, or use vibe-doc-quality-gate to bootstrap)
  • Prototype/spike code with no spec commitment
  • Spec is explicitly labeled as aspirational/future-state
  • Code was intentionally diverged, with the reasons documented

Modes

/vibe-spec-sync            # Sync mode: staged changes vs spec (default)
/vibe-spec-sync --audit    # Audit mode: full spec vs implementation, no edits

Prerequisites

The project must have:

  • A specification document (markdown) — configured in step 1
  • Implementation code that the spec describes
  • Optionally: a test suite with requirement traceability markers (# req:[ID])

Steps

Step 1: Locate Spec and Code (both modes)

  1. Find the spec — Look for:

    • spec.md, SPEC.md, *_spec.md in project root or docs/
    • Design docs in docs/design/, docs/architecture/
    • Ask user if ambiguous: "Which document is the authoritative spec?"
  2. Find the implementation — The code files the spec describes

  3. Find the decision log — docs/decisions/decisions.jsonl (from vibe-decision-journal)

Audit Mode (--audit)

Read-only. Nothing is edited.

  1. For each requirement or section in the spec, find the corresponding code and check whether it matches exactly.
  2. Record each divergence as a gap:
    • ID: GAP-[SECTION]-[NNN] (e.g., GAP-AUTH-001)
    • Type: Missing (spec says X, code has nothing) / Incorrect (spec says X, code does Y) / Extra (code does X, spec is silent)
    • Severity: Critical / High / Medium / Low
    • Evidence: the spec quote and the code file:line
  3. Report using the Audit Report format below. For 10+ gaps, hand them to vibe-gap-closure-loop. To accept an Extra or Incorrect item as the new intended behavior, run sync mode on it.

Sync mode (default) continues with Steps 2–5 below.

Step 2: Extract Drift from Staged Changes

Run git diff --cached and analyze what changed relative to the spec:

  1. Categorize each change:

    • Spec-aligned: Change matches what the spec says → no action
    • Spec-extending: Change adds behavior the spec doesn't mention → spec needs new section
    • Spec-modifying: Change alters behavior the spec describes differently → spec needs update
    • Spec-contradicting: Change violates what the spec explicitly forbids → flag for review
  2. For each drift item, produce:

    DRIFT-[NNN]:
      Type: extending | modifying | contradicting
      Spec section: "## [Header]"
      Current spec says: "[quoted text]"
      Code now does: "[description of new behavior]"
      Suggested spec update: "[proposed new text]"
    
  3. Present drift items to the user for a decision (use the harness's structured question tool if it has one; otherwise ask in plain text and wait):

    • Approve update — update the spec to match the code
    • Approve with edits — user refines the proposed spec text
    • Reject — the code is wrong; flag for fix (do NOT update spec)
    • Defer — not ready to decide; skip for now

Step 3: Apply Spec Updates

For each approved drift item:

  1. Find the target section in the spec:

    • Match by exact header first
    • Fall back to normalized match (case-insensitive, whitespace-collapsed)
    • If no matching section, determine correct placement by reading surrounding sections
  2. Apply the update:

    • For modifying: Replace the relevant paragraph/sentence within the section. Use search-and-replace with the old text and new text. Preserve surrounding content.
    • For extending: Add new content to the appropriate existing section, or create a new section if the content doesn't fit anywhere.
    • For contradicting (approved): Same as modifying — replace the contradicted text.
  3. Preserve spec structure:

    • Don't rewrite sections that weren't affected
    • Maintain existing formatting, header hierarchy, and ordering
    • Add a brief inline note if a section was significantly changed: <!-- Updated: [date] per DEC-[NNNN] -->
  4. Stage the spec changes: git add [spec file]

Step 4: Verify Consistency

After applying updates:

  1. Re-read the updated spec — verify it reads coherently (no dangling references, no contradictions between sections)

  2. Cross-check with decision log — ensure approved decisions from vibe-decision-journal are reflected in the spec

  3. Check test coverage — identify any updated spec sections that now lack test coverage:

    • Scan tests for # req:[ID] markers matching affected requirements
    • Report uncovered requirements: "Spec updated but no test covers [requirement]. Consider running vibe-adversarial-test-generation in spec-driven mode."

Step 5: Report

Output Format

Audit Report (audit mode)

Spec: [path] · Implementation: [paths] Gaps found: X (Y critical, Z high)

GAP IDTypeSeveritySpec saysCode does
GAP-AUTH-001MissingCritical"Tokens expire after 24h"No expiration logic (auth/token.go)

Top risks: [the 1–3 most dangerous gaps] Recommended fix order: [critical first]

Spec Sync Report (sync mode)

Spec: [path/to/spec.md] Staged Changes Analyzed: [N files, M insertions, K deletions]

#TypeSpec SectionActionStatus
1modifying## AuthenticationUpdated: "JWT tokens" → "JWT tokens with 1h expiry"Approved
2extending(new) ## Rate LimitingAdded new sectionApproved
3contradicting## Data RetentionFlagged: spec says "never delete", code adds TTLRejected — code needs fix
4extending## Error HandlingDeferred—

Spec Changes Applied

  • docs/spec.md: 2 sections updated, 1 section added
  • Linked decisions: DEC-0045, DEC-0046

Test Coverage After Sync

  • Requirements with tests: X/N
  • Newly uncovered: ## Rate Limiting (no tests yet)

Next Steps

  • Fix rejected drift item #3 (code contradicts spec on data retention)
  • Add tests for ## Rate Limiting section
  • Run /vibe-spec-sync --audit to verify full alignment

Integration with Other Skills

  • vibe-decision-journal: Decisions feed into spec sync. When decisions are approved, this skill updates the spec to reflect them.
  • vibe-gap-closure-loop: Closes large sets of audit-mode gaps in prioritized waves.
  • vibe-adversarial-test-generation (spec-driven mode): Generate tests for requirements that were updated or added during sync.
  • vibe-coverage-enforcer: Verify that test coverage still meets tier targets after spec-driven test additions.
  • vibe-pre-commit-audit: Complementary — that skill checks for secrets/debug code; this skill checks for spec alignment. Both belong in a pre-commit workflow.

Rules

  • NEVER update the spec without user approval. Every drift item must be presented and explicitly approved.
  • NEVER silently drop drift items. If a change affects the spec, report it — even if you think it's minor.
  • Preserve spec authority. The spec is the source of truth for intended behavior. If code contradicts spec and the user rejects the update, the code is wrong — not the spec.
  • Don't rewrite what you didn't change. Only modify spec sections affected by the current drift. Leave everything else untouched.
  • Link to decisions. When a spec update corresponds to a recorded decision, add the decision ID as an HTML comment: <!-- DEC-NNNN -->

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Validates completed work against defined acceptance criteria. Use after completing a task that has specific success criteria defined in issues, specs, or task descriptions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ash1794/vibe-engineering1642026년 10월 8일 업데이트

Generates edge case, failure mode, and spec-driven test cases. Covers boundary values, nil inputs, concurrency, resource exhaustion, malformed data, and requirement-linked traceability tests. Use after happy-path tests exist and before claiming coverage is complete, when requirements lack tests, or before a security review.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ash1794/vibe-engineering1642026년 10월 8일 업데이트

Catches shortcuts and reward hacking — weakening or deleting tests to make them pass, hard-coding expected outputs, silently dropping requirements, or claiming work is done without running it. Use before declaring a task complete and whenever a test or requirement feels like it's in the way.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ash1794/vibe-engineering1642026년 10월 8일 업데이트

Safely integrates commits from parallel agent branches using sequential cherry-pick. Use after parallel work completes in isolated branches or worktrees.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ash1794/vibe-engineering1642026년 10월 8일 업데이트

Audits tests for concurrency safety — race conditions, shared mock state, cleanup ordering. Use when writing tests that involve goroutines, async operations, or shared mutable state.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ash1794/vibe-engineering1642026년 10월 8일 업데이트

Enforces tiered test coverage standards with three dimensions — line coverage by tier, spec-to-test traceability, and spec-to-code implementation mapping. Use before claiming code is complete.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ash1794/vibe-engineering1642026년 10월 8일 업데이트

ash1794의 스킬 모두 보기

이 스킬의 문제 신고