Token导航 LogoToken导航

Agent Skill · 研究检索

tdd(时差)

tdd 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

tdd 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 70,176。

总安装 212周安装 9GitHub Stars 4下载 74核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/lukasstrickler/ai-dev-atelier --skill tdd

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息。适用宿主包括 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/lukasstrickler/ai-dev-atelier --skill tdd;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tdd 怎么安装?

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

tdd 支持哪些 AI 工具?

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

tdd 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

tdd 是免费的吗?

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

tdd 用的人多吗?

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

tdd 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

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

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
tdd

时差 · 本页

2124操作浏览器未明确通过

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

SKILL.md 原文

Test-Driven Development (TDD)

Strict Red-Green-Refactor workflow for robust, self-documenting, production-ready code.

Quick Navigation

SituationGo To
New to this codebaseStep 1: Explore Environment
Know the framework, starting workStep 2: Select Mode
Need the core loop referenceStep 3: Core TDD Loop
Complex edge cases to coverProperty-Based Testing
Tests are flaky/unreliableFlaky Test Management
Need isolated test environmentHermetic Testing
Measuring test qualityMutation Testing

The Three Rules (Robert C. Martin)

  1. No Production Code without a failing test
  2. Write Only Enough Test to Fail (compilation errors count)
  3. Write Only Enough Code to Pass (no optimizations yet)

The Loop: 🔴 RED (write failing test) → 🟢 GREEN (minimal code to pass) → 🔵 REFACTOR (clean up) → Repeat


Step 1: Explore Test Environment

Do NOT assume anything. Explore the codebase first.

Checklist:

  • Search for test files: glob("**/*.test.*"), glob("**/*.spec.*"), glob("**/test_*.py")
  • Check package.json scripts, Makefile, or CI workflows
  • Look for config: vitest.config.*, jest.config.*, pytest.ini, Cargo.toml

Framework Detection:

LanguageConfig FilesTest Command
Node.jspackage.json, vitest.config.*npm test, bun test
Pythonpyproject.toml, pytest.inipytest
Gogo.mod, *_test.gogo test./...
RustCargo.tomlcargo test

Step 2: Select Mode

ModeWhenFirst Action
New FeatureAdding functionalityRead existing module tests, confirm green baseline
Bug FixReproducing issueWrite failing reproduction test FIRST
RefactorCleaning codeEnsure ≥80% coverage on target code
LegacyNo tests existAdd characterization tests before changing

Tie-breaker: If coverage <20% or tests absent → use Legacy Mode first.

Mode: New Feature

  1. Read existing tests for the module
  2. Run tests to confirm green baseline
  3. Enter Core Loop for new behavior
  4. Commits: test(module): add test for X → feat(module): implement X

Mode: Bug Fix

  1. Write failing reproduction test (MUST fail before fix)
  2. Confirm failure is assertion error, not syntax error
  3. Write minimal fix
  4. Run full test suite
  5. Commits: test: add failing test for bug #123 → fix: description (#123)

Mode: Refactor

  1. Run coverage on the specific function you'll refactor
  2. If coverage <80% → add characterization tests first
  3. Refactor in small steps (ONE change → run tests → repeat)
  4. Never change behavior during refactor

Mode: Legacy Code

  1. Find Seams - insertion points for tests (Sensing Seams, Separation Seams)
  2. Break Dependencies - use Sprout Method or Wrap Method
  3. Add characterization tests (capture current behavior)
  4. Build safety net: happy path + error cases + boundaries
  5. Then apply TDD for your changes

→ See references/examples.md for full code examples of each mode.


Step 3: The Core TDD Loop

Before Starting: Scenario List

List all behaviors to cover:

  • Happy path cases
  • Edge cases and boundaries
  • Error/failure cases
  • Pessimism: 3 ways this could fail (network, null, invalid state)

🔴 RED Phase

  1. Write ONE test (single behavior or edge case)
  2. Use AAA: Arrange → Act → Assert
  3. Run test, verify it FAILS for expected reason

Checks:

  • Is failure an assertion error? (Not SyntaxError/ModuleNotFoundError)
  • Can I explain why this should fail?
  • If test passes immediately → STOP. Test is broken or feature exists.

🟢 GREEN Phase

  1. Write minimal code to pass
  2. Do NOT implement "perfect" solution
  3. Verify test passes

Checks:

  • Is this the simplest solution?
  • Can I delete any of this code and still pass?

🔵 REFACTOR Phase

  1. Look for duplication, unclear names, magic values
  2. Clean up without changing behavior
  3. Verify tests still pass

Repeat

Select next scenario, return to RED.

Triangulation: If implementation is too specific (hardcoded), write another test with different inputs to force generalization.


Stop Conditions

