agentleFS
kynn-devkynn-dev/agent-skills/.agents/skills/debugging/SKILL.md

debugging

Skill1 starsChanged 46 days agoMITView on GitHub

Use when investigating a bug, test failure, incident, performance regression, or unexpected behavior; require reproduction, evidence, a testable hypothesis, isolation, a minimal correction, and regression validation. Do not use for speculative feature work or unrelated cleanup.

119 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use Problem-Solving Techniques, media-processing and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • truongtv22Skill

    Problem-Solving Techniques

    Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.

    Also in 4 projects that use this

  • mrgoonieSkill

    media-processing

    Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

    Also in 6 projects that use this

  • JetBrainsSkill

    ssr

    Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.

    Also in 3 projects that use this

  • mrgoonieSkill

    web-frameworks

    Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.

    Also in 6 projects that use this

  • DevNewbie1826Skill

    remove-ai-slops

    Remove AI-generated code slop from branch changes or an explicit file list while preserving behavior, including junk tests (prose pins, source greps, copied inventories, mock echoes), each proven by its class rule before a cut. Use when asked to remove slop, clean AI code, deslop, clean up generated code, strip slop, prune junk tests, or review generated-code cleanup. Start by locking behavior with regression tests, then use the category and workflow references.

    Also in 3 projects that use this

  • DevNewbie1826Skill

    programming

    MUST USE for work on Python, Rust, TypeScript, JavaScript, or Go source files and project manifests, and whenever a test or spec file is written, reshaped, reviewed, or deleted. Triggers: write or edit code; add, change, or delete a test; test authoring gate; junk tests; new project; Go HTTP service (gin lane); Bubble Tea TUI; CJK IME; Connect-Go RPC; sqlc or pgx; branded IDs; exhaustive matching; unsafe Rust; Miri; oversized file; refactoring; logging, log levels, structured logging, or observability; arena, allocator, bumpalo, const fn, const generics, compile-time programming, zero-allocation APIs, bitfields, repr, scope guards, errdefer-style cleanup, Zig-like patterns, zero-copy parsing, packed data, or FFI; Rust public API design or macros.

    Also in 3 projects that use this

  • +6 more from mrgoonie

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 107 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use for bugs, regressions, failed tests, build/integration failures, performance or concurrency failures, incidents with a safe evidence …

    line 34
  2. Distinctive:

    Do not use to invent a feature from an ambiguous request, replace a missing acceptance criterion, or justify changing unrelated code.

    line 36
  3. Distinctive:

    If the request is diagnosis-only, stop there.

    line 50
  4. Distinctive:

    Only after diagnosis justifies a correction:

    line 54
  5. Distinctive:

    avoid unrelated cleanup, upgrades, or production changes.

    line 58
  6. Distinctive:

    If the issue cannot be reproduced, remain in diagnosis.

    line 73
  7. Distinctive:

    Never print or persist secrets, tokens, cookies, private keys, credentials, or unnecessary personal data.

    line 79
  8. Distinctive:

    Use a falsifiable form:

    line 83
  9. Distinctive:

    Prefer one variable per experiment.

    line 87
  10. Distinctive:

    Do not disable authorization, validation, tenant checks, TLS, rate limits, or error handling to make reproduction easier.

    line 93
  11. Distinctive:

    If the hypothesis was not confirmed, do not keep a patch merely because it appears to help.

    line 99
  12. Distinctive:

    Add or update a focused regression check.

    line 103
  13. Very specific:

    If required validation cannot run because of an unavailable environment, credential, service, or dependency, report NOT_RUN or …

    line 105

“Common” is measured: kept by at least 6 in 10 of the 107 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debugging

Turn an observable failure into an evidence-backed root-cause finding and, only after that, a narrowly scoped correction.

Operational contract

Objective

Convert an observed failure into a defensible root-cause conclusion before changing behavior. When implementation is authorized and justified, apply the smallest correction tied to that cause and prove the original symptom is covered by regression evidence.

Expected inputs

The workflow expects the symptom, expected behavior, actual behavior, affected scope, environment or version context, a safe reproduction path when available, relevant sanitized evidence, repository/worktree state, and whether the request is diagnosis-only or includes implementation.

Required outputs

Return reproduction status, labeled FACT/INFERENCE/HYPOTHESIS/UNKNOWN evidence, the falsifiable hypothesis and experiment, the isolated failing boundary, root cause with limits, any changed files when implementation is in scope, and regression/static validation results with honest external blockers.

Definition of done

Diagnosis is done when the root-cause conclusion is supported by evidence or the remaining uncertainty is explicitly bounded. A fix is done only when it is tied to the confirmed cause, the original reproduction is re-run, focused regression evidence covers the symptom, and required unavailable checks remain NOT_RUN or BLOCKED_EXTERNAL rather than being inferred as PASS.

Non-negotiable invariant

Do not implement a correction before investigating the root cause, and do not present diagnosis as implementation.

When to use

Use for bugs, regressions, failed tests, build/integration failures, performance or concurrency failures, incidents with a safe evidence source, and requests to explain a failure before deciding whether code should change.

Do not use to invent a feature from an ambiguous request, replace a missing acceptance criterion, or justify changing unrelated code.

Required separation

Diagnosis

Establish:

  1. expected behavior and actual behavior;
  2. a reproduction, or why reproduction is unavailable;
  3. sanitized evidence from the relevant execution path;
  4. a falsifiable hypothesis and controlled test;
  5. the smallest confirmed root cause, with confidence and limits.

If the request is diagnosis-only, stop there.

Implementation

Only after diagnosis justifies a correction:

  • change the smallest coherent surface tied to the cause;
  • preserve behavior outside the affected path;
  • avoid unrelated cleanup, upgrades, or production changes;
  • include focused regression evidence for the original symptom.

Workflow

1. Establish the boundary

Record issue, expected result, actual result, affected scope, environment class, and the decision the investigation must support. Inspect the current worktree/diff before editing.

Label important statements as FACT, INFERENCE, HYPOTHESIS, or UNKNOWN.

2. Reproduce before correcting

Attempt the smallest safe reproduction before changing implementation. Preserve relevant input, preconditions, command/request shape, version, and timing. Compare a known-good case when possible and capture the original failure.

If the issue cannot be reproduced, remain in diagnosis. A non-reproduced issue does not justify a speculative fix.

3. Gather sanitized evidence

Collect only evidence needed to distinguish hypotheses: error text, trace shape, status, timing, state transition, focused logs/metrics, test output, diff, and boundary evidence.

Never print or persist secrets, tokens, cookies, private keys, credentials, or unnecessary personal data.

4. Test one hypothesis

Use a falsifiable form:

If cause X is responsible under condition Y, observation Z should occur; if X is not responsible, Z should not occur.

Prefer one variable per experiment. Record what the experiment proved and what it did not prove.

5. Isolate the failing boundary

Separate application logic from inputs, persistence, network calls, authentication, queues, caches, clocks, and external dependencies.

Do not disable authorization, validation, tenant checks, TLS, rate limits, or error handling to make reproduction easier. A mock can establish a local contract; it cannot prove the real dependency is healthy.

6. Apply the minimal correction

State the confirmed root cause, identify the smallest correction, make one coherent change at a time, then re-run the original reproduction.

If the hypothesis was not confirmed, do not keep a patch merely because it appears to help.

7. Prove regression behavior

Add or update a focused regression check. When practical, show that it fails against the pre-correction behavior and passes after the correction. Run the narrowest neighboring/static check needed to catch accidental breakage.

If required validation cannot run because of an unavailable environment, credential, service, or dependency, report NOT_RUN or BLOCKED_EXTERNAL rather than calling the correction proven.

External failure boundaries

Timeouts, outages, quotas, remote 5xx, unavailable authenticated sessions, and network restrictions are evidence about a boundary, not automatic proof of an application defect.

A local stub can validate local contract handling; it cannot prove remote provider health. A 401/403 can prove access was not granted; it cannot justify bypassing authentication.

Handoff

Report:

  • symptom and reproduction status;
  • evidence with FACT/INFERENCE/HYPOTHESIS/UNKNOWN labels;
  • hypothesis, experiment, result, and confirmed root cause;
  • files/boundaries changed if implementation was in scope;
  • regression and static validation results;
  • external limits, unexecuted checks, residual risk, and next action.

Checklist

  • Expected and actual behavior are explicit.
  • Existing worktree changes were inspected and preserved.
  • Original symptom was reproduced or inability to reproduce is documented.
  • Evidence is sanitized and separated from inference.
  • A falsifiable hypothesis and controlled experiment were recorded.
  • The failing boundary was isolated without weakening controls.
  • The correction is minimal and tied to a confirmed cause.
  • A focused regression check covers the original symptom.
  • External failures and unrun checks are labeled honestly.
  • Diagnosis and implementation are reported separately.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.