/ct:stacktrace-triagefrom ct
Parses stack traces, identifies runtime, separates user/lib frames, locates top user frame, and produces ranked hypothesis tree. Read-only diagnosis before fixing.
Ships in ct. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Parse, rank, hypothesise. Read-only diagnosis before any fix attempt.
The value of this skill is separation of diagnosis from action. Jumping to a fix off a stack trace is the canonical way to patch the wrong line and introduce a second bug. This skill produces a ranked hypothesis tree grounded in the actual code at the named frame, so the next step is informed.
debugger agent afterwards to reproduce, verify, and fix.INGEST → Take stack text from user message or file
PARSE → Extract frames + identify language/runtime
RANK → Separate user frames from library frames
LOCATE → Find top user frame in source
HYPOTHESIZE → Produce top-3 ranked causes
PROPOSE → Recommend ONE diagnostic next step
Accept the stack trace from the user's message. If the user named a file (e.g. logs/error.log), Read it.
If the "trace" is a single line with no frames, STOP and say: "That looks like an error message without a stack. Paste more context (frames above/below) or the full log excerpt."
Identify the structural shape of a stack frame in this trace, then apply that shape to every frame. Match on SHAPE, not on language — many languages share shapes, and new languages appear regularly.
Every stack frame contains, minimally, three elements: a function/method identifier, a file path, and a line number (column optional). Languages differ only in their ordering and delimiters. Look at the FIRST TWO frames — their shared layout is your parser for the rest of the trace.
Common shapes for reference (illustrative, not exhaustive — apply the underlying pattern, not the label):
| Shape | Typical origins |
|---|---|
File "path", line N, in function | Python |
at function_name (path:line:col) or at path:line:col | modern JS/TS runtimes |
at package.Class.method(File:line) | JVM languages (Java, Kotlin, Scala, Clojure) |
path:line:col under a backtrace header, with function on a neighbouring line | Rust (stack backtrace:), many others |
function_name(...)\n\tpath:line +0xNN | Go |
path:line:in 'method_name' | Ruby |
at Namespace.Class.Method() in File:line N | .NET |
#N <addr> in function_name at path:line | debuggers (LLDB, GDB) |
If the trace's shape does NOT match any familiar pattern but is internally consistent (every frame has the same layout), parse it anyway by visually identifying the three structural elements (function, file, line) in each frame. The triage works without a runtime label as long as Phase 3 can tell user frames apart from library frames.
Ask the user to name the runtime ONLY if:
Record:
NullPointerException, TypeError, panic: runtime error: index out of range, or the first non-frame line of the trace when the runtime emits untyped errors).Separate user-code frames from library/runtime frames. The real rule is "inside the project tree vs outside" — the prefix lists below are examples to recognise, not an exhaustive list to match against.
User frames — paths inside the project repo. Typical signals: relative paths or absolute paths beginning with the repo root. Common project-internal directory names (examples, not exhaustive): src/, lib/, internal/, app/, pkg/, cmd/, main/, Sources/, source/, crates/, packages/, apps/, modules/, or the filename at trace root with no directory prefix.
Library frames — paths OUTSIDE the project tree. Common signals (examples, not exhaustive): node_modules/, .venv/, site-packages/, dist-packages/, vendor/, ~/.cargo/registry, ~/go/pkg/mod, .stack-work/, .mix/, _build/deps/, platform library roots (/usr/lib/, /usr/local/lib/), language-runtime package prefixes (java., javax., sun., jdk., kotlin., scala., etc.), pseudo-paths (<anonymous>, <internal>, <native code>, <runtime>).
The top user-code frame is the first (most recent) user frame in the stack. That is where the proximate cause lives. Everything below it is context for how control reached that point.
If the frame paths are ambiguous — e.g. a monorepo where packages/* could be either project code or vendored deps — ask the user which paths are the project's own code and which are dependencies.
If there are ZERO user-code frames (pure library/runtime crash), STOP and say exactly:
This stack has no user-code frames — every frame is library or runtime. The proximate cause is not in your code directly. Paste the surrounding log (lines before the panic/exception) or the input that triggered it.
Find the source of the top user-code frame. Follow the project CLAUDE.md <tool_priority>:
goToDefinition on the function named in the frame.gabb_structure — supports Rust, Go, Python, TS/JS, Kotlin, C++, C#, Ruby.Grep pattern="<function_name>" path="<file_from_frame>"
If Grep with no path scoping returns >20 candidates, STOP and say: "Grep fallback is too broad (>20 matches). Paste more context — e.g. the module or class containing this function."Read the function body at the frame's line. Scope: ±10 lines around the line number in the frame. Do NOT read the entire file unless the hypothesis tree demands cross-function context.
Produce a ranked top-3 cause tree. Cap at 3. Each hypothesis must cite code or frame evidence — no speculation.
Format each exactly:
H1 (most likely): <one-sentence hypothesis, with line number>
evidence:
frame: <frame-verbatim>
code (±10 lines of line N):
<code excerpt, ≤15 lines>
pattern: <named pattern, if applicable>
H2 (plausible): ...
H3 (worth checking): ...
Named patterns to recognise when they match:
with / defer / using / finally.<= where < is needed, or len where len - 1 is.If only 1 hypothesis is evidence-supported, produce 1. Do not pad to 3.
Recommend exactly ONE of the following:
<specific log line>."<X> to eliminate H2."git log -5 --oneline <path>."<file>) — the null likely originates one frame up."Do NOT propose a code change. Runtime failures go to the debugger agent, which reproduces, verifies, and fixes. Call it out explicitly:
To patch this, dispatch the
debuggeragent with H1 as input — it will reproduce, verify, and produce a minimal fix.
Total output ≤ 400 words. Code excerpts ≤ 15 lines per hypothesis. Frame quotes ≤ 3 lines each.
If output would exceed 400 words, drop H3 first, then shrink H2's code excerpt, then drop H2. Never drop H1.
## Stacktrace Triage — <runtime>
**Error:** <type>: <message>
**Top user-code frame:** <file>:<line> in <function>
### Hypotheses
H1 (most likely): ...
evidence: <frame / code / pattern>
H2 (plausible): ...
H3 (worth checking): ...
### Next step
<exactly one recommended diagnostic>
### To apply a fix
Dispatch the `debugger` agent with H1 as input.
Both gates STOP the skill before Phase 5 when tripped:
| Gate | Condition | Action |
|---|---|---|
| No user frames | Every frame is library/runtime | Report and ask for more context |
| Grep too broad | Grep fallback returns >20 matches | Report and ask for module/class context |
| Thought | Reality |
|---|---|
| "I'll just apply the fix" | Out of scope. Hand off to debugger. |
| "The top frame is in node_modules so the bug is there" | No. The proximate cause is the top user frame. Library frames are the context, not the cause. |
| "I can tell what the bug is without reading the code" | Read the function body at the frame's line. Every time. |
| "All 3 hypotheses are equally likely" | Then your evidence is thin. Collapse to 1 H1 and ask for more context. |
What SKILL.md sets; muted values are Claude Code's defaults
opusnpx claudepluginhub pvillega/claude-templates --plugin ct38 skills in this plugin
/argocdDeep ArgoCD operational intuition — sync waves and hook lifecycle, ApplicationSet generators, Sync vs Health, drift root causes, sync options, AppProject constraints, rollback, multi-cluster. Load for sync ordering, hook design, drift diagnosis, generator selection, rollback planning, or multi-cluster registration. Skip for "what is GitOps", install walkthroughs, or basic Application YAML. Triggers on: "sync wave", "presync hook", "syncfail", "applicationset generator", "matrix generator", "hpa replicas drift", "ignoreDifferences", "ServerSideApply", "Replace=true", "self-heal", "app-of-apps cascade".
/audit-skillsAudit installed skills for redundancy with built-in model knowledge. Use when asked to "audit skills", "review my skills", "check skill redundancy", "which skills are useful", "clean up skills", or "are my skills teaching you anything new"./Other plugins' skills for the same job