Trellis Implement Tdd Zh logo

Trellis Implement Tdd Zh

Community
coldwateryi
trellis-implement-tdd-zh

在 Trellis 子任务进入实现阶段时,用严格 TDD(红→绿→重构)逐条把验收标准落成代码。用于 Codex / Claude Code 等在 trellis-zero-to-mvp-zh 或 trellis-mvp-to-delivery-zh 生成主子任务后,按依赖顺序实现某个子任务,尤其当执行模型是 qwen3.6 35b 这类小参数本地模型时——把"理解并实现需求"转成"让这条失败测试变绿"的机械循环,每步都有客观信号。

Overview

Publishercoldwateryi
Repositorytrellis-skills
Skill nametrellis-implement-tdd-zh
Stars
44
Forks
1
Bundled files
4
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.

  • 4 bundled files

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

  • Open source

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

Installation

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

Use it in TypingMind

Enable Trellis Implement Tdd Zh 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 Trellis Implement Tdd Zh 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 Trellis Implement Tdd Zh 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.

Trellis TDD 落地(红绿重构)

概览

把一个已规划好的 Trellis 子任务,按其 prd.md 的验收标准(AC)逐条用 TDD 实现:先写失败测试看到红,再写最小代码看到绿,跑自检确认没弄坏别的,执行最小实现收敛,记录进度,进入下一条 AC。

本技能由编排会话(主会话,通常强模型)调用,去驱动实现执行体(可为 qwen3.6 35b 小模型)。流程由本技能"夹着走",执行体只做有客观信号的机械步骤,不需要自己判断"做完没有"——测试变绿就是做完。

输入:一个 status 为进行中、依赖已满足的子任务目录(含 prd.md,可能含 design.md、implement.md、implement.jsonl、check.jsonl)。产出:通过测试的代码改动 + 回写到 <task-dir>/tdd-progress.md 的进度,不执行 git commit(Trellis 实现执行体禁止 commit/push/merge)。

约束

  • 不要在没有失败测试之前写实现代码。每条 AC 的第一步永远是写一个会失败的测试。
  • 一次只处理一条 AC。当前 AC 未绿,不开始下一条。
  • 不要判断"需求是什么"。需求已由 prd.md 的验收标准、决策表、契约定死;执行体只负责让对应测试变绿。
  • 落点已定死。新代码放哪由 prd.md 文件清单 + design.md 的编排-计算分层决定;不要自行决定放哪个文件。
  • 不要改文件清单 / 禁止事项之外的文件。需要动别的文件时,停下来报告,不要自行扩散。
  • 不执行 git commit / git push / git merge。完成一条 AC 后只做暂存/记录。
  • 红绿信号是唯一完成判据。测试没看到红,说明测试没写对,停下来修测试,不要写实现去"凑绿"。
  • 绿灯后必须收敛复杂度。测试全绿不等于可以保留无用抽象、重复实现、新依赖或未来扩展点;按 references/minimal-implementation-pass.md 删除不必要复杂度。
  • 不要为了最小化削掉安全和验证。输入校验、错误处理、安全、可访问性、已声明边界和回归保护不能被简化掉。
  • 测试该绿却仍红、或自检命令失败时,改用 trellis-debug-systematic-zh,不要在本循环里乱试。
  • 若 prd.md 缺少可执行的测试定义或自检命令(违反规划期质量门槛),停止并回报,要求先补规划产物,不要硬上。

工作流

1. 载入任务上下文(编辑前必读)

按顺序读取,只读"编辑前必须读"的稳定上下文,控制小模型上下文占用:

  1. 子任务 prd.md:重点读 验收标准、自动化测试要求、参考实现、文件清单、决策表、行为约束、自检命令、禁止事项。
  2. 若存在 implement.jsonl:逐条预加载其中列出的稳定上下文(spec / 契约 / 调研)。
  3. 若存在 design.md:读编排-计算分离与挂载点清单两节,确认每个新代码的落点。
  4. 若存在 .trellis/spec/<相关层>:读与本任务直接相关的规范。

