Skip to content
Agentmart
Submit a tool

tdd-workflow

在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。

Skill by Luohaothu

IndexedMIT★ 26
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/luohaothu-tdd-workflow

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。

Use cases: testing, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/tdd-workflow

What's inside

Skill name
tdd-workflow
Description
在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。
License
MIT
Instructions
436 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 测试驱动开发工作流

此技能确保所有代码开发遵循TDD原则,并具备全面的测试覆盖率。

## 何时激活

* 编写新功能或功能
* 修复错误或问题
* 重构现有代码
* 添加API端点
* 创建新组件

## 核心原则

### 1. 测试优先于代码

始终先编写测试,然后实现代码以使测试通过。

### 2. 覆盖率要求

* 最低80%覆盖率(单元 + 集成 + 端到端)
* 覆盖所有边缘情况
* 测试错误场景
* 验证边界条件

### 3. 测试类型

#### 单元测试

* 单个函数和工具
* 组件逻辑
* 纯函数
* 辅助函数和工具

#### 集成测试

* API端点
* 数据库操作
* 服务交互
* 外部API调用

#### 端到端测试 (Playwright)

* 关键用户流程
* 完整工作流
* 浏览器自动化
* UI交互

## TDD 工作流步骤

### 步骤 1: 编写用户旅程

```
As a [role], I want to [action], so that [benefit]

Example:
As a user, I want to search for markets semantically,
so that I can find relevant markets even without exact keywords.
```

### 步骤 2: 生成测试用例

针对每个用户旅程,创建全面的测试用例:

```typescript
describe('Semantic Search', () => {
  it('returns relevant markets for query', async () => {
    // Test implementation
  })

  it('handles empty query gracefully', async () => {
    // Test edge case
  })

  it('falls back to substring search when Redis unavailable', async () => {
    // Test fallback behavior
  })

  it('sorts results by similarity score', async () => {
    // Test sorting logic
  })
})
```

### 步骤 3: 运行测试(它们应该失败)

```bash
npm test
# Tests should fail - we haven't implemented yet
```

### 步骤 4: 实现代码

编写最少的代码以使测试通过:

```typescript
// Implementation guided by tests
export async function searchMarkets(query: string) {
  // Implementation here
}
```

### 步骤 5: 再次运行测试

```bash
npm test
# Tests should now pass
```

### 步骤 6: 重构

在保持测试通过的同时提高代码质量:

* 消除重复
* 改进命名
* 优化性能
* 增强可读性

### 步骤 7: 验证覆盖率

From Luohaothu/everything-codex, MIT.

More from Luohaothu/everything-codex

Signals

Stars
26
Forks
5
Open issues
0
Last commit (this folder)
Feb 5, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Luohaothu

Cite this page

tdd-workflow skill. Agent Mart. https://agentmart.dev/skills/luohaothu-tdd-workflow (last updated 2026-10-24)