kramme-cc-workflow/skills/kramme:siw:spec-audit/SKILL.md
Audit specification documents for quality — coherence, completeness, clarity, scope, actionability, testability, value proposition, and technical design. Catches spec issues before implementation begins. Supports inline report output with --inline; --apply runs the same auto-fix procedure as kramme:siw:spec-audit:auto-fix. Use --team for multi-agent cross-validation.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:siw:spec-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.
Evaluate specification documents for quality across 8 dimensions before implementation begins. This is a spec-only analysis — no codebase code is read or compared.
IMPORTANT: This is a thorough quality audit. Do not return early. Do not assume a section is well-written without reading it carefully. Check every part of the specification against quality criteria. The goal is to find ALL weaknesses — a clean report is suspicious, not reassuring.
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.
/kramme:siw:spec-audit [spec-file-path(s) | 'siw'] [--auto] [--apply] [--model opus|sonnet|haiku] [--inline] [--team]
|
v
[Step 1: Resolve Spec Files] -> Parse args or auto-detect from siw/
|
v
[Step 2: Read Specs and Extract Structure] -> Read fully, detect type, extract elements
|
v
[Step 3: Launch Parallel Analysis] -> Explore agents per dimension group
|
v
[Step 4: Analyze Findings] -> Classify, deduplicate, assign severity and scores
|
v
[Step 5: Write Report] -> siw/AUDIT_SPEC_REPORT.md
|
v
[Step 6: Optionally Apply Findings or Create SIW Issues] -> Canonical auto-fix or issue creation
|
v
[Step 7: Report Summary] -> Stats and next steps
$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 --apply or --apply-now, set APPLY_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:
--apply means:
/kramme:siw:spec-audit:auto-fix against that report for findings that clear the canonical auto-fix gatesG-* issues, do not update siw/OPEN_ISSUES_OVERVIEW.md, and do not touch siw/issues/--auto, pass the same approval behavior to the auto-fix procedure--inline means:
siw/AUDIT_SPEC_REPORT.mdsiw/OPEN_ISSUES_OVERVIEW.md / siw/LOG.md updates) so the workspace is not mutatedIf INLINE_MODE=true and APPLY_MODE=true (from --apply or --apply-now), abort before reading specs:
Error: --inline cannot be combined with --apply or --apply-now.
--inline is read-only. Re-run without --inline to apply spec updates.
Detection rules for remaining arguments:
/ or ends in .md, .txtsiw: Explicitly requests auto-detectionmyspec token with no slash or extension): Treat as a candidate path and verify it with ls. If verification fails, surface the same "No valid specification files found" error from Section 1.2 — never silently fall through to auto-detection on an unrecognized token.$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, DISCOVERY_BRIEF.md, SPEC_STRENGTHENING_PLAN.md, AUDIT_*.md, PRODUCT_AUDIT.md, SIW_*.md.siw/*.md file as a spec. When the filter excludes every candidate, report the excluded filenames and ask for an explicit spec path instead of silently proceeding.siw/ by sibling skills must either match one of the patterns above or be added to this list, or it will be silently audited as a spec.Find 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 (e.g., 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.
If auto-detection found no spec files because every top-level siw/*.md candidate was excluded by the workflow-artifact filter, report the excluded filenames and ask the user for explicit spec path(s). Validate provided paths with the explicit-path flow from Step 1.2 and continue when valid. If the user provides no path, then emit the generic error below and abort.
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:spec-audit path/to/spec.md
/kramme:siw:spec-audit docs/spec1.md docs/spec2.md
To initialize a workflow with a spec, run /kramme:siw:init
Action: Abort.
Read each spec file completely. Do not skim. Understand the full picture before analyzing quality.
For each spec file, identify and extract:
| Element | What to look for | | --- | --- | | Overview/Objectives | Opening section, project description, goals | | Scope Definition | In-scope items, out-of-scope items, boundaries | | Success Criteria | Measurable outcomes, checkboxes, definitions of done | | Requirements | Named entities, behaviors, constraints, contracts | | Design Decisions | Technical choices, rationale, alternatives considered | | Implementation Tasks | Task breakdowns, phases, work items | | Testing/Verification | Test plans, verification checklists, quality gates | | Edge Cases | Boundary conditions, error scenarios, exceptional flows | | Out of Scope | Explicit exclusions | | Technical Architecture | Data models, API contracts, system design, component boundaries |
For each element, capture:
ELEM-001)After reading all spec files, look for a ## Work Context section in the spec files:
siw/*.md candidate (specs in siw/supporting-specs/ are auxiliary). If more than one top-level spec defines Work Context, use the lexicographically first one and emit a one-line warning that names the ignored files.work_contextWork Context drives severity adjustments in Steps 3 and 4. See downstream behavior rules below.
Spec Analysis Complete
Sources:
- {spec_file_1}
- {spec_file_2}
Structural Elements Found: {total}
Sections identified: {count}
Work Context: {work_context.work_type} — Priority: {priority_dimensions}, Deprioritized: {deprioritized}
If no Work Context found, show: Work Context: Not specified (using Production Feature defaults)
If no extractable structure found:
Warning: Could not extract structured sections from {file}.
The file may need clearer headings, task definitions, or section organization.
If AUTO_MODE=true, choose Attempt best-effort analysis automatically.
Otherwise use AskUserQuestion:
header: "No Structure Found"
question: "Could not extract structured sections. How should I proceed?"
options:
- label: "Attempt best-effort analysis"
description: "Analyze the spec text as-is, even without clear section structure"
- label: "Abort"
description: "Cancel the audit"
Group the 8 quality dimensions across Explore agents based on spec size:
Small specs (single file, under 200 lines) — 2 agents:
Medium specs (1-3 files, 200-800 lines) — 3 agents:
Large specs (3+ files or 800+ lines) — 4 agents:
Platform requirement: The standard workflow assumes the Claude Code Task tool with subagent_type=Explore. For multi-agent execution on Codex or other runtimes, invoke this skill with --team (see references/team-mode.md for the cross-platform multi-agent path). If the standard workflow runs in a runtime without the Task/Explore tooling, fall back to a single sequential pass that walks every dimension group inline and report this in the summary.
For each agent group, 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.
Each agent receives the full spec text and analysis instructions for its assigned dimensions. Read references/audit-agent-prompt.md, populate the placeholders for the assigned dimension group, and omit the Work Context Adjustments block when the work context is Production Feature or unspecified.
Read the dimension-specific instructions from references/dimension-instructions.md and include the relevant dimension blocks in each agent's prompt based on its assigned dimensions.
The 8 dimensions are: Coherence, Completeness, Clarity, Scope, Actionability, Testability, Value Proposition, Technical Design. Each includes check items and a severity guide.
After all Explore agents complete:
Gather all findings from every agent. Deduplicate — if multiple dimensions flagged the same issue, merge into one finding and note all affected dimensions.
Read references/post-processing-rules.md once at the start of Step 4 and apply it throughout: merged-finding handling here in 4.1, severity-cap accounting in 4.3.5, final fix-confidence normalization in 4.3.6, dimension-score effects in 4.4, and issue eligibility in Step 6.
If a previous report exists at the target path from Step 5.1 (siw/AUDIT_SPEC_REPORT.md, or AUDIT_SPEC_REPORT.md in the project root), read it and record the highest previously reported SPEC-NNN as previous_max_id. Findings that match a previously reported finding (same issue, even if reworded) retain their existing IDs; new findings get sequential IDs starting at previous_max_id + 1, ordered by severity (Critical first, then Major, then Minor). If no previous report exists, number all findings SPEC-001, SPEC-002, etc. in severity order.
This keeps IDs stable across re-runs so commits, SIW issues (e.g. /kramme:siw:resolve-audit filenames ISSUE-G-XXX-{finding-id}-*.md), and external references stay valid.
For each finding:
| Severity | Criteria | | --- | --- | | Critical | Would block implementation or lead to fundamentally wrong implementation. Missing core requirements, contradictory specs, undefined key behaviors, fundamental design flaws. | | Major | Risks incorrect implementation or significant rework. Ambiguous requirements, missing edge cases, unclear scope boundaries, design gaps. | | Minor | Cosmetic or low-risk. Inconsistent terminology, missing non-critical sections, formatting issues, suboptimal choices. |
If work_context specifies deprioritized dimensions:
For each finding whose affected dimensions are all deprioritized:
original_severity={severity}, then downgrade to Minor**Severity Note:** [Deprioritized — capped at Minor from {original_severity}]If a merged finding also affects any non-deprioritized dimension, do not apply the cap. Keep the normally assigned severity and note all affected dimensions in the finding body.
This ensures purely deprioritized dimensions never produce Critical or Major findings, while still preserving blockers that also affect prioritized or neutral dimensions.
Apply the "Final Fix Confidence" section of references/post-processing-rules.md (already loaded in Step 4.1) after severity assignment and any Work Context caps.
For each dimension, compute a quality score:
| Score | Meaning | | ------------ | ------------------------------------------------------ | | Strong | No Critical or Major findings. At most Minor findings. | | Adequate | No Critical findings. Some Major findings. | | Weak | Has Critical findings or many Major findings. | | Missing | Dimension not addressed at all in the spec. |
Apply the "Overall Assessment After Severity Caps" section of references/post-processing-rules.md (already loaded in Step 4.1) when computing dimension scores and the overall assessment.
Only if SIW workflow is active:
Read siw/OPEN_ISSUES_OVERVIEW.md and siw/issues/*.md to check if any found spec gaps already have open issues. Mark these findings with a note: "Existing issue: {issue-id}".
siw/ directory exists: siw/AUDIT_SPEC_REPORT.mdsiw/ directory: AUDIT_SPEC_REPORT.md in project rootIf INLINE_MODE=true, skip this overwrite step because no report file will be written.
Otherwise, if a previous report exists at the target path:
If AUTO_MODE=true, choose Replace automatically.
Otherwise:
header: "Existing Spec Audit Report"
question: "A previous spec audit report exists. How should I proceed?"
options:
- label: "Replace"
description: "Overwrite with new audit results"
- label: "Append"
description: "Add new audit as a dated section (preserves history)"
- label: "Abort"
description: "Cancel — keep existing report"
If the user chooses Append, append the new report as a complete new # Spec Audit Report block at the end of the file, separated from the previous run with ---. Do not merge sections across runs.
Use the report format template from assets/spec-audit-report-format.md.
If INLINE_MODE=true:
siw/AUDIT_SPEC_REPORT.md or AUDIT_SPEC_REPORT.mdOtherwise, after writing:
Spec audit report written to: {path}
If INLINE_MODE=true, skip this entire step. Inline runs are read-only previews — do not write issue files or touch siw/OPEN_ISSUES_OVERVIEW.md / siw/LOG.md.
If there are no findings, skip the rest of Step 6.
If APPLY_MODE=true, read and follow references/apply-now.md, then skip issue creation entirely.
If AUTO_MODE=true, apply the "Issue-Eligible Findings" section of references/post-processing-rules.md (already loaded in Step 4.1), then read and follow references/issue-creation.md using the standard auto-mode behavior.
Before prompting, determine whether SIW issue creation is available:
references/post-processing-rules.md using the Critical and major only selection to compute ISSUE_ELIGIBLE_FINDINGS.ISSUE_CREATION_AVAILABLE=true only if all references/issue-creation.md eligibility requirements are met: siw/OPEN_ISSUES_OVERVIEW.md exists, siw/issues/ exists or can be created, siw/LOG.md exists or can be created, and ISSUE_ELIGIBLE_FINDINGS is not empty.ISSUE_CREATION_AVAILABLE=false, do not show any issue-creation options.If ISSUE_CREATION_AVAILABLE=false, ask the user which follow-up path to take:
header: "Resolve Spec Findings"
question: "Found {N} actionable spec findings. Auto-fix safe findings now or keep the report only?"
options:
- label: "Apply now"
description: "Run the canonical auto-fix procedure against the audit report"
- label: "Keep report only"
description: "Make no spec edits or issue files"
If the user chooses Apply now, read and follow references/apply-now.md, then skip issue creation entirely.
If the user chooses Keep report only, stop Step 6 after keeping the report only.
If ISSUE_CREATION_AVAILABLE=true, ask the user which follow-up path to take:
header: "Resolve Spec Findings"
question: "Found {N} actionable spec findings. Auto-fix safe findings, create SIW issues, or keep the report only?"
options:
- label: "Apply now"
description: "Run the canonical auto-fix procedure against the audit report; create no G-* issues"
- label: "Create SIW issues"
description: "Choose which findings become SIW issues"
- label: "Keep report only"
description: "Make no spec edits or issue files"
If the user chooses Apply now, read and follow references/apply-now.md, then skip issue creation entirely.
If the user chooses Keep report only, stop Step 6 after keeping the report only.
If the user chooses Create SIW issues, read and follow references/issue-creation.md starting at §6.1. Treat Create SIW issues as a routing choice only, not as the detailed issue-selection choice; §6.1 must still ask for or resolve Critical and major only, All findings, Let me select, or No issues.
Use the summary template from assets/spec-audit-summary.md, then end the turn.
siw/.development
Runs kramme:pr:code-review as a closeout review loop for local or PR branch changes before commit, ship, or final response. Use when the user asks for autoreview, second-model review, or a final code-review pass after non-trivial edits. Not for UX, visual, accessibility, or product review.
development
Guides topic-level understanding verification for a PR, branch, feature, document, spec, design decision, bug fix, or other concrete subject. Use when the user asks to confirm, quiz, drill, teach-and-check, or verify that they understand a topic. Maintains a topic-specific checklist artifact and requires demonstrated understanding before marking the topic complete. Not for ordinary explanations without verification, end-of-session summaries, or code/test correctness checks.
testing
Design a CI/CD pipeline with quality gates, a <10-minute budget, feature-flag lifecycle, and an exit checklist. Use when adding a new CI pipeline, changing gate configuration, or planning a rollout for a new service. Complementary to kramme:pr:fix-ci (which fixes failures in an existing pipeline). Covers gate ordering, secrets storage, branch protection, rollback mechanism, and staged-rollout guardrails — not a rollout-execution runbook.
tools
--- name: kramme:visual:demo-reel description: Capture local demo evidence for observable product behavior: screenshots, before/after image sets, browser reels, terminal recordings, and short GIF/video proof. Use when shipping UI changes, CLI features, or any change where PR reviewers would benefit from visual or behavioral evidence. argument-hint: "[what to capture] [--url <url>|auto] [--tier static|before-after|browser-reel|terminal-recording]" disable-model-invocation: true user-invocable: tr