开始编辑前,先把 references/tdd-progress-template.md 复制为 <task-dir>/tdd-progress.md。这个任务目录下的文件才是可写进度记录;skill 目录里的模板保持只读。

把 prd.md 的每条 AC-xxx 抽成一个待办测试清单,写入 <task-dir>/tdd-progress.md。

2. 对每条 AC 跑红绿循环

按 AC 顺序,对每一条执行 references/tdd-loop-protocol.md 的循环:

1. RED  ── 照抄 prd.md「参考实现/测试范例」,为 AC-xxx 写一个测试,断言其期望可观察结果
2. 看红 ── 运行该测试,必须看到失败(客观证据)。没失败 → 测试没覆盖到行为,回到第1步修测试
3. GREEN ── 写"刚好让它变绿"的最小代码;落点按文件清单+编排分层,决策按决策表,不自由发挥
4. 看绿 ── 再次运行该测试,看到通过(客观信号)
5. 自检 ── 运行 prd.md「自检命令」全集,确认没弄坏已绿的 AC(无回归)
6. 收敛 ── 若本 AC 引入抽象/依赖/新文件/重复代码,按 `references/minimal-implementation-pass.md` 删除不必要复杂度
7. 记录 ── 在 `<task-dir>/tdd-progress.md` 里把 AC-xxx 标记为 done,暂存改动(不 commit)
8. 下一条 AC

任一步失败且不显然时 → 触发 trellis-debug-systematic-zh,修复后回到失败的那一步重跑。

3. 收尾自检

所有 AC 变绿后:

  1. 运行 prd.md 全部自检命令 + 项目 lint / type-check,全绿。
  2. 读取 references/minimal-implementation-pass.md,执行完整最小实现收敛:删除无用抽象、避免新依赖、优先标准库/平台/已有依赖,保留安全和验证。
  3. 对照 design.md 的挂载点清单逐项确认已接线(路由注册 / 配置项 / 事件订阅 / DI 绑定等),防止"写了实现没接线"。
  4. <task-dir>/tdd-progress.md 所有 AC 为 done,无遗留红灯,并记录最小实现收敛结果。

4. 交接评审

实现自检全绿后,不要自行标记任务完成。交给 trellis-review-twostage-zh 做双阶段评审;评审通过后再由编排会话推进任务状态。

小模型适配要点

  • 判断已左移:命名 / 分支 / schema / 落点等在规划期由强模型定死,执行体只机械照搬。
  • 客观信号驱动:每步完成与否由测试红绿 / 命令退出码决定,不让小模型主观判断。
  • 窄上下文:一次只面对一条 AC + 一个测试,天然把上下文切到最小。
  • 角色分层:本技能驱动的实现执行体配小模型(如 qwen3.6 35b);调试超 3 轮、评审 Stage 2 升强模型(见 trellis-review-twostage-zh)。

参考文件

  • references/tdd-loop-protocol.md —— 每条 AC 的红绿循环详规、铁律与反模式,开始实现前读取。
  • references/minimal-implementation-pass.md —— 绿灯后删除不必要复杂度、复用标准库/平台/已有依赖、保留安全验证边界时读取。
  • references/tdd-progress-template.md —— <task-dir>/tdd-progress.md 的只读模板;全程更新任务目录下的副本。

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 Trellis Implement Tdd Zh AI skill do?

在 Trellis 子任务进入实现阶段时,用严格 TDD(红→绿→重构)逐条把验收标准落成代码。用于 Codex / Claude Code 等在 trellis-zero-to-mvp-zh 或 trellis-mvp-to-delivery-zh 生成主子任务后,按依赖顺序实现某个子任务,尤其当执行模型是 qwen3.6 35b 这类小参数本地模型时——把"理解并实现需求"转成"让这条失败测试变绿"的机械循环,每步都有客观信号。

Why use Trellis Implement Tdd Zh on TypingMind?

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/coldwateryi/trellis-skills/tree/main/trellis-implement-tdd-zh. 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 Trellis Implement Tdd Zh?

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 Trellis Implement Tdd Zh?

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

Is the Trellis Implement Tdd Zh AI skill free?

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