SignalResponse
Test passes immediatelyCheck assertions, verify feature isn't already built
Test fails for wrong reasonFix setup/imports first
Flaky testSTOP. Fix non-determinism immediately
Slow feedback (>5s)Optimize or mock external calls
Coverage decreasedAdd tests for uncovered paths

Test Distribution: The Testing Trophy

The Testing Trophy (Kent C. Dodds) reflects modern testing reality: integration tests give the best confidence-to-effort ratio.

          _____________
         /   System    \      ← Few, slow, high confidence; brittle (E2E)
        /_______________\
       /                 \
      /    Integration    \   ← Real interactions between units — **BEST ROI** (Integration)
      \                   /
       \_________________/
         \    Unit     /      ← Fast & cheap but test in isolation (Unit)
          \___________/
          /   Static  \       ← Typecheck, linting — typos/types (Static)
         /_____________\

Layer Breakdown

LayerWhatToolsWhen
StaticType errors, syntax, lintingTypeScript, ESLintAlways on, catches 50%+ of bugs for free
UnitPure functions, algorithms, utilitiesvitest, jest, pytestIsolated logic with no dependencies
IntegrationComponents + hooks + services togetherTesting Library, MSW, TestcontainersReal user flows, real(ish) data
E2EFull app in browserPlaywright, CypressCritical paths only (login, checkout)

Why Integration Tests Win

Unit tests prove code works in isolation. Integration tests prove code works together.

ConcernUnit TestIntegration Test
Component renders✅✅
Component + hook works❌✅
Component + API works❌✅
User flow works❌✅
Catches real bugsSometimesUsually

The insight: Most bugs live in the seams between modules, not inside pure functions. Integration tests catch seam bugs; unit tests don't.

Practical Guidance

  1. Start with integration tests - Test the way users use your code
  2. Drop to unit tests for complex algorithms or edge cases
  3. Use E2E sparingly - Slow, flaky, expensive to maintain
  4. Let static analysis do the heavy lifting - TypeScript catches more bugs than most unit tests
  5. Prefer fakes over mocks - Fakes have real behavior; mocks just return canned data
  6. SMURF quality: Sustainable, Maintainable, Useful, Resilient, Fast

Anti-Patterns

PatternProblemFix
Mirror BlindnessSame agent writes test AND codeState test intent before GREEN
Happy Path BiasOnly success scenariosInclude errors in Scenario List
Refactoring While RedChanging structure with failing testsGet to GREEN first
The MockeryOver-mocking hides bugsPrefer fakes or real implementations
Coverage TheaterTests without meaningful assertionsAssert behavior, not lines
Multi-Test StepMultiple tests before implementingOne test at a time
Verification Trap 🤖AI tests *what code does* not *what it should do*State intent in plain language; separate agent review
Test Exploitation 🤖LLMs exploit weak assertions or overload operatorsUse PBT alongside examples; strict equality
Assertion Omission 🤖Missing edge cases (null, undefined, boundaries)Scenario list with errors; test.each
Hallucinated Mock 🤖AI generates fake mocks without proper setupTestcontainers for integration; real Fakes for unit

Critical: Verify tests by (1) running them, (2) having separate agent review, (3) never trusting generated tests blindly.


Advanced Techniques

Use these techniques at specific points in your workflow:

TechniqueUse DuringPurpose
Test Doubles🔴 RED phaseIsolate dependencies when writing tests
Property-Based Testing🔴 RED phaseCover edge cases for complex logic
Contract Testing🔴 RED phaseDefine API expectations between services
Snapshot Testing🔴 RED phaseCapture UI/response structure
Hermetic Testing🔵 SetupEnsure test isolation and determinism
Mutation Testing✅ After GREENValidate test suite effectiveness
Coverage Analysis✅ After GREENFind untested code paths
Flaky Test Management🔧 MaintenanceFix unreliable tests blocking CI

Test Doubles (Use: Writing Tests with Dependencies)

When: Your code depends on something slow, unreliable, or complex (DB, API, filesystem).

TypePurposeWhen
StubReturns canned answersNeed specific return values
MockVerifies interactionsNeed to verify calls made
FakeSimplified implementationNeed real behavior without cost
SpyRecords callsNeed to observe without changing

Decision: Dependency slow/unreliable? → Fake (complex) or Stub (simple). Need to verify calls? → Mock/Spy. Otherwise → real implementation.

→ See references/examples.md → Test Double Examples


Hermetic Testing (Use: Test Environment Setup)

When: Setting up test infrastructure. Tests must be isolated and deterministic.

Principles:

  • Isolation: Unique temp directories/state per test
  • Reset: Clean up in setUp/tearDown
  • Determinism: No time-based logic or shared mutable state

Database Strategies:

