Tdd logo

Tdd

Community
WenWuZhiDao
tdd

测试驱动开发。当用户想测试先行地构建功能或修复 bug、提到「red-green-refactor」,或想要集成测试时使用。

Overview

PublisherWenWuZhiDao
Repositorymattpocock-skills-zh
Skill nametdd
Stars
30
Forks
5
Bundled files
3
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.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Tdd 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/WenWuZhiDao/mattpocock-skills-zh/tree/main/skills/engineering/tdd
  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/WenWuZhiDao/mattpocock-skills-zh.git /tmp/mattpocock-skills-zh
mkdir -p .claude/skills
cp -r /tmp/mattpocock-skills-zh/skills/engineering/tdd .claude/skills/tdd
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tdd 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 Tdd 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 Tdd 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.

测试驱动开发

TDD 是红 → 绿的循环。这个技能是让那个循环产出值得保留的测试的参考:什么是好测试、测试放在哪里、反模式,以及循环的规则。每一节在每个周期都适用——在循环之前和之中查阅它们,而不是之后。

在探索代码库时,读 CONTEXT.md(如果存在),让测试名和接口词汇与项目的领域语言相符,并尊重你正在触碰的区域里的 ADR。

什么是好测试

测试通过公共接口验证行为,而不是实现细节。代码可以整个改变;测试不该变。一个好测试读起来像一份规格说明——「用户可以用有效购物车结账」明确告诉你存在什么能力——而且它能在重构中存活,因为它不关心内部结构。

示例见 tests.md,mock 指南见 mocking.md。

接缝——测试放在哪里

一个接缝是你在其处测试的公共边界:你在这个接口上观察行为而不伸进内部。测试活在接缝处,绝不针对内部。

只在预先约定的接缝处测试。 在写任何测试之前,写下受测的接缝并与用户确认。在未确认的接缝处不写任何测试。你不可能测试一切——预先约定接缝,是让测试努力落在关键路径和复杂逻辑上、而不是落在每个边界情况上的办法。

问:「公共接口是什么,我们该在哪些接缝处测试?」

当那个接口的形状本身成问题时——模块该有多深、接缝该在哪里、接口该暴露什么——用 /codebase-design 技能获取词汇。它是模块、接口、深度、接缝、适配器、杠杆和局部性这些术语的共享来源,而且它是一份供查阅的参考,不是一个供运行的会话。

反模式

  • 实现耦合 — mock 内部协作者、测试私有方法,或通过侧信道验证(查数据库而不是用接口)。破绽:当你重构时测试坏了,但行为并没变。
  • 同义反复 — 断言以代码计算期望值的同样方式重新计算它(expect(add(a, b)).toBe(a + b)、一个用同样方式手工推导的快照、一个断言等于自身的常量),所以它天生就通过、永远不可能与代码相左。期望值必须来自一个独立的真理来源——一个已知良好的字面量、一个手算的例子、规格。
  • 横向切片 — 先写所有测试,再写所有实现。批量测试验证的是想象的行为:你测的是事物的形状而非面向用户的行为,测试对真实改动变得不敏感,而且你在理解实现之前就绑死了测试结构。改为在纵向切片里工作——一个测试 → 一个实现 → 重复,每个测试都是一颗曳光弹,回应上一个周期教给你的东西。

循环的规则

  • 先红后绿。 先写失败的测试,然后只写刚好足以让它通过的代码。不要预判未来的测试或添加投机性的功能。
  • 一次一个切片。 每个周期一个接缝、一个测试、一个最小实现。
  • 重构不是循环的一部分。 它属于审查阶段(见 code-review 技能),而不是红 → 绿的实现周期。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Tdd AI skill do?

测试驱动开发。当用户想测试先行地构建功能或修复 bug、提到「red-green-refactor」,或想要集成测试时使用。

Why use Tdd on TypingMind?

Because you install it once and use it with any model. Tdd 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 Tdd in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/WenWuZhiDao/mattpocock-skills-zh/tree/main/skills/engineering/tdd. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Tdd?

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 Tdd?

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

Is the Tdd AI skill free?

Yes. It is published on GitHub by WenWuZhiDao 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 👇