Token导航 LogoToken导航

Agent Skill · 前端设计

tdd(时差)

tdd 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

tdd 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 5,948。

总安装 574周安装 23GitHub Stars 5下载 186核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tdd(时差)
来源仓库:https://github.com/lucastamoios/celeiro
仓库路径:skills/tdd
安装命令:
npx skills add https://github.com/lucastamoios/celeiro --skill tdd
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/lucastamoios/celeiro --skill tdd

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

TDD 分 3 步: 🔴红色 - 编写失败的测试(描述你想要什么) 🟢 绿色 - 使测试通过(实现最少的代码) 🔵 REFACTOR - 改进代码(保持测试通过) 永远记住: 明确识别被测实体 在实施之前编写测试 测试主要情况(不是所有可能性) 使用清晰的命名约定 不确定时询问 黄金法则:如果您正在编写实现代码而没有失败的测试,请停止并首先编写测试。

参考文件 示例:参见示例/feature-implementation.md 和示例/对话-examples.md 模板:参见 templates/test-struct.md 用于测试模式和模拟 命名:参见 data/naming-conventions.md 命名指南 覆盖范围:参见 data/coverage-guidelines.md 为了测试什么 每周安装量 23 存储库 卢卡斯塔莫奥斯/塞莱罗 GitHub 之星 5 第一次看到 2026 年 1 月 24 日 安全审计 Gen Agent Trust Hub 通行证 套接字通行证 斯尼克通行证

来源仓库内路径:skills/tdd

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/lucastamoios/celeiro --skill tdd;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tdd 怎么安装?

在终端执行 npx skills add https://github.com/lucastamoios/celeiro --skill tdd。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tdd 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tdd 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

tdd 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

tdd 用的人多吗?

公开数据是累计安装 574 次,近一周安装 23 次,下载 186 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tdd 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
tdd

时差 · 本页

5745需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

TDD (Test-Driven Development) Skill

Guide Claude to follow strict Test-Driven Development practices when implementing new features or fixing bugs. Ensures tests are written BEFORE implementation code.

When to Use

  • Implementing new features
  • Adding new methods to existing services/repositories
  • Fixing bugs (write failing test first)
  • Refactoring existing code

Core TDD Cycle

RED → GREEN → REFACTOR
 ↓      ↓         ↓
Fail   Pass    Improve

1. RED - Write Failing Test

  • Write test that describes desired behavior
  • Test MUST fail (compilation error or assertion failure)
  • Verify test fails for the right reason

2. GREEN - Make Test Pass

  • Write minimal code to make test pass
  • Don't worry about perfect code yet
  • Just make it work

3. REFACTOR - Improve Code

  • Clean up implementation
  • Remove duplication
  • Improve naming
  • Tests still pass

Critical Rules

Rule 1: ALWAYS Identify Entity Under Test

Before writing any test, Claude MUST:

  1. Ask the user if entity under test is ambiguous
  2. State explicitly which entity is being tested
  3. Use correct naming in test file and test functions

See examples/dialogue-examples.md for examples of clear vs ambiguous entity identification.

Rule 2: Test File Location

Place test files next to the code being tested:

internal/service/
├── transaction_service.go
└── transaction_service_test.go  ← Test file here

pkg/ofx/
├── parser.go
└── parser_test.go  ← Test file here

Rule 3: Test Naming Convention

Pattern: Test<EntityName>_<MethodName>_<Scenario>

See data/naming-conventions.md for detailed naming guidelines and examples.

// ✅ GOOD - Clear entity, method, and scenario
func TestTransactionService_ImportFromOFX_WithDuplicateFITID(t *testing.T)
func TestOFXParser_Parse_WithInvalidXML(t *testing.T)
func TestBudgetRepository_Create_WithNullAmount(t *testing.T)

// ❌ BAD - Missing entity or scenario
func TestImport(t *testing.T)
func TestValidData(t *testing.T)

Rule 4: Test Main Cases (Not Everything)

Focus on:

  • Happy path (1 test)
  • Common errors (2-3 tests)
  • Edge cases (1-2 tests)
  • Business rules (as many as needed)

Don't test:

  • Language features (e.g., "does append work?")
  • Third-party library internals
  • Trivial getters/setters
  • Every possible combination

See data/coverage-guidelines.md for what to test and what to skip.

Test Structure (AAA Pattern)

Use templates from templates/test-structure.md:

