tdd
測試驅動開發。當使用者想以測試優先的方式建立功能或修 bug、提到「red-green-refactor」、或想要整合測試時使用。
Skill by shumingyang-opencode
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/shumingyang-opencode-tdd
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/tdd
What's inside
- Skill name
tdd- Description
- 測試驅動開發。當使用者想以測試優先的方式建立功能或修 bug、提到「red-green-refactor」、或想要整合測試時使用。
- License
- MIT
- Instructions
- 35 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- openai.yaml · agents/
- mocking.md
- tests.md
SKILL.md (first lines)
# 測試驅動開發 TDD 就是紅 → 綠的迴圈。本技能是讓這個迴圈產出值得保留之測試的參考文件:什麼是好測試、測試放哪裡、反模式,以及迴圈的規則。每個章節在每個循環都適用——在迴圈之前和之中查閱它們,而不是事後。 探索程式碼時,先讀 `GLOSSARY.md`(如果存在),讓測試名稱和介面詞彙符合專案的領域語言,並尊重你要觸及區域中的 ADR。 ## 什麼是好測試 測試透過公開介面驗證行為,而不是實作細節。程式碼可以完全改變;測試不應該。好測試讀起來像規格說明——「使用者可以用有效的購物車結帳」確切告訴你存在什麼能力——而且能安然度過重構,因為它不在乎內部結構。 範例見 [tests.md](tests.md),模擬指引見 [mocking.md](mocking.md)。 ## 接縫——測試放哪裡 **接縫**是你測試所處的公開邊界:你在那裡觀察行為而不伸進內部。測試放在接縫,絕不對著內部。 **只在事前約定的接縫上測試。** 寫任何測試之前,先寫下將被測試的接縫並與使用者確認。不會在未確認的接縫上寫測試。你不可能測試一切——事先約定接縫,就是讓測試心力落在關鍵路徑與複雜邏輯上,而不是每個邊緣案例。 問:「公開介面是什麼,我們該測試哪些接縫?」 當那個介面的形狀本身有疑問時——模組要多深、接縫該放哪裡、介面該暴露什麼——用 `/codebase-design` 技能取得詞彙。它是模組、介面、深度、接縫、轉接器、槓桿收益與局部性這些術語的共同來源,而且是要查閱的參考文件,不是要執行的會話。 ## 反模式 - **耦合實作細節**——模擬內部協作者、測試私有方法,或透過側通道驗證(查資料庫而不是用介面)。特徵:重構時測試壞掉,但行為沒有改變。 - **同義反覆**——斷言用跟程式碼相同的方式重新計算期望值(`expect(add(a, b)).toBe(a + b)`、用手以同樣方式導出的快照、跟自己比較的常數),所以它依構造而通過、永遠不會與程式碼意見不合。期望值必須來自獨立的真實來源——已知良好的常數、實際算過的範例、規格。 - **水平切片**——先寫全部測試,再寫全部實作。大量測試驗證的是_想像中_的行為:你測試的是東西的_形狀_而不是使用者可見的行為,測試對真實變動變得不敏感,而且你在理解實作之前就承諾了測試結構。改用**垂直切片**——一個測試 → 一個實作 → 重複,每個測試都是一顆回應上一循環所學的**曳光彈**。 ## 迴圈的規則 - **先紅後綠。** 先寫失敗測試,然後只寫足以讓它通過的程式碼。不要預期未來的測試或加投機性的功能。 - **一次一個切片。** 每個循環一個接縫、一個測試、一個最小實作。 - **重構不是迴圈的一部分。** 它屬於審查階段(見 `code-review` 技能),不屬於紅 → 綠的實作循環。
From shumingyang-opencode/mattpocock-skills-zh-tw, MIT.
More from shumingyang-opencode/mattpocock-skills-zh-tw
- 0.603score
diagnosing-bugs
shumingyang-opencode
硬 bug 與效能回歸的診斷迴圈。當使用者說「diagnose」/「debug this」,或回報東西壞了/拋錯/失敗/很慢時使用。
SkillAFreshness: A★ 3Claude Code +9 - 0.598score
codebase-design
shumingyang-opencode
設計深模組的共用詞彙。當使用者想設計或改進模組的介面、找深化的機會、決定接縫放哪裡、讓程式碼更容易測試或對 AI 更容易導覽,或另一個技能需要深模組詞彙時使用。
SkillAFreshness: A★ 3Claude Code +9 - 0.598score
setup-matt-pocock-skills
shumingyang-opencode
為工程技能設定這個 repo——設定它的 issue 追蹤器、分診標籤詞彙與領域文件佈局。首次使用其他工程技能前執行一次。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
domain-modeling
shumingyang-opencode
建立並磨利專案的領域模型。當使用者想釐清領域術語或通用語言、記錄架構決策,或另一個技能需要維護領域模型時使用。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
ask-matt
shumingyang-opencode
詢問哪個技能或流程最符合你的情況。這個 repo 中技能的路由器。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
improve-codebase-architecture
shumingyang-opencode
掃描程式碼庫找出深化機會,以視覺 HTML 報告呈現,然後對你挑選的那個進行 grilling。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
triage
shumingyang-opencode
讓 issues 與外部 PR 穿過分診角色的狀態機——分類、驗證、視需要 grill,並撰寫可供代理使用的簡報。
SkillAFreshness: A★ 3Claude Code +9 - 0.561score
code-review
shumingyang-opencode
沿兩軸審查自某個固定點(commit、分支、標籤或合併基點)以來的變更——規範(軸)(程式碼是否符合此 repo 記錄的編碼規範?)與規格(軸)(程式碼是否符合原始 issue/規格的要求?)。以平行子代理執行兩種審查並排呈現。當使用者想審查分支、PR、進行中的變更,或說「review since X」時使用。
SkillBFreshness: B★ 3Claude Code +9 - 0.558score
to-tickets
shumingyang-opencode
把計畫、規格說明或目前的對話拆成一組曳光彈 tickets,每個都宣告自己的阻塞邊,發佈到設定的追蹤器——在本機是每個 ticket 一個檔案、以文字表示邊,或在真正的追蹤器上用原生阻塞連結。
SkillBFreshness: B★ 3Claude Code +9 - 0.558score
wayfinder
shumingyang-opencode
把一大塊工作——大得單一代理 session 裝不下——規劃成 Issue 追蹤器上決策 tickets 的共享地圖,逐一解決,直到通往目的地的路徑清晰為止。
SkillBFreshness: B★ 3Claude Code +9 - 0.558score
wizard
shumingyang-opencode
產生一個互動式 bash wizard,引導人類走過只有他們能做的步驟。用於佈建基礎設施、設定憑證或 CI secrets、走訪陌生的第三方儀表板,或執行一次性遷移或切換。不要為代理自己能做的步驟叫用它。
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
loop-me
shumingyang-opencode
在此工作區內,針對我想建立的 workflow 之規格說明 grill 我。
SkillBFreshness: B★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 7, 2026 (22 days ago)
- Last release
- Aug 6, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from shumingyang-opencode
- 0.603score
diagnosing-bugs
shumingyang-opencode
硬 bug 與效能回歸的診斷迴圈。當使用者說「diagnose」/「debug this」,或回報東西壞了/拋錯/失敗/很慢時使用。
SkillAFreshness: A★ 3Claude Code +9 - 0.598score
setup-matt-pocock-skills
shumingyang-opencode
為工程技能設定這個 repo——設定它的 issue 追蹤器、分診標籤詞彙與領域文件佈局。首次使用其他工程技能前執行一次。
SkillAFreshness: A★ 3Claude Code +9 - 0.598score
codebase-design
shumingyang-opencode
設計深模組的共用詞彙。當使用者想設計或改進模組的介面、找深化的機會、決定接縫放哪裡、讓程式碼更容易測試或對 AI 更容易導覽,或另一個技能需要深模組詞彙時使用。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
ask-matt
shumingyang-opencode
詢問哪個技能或流程最符合你的情況。這個 repo 中技能的路由器。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
improve-codebase-architecture
shumingyang-opencode
掃描程式碼庫找出深化機會,以視覺 HTML 報告呈現,然後對你挑選的那個進行 grilling。
SkillAFreshness: A★ 3Claude Code +9 - 0.595score
domain-modeling
shumingyang-opencode
建立並磨利專案的領域模型。當使用者想釐清領域術語或通用語言、記錄架構決策,或另一個技能需要維護領域模型時使用。
SkillAFreshness: A★ 3Claude Code +9
Cite this page
tdd skill. Agent Mart. https://agentmart.dev/skills/shumingyang-opencode-tdd (last updated 2026-10-24)