agentleFS
kiko197kiko197/skill/debugging/SKILL.md

debugging

Skill0 starsChanged 3 months agoMITView on GitHub

系统化地定位和解决软件问题。当遇到 bug、崩溃、异常、性能或行为不符合预期的问题,且原因不明、需要按证据推理、缩小范围并验证修复时使用。

116 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

Files
SKILL.md

系统化调试

把“碰运气”改成“按证据缩小范围”。核心:复现 → 二分定位 → 提出假设 → 验证假设 → 修复 → 回归。

使用步骤

1. 复现(Reproduce)

无法复现就无法定位。尽量:

  • 拿到可复现的最小输入 / 操作序列。
  • 记下环境:版本、配置、操作系统/平台、负载。
  • 如果只在特定数据/时序下出现,保留现场(日志、dump、输入样本)。
  • 构造最小复现用例,去掉无关因素。

2. 收集证据(Observe)

不要靠猜,先取证:

  • 完整错误信息与堆栈:它指向哪个文件哪一行。
  • 相关日志(前后文,不只是出错那一行)。
  • 关键变量在实际运行时的值(打印/断点/日志)。
  • 输入输出是否符合预期,哪里开始偏离。

3. 缩小范围(二分)

用“是/否”二分切割问题空间,锁定第一个可疑边界:

  • 是数据问题还是逻辑问题?(换输入/固定输入测试)
  • 是新增改动引入还是历史一直存在?(git bisect 定位引入提交)
  • 是单机问题还是环境问题?(换环境/新副本复现)
  • 注释掉/短路掉一半代码看问题是否消失,反复二分。

4. 形成假设并验证(Hypothesize & Verify)

  • 每个假设写成可证伪:“如果 X 是根因,那么做 Y 应当出现/消失现象 Z”。
  • 一次只改一个变量,改完立刻验证。
  • 通过“最小改动”验证假设,而不是顺手改一堆。

5. 修复与回归(Fix & Regress)

  • 修复根因,而非掩盖症状。
  • 为根因写回归测试,防止复发。
  • 全量跑一遍相关测试/构建,确认无副作用。

常用技巧

  • git bisect:自动二分查找引入 bug 的提交。
  • 记录每次猜测与结果,避免重复走弯路。
  • 怀疑“更新后才是这样”优先查最近改动 + git diff。
  • 数据类问题:对比“好数据的特征”与“坏数据的特征”。
  • 间歇性问题:加日志 + 自动化重试捕获,而不是一次观察。

输出/复盘模板

现象(Phenomenon):...
复现步骤:...
证据(日志/堆栈/变量值):...
根因(Root cause):...
修复(Fix):...
回归测试(Regression test):...
防止复发的长期手段:...

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.

Reviews can't be read right now.

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.