loom-systematic-debugging

loom-systematic-debugging is a skill for Claude Code, Codex from xiqin/loom. It costs 56 tokens per session (1,351 once invoked), scanned A, original, MIT.

A step-by-step method for finding the cause of bugs, failed tests, flaky behavior, or unexpected program results.

In plain words
What is it for?
It helps create a quick pass-or-fail check, narrow down failures, inspect logs and changes, and validate the final fix.
Why use it?
It replaces guesswork with a repeatable loop: reproduce the problem, collect evidence, test possible causes, then fix and verify it.

Skill for Claude CodeCodex

Part of the loom-engineering plugin — 22 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xiqin/loom/loom-systematic-debugging
Any agent
npx skills add xiqin/loom --skill loom-systematic-debugging
Clone the repo
git clone --depth 1 https://github.com/xiqin/loom

Made for: Claude Code, Codex.

Or install loom-engineering, the plugin that ships this one along with the rest of its 22 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for loom-systematic-debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiqin/loom/loom-systematic-debugging.svg)](https://agentmods.dev/skills/xiqin/loom/loom-systematic-debugging)
Your own site
<a href="https://agentmods.dev/skills/xiqin/loom/loom-systematic-debugging"><img src="https://agentmods.dev/badge/skills/xiqin/loom/loom-systematic-debugging.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,351 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.01351
Opus 5 $0.00028 $0.00675
Sonnet 5 $0.00011 $0.00270
Haiku 4.5 $0.00006 $0.00135

Measured 3d ago against content hash 71da9cbe6124, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loom-systematic-debugging scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- curl / HTTP script
skills/loom-systematic-debugging/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

系统化调试

调试原则

先找根因,再修问题。 系统化方法首次修复率约 95%,随机猜测仅 40%。

绝对规则

Phase 1 完成前不许提出解决方案。 三次修复失败 → 重新审视架构,不是再试一次补丁。

Phase 1 的完成标准不是“看起来知道原因”,而是已经建立一个 red-capable feedback loop:一个已运行过、能暴露失败、足够快、agent 可重复执行的命令、测试、脚本或 harness。

多组件系统:在每个边界插桩,定位数据流在哪里断了。

执行流程

阶段映射:Step1+2=收集信息 → Step3+4=形成/验证假设 → Step5+6=修复验证

Step 1:建立反馈环

先构造可运行的 pass/fail 信号,再进入根因分析。可选方式包括:

  • failing test
  • curl / HTTP script
  • CLI fixture
  • headless browser script
  • captured trace replay
  • throwaway harness
  • property / fuzz loop
  • bisection harness
  • differential loop
  • 带人工确认点的脚本化检查

完成标准:

  1. 命令已经运行过。
  2. 当前能失败,或对 flaky bug 明显提高复现率。
  3. 失败与用户报告的行为相关,而不是测试拼写、导入或环境错误。
  4. 运行足够快,能在修复循环中反复执行。
  5. agent 可以独立执行,不依赖未记录的手工步骤。

如果无法建立反馈环,必须停止并说明已尝试的方法、缺失的环境/日志/artifact,以及需要用户提供什么;不得进入修复。

Step 2:复现并最小化问题

  1. 确认问题的复现步骤
  2. 记录环境信息(操作系统、版本、配置)
  3. 确认问题是否可稳定复现
  4. 收紧反馈环:减少依赖、缩短运行时间、缩小输入范围

Step 3:收集信息

错误信息:控制台输出、日志文件、堆栈追踪

上下文信息:触发条件、输入数据、系统状态

对比分析:最近的代码变更、配置变更、环境变更

Step 4:缩小范围 + 形成假设

  1. 二分法:不确定哪个变更导致问题 → 使用 git bisect
  2. 日志定位:关键位置添加日志,追踪数据流
  3. 单元测试:编写测试覆盖问题场景

基于收集的信息,列出 3-5 个按可能性排序、可证伪的原因:

| #   | 假设           | 依据             | 验证方法       |
| --- | -------------- | ---------------- | -------------- |
| 1   | 数据库连接超时 | 日志显示连接错误 | 检查连接池配置 |
| 2   | 参数解析错误   | 请求参数格式异常 | 检查绑定标签   |

逐一验证假设,每次只验证一个:

  1. 选择最可能的假设
  2. 做最小化改动验证
  3. 假设正确 → 进入修复
  4. 假设错误 → 验证下一个假设

Step 5:修复和验证

  1. 实施修复
  2. 编写回归测试
  3. 运行全量测试
  4. 确认问题解决
  5. 用 Phase 1 的反馈环证明 red → green

详细模式和工具见 references/common-patterns.md

调试技术

条件等待(Condition-Based Waiting)

当调试异步问题时,不要使用固定 sleep,而是:

  1. 设置明确的完成条件
  2. 轮询检查条件是否满足
  3. 设置合理的超时时间
  4. 超时时提供诊断信息

纵深防御(Defense in Depth)

建立多层防护来验证假设:

  1. 输入验证层:检查输入合法性
  2. 业务逻辑层:验证业务规则
  3. 数据/状态层:检查数据完整性
  4. 输出层:验证输出格式

警告信号

出现以下想法意味着你在走捷径,立即回到 Phase 1:

  • "先快速修一下" / "quick fix for now"
  • "大概是 X,修一下" / "probably X, let me fix that"
  • "这个简单" / "this is simple"
  • "就试一个东西" / "just try this one thing"
  • 没有 red-capable feedback loop 就开始改代码
  • 三次修复失败还在猜

Read the full file on GitHub · 166 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 166 lines · 56 tokens per session scan A 71da9cbe6124

Subscribe to this mod's changes

loom-systematic-debugging is a skill published in the GitHub repository xiqin/loom (5 stars, last pushed 1mo ago), licensed MIT. It adds 56 tokens to every session and 1,351 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens