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 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 20,201。

总安装 235周安装 10GitHub Stars 633下载 82核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/citypaul/dotfiles --skill tdd

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,辅助项目状态整理。适用于 Codex、Claude、Cursor、Gemini CLI 中需要围绕代码变更进行梳理的场景。可结合来源仓库和原始 README 进一步核验具体功能和操作流程。

安装前建议确认权限范围和维护状态,避免触发意外的网络或文件操作。tdd 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/tdd

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

tdd 怎么安装?

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

tdd 支持哪些 AI 工具?

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

tdd 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

tdd 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

tdd 用的人多吗?

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

tdd 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
tdd

时差 · 本页

235633只读未明确通过

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

SKILL.md 原文

Test-Driven Development

TDD is the fundamental practice. Every line of production code must be written in response to a failing test.

For how to write good tests, load the testing skill. This skill focuses on the TDD workflow/process.


RED-GREEN-MUTATE-KILL MUTANTS-REFACTOR Cycle

RED: Write Failing Test First

  • NO production code until you have a failing test
  • Test describes desired behavior, not implementation
  • Test should fail for the right reason

GREEN: Minimum Code to Pass

  • Write ONLY enough code to make the test pass
  • Resist adding functionality not demanded by a test

MUTATE: Verify Test Effectiveness

  • Run mutation-testing skill against the changed code
  • Produce a mutation testing report (killed/survived/score)
  • This validates whether your tests would catch real bugs

KILL MUTANTS: Address Surviving Mutants

  • Add or strengthen tests to kill surviving mutants
  • Ask the human when a surviving mutant's value is ambiguous
  • All tests pass after fixes

REFACTOR: Assess Improvements

  • Assess AFTER mutation testing confirms test strength
  • Commit before refactoring
  • All tests must pass after refactoring

TDD Evidence in Commit History

Default Expectation

Commit history should show clear RED → GREEN → MUTATE → KILL MUTANTS → REFACTOR progression.

Ideal progression:

commit abc123: test: add failing test for user authentication
commit def456: feat: implement user authentication to pass test
commit ghi789: test: strengthen boundary tests (mutation testing)
commit jkl012: refactor: extract validation logic for clarity

Rare Exceptions

TDD evidence may not be linearly visible in commits in these cases:

1. Multi-Session Work

  • Feature spans multiple development sessions
  • Work done with TDD in each session
  • Commits organized for PR clarity rather than strict TDD phases
  • Evidence: Tests exist, all passing, implementation matches test requirements

2. Context Continuation

  • Resuming from previous work
  • Original RED phase done in previous session/commit
  • Current work continues from that point
  • Evidence: Reference to RED commit in PR description

3. Refactoring Commits

  • Large refactors after GREEN + MUTATE + KILL MUTANTS
  • Multiple small refactors combined into single commit
  • All tests remained green throughout
  • Evidence: Commit message notes "refactor only, no behavior change"

Documenting Exceptions in PRs

When exception applies, document in PR description:

## TDD Evidence

RED phase: commit c925187 (added failing tests for shopping cart)
GREEN phase: commits 5e0055b, 9a246d0 (implementation + bug fixes)
MUTATE + KILL MUTANTS: commit 7b8c9d0 (strengthened boundary tests)
REFACTOR: commit 11dbd1a (test isolation improvements)

Test Evidence:
✅ 4/4 tests passing (7.7s with 4 workers)

Important: Exception is for EVIDENCE presentation, not TDD practice. TDD process must still be followed - these are cases where commit history doesn't perfectly reflect the process that was actually followed.


Coverage Verification - CRITICAL

NEVER Trust Coverage Claims Without Verification

Always run coverage yourself before approving PRs.

Verification Process

Before approving any PR claiming "100% coverage":

  1. Check out the branch git checkout feature-branch
  2. Run coverage verification: cd packages/core pnpm test:coverage # OR pnpm exec vitest run --coverage
  3. Verify ALL metrics hit 100%:

- Lines: 100% ✅ - Statements: 100% ✅ - Branches: 100% ✅ - Functions: 100% ✅

  1. Check that tests are behavior-driven (not testing implementation details)

For anti-patterns that create fake coverage (coverage theater), see the testing skill.

Reading Coverage Output

Look for the "All files" line in coverage summary:

File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files      |     100 |      100 |     100 |     100 |
setup.ts       |     100 |      100 |     100 |     100 |
context.ts     |     100 |      100 |     100 |     100 |
endpoints.ts   |     100 |      100 |     100 |     100 |

✅ This is 100% coverage - all four metrics at 100%.

Red Flags

Watch for these signs of incomplete coverage:

❌ PR claims "100% coverage" but you haven't verified

  • Never trust claims without running coverage yourself

❌ Coverage summary shows <100% on any metric

All files      |   97.11 |    93.97 |   81.81 |   97.11 |
  • This is NOT 100% coverage (Functions: 81.81%, Lines: 97.11%)

❌ "Uncovered Line #s" column shows line numbers

