kramme-cc-workflow/skills/kramme:siw:close/SKILL.md
Close an SIW project by generating permanent documentation in docs/<feature>/ and removing temporary workflow files
npx skillsauth add abildtoft/kramme-cc-workflow kramme:siw:closeInstall 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.
Generate permanent documentation from SIW artifacts, then remove temporary workflow files. This is the terminal lifecycle command for SIW projects -- it captures accumulated knowledge (decisions, architecture, principles) before cleaning up.
Use when: The project is complete and you want to preserve the knowledge before removing SIW files. Use siw:reset instead when: You want to start a new iteration on the same project. Use siw:remove instead when: You just want to delete SIW files without generating documentation.
Parse $ARGUMENTS before Step 1. If --auto is present, set AUTO_MODE=true. --auto uses the derived documentation directory and skips confirmation prompts only when the close is unambiguous: no open issues, no dirty SIW files, one main spec candidate, and no existing docs directory. It does not bypass cleanup safety or overwrite existing documentation.
Check whether any SIW artifacts exist:
find siw -type f -print -quit 2> /dev/null
If the command returns no output, no SIW files exist. Print the message below and stop:
No SIW workflow files found in this directory.
To initialize a new SIW workflow, run /kramme:siw:init
Otherwise, detect the "minimal SIW" case (only a spec, no workflow state):
if [ ! -f siw/LOG.md ] && [ ! -d siw/issues ] && [ -n "$(ls siw/*.md 2> /dev/null)" ]; then echo minimal; fi
If the check prints minimal and AUTO_MODE=true, choose Generate docs from spec only automatically.
If the check prints minimal and AUTO_MODE is false, use AskUserQuestion:
header: "Minimal SIW Project"
question: "Only a spec file was found -- no LOG.md, issues, or other workflow files. There's little to extract beyond the spec itself. How should I proceed?"
options:
- label: "Generate docs from spec only"
description: "Create documentation from the spec file alone"
- label: "Abort"
description: "Cancel -- nothing to close"
Read siw/OPEN_ISSUES_OVERVIEW.md and check for issues not marked DONE:
grep -iE "\| (READY|IN PROGRESS|IN REVIEW) \|" siw/OPEN_ISSUES_OVERVIEW.md 2> /dev/null
If open issues found:
If AUTO_MODE=true, stop with MISSING REQUIREMENT: open SIW issues remain; rerun without --auto to close anyway or abort.
Use AskUserQuestion:
header: "Open Issues Detected"
question: "There are {N} issues not marked DONE ({list statuses}). Closing will remove these issue files. How should I proceed?"
options:
- label: "Close anyway"
description: "Generate documentation and remove all SIW files despite open issues"
- label: "Abort"
description: "Cancel and finish remaining issues first"
git status --porcelain siw/ 2> /dev/null
If uncommitted changes exist and AUTO_MODE=true, stop with MISSING REQUIREMENT: uncommitted SIW changes exist; rerun without --auto to review them before cleanup.
If uncommitted changes exist and AUTO_MODE is false, warn:
Warning: There are uncommitted changes to SIW files.
These will be included in the generated documentation but the SIW file
changes themselves will be lost after cleanup.
If AUTO_MODE=true, verify trash is installed before generating documentation or moving spec files:
command -v trash
If it is missing, stop with MISSING REQUIREMENT: trash is required for --auto close; rerun without --auto to confirm permanent deletion.
The feature name determines the output directory docs/<feature-name>/.
Build spec_candidates from siw/*.md, excluding temporary SIW files:
siw/LOG.mdsiw/OPEN_ISSUES_OVERVIEW.mdsiw/AUDIT_*.mdsiw/PRODUCT_AUDIT.mdsiw/SIW_*.mdsiw/SPEC_STRENGTHENING_PLAN.mdsiw/DISCOVERY_BRIEF.mdSynced SIW spec-exclusion contract (keep aligned across SIW spec detectors): LOG.md, OPEN_ISSUES_OVERVIEW.md, DISCOVERY_BRIEF.md, SPEC_STRENGTHENING_PLAN.md, AUDIT_*.md, PRODUCT_AUDIT.md, SIW_*.md.
If no spec candidates are found, follow the "No spec file found" edge case.
If multiple spec candidates are found and AUTO_MODE=true, stop with MISSING REQUIREMENT: multiple spec candidates found; pass through an interactive close to choose the main spec. Otherwise use AskUserQuestion to select the main one:
header: "Multiple Spec Files Found"
question: "Which specification file is the main spec for this project?"
options:
- label: "{spec_file_1}"
- label: "{spec_file_2}"
Read the first # heading from the selected spec
Convert to kebab-case: lowercase, replace spaces/underscores with hyphens, strip non-alphanumeric characters
If the heading is too generic (e.g., just "Specification" or "Feature"), fall back to the filename minus suffixes like _SPECIFICATION, _DESIGN, _PLAN, .md
If AUTO_MODE=true, use the default docs/{derived-feature-name} and print it. Otherwise use AskUserQuestion:
header: "Documentation Directory"
question: "Where should the documentation be generated?"
freeform: true
defaultValue: "docs/{derived-feature-name}"
Store as docs_path.
If docs_path already exists:
If AUTO_MODE=true, stop with MISSING REQUIREMENT: {docs_path} already exists; rerun without --auto to overwrite or choose another directory.
header: "Documentation Directory Exists"
question: "{docs_path} already exists. How should I proceed?"
options:
- label: "Overwrite"
description: "Replace existing documentation files"
- label: "Choose different directory"
description: "Enter a different path"
- label: "Abort"
description: "Cancel without making changes"
If "Choose different directory", re-prompt with freeform AskUserQuestion.
Read all existing SIW files and extract structured knowledge.
siw/[YOUR_SPEC].md)Extract:
# heading)## Overview)## Problem Statement if present)## Who's Affected if present)## Objectives)## Scope -- In Scope, Out of Scope, and Deferred)## Success Criteria)## Priorities & Tradeoffs if present)## Constraints if present)## Design Decisions)## Decision Boundaries if present)## Risks if present)## Discovery Notes if present)## Technical Design if present)## Linked Specifications if present)siw/supporting-specs/*.md)For each supporting spec:
siw/LOG.mdExtract:
## Guiding Principles)## Current Progress)siw/OPEN_ISSUES_OVERVIEW.mdExtract:
siw/issues/ISSUE-*.md)For DONE issues:
For non-DONE issues:
From siw/AUDIT_IMPLEMENTATION_REPORT.md and siw/AUDIT_SPEC_REPORT.md:
Decisions may appear in both LOG.md and the spec's Design Decisions section (from prior resets or syncs):
Decision #N) or titleCreate the documentation directory and write the output files:
mkdir -p "{docs_path}"
Read the templates from assets/documentation-templates.md, substitute placeholders from Step 4's extracted knowledge, and write:
{docs_path}/README.md -- project summary (scope, decisions, principles, implementation metrics){docs_path}/decisions.md -- architecture decision records (index, context, rationale, alternatives){docs_path}/architecture.md -- technical design, only if any of the following holds:
## Technical Design section, orAll generated documentation must be:
siw/, LOG.md, OPEN_ISSUES_OVERVIEW.md, issue file paths, or SIW-specific conceptsDecide what happens to the spec, siw/supporting-specs/, and siw/SPEC_STRENGTHENING_PLAN.md. Read references/spec-disposition.md for the prompts, discovery-rich detection rules, and conflict handling.
If AUTO_MODE=true, do not use the interactive prompts from references/spec-disposition.md. Use conservative preservation defaults instead:
spec_disposition=move so the main spec and siw/supporting-specs/ are preserved under {docs_path}/spec/.siw/SPEC_STRENGTHENING_PLAN.md exists, set strengthening_plan_disposition=move; otherwise set strengthening_plan_disposition=remove.{docs_path}/spec/ do not already exist. If any destination would overwrite a file or directory, stop with MISSING REQUIREMENT: spec disposition target already exists; rerun without --auto to choose how to preserve the source material.references/spec-disposition.md after the move. This keeps durable source material while avoiding hidden prompts in auto mode.If AUTO_MODE is false, read and follow references/spec-disposition.md.
Outputs (consumed by Step 7):
spec_disposition: remove, keep, or movestrengthening_plan_disposition: remove, keep, or moveWhen either disposition is move, append the "Original Specification" README note described in the reference.
The reference enforces: strengthening_plan_disposition=keep requires spec_disposition=keep; otherwise the plan cannot remain orphaned in siw/ after Step 7.
Before removing any SIW files, confirm the generated documentation is present and non-empty. If any required file is missing or zero-byte, abort without deleting anything; the docs must be rewritten before retrying.
test -s "{docs_path}/README.md" || {
echo "ERROR: {docs_path}/README.md missing or empty"
exit 1
}
test -s "{docs_path}/decisions.md" || {
echo "ERROR: {docs_path}/decisions.md missing or empty"
exit 1
}
If architecture.md was generated in Step 5, also require:
test -s "{docs_path}/architecture.md" || {
echo "ERROR: {docs_path}/architecture.md missing or empty"
exit 1
}
If any move disposition from Step 6 applies, confirm the move targets are in place under {docs_path}/spec/ before deletion.
Use trash (recoverable). Always quote the spec filename: it can contain spaces or other shell-significant characters.
In AUTO_MODE, trash was already verified during Step 2.3 before documentation generation or spec moves. If it is missing here anyway, stop with MISSING REQUIREMENT: trash is required for --auto close; rerun without --auto to confirm permanent deletion.
Temporary files (always deleted):
siw/LOG.mdsiw/OPEN_ISSUES_OVERVIEW.mdsiw/AUDIT_*.mdsiw/PRODUCT_AUDIT.mdsiw/SIW_*.mdsiw/DISCOVERY_BRIEF.mdsiw/issues/ (entire directory)siw/qa-intake/ (QA intake parent summaries)Conditional (based on Step 6):
siw/SPEC_STRENGTHENING_PLAN.md (only if strengthening_plan_disposition=remove)siw/{spec_filename} (only if spec_disposition=remove; skip when empty)siw/supporting-specs/ (only if spec_disposition=remove)Build delete_targets from the paths above that actually exist. Expand globs before deletion so unmatched globs are never reported as removed. If delete_targets is empty, skip the deletion command and continue to reporting. Delete directories by passing them to trash as normal path arguments; do not pass recursive flags to trash. Do not suppress deletion errors. Capture stderr/stdout so any failure can be reported.
if command -v trash &> /dev/null; then
trash "${delete_targets[@]}"
else
if [ "${AUTO_MODE:-false}" = "true" ]; then
echo "MISSING REQUIREMENT: trash is required for --auto close; rerun without --auto to confirm permanent deletion"
exit 1
fi
echo "Warning: 'trash' command not found. Files will be permanently deleted."
echo "Consider installing: brew install trash"
# Ask for explicit confirmation before running:
rm -rf "${delete_targets[@]}"
fi
After deletion, verify every target with [ ! -e "$path" ]. Record only verified-absent paths in deleted_paths. Record any surviving paths in failed_delete_paths with the captured error output; these must be reported as failures instead of "Removed".
siw/ DirectoryAfter deletion, check if siw/ is empty:
# Remove .gitkeep only from directories that were part of delete_targets.
rm -f siw/issues/.gitkeep siw/qa-intake/.gitkeep 2> /dev/null
if [ "{spec_disposition}" = "remove" ]; then
rm -f siw/supporting-specs/.gitkeep 2> /dev/null
fi
if [ -z "$(find siw -mindepth 1 ! -name .gitkeep -print -quit 2> /dev/null)" ]; then
rm -f siw/.gitkeep 2> /dev/null
fi
# Remove empty directories
rmdir siw/issues siw/qa-intake 2> /dev/null
if [ "{spec_disposition}" = "remove" ]; then
rmdir siw/supporting-specs 2> /dev/null
fi
rmdir siw 2> /dev/null
If siw/ still has files (spec kept or other files present), leave it alone.
Print a closing summary built from what actually happened. Include only lines that apply -- do not emit the (if …) annotations themselves.
Sections to include:
{docs_path}/ (always at least README.md and decisions.md; architecture.md when generated).siw/{spec_filename}, siw/supporting-specs/, siw/SPEC_STRENGTHENING_PLAN.md, {docs_path}/spec/). Omit the section if nothing was preserved.trash was used in Step 7.2, add: Files moved to Trash and can be restored if needed.The documentation in {docs_path}/ is self-contained and can be read without any SIW context.Example shape (with placeholders for the dynamic content):
SIW Project Closed
Documentation generated:
{docs_path}/README.md - Project summary
{docs_path}/decisions.md - {N} design decisions
{docs_path}/architecture.md - Technical design
Removed:
siw/LOG.md
siw/OPEN_ISSUES_OVERVIEW.md
siw/issues/ ({count} issue files)
siw/qa-intake/ ({count} intake summaries)
Preserved:
{docs_path}/spec/
Files moved to Trash and can be restored if needed.
The documentation in {docs_path}/ is self-contained and
can be read without any SIW context.
header: "No Specification Found"
question: "No specification file was found in siw/ after excluding temporary SIW files. Cannot generate meaningful documentation. How should I proceed?"
options:
- label: "Remove SIW files only"
description: "Delete temporary files without generating documentation (same as /kramme:siw:remove)"
- label: "Abort"
description: "Cancel"
If the spec has a ## Linked Specifications section referencing files outside siw/:
siw/)If LOG.md has no Decision Log entries:
decisions.md will contain only the note: "No formal design decisions were recorded during this project."trash when available -- allows recovery from system Trashsiw/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