spec-fix

Fixes functional and visual implementation gaps detected by spec-check gap reports.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/julien-m/livespec --skill spec-fix-julien-m
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-fix
Source: https://github.com/julien-m/livespec/tree/main/.agent-sync/skills/spec-fix
Command: npx skills add https://github.com/julien-m/livespec --skill spec-fix-julien-m

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After a spec-to-code audit finds gaps (missing features, partial implementations, visual drift from mockups), developers must manually reconcile code with specifications. This Skill automates that correction loop by loading the full project context, generating a targeted fix plan, executing fixes, and verifying results with tests and visual gates. ## Core Features & Use Cases - Gap-driven fixes: Loads the latest gap report from .specs/features/NNN/checks/, filters by flags (--visual, --functional, --fr, --ac), and fixes functional and visual divergences with a retry loop (up to 3 iterations). - Visual correction pipeline: Compares Playwright baselines against design mockups via pixel diff plus LLM visual reasoning, enforces theme.css tokens, and certifies results through a non-skippable visual gate. - Conventions debt mode: --conventions burns down conventions debt worst-first, requiring strictly decreasing debt and zero new violations. - Use Case: After /spec-check reports 3 functional gaps and 2 visual divergences on a notifications feature, run /spec-fix 004-notifications to automatically patch the code, re-capture baselines, and update implementation.md and changelogs. ## Quick Start Ask the AI to run /spec-fix for your feature name to close all gaps found in the latest spec-check report.

Frequently Asked Questions about spec-fix

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

FAQPage Schema
How do I fix gaps found by a spec-to-code audit?

Run /spec-fix with a feature name to load the latest gap report from the feature's checks directory, generate a fix plan, and execute corrections with a retry loop. Use --dry-run first to preview the plan without modifying code.

How to fix visual drift between code and design mockups?

Use /spec-fix with the --visual flag to target only drift and divergence gaps. It compares Playwright baselines against mockup PNGs via pixel diff and LLM visual reasoning, then adjusts CSS and layout to match the design.

Can I fix only one specific requirement or acceptance criterion?

Yes, use --fr FR-NNN to fix a specific functional requirement and its dependent ACs, or --ac AC-NNN for a single acceptance criterion. Filtered fixes certify only the selected scope and never claim full feature acceptance.

What happens if the fix introduces a visual regression?

The iteration loop exits early if any visual diff increases between iterations, reverts that fix, and proceeds with partial results. The visual gate must return exit code 0 before the fix is accepted.

Why does spec-fix refuse to run without a gap report?

A fresh gap report from the same calendar day is required; if missing or stale, an executable fix spawns a /spec-check sub-agent to generate one. In dry-run or audit mode it blocks instead and tells you to run /spec-check first.

When should I use spec-fix versus spec-implement?

Use spec-fix when a feature is already implemented but has gaps against its spec. If the feature status is Draft or Planned with no implementation, spec-fix exits and directs you to /spec-implement instead.