kramme-cc-workflow/skills/kramme:debug:investigate/SKILL.md
Structured bug investigation workflow: reproduce, isolate, trace root cause, and fix. Use when debugging a bug, investigating an error, or tracking down a regression.
npx skillsauth add abildtoft/kramme-cc-workflow kramme:debug:investigateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Structured debugging workflow: reproduce, isolate, trace root cause, and fix. Maintains an investigation log throughout with evidence and confidence assessment.
IMPORTANT: Follow all phases systematically. Do not skip to a fix without tracing the root cause first.
Not for: performance profiling, greenfield feature work, or changes whose cause is already known — go straight to the change in those cases.
/kramme:debug:investigate "TypeError: Cannot read property 'id' of undefined"
|
v
[Step 1: Parse Input] -> Bug description / error / Linear issue
|
v
[Step 2: Reproduce] -> Confirm bug exists, find trigger
|
v
[Step 3: Isolate] -> Narrow scope to files/functions
|
v
[Step 4: Trace Root Cause] -> Follow data flow, git bisect if regression
|
v
[Step 5: Document Findings] -> Structured investigation log
|
v
[Step 6: Propose Fix] -> Confidence assessment + user approval
|
v
[Step 7: Implement and Verify] -> Fix + regression test + verify
|
v
[Step 8: Summary] -> Root cause, fix, verification status
If $ARGUMENTS matches a Linear issue pattern (e.g., TEAM-123):
mcp__linear__get_issue).If $ARGUMENTS contains an error message: use as a grep search target.
If $ARGUMENTS is free text: use as bug description.
If $ARGUMENTS is empty: ask the user — "What bug should I investigate? Describe it, paste an error message, or provide a Linear issue ID." Wait for a response before continuing.
Store as BUG_DESCRIPTION.
Search the codebase for the error message or relevant symbols using Grep.
Check for existing tests that cover the affected area — run them.
If reproduction is found, log: [REPRODUCE] Confirmed via {method}
If no reproduction path found:
AskUserQuestion
header: Reproduction
question: How can this bug be reproduced?
options:
- Run specific test — I'll provide the test command
- Steps to follow — I'll describe the reproduction steps
- Cannot reproduce — the bug is intermittent or environment-specific
[REPRODUCE] {method} → {result: confirmed/unconfirmed}From the error location (Step 2), identify affected files.
Read surrounding code to understand module boundaries and data flow.
Grep for all callers and call sites of the affected function/method.
Classify the scope:
If multiple candidate areas found:
AskUserQuestion
header: Multiple Candidate Areas
question: The bug could originate in several areas. Where should I focus first?
options:
- "{area 1}: {evidence}"
- "{area 2}: {evidence}"
- "Investigate all candidates"
[ISOLATE] Scope narrowed to {files/functions}Read identified code paths in full. Follow execution from trigger to error.
Check for regression — if the bug may have been introduced recently:
AskUserQuestion
header: Regression Investigation
question: This looks like it may be a regression. Use git bisect to find the introducing commit?
options:
- Yes, run git bisect
- No, continue manual trace
If bisecting:
references/bisect-guide.md.git bisect run <test-command>.git bisect reset when finished — and before any fallback or early exit — to restore the working tree.Consult investigation patterns:
references/investigation-patterns.md.Trace data flow from origin to error point. Track variable values through assignments and transformations.
Log: [ROOT CAUSE] {description} at {file}:{line}
Read the log template from assets/investigation-log.md and fill it in from the timeline logs ([REPRODUCE], [ISOLATE], [ROOT CAUSE]) and findings gathered so far. Capture evidence — code snippets, test output, bisect results — under the relevant sections.
Store the completed log for inclusion in the final summary.
Assess confidence:
If confidence is Low: present findings to user before proceeding.
Ask the user:
AskUserQuestion
header: Fix Strategy
question: "Root cause identified with {confidence} confidence. How to proceed?"
options:
- Implement fix + write regression test
- Implement fix only, skip test
- Report findings only, do not change code
If Report only: skip to Step 8.
[FIX] Applied at {file}:{line}[TEST] Regression test at {test_file}/kramme:verify:run if available.[VERIFY] Tests: {PASS/FAIL}, Build: {PASS/FAIL}Bug Investigation Complete
==========================
Bug: {BUG_DESCRIPTION}
Root Cause: {one-line summary}
Confidence: High / Medium / Low
Location: {file}:{line}
Fix Applied: Yes / No
Files Modified: {list}
Regression Test: {test file path}
Verification:
Tests: PASS / FAIL
Build: PASS / FAIL
Investigation Log:
(include the completed log from Step 5)
STOP — Do not continue beyond this point. The investigation is complete.
| Scenario | Action |
| --- | --- |
| Error message not found in codebase | Widen search: partial matches, case-insensitive, related symbols. Ask user for context. |
| Git bisect fails | Run git bisect reset to restore the tree, then fall back to manual trace using investigation patterns. |
| Fix verification fails after 3 iterations | Present failures, suggest manual investigation. |
| Linear MCP unavailable | Treat issue ref as text, ask user to paste content. |
| No test framework detected | Skip regression test. Note in summary. |
| Codebase too large for broad grep | Ask user to narrow scope to specific directories. |
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.
data-ai
Remove all DONE issues and renumber remaining issues within each prefix group. Not for editing live issue content, archiving still-open issues, or moving issues between prefix groups.