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

debugging

Skill1 starsChanged 2 months 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.

81 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use media-processing, databases 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.
  • 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 4 projects that use this

  • mrgoonieSkill

    databases

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.

    Also in 5 projects that use this

  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 17 projects that use this

  • ShopifySkill

    profiling

    Profile Rubydex indexer performance — CPU flamegraphs, memory usage, phase-level timing. Use this skill whenever the user mentions profiling, performance, flamegraphs, benchmarking, "why is X slow", bottlenecks, hot paths, memory usage, or wants to understand where time is spent during indexing/resolution. Also trigger when comparing performance before/after a change.

    Also in 3 projects that use this

  • sarveshtaleleSkill

    test-generation

    Generate a test strategy and starter test stubs for given modules across unit, integration, and e2e layers (pytest/jest/playwright). Trigger on: generate tests, test plan, test strategy, coverage plan, test scaffolding.

    Also in 3 projects that use this

  • MicrosoftSkill

    using-skills

    Describes how to use abilities. Read before any conversation.

    Also in 3 projects that use this

  • +5 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 73 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 73 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.