Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计未展示

tdd:write-testsTDD 编写测试

Agent Skill

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

总安装

11,856

周安装

475

GitHub Stars

891

下载量

3,838
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/neolabhq/context-engineering-kit --skill tdd:write-tests

简介

用于辅助测试设计、自动化测试、用例整理和回归验证。

  • 适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。
  • 使用时需要确认项目测试框架、运行命令和夹具数据,避免改坏真实逻辑。
  • 涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。
  • 当前无额外底部简介,可参考来源仓库获取完整功能说明。

SKILL.md

Cover Local Changes with Tests

User Arguments

User can provide a what tests or modules to focus on:

$ARGUMENTS

If nothing is provided, focus on all changes in current git diff that not commited. If everything is commited, then will cover latest commit.

Context

After implementing new features or refactoring existing code, it's critical to ensure all business logic changes are covered by tests. This command orchestrates automated test creation for local changes using coverage analysis and specialized agents.

Goal

Achieve comprehensive test coverage for all critical business logic in local code changes.

Important Constraints

  • Focus on critical business logic - not every line needs 100% coverage
  • Preserve existing tests - only add new tests, don't modify existing ones
  • "Analyse complexity of changes" -

- if there 2 or more changed files, or one file with complex logic, then Do not write tests yourself - only orchestrate agents! - if there is only one changed file, and it's a simple change, then you can write tests yourself.

Workflow Steps

Preparation

  1. Read sadd skill if available

- If available, read the sadd skill to understand best practices for managing agents

  1. Discover test infrastructure

- Read @README.md and package.json (or equivalent project config) - Identify commands to run tests and coverage reports - Understand project structure and testing conventions

  1. Run all tests

- Execute full test suite to establish baseline

Analysis

Do steps 4-5 in parallel using haiku agents:

  1. Verify single test execution

- Choose any passing test file - Launch haiku agent with instructions to find proper command to run this only test file - Ask him to iterate until you can reliably run individual tests - After he complete try running a specific test file if it exists - This ensures agents can run tests in isolation

  1. Analyze local changes

- Run git status -u to identify all changed files (including untracked files) - If there no uncommited changes, then run git show --name-status to get the list of files that were changed in the latest commit. - Filter out non-code files (docs, configs, etc.) - Launch separate haikue agent per changed file to analyze file itself, and the complexity of the changes, and prepare short summary of it. - Extract list of files with actual logic changes

Test Writing

Simple Single File Flow

If there is only one changed file, and it's a simple change, then you can write tests yourself. Following this guidline:

  1. Read TDD skill for best practices on writing tests
  2. Read the target file {FILE_PATH} and understand the logic
  3. Review existing test files for patterns and style, if not exists then create it.
  4. Analyse which tests cases should be added to cover the changes.
  5. Create comprehensive tests for all identified cases
  6. Run the test command identified before.
  7. Iterate and fix any issues until all tests pass

Ensure tests are:

  • Clear and maintainable
  • Follow project conventions
  • Test behavior, not implementation
  • Cover edge cases and error paths

Multiple Files or Complex File Flow

If there are multiple changed files, or one file with complex logic, then you need to use specialized agents to cover the changes. Following this guidline:

  1. Launch code-review:test-coverage-reviewer agents (parallel) (Sonnet or Opus models)

- Launch one coverage-reviewer agent per changed file - Provide each agent with: - Context: What changed in this file (git diff) - Target: Which specific file to analyze - Resources: Read README and relevant documentation - Goal: Identify what test suites need to be added - Output: List of test cases needed for critical business logic - Collect all coverage review reports

  1. Launch developer agents for test file (parallel) (Sonnet or Opus models)

- Launch one developer agent per changed file that needs tests - Provide each agent with: - Context: Coverage review report for this file - Target: Which specific file to create tests for - Test cases: List from coverage-reviewer agent - Guidance: Read TDD skill (if available) for best practices on writing tests. - Resources: Read README and test examples - Command: How to run tests for this file - Goal: Create comprehensive tests for all identified cases - Constraint: Add new tests, don't modify existing logic (unless clearly broken)

  1. Verify coverage (iteration) (Sonnet or Opus models)

- Launch code-review:test-coverage-reviewer agents again per file - Provide: - Context: Original changes + new tests added - Goal: Verify all critical business logic is covered - Output: Confirmation or list of missing coverage

  1. Iterate if needed
  • If any files still lack coverage: Return to step 5
  • Launch new developer agents only for files with gaps
  • Provide specific instructions on what's still missing
  • Continue until all critical business logic is covered
  1. Final verification
  • Run full test suite to ensure all tests pass
  • Generate coverage report if available
  • Verify no regressions in existing tests

Success Criteria

  • All critical business logic in changed files has test coverage ✅
  • All tests pass (new and existing) ✅
  • Test quality verified by coverage-reviewer agents ✅

Agent Instructions Templates

Coverage Review Agent (Initial Analysis)

Analyze the file {FILE_PATH} for test coverage needs.

Context: This file was modified in local changes:
{GIT_DIFF_OUTPUT}

Your task:
1. Read the changed file and understand the business logic
2. Identify all critical code paths that need testing:
   - New functions/methods added
   - Modified business logic
   - Edge cases and error handling
   - Integration points
3. Review existing tests (if any) to avoid duplication
4. Create a list of test cases needed, prioritized by importance:
   - CRITICAL: Core business logic, data mutations
   - IMPORTANT: Error handling, validations
   - NICE_TO_HAVE: Edge cases, performance

Output format:
- List of test cases with descriptions
- Priority level for each
- Suggested test file location

Developer Agent (Test Creation)

Create tests for file {FILE_PATH} based on coverage analysis.

Coverage review identified these test cases:
{TEST_CASES_LIST}

Your task:
1. Read TDD skill (if available) for best practices on writing tests
2. Read @README.md for project context and testing conventions
3. Read the target file {FILE_PATH} and understand the logic
4. Review existing test files for patterns and style
5. Create comprehensive tests for all identified cases
6. Run the tests: {TEST_COMMAND}
7. Iterate until all tests pass
8. Ensure tests are:
   - Clear and maintainable
   - Follow project conventions
   - Test behavior, not implementation
   - Cover edge cases and error paths

Test command: {TEST_COMMAND}

Coverage Review Agent (Verification)

Verify test coverage for file {FILE_PATH}.

Context: Tests were added to cover local changes in this file.

Your task:
1. Read the changed file {FILE_PATH}
2. Read the new test file(s) created
3. Verify all critical business logic is covered:
   - All new functions have tests
   - All modified logic has tests
   - Edge cases are tested
   - Error handling is tested
4. Identify any gaps in coverage
5. Confirm test quality (clear, maintainable, follows TDD principles)

Output:
- PASS: All critical business logic is covered ✅
- GAPS: List specific missing test cases that need to be added

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

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

平台分布

Codex

36.81%
按下载量换算1,413

Claude

31.42%
按下载量换算1,206

Cursor

17.09%
按下载量换算656

Gemini CLI

8.45%
按下载量换算324

安全审计

暂无安全审计结果可展示。

权限和风险

只读

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

安装前确认

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

来源信息

继续浏览同类 Skills