← 返回 Skills 市场
bovinphang

Tdd Workflow

作者 Bovin Phang · GitHub ↗ · v2.5.0 · MIT-0
cross-platform ✓ 安全检测通过
28
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fec-tdd-workflow
功能描述
Use when implementing new frontend behavior, fixing bugs, or refactoring logic where tests can describe the expected behavior first. Apply to components, hoo...
使用说明 (SKILL.md)

前端 TDD 工作流

Purpose

用“先写失败测试,再实现最小代码,再重构”的节奏交付前端功能,避免只在实现后补覆盖率。

Procedure

  1. 识别可观察行为:用户能看到的 UI、组件契约、hook/composable 返回值、路由守卫结果、API client 输出或错误状态。
  2. 先写一个最小失败测试:
    • 纯逻辑优先单元测试。
    • 组件交互优先 Testing Library / Vue Test Utils。
    • 跨页关键流程优先 Playwright / Cypress。
  3. 运行该测试并确认失败原因正确,失败应来自行为尚未实现,而不是语法、导入或测试环境错误。
  4. 写刚好能通过测试的最小实现,不顺手扩大范围。
  5. 重新运行测试,确认变绿。
  6. 在测试保持通过的前提下重构命名、边界和重复逻辑。
  7. 对 bug 修复,保留能复现问题的回归测试。
  8. 每轮只扩大一个可观察行为;新需求、新边界和新异常路径各自进入下一轮。

Prove-It Pattern

修复缺陷时先让测试失败,再让它通过。若无法先失败,说明测试没有覆盖原始问题,需要收窄输入、断言或测试层级。

Frontend Test Selection

Risk Preferred Test
utils、schema、状态计算 单元测试
hooks / composables 单元或轻量集成测试
组件 props、emits、交互、状态 组件测试
Router、Provider、Store 协作 轻量集成测试
登录、支付、权限、关键 CRUD E2E 测试

Constraints

  • 不为了 TDD 引入项目没有使用且收益不清晰的新测试框架。
  • 不测试实现细节、私有状态或脆弱 DOM 结构。
  • 不把 E2E 当作所有风险的默认答案;优先选择离风险最近的测试层。
  • 如果现有仓库没有测试基础设施,先输出最小测试落地建议,再请求用户确认是否引入。
  • 不在红灯阶段同时重构;先证明问题,再最小修复,再整理结构。

Expected Output

  • 至少一个先失败后通过的测试覆盖新增或修复行为。
  • 实现保持最小范围,重构只在测试通过后进行。
  • 总结运行过的测试命令、覆盖的行为和未覆盖风险。
安全使用建议
This skill is reasonable to install if you want an agent to follow a test-first frontend workflow. Expect it to encourage test and source-code changes and running test commands, but there is no evidence of hidden execution, credential access, persistence, or unrelated data handling.
能力评估
Purpose & Capability
The stated purpose is to guide agents through red-green-refactor frontend testing. The SKILL.md, README, package metadata, and ClawHub metadata are coherent and limited to testing workflow guidance.
Instruction Scope
Runtime instructions are scoped to writing a failing test, implementing the minimum change, rerunning tests, and summarizing coverage. They do not request hidden actions, prompt overrides, broad data access, credential use, or unrelated authority.
Install Mechanism
The package contains only markdown and JSON files. package.json declares no dependencies, lifecycle scripts, binaries, or executable files.
Credentials
The skill may lead an agent to edit project tests/code and run project test commands when the user is already asking for frontend implementation or bug fixing; that authority is expected and proportionate to TDD workflow use.
Persistence & Privilege
No persistence mechanism, background worker, privilege escalation, authentication store access, network behavior, or local indexing behavior appears in the artifacts.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fec-tdd-workflow
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fec-tdd-workflow 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.5.0
- Added a detailed SKILL.md outlining the "frontend TDD workflow" purpose, step-by-step procedure, and best practices. - Included guidance for choosing test types according to risk (unit, component, integration, E2E). - Documented constraints to avoid overengineering testing or using unsuitable tools. - Defined clear expected outputs for following the TDD workflow. - Provided Chinese-language triggers and documentation to support bilingual usage.
元数据
Slug fec-tdd-workflow
版本 2.5.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Tdd Workflow 是什么?

Use when implementing new frontend behavior, fixing bugs, or refactoring logic where tests can describe the expected behavior first. Apply to components, hoo... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 28 次。

如何安装 Tdd Workflow?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fec-tdd-workflow」即可一键安装,无需额外配置。

Tdd Workflow 是免费的吗?

是的,Tdd Workflow 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Tdd Workflow 支持哪些平台?

Tdd Workflow 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Tdd Workflow?

由 Bovin Phang(@bovinphang)开发并维护,当前版本 v2.5.0。

💬 留言讨论