Skip to content
Agentmart
Submit a tool

tdd-workflow

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

Skill by aaione

IndexedMIT★ 29
Write a review

Chalk Labs

Need help deploying tdd-workflow?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

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/aaione-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%+ 覆盖率的测试驱动开发,包括单元、集成和 E2E 测试。

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%+ 覆盖率的测试驱动开发,包括单元、集成和 E2E 测试。
License
MIT
Instructions
406 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • openai.yaml · agents/

SKILL.md (first lines)

# 测试驱动开发工作流

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

## 何时激活

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

## 核心原则

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

### 2. 覆盖要求
- 最低 80% 覆盖率(单元 + 集成 + E2E)
- 覆盖所有边缘情况
- 测试错误场景
- 验证边界条件

### 3. 测试类型

#### 单元测试
- 单个函数和工具
- 组件逻辑
- 纯函数
- 助手和工具

#### 集成测试
- API 端点
- 数据库操作
- 服务交互
- 外部 API 调用

#### E2E 测试(Playwright)
- 关键用户流程
- 完整工作流
- 浏览器自动化
- UI 交互

## TDD 工作流程步骤

### 步骤 1:编写用户旅程
```
作为 [角色],我想要 [操作],以便 [利益]

示例:
作为用户,我想要语义搜索市场,
以便即使没有确切的关键词也能找到相关市场。
```

### 步骤 2:生成测试用例
为每个用户旅程创建全面的测试用例:

```typescript
describe('语义搜索', () => {
  it('为查询返回相关市场', async () => {
    // 测试实现
  })

  it('优雅处理空查询', async () => {
    // 测试边缘情况
  })

  it('当 Redis 不可用时回退到子字符串搜索', async () => {
    // 测试回退行为
  })

  it('按相似度分数对结果排序', async () => {
    // 测试排序逻辑
  })
})
```

### 步骤 3:运行测试(它们应该失败)
```bash
npm test
# 测试应该失败 — 我们尚未实现
```

### 步骤 4:实现代码
编写使测试通过的最少代码:

```typescript
// 测试指导的实现
export async function searchMarkets(query: string) {
  // 实现这里
}
```

### 步骤 5:再次运行测试
```bash
npm test
# 测试现在应该通过
```

### 步骤 6:重构
在保持测试绿色的同时提高代码质量:
- 删除重复
- 改进命名
- 优化性能
- 增强可读性

### 步骤 7:验证覆盖率
```bash
npm run test:coverage
# 验证实现 80%+ 覆盖率
```

## 测试模式

### 单元测试模式(Jest/Vitest)
```typescript
import { render, screen, fireEvent } from '@testing-library/react'
import { Button } from './Button'

From aaione/everything-claude-code-zh, MIT.

More from aaione/everything-claude-code-zh

Signals

Stars
29
Forks
14
Open issues
1
Last commit (this folder)
May 31, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

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

More from aaione

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get tdd-workflow running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying tdd-workflow?

CallGet help
Cite this page

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