agentsclimarketplace

Diagnosis

Skill jacob-balslev/skill-graph/marketplace/skills/diagnosis

Skills that know your codebase. Repo-grounded, contract-validated, agent-routable.

Install
npx -y skills add jacob-balslev/skill-graph --skill diagnosis

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when facing an unknown software failure, when symptoms point to different root causes, or when an initial debugging attempt has not converged. Provides a triage-first diagnostic routing framework: classify the failure, collect the right evidence, choose a technique, track confidence, and escalate when stuck. Do NOT use for executing scientific debugging after triage (use `debugging`), code-quality review (use `code-review`), or proactive observability setup. Do NOT use for actually execute scientific-method debugging on this stack trace. Do NOT use for review this AI-generated PR for correctness. Do NOT use for scan this repo for OWASP top 10 vulnerabilities. Do NOT use for design observability instrumentation for this service. Do NOT use for decide which agent should pick up this ticket. Do NOT use for what's the right test pyramid for this feature.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

34.0 KB, ~5.4k tokens by cl100k_base, as published. Nobody here has run it

Diagnosis

Concept of the skill

Use when facing an unknown software failure, when symptoms point to different root causes, or when an initial debugging attempt has not converged.

Coverage

The triage-first framework that classifies a software failure into a problem class and routes it to the right diagnostic technique before root-cause investigation begins. Names nine symptom classes — Logic Error, Runtime Crash, Data Integrity, Timing / Race, Performance, Configuration, Security, Integration, Tooling / Build / Script-path — and provides a classification decision tree that walks from "is there a stack trace?" to a single class. Specifies a universal evidence-collection protocol (exact error message, reproduction steps, last-known-good state, environment facts) and class-specific evidence checklists. Lays out the technique-selection matrix — stack-trace reading, data-flow tracing, git bisect, differential comparison, instrumentation, MRE isolation, profiling, boundary probing — with each technique's time cost, best-case class, and evidence prerequisite. Defines the diagnostic confidence ladder (level 0 Symptom → 1 Classified → 2 Localized → 3 Root Cause → 4 Verified Fix) with explicit "you can say / you cannot say" boundaries at each level and stuck-state checkpoints (5-min, 10-min, 15-min, oscillation). Names escalation criteria for switching approach, switching class, or escalating to a human. Covers three cross-domain patterns where multiple classes apply simultaneously: the Cascade (one root cause, many symptoms), the Coincidence (two unrelated bugs that look like one), the Environment Ghost (works in one environment, fails in another). Catalogues diagnostic anti-patterns and ships a structured diagnostic-session template.

Philosophy of the skill

Debugging fails most often not because the engineer lacks skill, but because the wrong methodology is applied to the problem class. A timing bug needs different tools than a data-integrity bug. A scope leak needs different thinking than a rendering glitch. The most expensive debugging mistake is spending 30 minutes applying scientific-method debugging to what is actually a configuration error discoverable in 2 minutes.

This skill is the triage nurse, not the surgeon. A nurse does not treat the patient — they take vital signs, route to cardiology or neurology, and escalate to the attending physician when criteria are met. Software diagnosis works the same way: collect evidence, classify the symptom, route to the right specialist technique, and pivot when convergence stalls. The small cost of triage is almost always smaller than the cost of chasing a plausible but wrong cause. Skipping triage because "the cause is obvious" is a confirmation-bias trap; even seasoned engineers benefit from making the classification step explicit.

1. The Diagnostic Triage Protocol

Before debugging, diagnose which kind of problem you have. The class determines the technique and the technique determines the time-to-fix.

1. Collect baseline evidence (Section 3)
2. Classify the symptom            (Section 2)
3. Select the diagnostic technique (Section 4)
4. Execute using the routed technique
5. If not converging after 3 attempts, escalate (Section 6)

Rule: never start fixing before completing steps 1–3. The cost of misclassification often exceeds the cost of a short triage pass, and the written classification gives the next person something concrete to challenge.

Diagnosis vs debugging handoff

SurfaceDiagnosis ownsHandoff signalNext owner
Failure triageEvidence collection, symptom class, technique choice, confidence level, escalation triggerThe failure has a primary class, a chosen technique, and enough evidence to run itdebugging
Root-cause executionReproduction, scope reduction, instrumentation, hypothesis testing, fix verification, regression testThe selected technique has started producing falsifiable evidencedebugging
Error capture pipelineWhether the failure was captured, sanitized, and made observableThe problem is "this error was not reported or was reported unsafely"error-tracking
Pre-merge quality reviewWhether the code is risky before a known failure existsThe question is about correctness risk, maintainability, or review feedback rather than an observed symptomcode-review
Security investigationThreat-model-specific analysis against an attack classEvidence points at auth, authorization, injection, secret exposure, or data exposureowasp-security

