reverse-spec-diff

Compare a .spec.md against source code and report specification drift.

15|5|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/connor-git-yaml/reverse-spec --skill reverse-spec-diff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reverse-spec-diff
Source: https://github.com/connor-git-yaml/reverse-spec/tree/main/skills/reverse-spec-diff
Command: npx skills add https://github.com/connor-git-yaml/reverse-spec --skill reverse-spec-diff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill detects and reports drift between a .spec.md and its corresponding source code, helping teams verify that documentation stays aligned with implemented behavior after changes or refactoring.

Core Features & Use Cases

  • Compare a spec against current code to identify missing, extra, or changed interfaces, rules, and constraints.
  • Load and parse both the spec and the codebase, compute a precise diff, and generate a drift report for review.
  • Use after code updates or during refactoring to keep specs current and consistent with code behavior.

Quick Start

Compare the specified .spec.md with its current source to surface drift and mismatches.

Frequently Asked Questions about reverse-spec-diff

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect specification drift between a spec file and my source code?

To detect specification drift, compare your .spec.md file against the current codebase to identify missing, extra, or changed interfaces. This process parses both the spec and code, computes a precise diff, and generates a structured drift report for review.

What is spec drift and how do I check if my code still matches it after refactoring?

Spec drift occurs when implemented behavior diverges from documented specifications. After refactoring, you can check alignment by loading and parsing both the .spec.md and the modified codebase, then computing added, removed, or modified items to surface mismatches.

How do I generate a drift report to verify documentation stays aligned with code behavior?

You can generate a drift report by parsing the specification and analyzing the current codebase to compute a precise diff. This structured output highlights added, removed, and modified items, helping you verify documentation alignment with implemented behavior.

Can I use this spec verification approach to find missing interfaces across multiple modules?

Yes, this spec verification approach detects missing, extra, or changed interfaces across modules. It analyzes the current codebase against the .spec.md file to compute a structured diff, verifying the spec stays in sync with implemented behavior.

What is the best way to keep specifications current and consistent with code during updates?

The best way to keep specifications current is to run a spec diff after code updates or during refactoring. This compares the .spec.md against the source code, computes added, removed, or modified items, and outputs a drift report for review.

Does this code review drift detection require any specific dependencies or environment setup?

No specific dependencies or environment setup are required for this code review drift detection. It operates by loading and parsing the .spec.md file and the current codebase directly to compute the diff and output the drift report.