← Back to Skills Marketplace
bovinphang

Tdd Workflow

by Bovin Phang · GitHub ↗ · v2.5.0 · MIT-0
cross-platform ✓ Security Clean
28
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install fec-tdd-workflow
Description
Use when implementing new frontend behavior, fixing bugs, or refactoring logic where tests can describe the expected behavior first. Apply to components, hoo...
README (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

  • 至少一个先失败后通过的测试覆盖新增或修复行为。
  • 实现保持最小范围,重构只在测试通过后进行。
  • 总结运行过的测试命令、覆盖的行为和未覆盖风险。
Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install fec-tdd-workflow
  3. After installation, invoke the skill by name or use /fec-tdd-workflow
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug fec-tdd-workflow
Version 2.5.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 28 downloads so far.

How do I install Tdd Workflow?

Run "/install fec-tdd-workflow" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Tdd Workflow free?

Yes, Tdd Workflow is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Tdd Workflow support?

Tdd Workflow is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Tdd Workflow?

It is built and maintained by Bovin Phang (@bovinphang); the current version is v2.5.0.

💬 Comments