Treat the handoff as a contract, not a vague recommendation. Diagnosis does not fix the bug; it decides which investigation path is justified by evidence.

2. Symptom-Classification Taxonomy

Every failure falls into one of nine classes. Each class has a primary diagnostic technique.

ClassSymptomsPrimary technique
Logic ErrorWrong output, wrong calculation, wrong state transitionTrace data flow; compare expected vs actual at each stage
Runtime CrashUnhandled exception, process exit, 500 errorRead stack trace; find the throwing line; check preconditions
Data IntegrityMissing records, wrong totals, duplicate entries, cross-tenant leakCompare source data to derived data at each transform stage
Timing / RaceIntermittent failure, works on retry, order-dependentAdd timestamps to logs; look for concurrent mutations; check locks
PerformanceSlow response, timeout, memory growth, CPU spikeProfile first (measure before hypothesizing); find the hot path
ConfigurationWorks locally but not in staging / prod, env-dependentDiff environments — env vars, versions, feature flags, DNS, SSL
SecurityAuth bypass, data exposure, HMAC failure, injectionFollow data flow from untrusted input to sensitive operation
IntegrationWebhook not arriving, API returning unexpected shape, sync driftCheck both sides of the boundary independently, then compare
Tooling / Build / Script-pathCannot find module, wrong cwd, stale script paths, read EIO, ENOENT on a scriptVerify path resolution; check cwd; verify dependency install; compare referenced path vs actual filesystem path

Classification decision tree

Is there a stack trace or error message?
  YES → Does it point to a specific line?
          YES → Runtime Crash (read the line; check preconditions)
          NO  → Is it a timeout or OOM?
                  YES → Performance
                  NO  → Logic Error (the error is a symptom of wrong state)
  NO  → Is the output wrong but no error thrown?
          YES → Is the wrongness in calculated numbers or records?
                  YES → Data Integrity
                  NO  → Logic Error
          NO  → Is it intermittent?
                  YES → Timing / Race
                  NO  → Does it depend on environment?
                          YES → Configuration
                          NO  → Does the error message contain a file/module path?
                                  YES → Tooling / Build / Script-path
                                  NO  → Does it involve external services?
                                          YES → Integration
                                          NO  → Are there security signals
                                                (auth failure, permission error,
                                                unexpected data exposure, HMAC failure,
                                                access-control bypass)?
                                                  YES → Security
                                                  NO  → Unknown / Unclassified
                                                          → restart evidence collection;
                                                            run a fresh investigative sweep

3. Evidence-Collection Protocol

Before forming any hypothesis, collect baseline evidence. The class determines the additional evidence needed beyond the universal set.

Evidence safety rule

Diagnostic notes, logs, screenshots, and repro snippets often contain more sensitive information than the final fix. Collect enough evidence to classify the failure, but redact or replace personal data, credentials, session tokens, raw request bodies, and secret-bearing headers before copying evidence into a shared note, issue, audit artifact, or skill. Prefer internal opaque IDs, hashes, synthetic examples, and minimal reproductions over real payload dumps.

Universal evidence (always collect)

EvidenceHow to collectWhy
Exact error message or wrong outputCopy from logs, terminal, or UIPrevents paraphrasing errors
Reproduction stepsThe minimal sequence that triggers the failureProves the bug exists and is testable
Last-known-good stategit log --oneline -10, recent deploys, recent data changesBrackets the introduction window
Environment factsRuntime version, env vars, database state, running servicesEliminates the Configuration class early

Class-specific evidence

ClassAdditional evidence to collect
Logic ErrorInput data, expected output, actual output, intermediate values at key transform points
Runtime CrashFull stack trace, request payload, database state at crash time
Data IntegritySource record count vs derived count, sample rows from each stage, tenant / scope identifiers
Timing / RaceTimestamps of concurrent operations, lock state, retry behaviour, whether it reproduces under load
PerformanceResponse-time baseline, CPU / memory profile, query plans (EXPLAIN), N+1 query check
ConfigurationEnv-var diff (local vs staging vs prod), package-version diff, feature-flag state
SecurityAuth state, session-token contents, role / permission, request headers, HMAC comparison
IntegrationRequest / response pair from both sides, delivery logs, timestamp alignment
Tooling / Build / Script-pathModule-resolution output, current working directory at failure, dependency-install verification, referenced path vs filesystem path

