/vibeflow:vibeflow-tddfrom vibeflow
Enforces test-driven development with Red-Green-Refactor cycle for VibeFlow build phase. Requires failing tests before implementation, with rules for coverage, negative test ratio, and assertion quality.
Ships in vibeflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
先写测试。看它失败。写最少代码通过。重构。
违反规则的字面意思就是违反规则的精神。
没有失败测试就没有实现代码
先写了代码再写测试?删掉。重来。没有例外。
TDD Red:编写失败测试 -> TDD Green:最小实现 -> TDD Refactor:清理
为功能规格中的所有 verification_steps 编写测试。测试必须失败(功能尚未实现)。
测试由两个主要来源驱动:
verification_steps(主要 — 每步成为一个或多个测试){srs_section})— 完整 FR-xxx 含 Given/When/Then 验收标准、边界条件和错误路径规则 1:类别覆盖 — 测试必须覆盖所有适用类别:
| 类别 | 测试什么 | 示例 |
|---|---|---|
| 正常路径 | 正常操作,有效输入 | 有效登录返回 token |
| 错误处理 | 已知故障,无效输入 | 无效密码返回 401 |
| 边界/极端 | 限制,空值,最大值,零值 | 空字符串;最长密码 |
| 安全 | 注入,授权 | 用户名中的 SQL 注入 |
不适用的类别需明确注释说明。
规则 2:负面测试比例 >= 40%
negative_test_count / total_test_count >= 0.40
"负面"测试 = 期望异常、错误、失败状态、边界/极端输入、未授权访问或畸形数据。
规则 3:断言质量 — 低价值 <= 20%
low_value_count / total_assertion_count <= 0.20
低价值断言模式(避免):
assert x is not None 不检查内容assert isinstance(x, SomeType) 不检查行为assert len(x) > 0 不验证元素assert "key" in dict 不检查值规则 4:"错误实现"挑战
对每个测试问:"什么错误实现会被这个测试捕获?"
设想 2-3 个合理的错误实现:
测试会对每个失败吗?如果多数不会 -> 重写。
规则 5:UI 专属测试规则(当 "ui": true 时)
[devtools] 步骤必须使用 EXPECT/REJECT 格式evaluate_script() 执行自动错误检测list_console_messages(types=["error"]) 必须返回 0 错误运行测试套件。所有测试必须失败。 如有测试通过 -> 它不测试任何有用的东西,重写它。
写仅够让测试通过的代码。
规则:
启动输出要求 — 实现服务器进程或后台服务的功能: 实现必须在启动时记录:
Starting server on port 8080PID: 12345Server readyservices.md 同步规则 — 实现或修改服务后:
.vibeflow/guides/services.md.vibeflow/guides/services.md保持测试绿色的同时清理:
assertNotNull / isinstance / len>0 不检查实际值。最多 20%。调用者: vibeflow-build-work(步骤 5-7) 依赖: 计划文件存在(来自 Work 步骤 4) 产出: 通过的测试 + 实现代码 链接到: vibeflow-quality(通过 Work 步骤 8)
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ttttstc/vibeflow --plugin vibeflow36 skills in this plugin
/vibeflowVibeFlow框架入口。运行 /vibeflow 开始新项目或继续现有工作流。/vibeflow-brainstormingBrainstorming Ideas Into Designs for VibeFlow. Must use before any creative work —
creating features, building components, adding functionality, or modifying behavior.
Explores user intent, requirements and design before implementation.
Use when asked to "brainstorm this", "help me design this", "think through this",
or when a design needs exploration before technical specification.
/vibeflow-browser-testing测试阶段的真实浏览器验证底座。用于页面交互、表单、路由、前端 API、视觉状态和运行时问题验证。优先使用 Playwright MCP 做真实交互验证,使用 Chrome DevTools MCP 做运行时诊断;MCP 不可用时回退到本地 Playwright CLI 脚本。Other plugins' skills for the same job