agentleFS
www-donghanhcungban-orgwww-donghanhcungban-org/X-Templates/.agents/skills/tdd/SKILL.md

tdd

Skill16 starsChanged 7 days agoMITView on GitHub

Phát triển hướng test theo lát dọc — viết một test hành vi, XEM nó đỏ vì đúng lý do, viết code tối thiểu cho xanh, refactor khi xanh; lặp từng hành vi. Dùng khi làm logic nghiệp vụ, parser, tính tiền/quyền, API mới, sửa bug có thể tái hiện bằng test, khi task có Given/When/Then, khi người dùng nói "viết test trước", "TDD", hoặc gõ /tdd.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use capture-learning-tools, design-frontend-dev 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.
  • The-Vibe-CompanySkill

    capture-learning-tools

    Turn technical conversations, bugs, CI failures, review comments,

    Also in 5 projects that use this

  • The-Vibe-CompanySkill

    design-frontend-dev

    Clean Impeccable frontend design skill. Use when the user wants to

    Also in 5 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 66 projects that use this

  • shiwenbin1617Skill

    ketchup-video

    Catch the user up like /ketchup, with a short subtitled video of slides for what happened and the waiting calls as text under it. Use for /ketchup-video.

    Also in 24 projects that use this

  • simo97Skill

    request-refactor-plan

    Use this skill when user wants to create a refactor plan.

    Also in 47 projects that use this

  • jaydubya818Skill

    principle-minimize-reader-load

    Apply when layers, wrappers, or hidden state make simple behavior hard to follow.

    Also in 57 projects that use this

  • +3 more from The-Vibe-Company
  • +2 more from jaydubya818

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 190 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test phải fail được: nếu xoá thân hàm mà test vẫn xanh, test vô dụng — viết lại.

    line 21
  2. Very specific:

    Test tất định: đồng hồ giả, seed cố định, không mạng thật (BASE-GATE-005).

    line 23

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

/tdd — đỏ thật, xanh tối thiểu, refactor khi xanh

<FW> = .xtemplates/framework ở dự án đích, framework ở repo khung. Mục kiểm thử: <FW>/14-testing-quality/ (biên QA-UNIT-001…006, mutation QA-COV-005/006, không nới coverage QA-COV-008). Lệnh test thật ở xt.yaml; không suy diễn.

Vòng cho mỗi hành vi (một lát dọc: một đường đi xuyên các tầng, không làm cả tầng một lúc)

  1. Chọn hành vi kế tiếp từ Given/When/Then của task, nhỏ nhất còn có giá trị cho người dùng. Ghi một dòng.
  2. Đỏ: viết một test gọi code như người dùng của nó gọi (API công khai, không hàm nội bộ) và kiểm kết quả họ thấy. Chạy, đọc thông báo đỏ: phải đỏ vì thiếu hành vi, không vì lỗi cú pháp/import/fixture. Test xanh ngay = test sai hoặc hành vi đã có.
  3. Xanh: viết code ít nhất để test xanh. Không thêm nhánh/tuỳ chọn chưa có test đòi.
  4. Refactor khi mọi test xanh: bỏ trùng lặp, đặt tên, tách hàm; chạy lại test sau mỗi bước. Không đổi hành vi trong bước này.
  5. Thêm ca biên theo QA-UNIT-001…006 (rỗng, một phần tử, null vs 0, off-by-one, tiền không float, chia 0, UTC) — mỗi ca một vòng đỏ → xanh.

Luật

  • Test phải fail được: nếu xoá thân hàm mà test vẫn xanh, test vô dụng — viết lại. Vùng tiền/quyền/parser: chạy mutation (QA-COV-005).
  • Code viết trước khi có test đỏ cho nó: bỏ đi và đi lại vòng, không "test sau cho có".
  • Test tất định: đồng hồ giả, seed cố định, không mạng thật (BASE-GATE-005).
  • Mock chỉ ở ranh giới hệ thống (mạng, thời gian, dịch vụ ngoài); logic trong cùng repo chạy thật.
  • Không tick task khi chưa xt.py loop record với lệnh test xanh (LOOP-ORCH-004).

Kết thúc

Báo cáo: danh sách hành vi đã phủ · lệnh test + exit code · ca biên đã thêm · phần cố ý chưa phủ và lý do.

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.