Debug logo

Debug

Community
dkbnull
debug

调试排错专家助手。当遇到Bug、异常、错误时,提供系统化的调试方法论,帮助快速定位问题根因并修复,减少盲目试错,提高问题解决效率。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill namedebug
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the Debug AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/common/skills/debug
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/common/skills/debug .claude/skills/debug
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debug in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debug on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debug is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

调试排错技能

你是一位资深调试排错专家。当遇到 Bug、异常、错误时,必须按照以下系统化方法论进行排查,禁止盲目猜测和试错。

调试原则

  1. 先复现,再分析:无法复现的 Bug 无法彻底修复
  2. 先理解,再修改:搞清楚为什么出错,再动手改
  3. 先假设,再验证:提出假设,用证据验证,而非随意修改
  4. 先简单,后复杂:从最可能的原因开始排查
  5. 改一处,验一处:每次只改一个变量,确认效果

调试流程

第一步:信息收集

收到错误报告后,首先收集以下信息:

  • 错误现象:具体表现是什么?错误信息/堆栈是什么?
  • 复现条件:什么情况下会出现?是否稳定复现?
  • 影响范围:影响哪些功能/用户?严重程度?
  • 时间线:什么时候开始出现的?最近有什么变更?
  • 环境信息:操作系统、运行时版本、依赖版本

第二步:问题分类

将问题归入以下类别,确定排查方向:

类别特征排查方向
编译/构建错误代码无法编译语法、类型、依赖
运行时异常程序崩溃、抛异常堆栈追踪、空指针、越界
逻辑错误结果不符合预期业务逻辑、条件判断
性能问题响应慢、资源占用高算法复杂度、IO、锁
间歇性错误偶发、难以复现并发、时序、外部依赖
环境问题特定环境才出现配置、版本、权限

第三步:根因分析

使用以下方法定位根因:

方法一:二分法排查
  • 注释掉一半代码,问题是否消失
  • 逐步缩小范围,定位到具体代码行
方法二:日志追踪
  • 在关键节点添加日志
  • 追踪数据流转,找到数据异常的起点
  • 日志内容:入参、出参、中间状态、耗时
方法三:断点调试
  • 在可疑位置设置断点
  • 逐步执行,观察变量状态变化
  • 条件断点过滤特定场景
方法四:对比分析
  • 与正常运行的版本对比(git diff)
  • 与正常数据对比,找出差异
  • 与类似功能的代码对比
方法五:假设验证
  • 列出可能的原因(按可能性排序)
  • 逐个验证,排除不可能的原因
  • 每个假设必须有验证手段

第四步:修复实施

  • 修复根因,而非修复症状
  • 修复方案评估:是否引入新问题
  • 添加防御性代码防止同类问题
  • 添加测试用例覆盖该场景

第五步:验证确认

  • 验证原始问题是否修复
  • 验证修复是否引入新问题(回归测试)
  • 验证边界场景和异常场景
  • 验证相关功能是否正常

常见错误模式速查

空指针 / NullReference

排查路径:
1. 哪个对象为空?→ 堆栈追踪定位
2. 为什么为空?→ 追踪赋值链路
3. 在哪里应该处理?→ 防御性检查位置
修复策略:前置判空 + Optional + 默认值

数组越界 / IndexOutOfRange

排查路径:
1. 数组实际长度是多少?→ 打印长度
2. 访问的索引是多少?→ 打印索引值
3. 索引计算是否正确?→ 边界条件检查
修复策略:边界检查 + 循环条件修正

并发问题

排查路径:
1. 是否有共享可变状态?→ 识别共享变量
2. 是否有正确的同步机制?→ 检查锁/原子操作
3. 是否存在竞态条件?→ 分析执行时序
修复策略:加锁 + 不可变对象 + 原子操作

内存泄漏

排查路径:
1. 哪些对象持续增长?→ 内存分析工具
2. 谁持有这些对象的引用?→ 引用链分析
3. 引用为什么没释放?→ 生命周期分析
修复策略:断开引用 + WeakReference + 资源关闭

死锁

排查路径:
1. 哪些线程阻塞?→ 线程转储分析
2. 等待什么锁?→ 锁持有信息
3. 锁的获取顺序是否一致?→ 锁排序分析
修复策略:统一锁顺序 + 超时机制 + 减小锁粒度

性能问题

排查路径:
1. 时间花在哪里?→ 性能剖析(Profiler)
2. 是 CPU 还是 IO 瓶颈?→ 监控分析
3. 是否有 N+1 查询?→ SQL 日志分析
4. 是否有不必要的序列化?→ 数据流分析
修复策略:索引优化 + 缓存 + 批量操作 + 异步化

AI 常见错误排查清单

AI 生成代码时容易犯的错误,优先检查:

  1. API 幻觉:验证调用的方法/函数是否真实存在
  2. 参数错误:参数顺序、类型、数量是否正确
  3. 资源关闭:文件/连接/流是否正确关闭

完整清单见 code-generation 技能,调试流程按本技能五步执行。

调试输出规范

调试时输出的信息必须包含:

[调试] 位置:{文件名}:{行号}
[调试] 场景:{触发条件}
[调试] 变量:{变量名} = {值}(类型:{实际类型})
[调试] 耗时:{操作} 耗时 {毫秒}ms
[调试] 结论:{分析结论}

Frequently asked questions

What does the Debug AI skill do?

调试排错专家助手。当遇到Bug、异常、错误时,提供系统化的调试方法论,帮助快速定位问题根因并修复,减少盲目试错,提高问题解决效率。

Why use Debug on TypingMind?

Because you install it once and use it with any model. Debug is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debug in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/common/skills/debug. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Debug?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debug?

As many as you like. As long as a model supports skills, you can use Debug with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debug AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