kramme-cc-workflow/skills/kramme:siw:implementation-audit/SKILL.md
Exhaustively audit codebase implementation against specification. Detects spec divergences, undocumented implementation extensions, contract violations, and spec drift. Supports inline report output and an optional team mode for multi-agent cross-validation.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:siw:implementation-auditInstall 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.
Exhaustively compare the codebase implementation against specification documents.
/kramme:siw:spec-audit to audit the spec itself for ambiguity, gaps, or contradictions before comparing against code./kramme:siw:product-audit to evaluate whether the spec describes the right product./kramme:pr:code-review for code quality on a specific diff; this skill compares the full implementation against the full spec.Standard mode assumes a host harness with a research sub-agent primitive (Claude Code: Task tool with subagent_type=Explore; Codex: equivalent task sub-agent). Interactive YAML prompt blocks shown in later steps map to the host's interactive question mechanism. Team mode (--team) additionally requires multi-agent support and is gated explicitly in references/team-mode.md.
Every audit must detect and report both:
A report is not complete unless it includes:
IMPORTANT: This workflow is adversarial and exhaustive. Do not return early. Do not conclude anything is implemented without reading code. Grep hits are not implementation evidence.
If $ARGUMENTS contains --team, remove that flag, read references/team-mode.md, and follow that workflow instead of the standard workflow below. Pass the remaining arguments through as the team-mode arguments.
$ARGUMENTS contains the spec file path(s), keyword, and optional flags.
Extract control flags first:
$ARGUMENTS contains --auto, set AUTO_MODE=true and remove the flag before processing remaining arguments.$ARGUMENTS contains --inline, set INLINE_MODE=true and remove the flag before processing remaining arguments.$ARGUMENTS contains --team, use Team Mode and remove the flag before processing remaining arguments.Extract --model flag next (Claude Code only — ignored on other platforms):
$ARGUMENTS contains --model opus, --model sonnet, or --model haiku, extract it and store as agent_model.opus$ARGUMENTS before processing remaining arguments.--auto means:
Detection rules for remaining arguments:
/ or ends in .md, .txtsiw: Explicitly requests auto-detection$ARGUMENTS as shell-style arguments so quoted paths stay intact.
ls {path}find {path} -maxdepth 2 -type f -name "*.md" 2> /dev/null
spec_files.If no valid files remain after verification:
Error: No valid specification files found at the provided path(s).
Provided: {arguments}
Action: Abort.
siw KeywordAuto-detect spec files from the siw/ directory:
Check if siw/ exists:
ls siw/ 2> /dev/null
Find spec files (exclude workflow files):
siw/*.mdLOG.md, OPEN_ISSUES_OVERVIEW.md, SPEC_STRENGTHENING_PLAN.md, DISCOVERY_BRIEF.md, AUDIT_.*\.mdFind supporting specs:
siw/supporting-specs/*.mdCheck for linked external specs:
siw/*.md and siw/supporting-specs/*.md candidates).Use all found spec files by default. Only ask the user to select if there are files that look unrelated to each other (for example, specs for entirely different features). Do NOT ask when the files are clearly parts of the same specification (main spec + supporting specs).
Store files as spec_files.
Error: No specification files found.
Expected locations:
- siw/*.md (SIW spec files)
- siw/supporting-specs/*.md (supporting specifications)
Or provide file path(s) directly:
/kramme:siw:implementation-audit path/to/spec.md
/kramme:siw:implementation-audit docs/spec1.md docs/spec2.md
To initialize a workflow with a spec, run /kramme:siw:init
Action: Abort.
Read every file in spec_files fully and extract a requirements checklist.
Read each spec file completely. Do not skim. Understand the full picture before extracting requirements.
Everything in the spec is a requirement — names, structures, behaviors, contracts, constraints. If the spec describes it, the code must match it. Extract checkable items across all of these areas:
For each item, capture:
REQ-001)MUST, ONLY, NEVER (or synonyms)For each requirement, detect strict operators:
MUST/REQUIRED/SHALL -> MUSTONLY/EXCLUSIVELY -> ONLYNEVER/MUST NOT/FORBIDDEN -> NEVERAny requirement with at least one strict marker requires explicit negative/permissiveness testing in Pass A.
When parsing specs:
siw/OPEN_ISSUES_OVERVIEW.md for phase status if available).Spec Analysis Complete
Sources:
- {spec_file_1}
- {spec_file_2}
Requirements Extracted: {total}
Spec Sections: {section_count}
Strict requirements (MUST/ONLY/NEVER): {strict_total}
Key search terms identified: {count} unique names/identifiers
If no extractable requirements found:
Warning: Could not extract structured requirements from {file}.
The file may need clearer acceptance criteria, named entities, or explicit contracts.
If AUTO_MODE=true, choose Attempt best-effort scan automatically.
Otherwise use AskUserQuestion:
header: "No Requirements Found"
question: "Could not extract structured requirements. How should I proceed?"
options:
- label: "Attempt best-effort scan"
description: "Search for any named terms found in the spec, even without clear requirement structure"
- label: "Abort"
description: "Cancel the audit"
Group requirements by spec file or major spec section (not by abstract domain). Each group will be assigned to an Explore agent that receives the full context of that spec section.
For each group of requirements, identify:
**/*controller*, **/*model*)This information will be passed to Explore agents to direct their search.
Create a section-level matrix row for every spec section that contributed requirements:
| Section ID | Source | Req Count | Strict (M/O/N) | Pass A Checked | Pass B Checked | Divergences | Extensions | Alignments | Evidence Refs | Status | | --- | --- | --: | --: | --: | --: | --: | --: | --: | --- | --- |
Initialize Status = PENDING.
Coverage is complete only when each row has:
CRITICAL: A grep hit is not evidence. Read and reason about actual behavior.
For each group from Step 3, launch an Explore agent using the Task tool (subagent_type=Explore, model={agent_model}).
Default model: opus. Override with --model sonnet or --model haiku for faster/cheaper runs.
All agents run in parallel — launch them in a single message with multiple Task tool calls.
Read the Pass A agent prompt template from references/pass-a-conformance.md. Each agent receives that prompt structure, populated with its assigned spec section and requirements checklist.
Agents must return:
MISSING requirementPass B is mandatory even if Pass A appears mostly compliant.
Launch Explore agents in parallel to hunt for undocumented implementation behavior beyond spec boundaries.
Read the Pass B agent prompt template from references/pass-b-extension.md. Each agent receives that prompt structure, populated with its assigned spec context.
Treat low-findings outcomes on large specs as suspicious:
requirements >= 30 or sections >= 6.divergences + extensions < max(3, ceil(requirements * 0.05)).If suspiciously clean, auto-run Pass B2 before finalizing:
MUST/ONLY/NEVER), role checks, config flags, and data-access boundaries.If Pass B2 cannot run, mark the audit BLOCKED and do not produce a final report.
Aggregate Pass A and Pass B/B2 findings by requirement and section.
A conflict exists when:
For each conflict:
If any conflict remains unresolved, audit is BLOCKED and no final report may be produced.
Every Divergence, Extension, and Verified Alignment must include:
Findings missing any of the above are invalid until evidence is completed.
After findings are stable (post tie-break, evidence verified), join them against existing SIW issues:
siw/issues/ does not exist, populate the report's Existing-Issue Cross-Reference section with None and skip the rest of this step.siw/issues/*.md and read each issue's title and Related / Spec requirement / Finding lines.REQ-{id} or finding ID (DIV-{n} / EXT-{n}), orHygiene constraints (Hard):
Complete the section matrix for every audited section with:
If the matrix is incomplete, audit is BLOCKED and no final report may be produced.
Generate the report using the schema from assets/report-schema.md. All sections in the schema are mandatory. If a section has zero entries, include the section with None.
Read the report output procedure from references/report-and-issue-output.md.
Read the SIW issue creation procedure from references/report-and-issue-output.md.
Use the summary template from assets/audit-complete-summary.md.
STOP HERE. Wait for the user's next instruction.
siw/.development
One-way migration of a local SIW project into Linear. Creates one Linear project, migrates the main spec and supporting specs as Linear Documents, creates milestones from SIW phases and issues from SIW issues, then prompts to retire the local siw/ files via /kramme:siw:remove. Linear becomes the source of truth; this is not a two-way sync and keeps no rerun mapping, so re-running can duplicate issues. Use when moving a planned SIW initiative into Linear for good. Not for implementing issues, defining new SIW issues, or generating an issue breakdown.
development
Compare an existing PR's title and body against the actual branch diff and report drift — false claims, missing major changes, stale scope, missing risk callouts. Use after pushing changes to a branch with an open PR, or before requesting review. Read-only by default; add --fix to delegate to kramme:pr:generate-description for an updated description. Complements kramme:pr:code-review (which checks description accuracy as one signal among many code-quality checks) by being a fast, focused, single-purpose check that runs in seconds.
tools
Reviews plugin skills for focused scope, progressive disclosure, portability, safety, retry behavior, and documentation quality. Use when auditing a SKILL.md, skill directory, or proposed skill text against skill-authoring standards. Not for creating new skills, editing skills, or reviewing ordinary application code.
tools
Reviews recent agent session transcripts to find repeated manual workflows or repeated user asks, then proposes and optionally scaffolds only useful new skills or custom subagents. Use when the user asks to inspect recent sessions, find automation opportunities, or create reusable workflows from repeated work. Not for summarizing one session, general retrospectives, or codebase refactoring.