Rule: if you cannot fill the universal evidence table, you are not ready to hypothesize. Collect first, think second.

Evidence ledger

Use an evidence ledger when the investigation has more than one plausible class. This keeps assumptions separate from observations and prevents confidence inflation.

FieldRecordExample
ObservationRaw fact, redacted if sensitivePOST /webhook returns 401 in staging only
SourceWhere the fact came fromDeployment log, stack trace, profile, sanitized request sample
Class signalWhich class it supportsConfiguration, Integration, Security
ContradictionWhich class it weakensLogic Error: same code path passes locally
Next testCheapest falsification stepCompare staging and local signing secret metadata without exposing the secret

If an observation changes the likely class, update the class explicitly. Silent reclassification is how investigations drift into mythology.

4. Technique-Selection Matrix

Once the symptom is classified, pick the cheapest technique that could resolve the class.

TechniqueBest forTime costEvidence required
Stack-trace readingRuntime crashes, unhandled exceptions1–2 minStack trace
Data-flow tracingLogic errors, data integrity5–15 minInput + output at each stage
Binary search (git bisect)Regressions with known-good state3–10 minKnown-good commit + reproducible test
Differential comparisonConfiguration, environment-dependent failure2–5 minTwo environments to compare
Instrumentation (logging)Timing / race, intermittent failures5–10 min setupHypothesis about where to instrument
Isolation (MRE)Complex failures with many variables10–20 minReproducible failure
ProfilingPerformance, memory, CPU5–15 minRunning system under load
Boundary probingIntegration failures5–10 minAccess to both sides of the integration

Technique-ordering principle

Always start with the cheapest technique that could resolve the class:

  1. Read the error (~30 s) — cheapest first pass for runtime crashes
  2. Check the environment (~1 min) — cheapest first pass for configuration issues
  3. Trace the data flow (~5 min) — cheapest first pass for logic / data errors
  4. Isolate with MRE (~10 min) — useful when too many variables remain in play
  5. Instrument and observe (~10+ min) — necessary when timing / intermittent failures cannot be reproduced directly

The percentages are intentionally absent. This skill is a routing framework, not a benchmark claim. Use local incident history or an actual eval corpus before making quantified success-rate claims.

5. The Diagnostic Confidence Ladder

As evidence accumulates, confidence in the diagnosis should increase monotonically. If it doesn't, the symptom has been misclassified.

LevelConfidenceYou can sayYou cannot say
0 — Symptom0%"Something is wrong"Anything about the cause
1 — Classified20%"This is a [class] problem"Where specifically
2 — Localized50%"The failure is in [module / file / function]"What exactly is wrong
3 — Root cause80%"The cause is [specific condition]"That the fix will work
4 — Verified fix95%"This fix resolves the root cause and does not regress"Nothing — ship it

Stuck-state checkpoints

  • Stuck at level 0 for > 5 min → you need more evidence; restart Section 3
  • Stuck at level 1 for > 10 min → likely misclassification; re-run the classification tree
  • Stuck at level 2 for > 15 min → the problem may be cross-domain; check whether multiple classes apply
  • Oscillating between levels → stop. Write down what you know vs what you're assuming. The assumption is wrong.

Reclassification rule

Classification is provisional until the evidence keeps moving the confidence ladder upward. Re-run the classification tree when any of these happens:

SignalMeaningRequired action
The selected technique produces no new evidenceThe class may be wrong or the evidence prerequisite is missingRe-check Section 3, then choose the next cheapest class-compatible technique
A contradiction appearsThe current class does not explain all observationsSplit observation from assumption in the evidence ledger and reclassify
Confidence decreases after a testThe hypothesis was falsified, not "almost right"Record the falsification and move down the ladder before continuing
Two classes stay equally plausibleThe failure may be a Cascade or CoincidenceTest the earliest shared data-flow point, then split symptoms if one fix does not affect both

6. Escalation Criteria

Switch diagnostic approach when

SignalAction
Three hypotheses tested, none confirmedRe-classify the symptom from scratch
Fix works locally but not in target envSwitch to Configuration-class techniques
Multiple symptoms that don't share a root causeYou may have 2+ bugs; triage each independently
Evidence contradicts the classificationTrust the evidence; re-classify
Confidence has decreased over the last 3 stepsStop. You're making it worse. Fresh context needed.

Escalate to human when

SignalWhy a human is needed
Requires access you don't have (production DB, third-party dashboard)Authorization boundary
Business-logic ambiguity ("should this return 0 or null?")Product decision, not technical
Fix requires a breaking change to a public APIStakeholder alignment needed
Reproduction requires real user data you cannot accessPrivacy / compliance boundary
30 minutes of investigation with no progressFresh perspective needed

7. Cross-Domain Patterns

Some failures span multiple classes simultaneously. These compound failures are the hardest to diagnose.

Pattern: the Cascade

A single root cause triggers symptoms across multiple classes.

Root cause: missing null-check in a data transform
  → Data Integrity symptom: wrong totals
  → Logic Error symptom:    UI shows negative values
  → Integration symptom:    webhook payload rejected by partner

Diagnostic approach: find the earliest symptom in the data flow. That's closest to the root cause.

Pattern: the Coincidence

Two unrelated bugs appear simultaneously, creating a misleading compound symptom.

Bug A: CSS regression from a recent deploy        (Logic Error)
Bug B: slow API from an unrelated query change    (Performance)
Combined symptom: "the page is broken and slow"

Diagnostic approach: separate the symptoms. Test each independently. If fixing one doesn't affect the other, they're independent bugs.

Pattern: the Environment Ghost

Works in one environment, fails in another, with no code difference.

Local:    works   (runtime 20.11, .env.local, fresh DB)
Staging:  fails   (runtime 20.9,  CI env vars, migrated DB)

Diagnostic approach: diff everything — runtime versions, env vars, DB state, feature flags, DNS, SSL, headers. The first difference you find is usually the cause.

8. Anti-Patterns

Anti-patternWhy it failsCorrect
Fixing before diagnosingTreats the symptom; root cause persistsComplete the triage protocol first
Hypothesis without evidenceConfirmation bias drives you toward your guessCollect universal evidence before any hypothesis
Changing multiple variables at onceCannot determine which change had the effectOne variable at a time
Assuming the obvious cause"Obvious" often means "familiar," not "verified"Verify with evidence even when "obvious"
Copying raw sensitive data into evidenceThe diagnostic artifact becomes a privacy or secret leakRedact, synthesize, hash, or replace with opaque IDs
Debugging by printf without a hypothesisRandom instrumentation wastes timeInstrument to test a specific hypothesis
Applying the wrong class's techniquePerformance profiling won't find a logic errorRe-classify if the technique isn't converging
Escalating too earlyHasn't gathered enough evidence for a useful escalationFill the evidence table before escalating
Escalating too lateSpent 45 minutes on what a human could resolve in 5Follow the time-based escalation triggers

9. Diagnostic-Session Template

Use this template to structure a diagnostic session. It prevents skipping steps.

## Diagnostic Session: [Brief description]

### 1. Symptom

- What: [exact error or wrong behavior]
- Where: [route / component / job]
- When: [always / intermittent / environment-specific]
- Since: [commit / deploy / data change]

### 2. Classification

- Primary class: [from taxonomy]
- Confidence: [0–4 level]
- Technique: [from technique matrix]

### 3. Evidence Collected

- [ ] Error message / wrong output (exact)
- [ ] Reproduction steps (minimal)
- [ ] Last-known-good state
- [ ] Environment facts
- [ ] Sensitive evidence redacted or replaced with safe identifiers
- [ ] Class-specific evidence: [list]

### 4. Evidence Ledger

| Observation | Source | Class signal | Contradiction | Next test |
| ----------- | ------ | ------------ | ------------- | --------- |
|             |        |              |               |           |

### 5. Hypotheses Tested

| #   | Hypothesis | Test | Result | Confidence after |
| --- | ---------- | ---- | ------ | ---------------- |
| 1   |            |      |        |                  |

### 6. Resolution

- Root cause: [one sentence]
- Fix: [what was changed]
- Prevention: [test / guard / doc added]

Grounding and Evaluation State

This skill is grounded in public troubleshooting and diagnostic-practice references: Google SRE troubleshooting guidance, git bisect documentation for regression bisection, Stack Overflow MRE guidance for isolation, Chrome DevTools and PostgreSQL EXPLAIN docs for measurement/profiling examples, OWASP logging guidance for diagnostic event capture, and OpenTelemetry sensitive-data guidance for safe telemetry handling.

The current eval metadata remains intentionally conservative: eval_artifacts: planned, eval_state: unverified, and routing_eval: absent. Do not mark this skill verified or routing-present until a real comprehension eval and routing eval include diagnosis and pass in the same change.

