30eggis

spec-mirror

by @30eggis in Tools
0
0
# Install this skill:
npx skills add 30eggis/claude-frontend-skills --skill "spec-mirror"

Install specific skill from multi-skill repository

# Description

|

# SKILL.md


name: spec-mirror
description: |
Compare original Spec against actual implementation to verify spec compliance.
Integrates with hack-2-spec skill to reverse-engineer Spec from codebase and compare.
Use when reviewing implementation for over-spec features or missing requirements.
permissionMode: bypassPermissions


Spec Mirror

Compare original Spec against implementation to identify over-spec/missing items.

Workflow

[Original Spec] + [Codebase]
       ↓
[Generate reverse-engineered Spec via hack-2-spec]
       ↓
[Ask language preference]
       ↓
[Compare REQ items]
       ↓
[Generate report]

Step 1: Confirm Inputs

Gather from user:

Input Description Example
Original Spec Requirements doc written before development docs/SPEC.md
Codebase Implemented project path ./my-project

Step 2: Generate Reverse-Engineered Spec

Use hack-2-spec skill to analyze codebase:

  1. Analyze codebase using hack-2-spec's "Code Analysis" method
  2. Generate reverse-engineered Spec (temp path: docs/_mirror/SPEC.md)
  3. Extract requirements in same REQ-### format as original Spec

Step 3: Ask Language Preference

Before generating report, ask user which language to use:

Which language would you like the report to be written in?
- English
- Korean (ν•œκ΅­μ–΄)
- Other (please specify)

Store the preference and apply to the generated report.

Step 4: Compare Specs

Compare REQ items between original and reverse-engineered Spec:

Comparison Criteria

Category Definition Identification Verdict
Match Original REQ properly implemented Same/similar REQ exists in reverse Spec PASS
Missing Original REQ not implemented No corresponding REQ in reverse Spec FAIL
Over-spec Feature implemented without Spec REQ exists only in reverse Spec PASS (ν—ˆμš©)

Over-spec ν—ˆμš© μ •μ±…

μ€‘μš”: Over-spec ν•­λͺ©μ€ FAIL이 μ•„λ‹™λ‹ˆλ‹€.
- Spec에 μ—†μ§€λ§Œ κ΅¬ν˜„λœ μΆ”κ°€ κΈ°λŠ₯은 ν—ˆμš©λ©λ‹ˆλ‹€
- Missing ν•­λͺ©λ§Œμ΄ μ‹€νŒ¨ μ‘°κ±΄μž…λ‹ˆλ‹€
- Over-spec은 정보 제곡 λͺ©μ μœΌλ‘œ λ¦¬ν¬νŠΈμ— ν¬ν•¨λ©λ‹ˆλ‹€

Matching Method

  1. Direct match by REQ ID if available
  2. Semantic matching by feature description if no ID
  3. Mark as "Review needed" if low confidence

Step 5: Generate Report

Use assets/templates/MIRROR_REPORT_TEMPLATE.md template.

Report structure:
- Summary (count of match/missing/over-spec)
- Detailed analysis (each item with explanation)
- Verdict (PASS if missing_count == 0, regardless of over-spec count)
- Checklist (action items for missing items only)

Output: docs/MIRROR_REPORT.md

Verdict Rules

IF missing_count == 0:
  verdict = "PASS"
  message = "λͺ¨λ“  Spec이 κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. (over-spec {N}건 ν—ˆμš©)"
ELSE:
  verdict = "FAIL"
  message = "λˆ„λ½λœ μš”κ΅¬μ‚¬ν•­ {N}건이 μžˆμŠ΅λ‹ˆλ‹€."

Usage Example

User: Review implementation against Spec
Assistant: Please provide the original Spec path and codebase path.

User: Spec is docs/SPEC.md, code is current folder
Assistant: Which language for the report? [English/Korean/Other]

User: Korean
Assistant: [reverse-engineer via hack-2-spec] β†’ [compare] β†’ [generate report in Korean]

Integration with spec-it-execute

When called from spec-it-execute Phase 5:

  1. Input: spec-folder path (from _state.specSource)
  2. Action: Compare implementation against original spec
  3. Output: MIRROR_REPORT with match/missing/over-spec counts
  4. Return: { matchCount, missingCount, overCount, verdict }
# spec-it-execute Phase 5 호좜 νŒ¨ν„΄
Skill(spec-mirror {spec-folder} --codebase .)

# κ²°κ³Ό 확인
IF missingCount > 0:
  β†’ λˆ„λ½ ν•­λͺ© 재개발 β†’ Phase 4 QA β†’ Phase 5 μž¬κ²€μ¦
ELSE:
  β†’ Phase 6 μ§„ν–‰ (over-spec은 ν—ˆμš©)

Templates

  • assets/templates/MIRROR_REPORT_TEMPLATE.md - Comparison report template

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.