func TestTransactionService_ImportFromOFX_Success(t *testing.T) {
    // ARRANGE - Setup test data and dependencies
    mockRepo := &mockTransactionRepository{}
    parser := ofx.NewParser()
    service := NewTransactionService(mockRepo, parser)

    ofxData := []byte(`<OFX>...</OFX>`)
    accountID := uuid.New()

    // ACT - Execute the method being tested
    result, err := service.ImportFromOFX(context.Background(), ofxData, accountID)

    // ASSERT - Verify expectations
    require.NoError(t, err)
    assert.Equal(t, 5, result.Inserted)
    assert.Equal(t, 0, result.Skipped)
}

TDD Workflow Examples

See examples/feature-implementation.md for complete examples:

Example 1: New Feature

  1. RED - Write failing test for BudgetService.CalculateEffectiveAmount()
  2. GREEN - Implement minimal code to pass
  3. REFACTOR - Add more test cases and improve

Example 2: Bug Fix

  1. RED - Reproduce bug with failing test
  2. GREEN - Fix the bug to make test pass
  3. REFACTOR - Verify no other bugs introduced

Example 3: Multiple Scenarios

Test 4 main cases for each method:

  • Happy path
  • Error handling
  • Boundary conditions
  • Business rules

Test Coverage Guidelines

From data/coverage-guidelines.md:

What to Test ✅

  • Repository: CRUD, constraints, complex queries
  • Service: Business logic, validation, error handling
  • Handler: Request/response, status codes, auth

What NOT to Test ❌

  • Language features
  • Framework internals
  • Database engine behavior
  • Third-party libraries
  • Trivial code

Mocking Guidelines

When to Mock

  • External dependencies (HTTP clients, databases)
  • Other services in service layer
  • Slow operations
  • Non-deterministic behavior (time, random)

How to Mock

See templates/test-structure.md for mock templates:

// Define interface in domain
type TransactionRepository interface {
    BulkInsert(ctx context.Context, txs []*Transaction) error
}

// Create mock in test file
type mockTransactionRepository struct {
    mock.Mock
}

func (m *mockTransactionRepository) BulkInsert(ctx context.Context, txs []*Transaction) error {
    args := m.Called(ctx, txs)
    return args.Error(0)
}

Claude's TDD Checklist

Before writing implementation code, Claude MUST:

  • Identify entity under test explicitly
  • Create/open correct test file (*_test.go)
  • Write test with clear AAA structure
  • Run test and verify it FAILS
  • State why test fails (compilation or assertion)
  • Ask user if entity or scenario is ambiguous

After test fails, Claude can:

  • Implement minimal code to pass test
  • Run test and verify it PASSES
  • Refactor if needed
  • Add more test cases for edge cases

Common Mistakes to Avoid

❌ Writing Implementation First

WRONG: "I'll implement ImportFromOFX, then test it"
RIGHT: "I'll write a test for ImportFromOFX first, then implement"

❌ Testing Multiple Things in One Test

One scenario per test function.

❌ Unclear Entity Under Test

Always specify which entity (Service, Repository, Handler) is being tested.

❌ Testing Implementation Details

Test public behavior, not internal variables or private methods.

TDD Dialog Examples

See examples/dialogue-examples.md for:

  • How to handle clear entity requests
  • How to ask for clarification when ambiguous
  • How to propose multiple test scenarios
  • How to stop before writing implementation without tests

Summary

TDD in 3 Steps:

  1. 🔴 RED - Write failing test (describe what you want)
  2. 🟢 GREEN - Make test pass (implement minimal code)
  3. 🔵 REFACTOR - Improve code (keep tests passing)

Always remember:

  • Identify entity under test explicitly
  • Write test BEFORE implementation
  • Test main cases (not every possibility)
  • Use clear naming conventions
  • Ask when unsure

Golden Rule: If you're writing implementation code without a failing test, STOP and write the test first.

Reference Files

  • Examples: See examples/feature-implementation.md and examples/dialogue-examples.md
  • Templates: See templates/test-structure.md for test patterns and mocks
  • Naming: See data/naming-conventions.md for naming guidelines
  • Coverage: See data/coverage-guidelines.md for what to test

平台分布

Claude Code

31.02%
按下载量换算58

trae

22.94%
按下载量换算43

Antigravity

18.9%
按下载量换算35

Codex

12.41%
按下载量换算23

windsurf

8.36%
按下载量换算16

Gemini CLI

3.97%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills