kramme-cc-workflow/skills/kramme:debug:triage-to-issue/SKILL.md
(experimental) Triage a bug end-to-end: orchestrate root-cause investigation, design a TDD fix plan with RED-GREEN cycles, and file a refactor-durable Linear or local SIW issue in one mostly-hands-off pass. Use when a bug needs to become an implementation-ready ticket without manually chaining kramme:debug:investigate, kramme:test:tdd, and kramme:linear:issue-define. Composes kramme:debug:investigate and kramme:linear:issue-define via skill invocation (or by reading the sub-skill's SKILL.md when blocked); captures kramme:test:tdd conventions inline in v1. Not for the full interactive investigation with confidence gates (use kramme:debug:investigate alone), not for conversational multi-bug QA-intake sessions (use kramme:qa:intake), not for implementing the fix (use kramme:linear:issue-implement or kramme:siw:issue-implement after this skill files the ticket).
npx skillsauth add abildtoft/kramme-cc-workflow kramme:debug:triage-to-issueInstall 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.
One command, one ticket. Take a bug description, run a root-cause investigation, design a TDD fix plan, and file a refactor-durable issue an autonomous (AUTO-mode) agent can pick up and implement. The composed result is what manually chaining kramme:debug:investigate → kramme:test:tdd → kramme:linear:issue-define would produce, but in one orchestrated pass.
kramme:debug:investigate directly.kramme:qa:intake (conversational multi-bug intake).kramme:debug:investigate then kramme:test:tdd (Prove-It); skip the ticket overhead.kramme:linear:issue-define directly.$ARGUMENTS. Strip any trailing --yes or --auto flag — both bypass the approval gate.header: Bug Description
question: What's the problem you're seeing?
options:
- (freeform) Describe the bug, paste an error message, or provide a Linear/SIW issue ref
Emit PLAN: triage to issue — investigate, design TDD plan, draft, gate, file.
Probe in order:
mcp__linear__create_issue, or Codex save_issue without id.siw/OPEN_ISSUES_OVERVIEW.md in the repo root.Decision table:
| Linear create operation | SIW present | Action | | --- | --- | --- | | Yes | Yes | Ask the user once which sink (Linear / SIW / Markdown at repo root). | | Yes | No | Use Linear, no question. | | No | Yes | Use SIW, no question. | | No | No | Use a markdown file at the project root, no question. |
The runtime question (when it fires):
header: Issue Sink
question: Both Linear and SIW are available. Where should the issue land?
options:
- Linear — create via the available Linear create operation and return the URL
- SIW — write to siw/issues/ and update OPEN_ISSUES_OVERVIEW.md + LOG.md
- Markdown — write a standalone file at the repo root and surface the path
If Linear is the selected sink, resolve required Linear metadata before continuing:
LINEAR_TEAM.LINEAR_TEAM.Linear Team question. This required metadata question still fires when --yes or --auto was passed; those flags skip only the approval gate, not required create inputs.POTENTIAL CONCERNS.Invoke kramme:debug:investigate via the Skill tool with the captured bug description as $ARGUMENTS. If Skill invocation is unavailable or blocked (the sub-skill is not model-invocable on this platform), locate and Read the sub-skill's SKILL.md from the installed skills directory and follow its steps inline.
Report-only contract. Triage instructs investigate to stop after root-cause identification and never apply a fix. Do not pass --auto to investigate — its AUTO mode implements fixes at High confidence, which would violate this skill's "No fix was applied" invariant.
Answer investigate's intermediate gates with these defaults (always under --yes/--auto; interactively, you may surface them to the user instead):
Capture from the returned log:
[ROOT CAUSE] line — the mechanism description.Root Cause Analysis block — What / Where / Why / When introduced.Evidence block.High / Medium / Low).[REPRODUCE] line and whether reproduction succeeded.If the investigation could not reproduce the bug, mark this in the draft body as UNVERIFIED: bug could not be reproduced from the report; implementer must verify the failure scenario before merging.
Invoke kramme:test:tdd via the Skill tool, framed as a planning-only call: ask it to produce the Prove-It cycle structure for the bug just analyzed, but do not write or run tests in this session — the goal is the plan that will live in the issue body. If Skill invocation is unavailable or blocked, locate and Read the sub-skill's SKILL.md from the installed skills directory and follow its Prove-It conventions inline.
Capture:
If the sub-skill output contains implementation details (private function names, internal class names), strip them in Phase 6.
Caveat (v1 honesty).
kramme:test:tddis written as instructions for a TDD session, not a pure planner. In v1, treat its output as guidance for the cycle list above; if the sub-skill insists on driving an interactive cycle, abort the sub-skill call and produce the cycle list inline using the Prove-It conventions fromkramme:test:tdd(RED-GREEN, behavior through public interface, Prove-It regression test). A future--liteflag will skip this handoff entirely.
Compose 3–6 acceptance criteria as checkboxes. Each criterion is a behavior statement, not an implementation step. Examples:
[ ] Expired tokens are rejected at the auth boundary with a 401 response.[ ] The Prove-It regression test passes after the fix and would have failed before.[ ] No existing test in the auth-middleware suite regresses.If reproduction was UNVERIFIED, add: [ ] Fix is verified by reproducing the original failure scenario before merging.
Take the merged context from Phases 3–5 and rewrite it for the issue body. The body must remain useful after a major refactor.
Forbidden in the body:
src/, any directory + filename).:\d+ patterns..ts, .js, .py, .go, .rs, .sh, .bats, .md, .json, .yml).Allowed:
/api/login endpoint", "the validateToken exported function").See
references/durability-examples.mdfor good-vs-bad rewrites of common patterns.
Redact secrets before publishing externally. Bug descriptions, error messages, stack traces, and repro logs routinely carry bearer tokens, API keys, connection strings, passwords, and personal data. Scan the body and replace any such value with [REDACTED] before filing to Linear or any shared sink — the durability grep below catches paths, not secrets.
This is the canonical durability grep, reused by the pre-create (Phase 8.5) and post-create (Phase 10) checks. The draft is not on disk until Phase 9, so pipe the body string into rg:
printf '%s' "$BODY" | rg ':\d+|([[:alnum:]_.-]+/)+[[:alnum:]_.-]+\.[[:alnum:]]{1,8}|[[:alnum:]_-]+\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|kt|rb|php|swift|cs|cpp|c|h|hpp|sh|bash|zsh|fish|bats|md|mdx|json|ya?ml)\b'
Classify each match before treating it as a problem:
Next.js, Node.js, Vue.js, Nuxt.js); public package names (@company/auth).Read assets/issue-body-template.md and populate it. The structure is:
Fix [observable behavior] in [public surface] (action verb + behavior + surface). No file paths.Show the drafted body to the user.
Skip if the user passed --yes or --auto. Otherwise:
header: Approval
question: Create this issue?
options:
- Create — file as-is at the chosen sink
- Edit — let me revise specific sections
- Cancel — abort without creating anything
If the user picks Edit, ask which section, take their changes, re-render the draft, and re-ask.
Run the durability grep from Phase 6 against the final drafted body (pipe the body string into rg) before writing anything to Linear, SIW, or markdown. Classify matches using the allowed / RED FLAG rules from Phase 6.
If the grep finds prose matches:
RED FLAG.If the user passed --yes or --auto and the grep finds prose matches, halt and require explicit approval before creation. Do not let the bypass flag file a leaky issue.
Branch on the sink chosen in Phase 2.
Linear: before creating, search the team for an open issue with the same title. If one exists, surface it and ask before filing a duplicate; under --yes / --auto, skip creation and report the existing issue instead of duplicating. Otherwise call the available Linear create operation: Claude Code mcp__linear__create_issue, or Codex save_issue without id. Pass title, description (the drafted body), required team: LINEAR_TEAM, and any auto-detectable labels/project. Return the issue URL.
SIW: follow the SIW-owned issue creation/update protocol from kramme:siw:issue-define. 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.
Create siw/issues/ISSUE-{prefix}-{NNN}-{slug}.md as a kramme:siw:issue-define-compatible issue, not as a raw paste of the drafted Linear body. Use the prefix and number scheme already in use in siw/issues/ (typically G for general or P{N} for phased; pad to 3 digits), and use the kramme:siw:issue-define title sanitization for the slug. Pick the next unused number for the prefix so a re-run never overwrites an existing issue file. The issue file must include the standard SIW header and status line:
# ISSUE-{prefix}-{NNN}: {title}
**Status:** READY | **Priority:** {High|Medium|Low} | **Size:** {XS|S|M|L} | **Phase:** {N or General} | **Parallelization:** {Safe to parallelize | Must be sequential | Needs coordination} | **Mode:** AUTO | **Related:** Debug triage
Then place the drafted triage body below that metadata. Add the overview row with status READY and the log entry required by the SIW-owned protocol. If any write fails, surface the error and offer the user a chance to roll back the partial create.
Markdown fallback: write BUG-{slug}-{YYYY-MM-DD}.md to the project root with the full body. If that file already exists (same-day re-run), append a numeric suffix (-2, -3, …) rather than overwriting. Surface the absolute path.
Repeat the durability grep from Phase 6 against the created body. For the SIW or markdown sink, grep the written file; for the Linear sink there is no local file, so grep the body string you submitted. Classify matches using the Phase 6 rules — matches in prose are a RED FLAG; surface them and prompt the user to edit. Do not silently rewrite.
Emit a final block:
CHANGES MADE
- Created issue at {sink}: {URL or path}
- Body length: {chars}; durability grep: {clean | <count> matches in code blocks only}
THINGS I DIDN'T TOUCH
- The fix itself — implementation belongs to kramme:linear:issue-implement / kramme:siw:issue-implement.
- Any related issues or follow-ups noticed during investigation (logged below).
POTENTIAL CONCERNS
- {confidence rating from Phase 3 if Medium or Low}
- {entries from investigate's epilogue (NOTICED BUT NOT TOUCHING / POTENTIAL CONCERNS sections), if present}
Adopt the kramme plugin-wide vocabulary verbatim, one per line, uppercase, no decoration:
STACK DETECTED — language / framework / test runner identified during investigation.UNVERIFIED — assumption flagged in the issue body or in this skill's reasoning that has not been confirmed.NOTICED BUT NOT TOUCHING — out-of-scope observation surfaced in the final summary, not in the issue body.CONFUSION — clarification needed before proceeding.MISSING REQUIREMENT — decision/input needed from the user.PLAN — announce next phases before acting.CHANGES MADE / THINGS I DIDN'T TOUCH / POTENTIAL CONCERNS — end-of-turn triplet.RED FLAG — used in Phase 10 when the durability grep finds matches in prose.Reuse from kramme:debug:investigate:
[REPRODUCE], [ISOLATE], [ROOT CAUSE], [VERIFY] — these markers may appear in the captured investigate output. Keep them in working notes but do not include :\d+ content from these markers in the issue body.Watch for these — they signal the durability rule is about to break.
| Excuse | Reality | | --- | --- | | "The file path is the clearest way to point at the bug." | Paths rot. The reader six months from now needs the behavior the bug breaks, not yesterday's filename. | | "Line numbers are pinned to a commit, so they're stable." | They're stable until the next refactor. The issue is supposed to outlive that. | | "The internal helper name is the actual root cause." | If the bug is "this private helper is wrong," the fix is also rename-stable: describe the contract the helper represents. | | "If I strip everything internal, the issue is too vague." | Then the investigation isn't done. The contract-level statement should exist; if it doesn't, return to Phase 3. | | "I'll just include the file path in a code block — that's allowed." | Code blocks are for repro commands. A bare path is still a path; readers parse it the same way. |
:\d+ pattern outside a fenced code block.Low confidence and no clarifying question was asked.--yes but the durability grep returned matches in prose — bypass the gate would file a leaky issue. Halt and require explicit approval.kramme:debug:investigate — source of the investigation phase (Steps 1–6 + Step 8 reporting). The orchestrator stops it at the propose-fix gate via the "Report only" option.kramme:test:tdd — source of the Prove-It cycle conventions and RED-GREEN structure used in Phase 4. v1 captures the patterns; the sub-skill itself may not be invocable as a pure planner (see Phase 4 caveat).kramme:linear:issue-define — source of issue-creation conventions (title format, template selection, metadata). v1 issues the create call directly through the available Linear create operation (Claude Code mcp__linear__create_issue; Codex save_issue without id) for predictable interception, but the body shape mirrors the Simple Bug Template and Comprehensive Template from issue-define's assets. Both skills enforce the same durability constraint: issue-define via its **Affected area:** field (module / behavior / contract, not paths or line numbers), this skill via the durability grep.kramme:linear:issue-implement / kramme:siw:issue-implement — downstream consumers. The ticket body produced here is designed to be picked up by these flows without re-investigation.$ARGUMENTS had a description).[ROOT CAUSE] line and a confidence rating.--yes was passed).CHANGES MADE block.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.