Verification

  • The symptom was classified before any debugging technique was chosen
  • Baseline evidence was collected before any hypothesis was formed
  • Sensitive or secret-bearing evidence was redacted, synthesized, hashed, or replaced with opaque IDs before sharing
  • The cheapest technique that could resolve this class was tried first
  • Confidence increased monotonically — or the symptom was re-classified the moment it didn't
  • If the approach was changed, the reason was documented (which signal triggered the switch)
  • The time-based stuck-state checkpoints were respected (5-min / 10-min / 15-min triggers)
  • If the failure spanned multiple classes, the cross-domain pattern (Cascade / Coincidence / Environment Ghost) was named explicitly

Do NOT Use When

Use insteadWhen
debuggingActually executing scientific-method debugging on a failure that has already been classified — this skill routes to debugging; it does not replace it
code-reviewReviewing code for quality / correctness before a failure exists — diagnosis is downstream
owasp-securityA focused security audit against a known threat list — diagnosis only routes here when symptoms point at security
testing-strategyDeciding what to test proactively — diagnosis is for reactive investigation after a failure
error-trackingSetting up the production-error-capture / sampling / alerting stack — diagnosis investigates a specific failure already in front of you
skill-routerChoosing which agent skill activates for an arbitrary query — that's cross-skill dispatch, not failure triage

Skill Graph context

<!-- skill-graph-context:start (generated — do not edit by hand) -->

Classification

  • Subject: software-engineering-method
  • Public: true
  • Domain: engineering/debugging
  • Scope: Use when facing an unknown software failure, when symptoms point to different root causes, or when an initial debugging attempt has not converged. Provides a triage-first diagnostic routing framework: classify the failure, collect the right evidence, choose a technique, track confidence, and escalate when stuck. Do NOT use for executing scientific debugging after triage (use debugging), code-quality review (use code-review), or proactive observability setup.

When to use

  • the agent has been chasing this bug for 30 minutes — what's the structural fix?
  • the symptoms span data integrity and UI rendering — which is the root cause?
  • the build fails locally but passes in CI — how do I diagnose that class first?
  • I have a stack trace and an unhandled exception — what's the cheapest technique?
  • intermittent failure that doesn't reproduce on retry — which class is this?
  • we ran profiling, instrumentation, and bisect — none converge. What did we misclassify?
  • two engineers disagree on whether this is a config issue or a logic error — what evidence settles it?

Not for

  • actually execute scientific-method debugging on this stack trace
  • review this AI-generated PR for correctness
  • scan this repo for OWASP top 10 vulnerabilities
  • design observability instrumentation for this service
  • decide which agent should pick up this ticket
  • what's the right test pyramid for this feature

Related skills

  • Verify with: debugging, a11y
  • Related: code-review, error-tracking, owasp-security, testing-strategy, debugging

Grounding

  • Mode: universal
  • Truth sources: https://sre.google/sre-book/effective-troubleshooting/, https://git-scm.com/docs/git-bisect, https://stackoverflow.com/help/minimal-reproducible-example, https://developer.chrome.com/docs/devtools/performance/overview, https://www.postgresql.org/docs/current/sql-explain.html, https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html, https://opentelemetry.io/docs/security/handling-sensitive-data/

Keywords

  • diagnostic triage software failure, symptom classification taxonomy, what kind of bug is this, which debugging approach, diagnostic routing framework, evidence collection before hypothesis, confidence ladder debugging, escalation criteria debugging, cascade vs coincidence failure, environment ghost
<!-- skill-graph-context:end -->

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most debug triage skills give in ~5.4k tokens

Counted across 839 of the 1,149 authors here whose files we hold, read 2026-08-07

  • Investigate root cause before proposing any fixin 102 of 839, across 67 files
  • Read error messages completelyin 89 of 839, across 49 files
  • Create a failing test case before fixingin 84 of 839, across 46 files
  • Reproduce the issue consistentlyin 82 of 839, across 41 files
  • Change one variable at a timein 82 of 839, across 42 files
  • Check recent changesin 74 of 839, across 36 files
  • Write the regression test before fixingin 74 of 839, across 40 files
  • Fix the root cause not the symptomin 60 of 839, across 45 files
  • Implement a single fix at a timein 59 of 839, across 20 files
  • Trace data flow backward to the sourcein 50 of 839, across 20 files
  • Remove all debug instrumentationin 49 of 839, across 13 files
  • Form a single hypothesisin 48 of 839, across 18 files

Said here and by no other author read

  • collect baseline evidence before hypothesizing
  • redact sensitive data from diagnostic notes
  • select a diagnostic technique based on symptom class

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 327,132. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.