Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

tdd-test-writerTDD 测试编写者

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

21,185

周安装

857

GitHub Stars

902

下载量

6,650
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/am-will/codex-skills --skill tdd-test-writer

简介

首先编写失败的测试,为测试驱动开发建立严格的实施合同。

  • 通过编写因正确原因失败的以行为为中心的测试来完成 TDD 的 RED 阶段,然后将其交给具有客观通过标准的实施代理
  • 将测试创作委托给 tdd_test_writer
  • 子代理(如果可用),确保测试在实施期间保持不变
  • 检测现有的测试框架和约定(pytest、jest、vitest、go test、cargo test)并遵循存储库模式以确保一致性
  • 生成一个结构化的切换块,指定精确的测试文件、验证命令、故障摘要和实施代理必须满足的不可变测试约束,而不会削弱测试
  • 通过添加回归测试来支持错误修复工作流程,以在代码更改之前捕获报告的故障模式

SKILL.md

TDD Test Writer

Use this skill to complete the RED phase of TDD: define behavior with tests first, verify they fail for the right reason, then hand off implementation with objective pass criteria.

When To Use

Use this skill when the user asks for:

  • test-first development
  • TDD / RED-GREEN-REFACTOR workflow
  • writing tests that implementation agents must satisfy
  • bugfixes that need regression tests before code changes

Required Rules

  1. Do not modify production code while running this skill.
  2. Use subagent role tdd_test_writer for RED-phase test authoring whenever available.
  3. Write behavior-focused tests, not placeholders.
  4. Every new/updated test must fail before handoff.
  5. Failures must come from missing or incorrect production behavior, not broken tests.
  6. Prefer deterministic, targeted test commands over full-suite runs when possible.
  7. For bugfix tasks, add a regression test that captures the reported failure mode.

Workflow

1. Define Behavior Contract

  • Convert user request into explicit acceptance criteria.
  • Identify happy path, edge cases, and negative-path expectations.
  • If requirements are ambiguous, record ASSUMPTION: lines in output.

2. Delegate Test Authoring To tdd_test_writer

  • Spawn a tdd_test_writer subagent with task scope, target files, and acceptance criteria.
  • Require the subagent to write/update tests only (no production code changes).
  • Require command output proving RED-state failure for the new tests.
  • If tdd_test_writer is unavailable, continue directly and note FALLBACK: tdd_test_writer unavailable.

3. Discover Existing Test Conventions

  • Detect framework and runner from the repo (for example vitest, jest, pytest, go test, cargo test).
  • Follow existing directory, naming, and fixture conventions.
  • Reuse existing helpers instead of introducing duplicate test utilities.

4. Author RED-Phase Tests

  • Create or update test files that encode the behavior contract.
  • Keep tests small and intention-revealing (clear names and assertions).
  • Include at least one negative-path assertion where applicable.
  • Avoid network/time randomness; mock or fixture external systems.

5. Verify RED State

  • Run the narrowest command that executes the new tests.
  • Confirm they fail for the expected behavioral gap.
  • If failure is caused by test syntax/setup, fix tests and rerun.

6. Produce Implementation Handoff

Return a block that implementation agents must follow. The handoff must include:

  • subagent used (tdd_test_writer) or explicit fallback reason
  • exact test files created/updated
  • exact verification command(s)
  • short failure summary proving RED state
  • immutable test constraint (do not edit tests unless requirement changes)
  • pass criteria that define task completion

Required Output Format

TDD RED PHASE COMPLETE

## Authoring Mode
- Subagent: tdd_test_writer
- Fallback: [only if subagent unavailable]

## Test Files
- [path]

## Verification
- Command: [exact command]
- Result: FAIL (expected)
- Failure reason: [1-2 lines tied to missing behavior]

## Implementation Contract (for next agent)
1. Do not modify these tests: [paths]
2. Implement production changes only in: [paths or modules]
3. Completion gate: [exact command] passes with no test weakening.
4. Run broader safety check: [secondary command]
5. Return evidence: changed files + command output summary.

## Assumptions
- ASSUMPTION: [only if needed]

Quality Bar

  • Tests fail before implementation and are reproducible locally.
  • Assertions are specific enough to prevent false positives.
  • Regression coverage is present for bugfix-driven tasks.
  • Handoff is precise enough that another agent can execute without clarifications.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.52%
按下载量换算2,362

Claude

27.21%
按下载量换算1,809

Cursor

18.84%
按下载量换算1,253

Gemini CLI

9.03%
按下载量换算600

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/am-will/codex-skills --skill tdd-test-writer 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills