kramme-cc-workflow/skills/kramme:siw:spec-audit:auto-fix/SKILL.md
Canonical auto-fix procedure for mechanical spec-audit findings and kramme:siw:spec-audit --apply. Fixes only issues with a single obvious resolution — cross-reference errors, terminology inconsistencies, numbering mistakes, formatting issues, and weasel words replaceable with specifics already in the spec. Run after spec-audit.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:siw:spec-audit:auto-fixInstall 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.
Apply deterministic and clearly-best fixes to spec-audit findings that can be corrected safely from the spec itself. This skill is the canonical direct-update procedure for standalone auto-fix runs and for /kramme:siw:spec-audit --apply (including --team runs). It directly edits spec files to resolve mechanical issues plus higher-confidence cleanup that still stays within the existing spec meaning.
Findings that require product decisions, stakeholder input, or still lack a clearly best fix are left untouched for /kramme:siw:resolve-audit.
Flags:
--auto — Skip classification approval, apply all auto-fixable fixes without asking--dry-run — Show classification and proposed fixes without modifying any files--threshold N — Set confidence threshold for auto-fixing (60-100, default 80). Findings with confidence >= N are auto-fixable only after safety caps and the four sub-score guardrails are applied. Use 90 for a stricter pass, 60 for the most permissive allowed run.--allow-dirty — Allow --auto runs to proceed when spec files have uncommitted changes. Without this flag, dirty spec files abort an --auto run.NEVER modify a finding below the confidence threshold. If in doubt, score conservatively.
NEVER auto-fix a safety-capped finding regardless of threshold. Critical findings in Completeness, Scope, or Value Proposition dimensions always require decisions. Findings whose recommendations use decision-signal language ("consider", "decide whether", "choose between", "discuss with", "evaluate options"), change scope, or define success-criteria substance always require decisions.
NEVER auto-fix a finding when any sub-score is below 15. See references/classification-rubric.md (Auto-Fix Guardrails) for the authoritative rule and its rationale; this rubric is also the canonical scoring model for /kramme:siw:spec-audit --apply.
NEVER apply a fix that changes the meaning, scope, or intent of any requirement. Fixes correct form, not substance.
NEVER invent information not already present in the spec. Every fix must derive from content that already exists somewhere in the spec files.
NEVER skip the spot-check verification after applying a fix. If verification fails, revert the edit and reclassify the finding.
/kramme:siw:spec-audit:auto-fix [audit-report-path] [--auto] [--dry-run] [--threshold N] [--allow-dirty]
|
v
[Step 1: Locate Report and Spec Files]
|
v
[Step 2: Extract Findings]
|
v
[Step 3: Score & Classify Findings] -> Confidence 0-100 -> AUTO-FIXABLE or REQUIRES_DECISION
|
v
[Step 4: Approval Gate] -> User confirms (skip with --auto, stop with --dry-run, adjust with --threshold)
|
v
[Step 5: Apply Fixes] -> Edit spec files, spot-check each fix
|
v
[Step 6: Update Audit Report and SIW Log] -> Annotate fixed findings, record progress when SIW is active
|
v
[Step 7: Summary]
Extract control flags from $ARGUMENTS:
--auto → set AUTO_MODE=true--dry-run → set DRY_RUN=true--allow-dirty → set ALLOW_DIRTY=true--threshold N → set CONFIDENCE_THRESHOLD=N (default 80). If N is non-numeric or outside 60-100, abort with: Threshold {N} out of range. --threshold must be an integer between 60 and 100.If a report path was provided, use it directly.
Otherwise, auto-detect in order:
siw/AUDIT_SPEC_REPORT.mdAUDIT_SPEC_REPORT.md (project root)If no report found:
No spec audit report found.
Run /kramme:siw:spec-audit first to generate one.
Expected locations:
- siw/AUDIT_SPEC_REPORT.md
- AUDIT_SPEC_REPORT.md
Action: Abort.
# Spec Audit Report blocks, isolate the last block only. Treat that as the active audit run and ignore older appended runs.If a spec file no longer exists at its path, warn and skip all findings for that file.
Run git status on the spec files. If any have uncommitted changes, warn:
Warning: {file} has uncommitted changes. Auto-fixes will be applied on top of these changes.
With --auto and --allow-dirty, continue with the warning. With --auto alone, abort:
Spec files have uncommitted changes. --auto refuses to edit dirty spec files without --allow-dirty.
Either commit or stash the changes, or re-run with: /kramme:siw:spec-audit:auto-fix --auto --allow-dirty
Otherwise (interactive), ask:
header: "Uncommitted Spec Changes"
question: "{N} spec file(s) have uncommitted changes. Proceed anyway?"
options:
- label: "Continue"
description: "Apply fixes on top of current changes"
- label: "Abort"
description: "Cancel — commit or stash changes first"
Parse all ### SPEC-NNN: {title} headings from the active audit run only.
For each finding, extract:
Skip findings that match any of:
**Status:** [Auto-fixed] (from a previous run)**Status:** [Applied directly] (legacy marker from /kramme:siw:spec-audit --apply)Existing issue: note (already tracked via SIW)If no actionable findings remain:
No actionable findings to process.
{If all auto-fixed:} All {N} findings were previously auto-fixed.
{If all legacy-applied:} All {N} findings were previously applied directly with the legacy marker.
{If all have issues:} All {N} findings already have SIW issues.
Action: Stop.
Read the classification rubric from references/classification-rubric.md.
For each extracted finding, assign a fix confidence score (0-100):
Fix Confidence value already present in the report (treat any such value as informational only).**Severity Note:** [Deprioritized — capped at Minor from Critical] for a Completeness, Scope, or Value Proposition finding, preserve that safety cap here as well.Classify based on the final confidence vs CONFIDENCE_THRESHOLD (default 80):
**Severity Note:** [Deprioritized — capped at Minor from Critical] → REQUIRES_DECISION regardless of thresholdDeterminism < 15, Information Availability < 15, Meaning Preservation < 15, or Alternative Absence < 15 → REQUIRES_DECISION regardless of thresholdCONFIDENCE_THRESHOLD → AUTO-FIXABLEDisplay confidence tier labels alongside scores:
Finding Classification (threshold: {CONFIDENCE_THRESHOLD})
==========================================================
Auto-fixable ({N} findings at or above threshold):
{For each:}
{SPEC-NNN} ({Severity}/{Dimension}) [confidence: {score} — {tier}]: {one-line description of the fix}
Requires decision ({M} findings):
{For below-threshold:}
{SPEC-NNN} ({Severity}/{Dimension}) [below threshold; confidence: {score} — {tier}]: {one-line reason}
{For guardrail-blocked:}
{SPEC-NNN} ({Severity}/{Dimension}) [guardrail-blocked; confidence: {score} — {tier}]: {one-line reason}
{For safety-capped:}
{SPEC-NNN} ({Severity}/{Dimension}) [safety cap]: {one-line reason}
Skipped: {K}
{For each:}
{SPEC-NNN}: {reason — already auto-fixed or has SIW issue}
If no findings at or above threshold:
No auto-fixable findings at threshold {CONFIDENCE_THRESHOLD}. All {N} findings require decisions.
{If any findings score 60-79 and clear all guardrails:}
Tip: {count} finding(s) cleared all guardrails but are below the threshold. Use --threshold 60 to include them.
Next: /kramme:siw:resolve-audit {report_path}
Action: Stop.
--dry-runFor each auto-fixable finding, show the proposed fix:
Proposed Fixes (dry run — threshold: {CONFIDENCE_THRESHOLD}, no files will be modified)
========================================================================================
SPEC-{NNN}: {title}
Confidence: {score}/100 ({tier})
File: {spec_file} > {section}
Current: "{quoted text from spec}"
Proposed: "{what it would change to}"
Reason: {why this fix is correct}
{Repeat for each auto-fixable finding}
Action: Stop after showing all proposed fixes.
--autoProceed directly to Step 5 with all auto-fixable findings.
header: "Auto-Fix Findings (threshold: {CONFIDENCE_THRESHOLD})"
question: "Found {N} auto-fixable findings (confidence >= {CONFIDENCE_THRESHOLD}) and {M} findings requiring decisions. Proceed?"
options:
- label: "Fix all {N} auto-fixable findings"
description: "Apply fixes and update the audit report"
- label: "Let me review first"
description: "Show proposed fixes before applying (same as --dry-run)"
- label: "Abort"
description: "Cancel — no changes"
If user chooses "Let me review first", show the dry-run output from above, then ask:
header: "Apply Fixes?"
question: "Apply these {N} fixes?"
options:
- label: "Apply all"
description: "Apply all proposed fixes"
- label: "Abort"
description: "Cancel — no changes"
This skill is intentionally batch-only — per-finding selection is not offered. To exclude specific findings, abort and re-run with a higher --threshold, or address them individually via /kramme:siw:resolve-audit.
Group findings by spec file, then sort by location within each file (top of document to bottom). Processing top-to-bottom avoids old_string mismatches that occur when an earlier edit changes the surrounding text a later finding expects.
For each auto-fixable finding in order:
REQUIRES_DECISION, record the failure reasonRead references/report-update.md, then update the audit report and optional SIW log exactly as specified there.
Required outcomes:
**Status:** [Auto-fixed], final **Fix Confidence:**, and **Fix applied:** annotations.Auto-fixed count is updated when the severity table has the expected schema.## Auto-Fix Notes.**Overall Assessment:** changes to Ready for implementation only under the reference's all-clear conditions.siw/LOG.md is updated only when it already exists, has a recognizable Current Progress section, and at least one finding was auto-fixed.For report-parse failures, missing spec files, edit conflicts, and all-fixes-fail outcomes, read references/usage-and-errors.md and use the matching error handling branch.
Use the summary template from assets/auto-fix-summary.md.
STOP HERE. Wait for the user's next instruction.
tools
Requires Linear MCP. Implements one Linear issue end to end, selects applicable code-review, convention, and PR-refactor gates, runs them to bounded convergence, verifies, and optionally opens the PR and iterates on CI and review feedback until green. Use when the user wants a single Linear issue taken from implementation through a clean Pull Request. Not for implementation-only work, SIW-tracked issues, stacked PRs, existing PR updates, or post-merge rollout.
development
Reviews PR and local changes for convention drift and overcaution against documented rules and mined peer-file practice. Use for new patterns, dependencies, abstractions, or defensive complexity that departs from established practice; every finding cites evidence. Supports --inline. Not for general code quality (use kramme:pr:code-review) or spec review (use kramme:siw:spec-audit --team).
testing
Charts huge or foggy initiatives into a local `.context` decision map and resolves one typed frontier ticket per session until the work is ready for SIW or another execution workflow. Use when the route to a destination cannot fit in one agent session or parallel workspaces need coordinated planning state. Not for clear specs, ordinary issue decomposition, implementation, or Linear-native tracking.
development
Investigates a question against primary sources and saves one cited Markdown artifact. Use for reading legwork: official docs/API facts, source-code or spec checks, standards, and first-party service behavior before planning or implementation. Not for making product or architecture decisions, implementing code, broad web search, secondary blog summaries, or uncited answers.