agentleFS
www-donghanhcungban-orgwww-donghanhcungban-org/X-Templates/.claude/skills/debug/SKILL.md

debug

Skill16 starsChanged 6 days agoMITView on GitHub

Gỡ lỗi có hệ thống — chưa có lệnh tái hiện ĐỎ thì chưa sửa; lập 3–5 giả thuyết bác bỏ được, khoanh vùng (bisect, log, nhị phân hoá đầu vào) tới nguyên nhân gốc, sửa kèm test hồi quy, 3 lần sửa hỏng thì xem lại thiết kế. Dùng khi test/CI đỏ không rõ vì sao, bug người dùng báo, lỗi chập chờn, hồi quy sau một commit, "sao cái này hỏng", "fix bug", hoặc gõ /debug.

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use update-nanoclaw, add-atomic-chat-tool 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.
  • MicrosoftSkill

    update-nanoclaw

    Efficiently bring upstream NanoClaw updates into a customized install, with preview, selective cherry-pick, and low token usage.

    Also in 9 projects that use this

  • MicrosoftSkill

    add-atomic-chat-tool

    Add Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its OpenAI-compatible API.

    Also in 8 projects that use this

  • +10 more from microsoft

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 177 edited versions we read keep these.

  • 0

    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. Very specific:

    Commit fix(<scope>): … nêu nguyên nhân gốc một câu.

    line 31

“Common” is measured: kept by at least 6 in 10 of the 177 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

/debug — nguyên nhân gốc trước, bản sửa sau

<FW> = .xtemplates/framework ở dự án đích, framework ở repo khung. Chữ ký lỗi lặp 3 lần → xt.py loop defer theo <FW>/11-autonomous-loop/self-healing-ci.md; không vá cho xanh (LOOP-CI-001: không skip/disable test, không hạ ngưỡng).

Pha 1 — Tái hiện (cổng: có lệnh ĐỎ)

  1. Viết một lệnh cho ra lỗi trên máy (test mới, script nhỏ, curl, lệnh CI chép về). Chạy, ghi exit code và dòng lỗi.
  2. Lỗi chập chờn: chạy ≥ 10 lần (for i in $(seq 10)), ghi tỉ lệ; khoá nguồn bất định (thời gian, seed, thứ tự, mạng) trước khi đoán.
  3. Chưa có lệnh đỏ thì không sang pha 2. Không tái hiện được sau khi thử hết → ghi điều đã thử, loop defer kèm lệnh và log.

Pha 2 — Khoanh vùng

  1. Đọc lỗi đầy đủ (stack, log liền trước) và diff gần nhất chạm vùng đó (git log -p -- <file>).
  2. Lập 3–5 giả thuyết bác bỏ được, mỗi cái kèm một phép thử rẻ cho kết quả khác nhau nếu giả thuyết sai.
  3. Thử rẻ trước: hồi quy → git bisect start <bad> <good> && git bisect run <lệnh đỏ> (lệnh thoát 125 = bỏ qua commit); dữ liệu → thu nhỏ đầu vào tới ca nhỏ nhất còn đỏ; tích hợp → gọi thẳng từng tầng. Thêm log tạm có tiền tố DEBUG: một dòng, xoá trước commit.
  4. Ghi giả thuyết đã loại và bằng chứng; dừng khi một giả thuyết giải thích hết triệu chứng (kể cả vì sao trước đây không lỗi).

Pha 3 — Sửa

  1. Lệnh đỏ ở pha 1 thành test hồi quy ở tầng thấp nhất bắt được lỗi (FE-TEST-006 cho UI); xem nó đỏ vì đúng lý do.
  2. Sửa nguyên nhân gốc, không chặn triệu chứng (try/except nuốt lỗi, if x is None: return không lý do, tăng timeout). Diff nhỏ nhất.
  3. Chạy lại lệnh pha 1, test hồi quy, rồi cổng (/gate); tìm cùng mẫu lỗi chỗ khác (grep) và sửa hoặc ghi task.
  4. Ba lần sửa không xanh → dừng vá: giả định kiến trúc sai; ghi xt.py loop decide (≥ 2 phương án) hoặc giao executor-deep.

Ghi lại

Commit fix(<scope>): … nêu nguyên nhân gốc một câu. Báo cáo: lệnh tái hiện · giả thuyết đã loại · nguyên nhân · test hồi quy · exit code trước/sau. Lỗi do môi trường/công cụ → thêm dòng TRAPS.md.

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.