skills/specops-spec-conformance/SKILL.md
Audit a SpecOps implementation spec against its source analysis spec to find requirements, policies, contracts, edge cases, error modes, invariants, defaults, side effects, or implementation steps that the implementation has dropped, weakened, contradicted, or silently changed — then patch the implementation spec to restore them. Use this skill whenever the user mentions auditing, comparing, conforming, reconciling, or checking an implementation spec against an analysis spec, finding gaps between two specs, ensuring an implementation spec preserves analysis behavior, or verifying spec derivation or traceability. Also trigger when the user describes "did the implementation spec lose anything from the analysis," "does the implementation match the analysis," "verify the implementation spec covers everything," or asks to confirm one spec is faithful to another. Run this before generating code from an implementation spec and after either spec is edited.
npx skillsauth add ryan-mahoney/ryan-llm-skills specops-spec-conformanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The SpecOps method derives an implementation spec from a verified analysis spec. The implementation spec is supposed to be a faithful translation: same behaviors, same contracts, same edge cases, same error modes — just expressed in terms of a target language and stack.
In practice, translation drops things. A behavioral contract gets weakened. An error mode is collapsed. An invariant is forgotten. A default value drifts. An open question gets silently resolved. The implementation spec adds something the analysis never asked for.
This skill runs a three-phase conformance audit on a pair of specs (analysis + implementation):
The output is a hardened implementation spec where every behavior in the analysis has a corresponding entry in the implementation, and any deliberate divergence is documented with rationale.
Confirm with the user before starting:
docs/specs/analysis/core/orchestrator.md).docs/specs/implementation/core/orchestrator.md).<implementation-name>.conformance.md next to the implementation spec.If only one spec path is given, look in docs/specs/analysis/ and docs/specs/implementation/ for matching filenames before asking.
Read both specs end-to-end. Then enumerate every concrete claim in the analysis spec and check whether the implementation spec reflects it. Work claim-by-claim, not section-by-section — the implementation spec may organize content differently, and a claim from analysis Section 4 might legitimately live in implementation Section 6.
Every analysis spec section produces traceable claims:
For each claim, look for:
Missing claim
Weakened claim
Contradicted claim
Silently resolved open question
Lost edge case or error mode
Type / schema drift
Default-value drift
Dropped dependency or side effect
Unjustified addition (reverse direction)
Write the gap list to <implementation-spec-name>.conformance.md next to the implementation spec. Format:
# Conformance Audit: <implementation spec name>
- **Implementation spec:** <path>
- **Analysis spec:** <path>
- **Audited:** <date>
## Gaps
### G1
- **Type:** Missing claim
- **Analysis section:** Behavioral Contracts
- **Analysis claim:** "Status writes are serialized through a single-writer queue to prevent torn reads."
- **Implementation reference:** Searched Concurrency, State, and Public Interface sections — no mention.
- **Question for subagent:** Is this serialization mentioned anywhere in the implementation spec? If not, propose where to add it.
### G2
- **Type:** Weakened claim
- **Analysis section:** Error Handling
- **Analysis claim:** "On transient network failure, retries up to 3 times with exponential backoff (100ms, 200ms, 400ms) before propagating."
- **Implementation reference:** Implementation says "retries with backoff."
- **Question for subagent:** Should the implementation restate the exact retry count and backoff schedule?
### G3
- **Type:** Unjustified addition
- **Implementation claim:** "All public functions return Result<T, E> discriminated unions."
- **Analysis equivalent:** Analysis describes errors as thrown, not returned.
- **Question for subagent:** Is this a legitimate TS-specific design (preserves observable behavior at module boundary) or does it change observable behavior?
...
The audit runs end-to-end without pausing for confirmation. Phase 1 produces the list; Phase 2 starts immediately. The user reviews the resulting report asynchronously.
Spawn one subagent per gap, all in the same turn.
You are auditing a single conformance gap between a SpecOps analysis spec and its derived implementation spec. Your job is to verify whether the gap is real, and if so, propose a precise patch to the implementation spec.
# The gap
- Type: <gap type>
- Analysis section: <section>
- Analysis claim: "<the claim from analysis>"
- Implementation reference: <where the claim should appear or was searched for>
- Question: <the specific question to answer>
# Documents to read
- Analysis spec: <full path>
- Implementation spec: <full path>
- (Optional) Legacy source files: <list> — read only if needed to break a tie between the two specs
# Your task
1. Read the relevant sections of both specs (don't skim — the claim may be paraphrased and live in a section you didn't expect).
2. Determine whether the gap is real:
- If the implementation already covers the claim somewhere — possibly in a different section than expected, possibly with different wording — report `gap_real: false` and point to the location.
- If the gap is real, propose a concrete patch.
3. For "Unjustified addition" gaps, decide which case applies:
- Legitimate translation concern (e.g., TS-specific type design that preserves observable behavior at module boundaries) — note this with justification, propose an `annotate` patch that documents the rationale in the implementation spec.
- Scope expansion (changes observable behavior beyond what the analysis specifies) — flag for review with a `defer` outcome.
4. Most gaps are mechanical — the implementation forgot or weakened something the analysis stated concretely. Resolve them with confident, specific patches. Defer only when resolution requires a real design decision that neither spec nor source can settle.
# Output format
Return a JSON object only, no commentary:
{
"gap_id": "<like G1>",
"gap_real": <true | false>,
"found_in_implementation": "<if gap_real is false: section + brief excerpt where the claim actually appears>",
"patch": {
"implementation_section": "<which section of the implementation spec to update>",
"operation": "<add | modify | annotate>",
"before": "<existing text being replaced; null for 'add'>",
"after": "<new or replacement text>",
"rationale": "<one sentence: why this patch closes the gap>"
},
"evidence": [
{"source": "<analysis | implementation | legacy_code>", "location": "<section name or file:lines>", "excerpt": "<relevant text>"}
],
"deferred": <true | false>,
"defer_reason": "<one of: requires_design_decision, contradiction_between_specs, missing_source_context — only if deferred>",
"defer_context": "<what someone needs to decide and the relevant tradeoffs — only if deferred>",
"suggested_resolver": "<who can decide — only if deferred>",
"suggested_next_action": "<concrete next step — only if deferred>"
}
When all subagents return:
Sort results into three buckets.
gap_real: false — false positive. The claim was already covered. Note in the audit report for traceability; no patch.gap_real: true, deferred: false — apply the patch.deferred: true — log to a "Deferred Design Decisions" section of the implementation spec with full context. The audit continues; deferrals don't block.Apply patches. For each real, non-deferred gap:
add — insert the new content into the specified implementation section.modify — replace before with after in the specified section.annotate — add a justification note next to existing content (used for legitimate "Unjustified addition" cases where TS-specific design preserves observable behavior).Preserve voice and structure. Don't rewrite whole sections. Apply minimal in-place edits that match the implementation spec's existing style.
Log deferred items in the implementation spec under a "Deferred Design Decisions" heading. Use this format so anyone picking up the item later has full context:
### DD-<id>: <short title>
- **Source claim:** <analysis section + the claim>
- **Why deferred:** <one of: requires_design_decision, contradiction_between_specs, missing_source_context>
- **Context:** <what's missing, contested, or needs to be decided — including relevant tradeoffs>
- **Suggested resolver:** <e.g., "domain expert on retry policy" / "team that owns the calling code">
- **Suggested next action:** <concrete next step>
Append an audit log at the end of the implementation spec:
---
## Audit History
### <YYYY-MM-DD> — Conformance audit against analysis spec
- Analysis spec audited against: <path>
- Gaps identified: <count>
- Resolved with patches: <count>
- False positives (already covered elsewhere): <count>
- Deferred (need design decision): <count>
- Audit report: `<implementation-spec-name>.conformance.md`
- Deferred items: see Deferred Design Decisions section for DD-<id> entries
Save the conformance report alongside the implementation spec. It records every gap, every subagent verdict, and the evidence — useful for reviewers and for diffing across audit passes.
Summarize for the user. Show:
Result<T, E> instead of thrown errors), the patch must spell out why this preserves observable behavior — not silently assert it does.User: "Audit docs/specs/implementation/core/orchestrator.md against docs/specs/analysis/core/orchestrator.md."
orchestrator.conformance.md with all 22.add operations (missing error modes, missing logging), 8 modify operations (weakened contracts restored to concrete), 2 annotate operations (justifying TS-specific type design). Add 2 entries to a Deferred Design Decisions section. Append the audit log. Save the conformance report.This skill is a pre-implementation gate. The full verification chain looks like:
Steps 2 and 5 are spec-level verification; step 7 is code-level verification. Each catches a different class of drift, and they compound.
testing
This skill should be used when the user asks to "run the spec", "implement the spec", or "execute the spec". Implements every step in a SpecOps implementation spec by delegating each step (or logical group of adjacent steps) to a sequential subagent, conventional-committing each one independently, and — when `roborev` is on the path — running `roborev check` on every commit and `roborev fix` (with spec context, so the fix cannot silently drift the implementation away from the spec) on any commit that fails.
development
Exhaustively audit a top-level UI implementation component against an HTML prototype and produce a grouped markdown checklist of corrections. Use when a user asks for UI parity review, visual QA, design implementation audit, pixel-level drift detection, or behavior/style mismatch analysis between prototype HTML and shipped component code.
development
Audit a set of SpecOps analysis specs for cross-spec coherence — establish a dependency-ordered implementation sequence, then verify pairwise integration contracts at module boundaries plus three cross-cutting consistency dimensions (shared data models, side-effect ownership, terminology) — and patch the affected specs to resolve gaps. Use this skill whenever the user mentions cross-spec consistency, integration gaps between specs, conflicts between specs, duplicate work across specs, implementation order, dependency order for migration, building an implementation-order checklist, ensuring specs interoperate, terminology drift across specs, or shared data model conflicts. Also trigger when the user describes "do my specs agree with each other," "what order should I implement these in," "find inconsistencies across all my specs," or asks to audit a folder of analysis specs as a set rather than individually. Run this once after generating a full set of analysis specs, before deriving implementation specs.
development
This skill should be used when the user asks to create a refactor-focused SpecOps plan for a specific source folder and explicit refactor goal.