setup.ts       |   95.23 |      100 |      60 |   95.23 | 45-48, 52-55
  • Lines 45-48 and 52-55 are not covered

❌ Coverage gaps without explicit exception documentation

  • If coverage <100%, exception should be documented (see Exception Process below)

When Coverage Drops, Ask

"What business behavior am I not testing?"

NOT "What line am I missing?"

Add tests for behavior, and coverage follows naturally.


100% Coverage Exception Process

Default Rule: 100% Coverage Required

No exceptions without explicit approval and documentation.

Requesting an Exception

If 100% coverage cannot be achieved:

Step 1: Document in package README

Explain:

  • Current coverage metrics
  • WHY 100% cannot be achieved in this package
  • WHERE the missing coverage will come from (integration tests, E2E, etc.)

Step 2: Get explicit approval

From project maintainer or team lead

Step 3: Document in CLAUDE.md

Under "Test Coverage: 100% Required" section, list the exception

Example Exception:

## Current Exceptions

- **Next.js Adapter**: 86% function coverage
  - Documented in `/packages/nextjs-adapter/README.md`
  - Missing coverage from SSR functions (tested in E2E layer)
  - Approved: 2024-11-15

Remember

The burden of proof is on the requester. 100% is the default expectation.


Development Workflow

Adding a New Feature

  1. Write failing test - describe expected behavior
  2. Run test - confirm it fails (pnpm test:watch)
  3. Implement minimum - just enough to pass
  4. Run test - confirm it passes
  5. Run mutation testing - verify tests catch real bugs
  6. Kill surviving mutants - strengthen tests (ask human when ambiguous)
  7. Refactor if valuable - improve code structure
  8. Commit - with conventional commit message

Workflow Example

# 1. Write failing test
it('should reject empty user names', () => {
  const result = createUser({ id: 'user-123', name: '' });
  expect(result.success).toBe(false);
}); # ❌ Test fails (no implementation)

# 2. Implement minimum code
if (user.name === '') {
  return { success: false, error: 'Name required' };
} # ✅ Test passes

# 3. Run mutation testing to verify test strength

# 4. Kill surviving mutants (ask human when ambiguous)

# 5. Refactor if needed (extract validation, improve naming)

# 6. Commit
git add .
git commit -m "feat: reject empty user names"

Commit Messages

Use conventional commits format:

feat: add user role-based permissions
fix: correct email validation regex
refactor: extract user validation logic
test: add edge cases for permission checks
docs: update architecture documentation

Format:

  • feat: - New feature
  • fix: - Bug fix
  • refactor: - Code change that neither fixes bug nor adds feature
  • test: - Adding or updating tests
  • docs: - Documentation changes

Pull Request Requirements

Before submitting PR:

  • All tests must pass
  • All linting and type checks must pass
  • Coverage verification REQUIRED - claims must be verified before review/approval
  • PRs focused on single feature or fix
  • Include behavior description (not implementation details)

Example PR Description:

## Summary

Adds support for user role-based permissions with configurable access levels.

## Behavior Changes

- Users can now have multiple roles with fine-grained permissions
- Permission check via `hasPermission(user, resource, action)`
- Default role assigned if not specified

## Test Evidence

✅ 42/42 tests passing
✅ 100% coverage verified (see coverage report)

## TDD Evidence

RED: commit 4a3b2c1 (failing tests for permission system)
GREEN: commit 5d4e3f2 (implementation)
REFACTOR: commit 6e5f4a3 (extract permission resolution logic)

Refactoring Priority

After mutation testing confirms test strength, classify any issues:

PriorityActionExamples
CriticalFix nowMutations, knowledge duplication, >3 levels nesting
HighThis sessionMagic numbers, unclear names, >30 line functions
NiceLaterMinor naming, single-use helpers
SkipDon't changeAlready clean code

For detailed refactoring methodology, load the refactoring skill.


Anti-Patterns to Avoid

  • ❌ Writing production code without failing test
  • ❌ Testing implementation details (spies on internal methods)
  • ❌ 1:1 mapping between test files and implementation files
  • ❌ Using let/beforeEach for test data
  • ❌ Trusting coverage claims without verification
  • ❌ Mocking the function being tested
  • ❌ Redefining schemas in test files
  • ❌ Factories returning partial/incomplete objects
  • ❌ Speculative code ("just in case" logic without tests)

For detailed testing anti-patterns, load the testing skill.


Summary Checklist

Before marking work complete:

  • Every production code line has a failing test that demanded it
  • Commit history shows TDD evidence (or documented exception)
  • All tests pass
  • Coverage verified at 100% (or exception documented)
  • Mutation testing run and surviving mutants addressed
  • Test factories used (no let/beforeEach)
  • Tests verify behavior (not implementation details)
  • Refactoring assessed and applied if valuable
  • Conventional commit messages used

平台分布

Codex

32.2%
按下载量换算26

Claude

30.05%
按下载量换算25

Cursor

18.48%
按下载量换算15

Gemini CLI

9.95%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills