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.