kramme-cc-workflow/skills/kramme:siw:issue-define/SKILL.md
Define or improve a local SIW issue file through a guided interview. For Linear or other external trackers use kramme:linear:issue-define.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:siw:issue-defineInstall 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.
Create or improve a local issue through guided interactive refinement. Can start from scratch with a description, or improve an existing issue by providing its identifier. Supports file references for technical context and proactively explores the codebase to inform issue definition.
Issue Naming: New issues default to G-XXX (General). Use P1-, P2-, etc. for phase-specific issues. When creating a new issue, recommend a phase prefix if the issue fits an active (not completed) phase.
This command ONLY creates or updates local issue files.
Implementation is a separate workflow. This skill ends when the issue file is written and the tracker/log are updated. After it completes, the user can invoke /kramme:siw:issue-implement if they want to start implementing.
Workflow files should exist. If siw/OPEN_ISSUES_OVERVIEW.md doesn't exist, suggest running /kramme:siw:init first. If the file is still missing after that suggestion, stop without creating an issue.
Use this shared vocabulary while deciding whether an issue can be written:
product-only: only the problem, user, or desired outcome is known.requirements-only: scope and success criteria exist, but issue-level dependencies, affected areas, or verification are not clear.planning-ready: enough context exists to define one or more SIW issues, but the current artifact is not yet executable.implementation-ready: the issue has bounded scope, dependencies/blockers, acceptance criteria, Mode, and verification.This skill turns planning-ready input into an implementation-ready local issue. If the interview cannot harden a product-only or requirements-only request into a single executable issue, stop and route to /kramme:siw:discovery or spec hardening instead of writing a vague issue. Route to /kramme:siw:generate-phases only when the artifact is planning-ready but too broad for one issue.
This skill owns the manual SIW issue creation/update protocol. Synced SIW issue-state contract (keep aligned across SIW issue creators): every SIW issue creation or tracker-visible issue update keeps the issue file, siw/OPEN_ISSUES_OVERVIEW.md, and siw/LOG.md synchronized as one issue-state change; partial write failures must be surfaced instead of accepted silently.
All final issue creation and tracker-visible updates use this skill's scripts/siw-issue-reservation.sh helper. The helper serializes its own invocations, provides new ownership-tokened publication locks with a baseline state hash, creates exclusive per-ID reservations using portable atomic hard-link claims, and atomically publishes a final receipt that binds the owner and all three SIW views. A killed invocation's operation claim is reclaimed only after its recorded process no longer exists. Keep the locked critical section short. Draft IDs are provisional; reserve final IDs only at the Phase 6 mutation boundary.
Primary: Future You — The issue must be clear enough to understand days or weeks later.
Secondary: Other Developers — Technical context helps others understand the work.
Handling $ARGUMENTS:
Check if input matches an existing issue:
ISSUE-G-001, ISSUE-P1-001, ISSUE-P2-001, etc.G-001, P1-001, P2-001, etc.ISSUE-001 or 001 (treated as G-001)Detection rule: Only treat it as an existing issue if a matching file exists in siw/issues/ISSUE-{prefix}-{number}-*.md.
If existing issue detected → IMPROVE MODE:
G and 001 from ISSUE-G-001, or P1 and 002 from P1-002)siw/issues/ISSUE-{prefix}-{number}-*.md; stop on zero matches, duplicate matches, symlinks, or other non-regular paths.IMPROVE_BASE_HASH from a successful git hash-object call. Stop if the content cannot be hashed.If an identifier-like argument was provided but no file exists:
AskUserQuestion to confirm whether they want to create a new issue insteadrequested_prefix and ignore the provided numberIf no issue detected → CREATE MODE:
$ARGUMENTS:
G, G-, P1, P1-, P2, P2-, etc.requested_prefix (without trailing -) and strip it from the description/ or ending in common extensions) and store for Step 2AskUserQuestion to gather the initial conceptIf file paths provided:
Read toolRead references/classification-and-prefix.md, then auto-detect issue type from context, present the detected type with reasoning, allow user override, and store issue_type. For Bug (Simple), store is_simple_bug = true so Phase 4 and Phase 5 use the streamlined path.
Only for CREATE MODE. Skip for IMPROVE MODE.
Synced 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.
Use the phase-prefix recommendation flow in references/classification-and-prefix.md. It defines the spec/log/overview inputs to check, completed-phase heuristics, the prefix confirmation prompt, and how to store issue_prefix.
Present the existing issue to the user:
Present Current Issue
Identify Improvement Areas
AskUserQuestion:
Before creating a new issue, check for existing similar issues:
Scan Existing Issues
siw/issues/ directorysiw/OPEN_ISSUES_OVERVIEW.md for existing issue titlesCheck for Similar Issues
AskUserQuestion:
Propose Next Issue Number
issue_prefix (from Step 4; fallback to requested_prefix if present; otherwise default G)siw/OPEN_ISSUES_OVERVIEW.md table to find highest issue number within that prefix groupsiw/issues/ISSUE-{issue_prefix}-{candidate}-*.md. If any file matches, the tracker is out of sync with siw/issues/. Increment the candidate and re-check until no file matches, then warn the user that the tracker may need a reindex via /kramme:siw:issue-reindex.issue_number for the draft. Do not create a reservation yet; interviews and review must not hold publication ownership.{issue_prefix}-{issue_number} (e.g., G-001, P1-002). Phase 6 may advance it if another creator publishes first.For Simple Bugs (is_simple_bug = true): Skip if user provided root cause and affected file(s).
For all other issue types: Proactively search the repository:
Find Related Implementations
Grep to search for keywords from the descriptionGlob to find files in related areasIdentify Patterns & Conventions
Discover Related Components
Find Existing Tests
Output: Summarize findings to share with user and inform interview.
Before the interview, synthesize a working hypothesis for:
Use these as assumptions to validate instead of asking the user to restate obvious context.
Read references/interview-guide.md and follow the simple-bug or standard interview path based on issue_type and is_simple_bug. Store priority, size, related work, blockers, parallelization category, prefactoring need, and Mode for Phase 5. Confirm inferred metadata before composing.
Read references/issue-templates.md and select the appropriate template:
is_simple_bug = true.Both templates include the Mode: field. When emitting the issue, fill Mode: AUTO or Mode: HITL — <one-line reason> from Round 5.
Apply the prefactoring-first rule before finalizing the draft:
The references file also defines the Durability rule: issue bodies must describe modules, behaviors, and contracts — not file paths, line numbers, or internal helper/class names. Apply it to every section of the composed issue (Problem, Context, Technical Notes, References).
IMPROVE MODE: Show updated issue with change indicators.
CREATE MODE: Show complete issue.
Resolve scripts/siw-issue-reservation.sh relative to this SKILL.md. Generate a collision-resistant owner token once with sh <helper> new-owner, retain it in this workflow's session state, and use it for the workflow's full publication and recovery lifetime. During normal contention, never copy or reuse a token observed in an existing lock or reservation.
sh <helper> acquire siw <owner-token> 30. This bounded wait is the serialization boundary. The helper persists an owner-bound baseline manifest for the overview, log, and issue ID/file state; interrupted same-owner retries validate that manifest instead of treating the recovery-time files as a new baseline. If it reports that another writer owns publication, preserve the lock and reservations unchanged and stop for owner-guided recovery without exposing its token. For malformed state or operational failures, preserve state and surface the helper's diagnostic exactly instead of describing the failure as contention.siw/OPEN_ISSUES_OVERVIEW.md, siw/LOG.md, and matching on-disk issue files while holding publication ownership. Never publish from the snapshot used during the interview.sh <helper> release-publication siw <owner-token> before prompting, rebase the proposed edits onto the fresh issue without discarding concurrent changes, show the revised draft and concurrent delta for explicit approval, replace the stored base path/hash, reacquire publication ownership, and repeat from Step 2. Conflicting edits always require approval; never prompt while holding publication ownership. Proceed only when the under-lock path and hash still match the latest approved base.sh <helper> reserve siw <issue-prefix> <owner-token> 100 issue-create. The stable issue-create request key makes an interrupted call safe to retry with the retained owner token. Treat the returned ID as final, replacing the provisional ID everywhere in the issue body, filename, overview row, and log entry. The helper recomputes the high-water mark across the overview, issue files, and live reservations, preserves gaps, and retries collisions with exclusive atomic claims. In IMPROVE MODE, keep the existing stable ID and do not reserve a new one.siw/issues/ISSUE-{prefix}-{number}-{sanitized-title}.md. In IMPROVE MODE, update the exact current path verified in Step 3; if an approved title change requires a new sanitized filename, verify the target is absent and rename that file instead of creating a second path for the same ID. Sanitize titles by lowercasing, replacing spaces with hyphens, removing special characters, and limiting them to 40 characters.siw/OPEN_ISSUES_OVERVIEW.md: add a new row in the correct prefix section, or update every changed tracker-visible field for an existing issue. Read references/tracker-schema.md for the coexisting layouts, parallelization-summary recomputation, and (DONE) phase-marker rules.siw/LOG.md. For new issues, add the created ID, title, and date under ## Current Progress; for updated issues, add an entry only when tracker-visible metadata changed and name the changed fields.sh <helper> publish-receipt siw <owner-token> <issue-id> as the final publication write. That command validates and writes one idempotent receipt from the same immutable operation snapshot. The receipt binds the owner, complete issue-state hash, and every ID whose issue file, overview row, or log entry changed since acquisition; it also rejects foreign-owned IDs and omitted same-owner reservations. After it succeeds, run sh <helper> release siw <issue-id> <owner-token> for a new issue, followed by sh <helper> release-publication siw <owner-token>. The release commands revalidate the receipt and current state, so a separate normal-path verify-receipt scan is unnecessary.In CREATE MODE, retry the same request key after an interrupted reservation call to recover its final ID. If a write fails before the issue file exists, the same owner may run abandon for its ID and then release-publication; the helper permits this no-op release only while the current SIW state still matches the baseline captured at acquisition. If the issue file exists, do not abandon the reservation: reacquire with the retained token, repair the overview/log from current state, verify all three views, publish and verify the receipt, then run release followed by release-publication. These receipt, cleanup, and publication-release commands are postcondition-idempotent for interruption recovery. In IMPROVE MODE no ID reservation exists: reacquire with the retained token, repair and verify all three views, publish and verify the receipt for the improved ID, then run only release-publication. A later recovery session may use the retained token only after the user explicitly confirms it is resuming that interrupted workflow. Never delete a reservation based on age or filename, and never clean up a different owner's token.
An owner-only publication lock written by an older helper has no trustworthy baseline. Reacquire it only with the retained token, repair and verify all three SIW views, then publish and verify a receipt before releasing publication. A legacy reservation cannot be abandoned because the helper cannot prove that the live views still match the pre-edit state. When that interrupted legacy workflow has no owned issue reservation or issue ID to bind, sh <helper> publish-receipt siw <owner-token> and the optional diagnostic sh <helper> verify-receipt siw <owner-token> create and verify a legacy-only zero-ID recovery receipt; a current baseline-hashed lock and a legacy lock with an owned reservation both reject that form.
IMPROVE MODE:
CREATE MODE:
The skill ends here. Surface the file path and tell the user that if they want to implement next, they can run /kramme:siw:issue-implement {prefix}-{number}, or re-run /kramme:siw:issue-define {prefix}-{number} to refine. Do not start implementation.
Read references/definition-guidelines.md and apply it throughout the workflow.
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.