StrategySpeedFidelityUse When
In-memory (SQLite)FastLowUnit tests, simple queries
TestcontainersMediumHighIntegration tests
Transactional RollbackFastHighTests sharing schema (80x faster than TRUNCATE)

→ See references/examples.md → Hermetic Testing Examples


Property-Based Testing (Use: Writing Tests for Complex Logic)

When: Writing tests for algorithms, state machines, serialization, or code with many edge cases.

Tools: fast-check (JS/TS), Hypothesis (Python), proptest (Rust)

Properties to Test:

  • Commutativity: f(a, b) == f(b, a)
  • Associativity: f(f(a, b), c) == f(a, f(b, c))
  • Identity: f(a, identity) == a
  • Round-trip: decode(encode(x)) == x
  • Metamorphic: If input changes by X, output changes by Y (useful when you don't know expected output)

How: Replace multiple example-based tests with one property test that generates random inputs.

Critical: Always log the seed on failure. Without it, you cannot reproduce the failing case.

→ See references/examples.md → Property-Based Testing Examples


Mutation Testing (Use: Validating Test Quality)

When: After tests pass, to verify they actually catch bugs. Use for critical code (auth, payments) or before major refactors.

Tools: Stryker (JS/TS), PIT (Java), mutmut (Python)

How: Tool mutates your code (e.g., changes > to >=). If tests still pass → your tests are weak.

Interpretation:

  • >80% mutation score = good test suite
  • Survived mutants = tests don't catch those changes → add tests for these

Equivalent Mutant Problem: Some mutants change syntax but not behavior (e.g., i < 10 → i!= 10 in a loop where i only increments). These can't be killed—100% score is often impossible. Focus on surviving mutants in *critical paths*, not chasing perfect scores.

When NOT to use: Tool-generated code (OpenAPI clients, Protobuf stubs, ORM models), simple DTOs/getters, legacy code with slow tests, or CI pipelines that must finish in <5 minutes. Use --incremental --since main for PR-focused runs. Note: This does NOT mean skip mutation testing on code you (the agent) wrote—always validate your own work.

→ See references/examples.md → Mutation Testing Examples


Flaky Test Management (Use: CI/CD Maintenance)

When: Tests fail intermittently, blocking CI or eroding trust in the test suite.

Root Causes:

CauseFix
Timing (setTimeout, races)Fake timers, await properly
Shared stateIsolate per test
RandomnessSeed or mock
NetworkUse MSW or fakes
Order dependencyMake tests independent
Parallel transaction conflictsIsolate DB connections per worker

How: Detect (--repeat 10) → Quarantine (separate suite) → Fix root cause → Restore

Quarantine Rules:

  • Issue-linked: Every quarantined test MUST link to a tracking issue. Prevents "quarantine-and-forget."
  • Mute, don't skip: Prefer muting (runs but doesn't fail build) over skipping. You still collect failure data.
  • Reintroduction criteria: Test must pass N consecutive runs (e.g., 100) on main before leaving quarantine.

→ See references/examples.md → Flaky Test Examples


Contract Testing (Use: Writing Tests for Service Boundaries)

When: Writing tests for code that calls or exposes APIs. Prevents integration breakage.

How (Pact): Consumer defines expected interactions → Contract published → Provider verifies → CI fails if contract broken.

→ See references/examples.md → Contract Testing Examples


Coverage Analysis (Use: Finding Gaps After Tests Pass)

When: After writing tests, to find untested code paths. NOT a goal in itself.

MetricMeasuresThreshold
LineLines executed70-80%
BranchDecision paths60-70%
MutationTest effectiveness>80%

Risk-Based Prioritization: P0 (auth, payments) → P1 (core logic) → P2 (helpers) → P3 (config)

Warning: High coverage ≠ good tests. Tests must assert meaningful behavior.


Snapshot Testing (Use: Writing Tests for UI/Output Structure)

When: Writing tests for UI components, API responses, or error message formats.

Appropriate: UI structure, API response shapes, error formats. Avoid: Behavior testing, dynamic content, entire pages.

How: Capture output once, verify it doesn't change unexpectedly. Always review diffs carefully.

→ See references/examples.md → Snapshot Testing Examples


Integration with Other Skills

TaskSkillUsage
Committinggit-committest: for RED, feat: for GREEN
Code Qualitycode-qualityRun during REFACTOR phase
Documentationdocs-checkCheck if behavior changes need docs

References

Foundational:

Tools: Testcontainers | fast-check | Stryker | MSW | Pact

平台分布

Codex

35.12%
按下载量换算26

Claude

28.25%
按下载量换算21

Cursor

18.86%
按下载量换算14

Gemini CLI

9.31%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

继续浏览同类 Skills