kramme-cc-workflow/skills/kramme:siw:spec-audit:auto-fix/SKILL.md
Auto-fix mechanical spec-audit findings that have a single obvious correct 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 runs after /kramme:siw:spec-audit (including --team runs) and 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.
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] -> Annotate fixed findings
|
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)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 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 reasonFor each successfully fixed finding, add annotations to its report entry:
After the **Severity:** line, add:
**Status:** [Auto-fixed]
Then handle Fix Confidence as follows:
**Fix Confidence:**, replace that line with the final score and tier from the auto-fix pass.**Fix Confidence:** (legacy report), insert:**Fix Confidence:** {score}/100 ({tier})
After the confidence line, add:
**Fix applied:** {one-line description of the change}
The audit report's Summary section contains a fixed-schema severity table:
| Severity | Count |
| --------- | ----------- |
| Critical | {count} |
| Major | {count} |
| Minor | {count} |
| **Total** | **{total}** |
Insert a new Auto-fixed row immediately before the **Total** row so it slots into the existing two-column schema:
| Auto-fixed | {count} |
Leave the Critical / Major / Minor counts unchanged — the per-finding **Status:** [Auto-fixed] annotation from Step 6.1 carries the resolution state.
If the table schema does not match the expected shape (e.g., extra columns, missing Total row), skip this step and log: Severity table schema unrecognized — per-finding annotations applied; summary table left unchanged.
If any findings failed verification and were reclassified, add a section at the end of the report:
## Auto-Fix Notes
The following findings were initially classified as mechanical but failed verification and have been reclassified as requiring decisions:
- **{SPEC-NNN}:** {failure reason}
Update the **Overall Assessment:** line (in the report's Summary section, format defined by kramme:siw:spec-audit: one of Ready for implementation, Needs revision, Significant gaps) only if all of the following hold:
**Severity Note:** [Deprioritized — capped at Minor from Critical] (or any other preserved-critical cap).When those conditions hold, replace the existing value with Ready for implementation. Otherwise, leave the existing value untouched.
Use the summary template from assets/auto-fix-summary.md.
STOP HERE. Wait for the user's next instruction.
# Default (balanced — fixes mechanical + high-confidence findings)
/kramme:siw:spec-audit:auto-fix
# Stricter pass (higher confidence bar)
/kramme:siw:spec-audit:auto-fix --threshold 90
# Most permissive allowed threshold
/kramme:siw:spec-audit:auto-fix --threshold 60
# Preview what the lowest threshold would fix
/kramme:siw:spec-audit:auto-fix --dry-run --threshold 60
# Auto-apply all auto-fixable findings without asking
/kramme:siw:spec-audit:auto-fix --auto
# Auto-apply with lower threshold
/kramme:siw:spec-audit:auto-fix --auto --threshold 70
If the report does not contain ### SPEC-NNN: headings, stop:
Could not parse findings from {report_path}.
Expected format: ### SPEC-NNN: {title}
The report may be from an incompatible version. Re-run /kramme:siw:spec-audit.
If a spec file referenced in the report no longer exists:
Spec file not found: {path} — skipping {N} findings for this fileIf the Edit tool fails (e.g., old_string not found because the spec was modified since the audit):
Edit failed for SPEC-{NNN}: text has changed since auditREQUIRES_DECISIONIf every auto-fixable fix fails verification:
All {N} auto-fixable fixes failed verification.
The spec may have changed significantly since the audit.
Recommended: Re-run /kramme:siw:spec-audit to get a fresh report.
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.