Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

tdd时差

Agent Skill

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

总安装

890

周安装

36

GitHub Stars

公开资料未说明

下载量

279
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/help-me-test/skills --skill tdd

简介

tdd 用于辅助测试驱动开发流程,支持自动化测试用例整理和回归验证。

  • 适用于需要编写端到端测试或根据失败日志快速定位问题的开发工作。
  • 使用时需确认项目测试框架和运行命令,确保测试逻辑与真实业务一致。
  • 涉及外部服务时应区分本地模拟与生产环境,避免因环境差异导致误判。
  • tdd 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Who you are: If .helpmetest/SOUL.md exists, read it — it defines your character.
No MCP? Use helpmetest <command> instead of MCP tools.

### 🔴 YOU WRITE THE TEST FIRST. Changed code → run the tests. New feature → write the test before the code. The test is the spec. The test is done when it's green. No test = not done.

Narrate Your Actions

Never create a test, artifact, or run a test silently. Always tell the user:

  • Before: what you are about to do and why (what scenario it covers, what risk it guards against)
  • After: what happened — result, what the artifact contains, why a test failed
  • Next: what you will do next and what decision point is coming

Silence means the user has no idea what you did or why.

Tests — Write, Generate, Fix

Orient First (Always)

Before doing anything, check what already exists:

helpmetest_status()
helpmetest_search_artifacts({ query: "" })
helpmetest_search_artifacts({ type: "Tasks" })
  • Tests already failing? → that's the priority, not creating new ones
  • Tasks artifact in progress? → resume it, don't start over
  • Feature artifacts exist? → use them, don't re-discover

Use Cases

"I need to build something" (TDD)

New feature, bug fix, or refactor. Tests come first — they define what "done" means.

1. Create a Tasks artifact to track the work:

{
  "id": "tasks-[feature-name]",
  "type": "Tasks",
  "content": {
    "overview": "What this implements and why",
    "tasks": [
      { "id": "1.0", "title": "Write all tests first", "status": "pending", "priority": "critical" },
      { "id": "2.0", "title": "Implement to make tests pass", "status": "pending" },
      { "id": "3.0", "title": "All green — review for gaps", "status": "pending" }
    ]
  }
}

2. Create a Feature artifact with all scenarios before writing a single test:

{
  "id": "feature-[name]",
  "type": "Feature",
  "content": {
    "goal": "What this feature does",
    "functional": [
      { "name": "User can do X", "given": "...", "when": "...", "then": "...", "tags": ["priority:critical"], "test_ids": [] }
    ],
    "edge_cases": [],
    "bugs": []
  }
}

3. Plan coverage before writing a single test. For every feature, enumerate scenarios across four types:

TypeAlways?Question to ask
Critical path✅ alwaysWhat does a real user do when everything works?
Error paths✅ alwaysWhat are the 3 most likely ways this breaks in prod?
Boundary conditionsif data/logicWhere does behavior change based on a threshold?
Edge casesselectivelyWhat would a QA engineer test that a dev wouldn't?

Mark each scenario: write immediately (critical/high) / write before launch (medium) / skip (cosmetic, already covered, unreliable). Don't test everything — test what would hurt if it broke.

4. Write ALL tests — happy paths, edge cases, errors — before implementing anything. Failing tests are your spec.

5. Implement incrementally — pick the highest-priority failing test, make it pass, move to the next.

6. Done when all tests are green and you've reviewed for missing edge cases.


"Write tests for an existing feature"

Feature exists (or was just built by someone else). Your job is tests only.

1. Read the Feature artifacthelpmetest_get_artifact({id: "feature-X"}). If none exists, create one first based on what you know.

2. Explore interactively before writing — run the scenario step by step using helpmetest_run_interactive_command. A test written after seeing real behavior uses real selectors and reflects actual timing. A test written from a description is a guess.

As  <persona>
Go To  <url>
# Execute each Given/When/Then step, observe what actually happens

3. Before writing each test, answer this out loud:

"If this test passes but the feature is actually broken, what user complaint would we miss until a customer reports it?"

Write that answer as the PROTECTS: line in [Documentation]. This is the contract the test makes with the user — not optional boilerplate. If you can't answer it in one sentence, the scenario needs more thought, not a test.

4. Write tests for priority:critical scenarios first, then high, then medium. For each:

  • 5+ meaningful steps
  • Verify business outcomes (data saved, state changed) — not just that an element is visible
  • Use Create Fake Email for any registration/email fields — never hardcode
  • [Documentation] must start with PROTECTS: <what user complaint this catches>

5. Validate each test with fix-tests before linking it to the scenario. A test that passes when the feature is broken must be rewritten — it is not done until the validator says PASS.

6. Link tests back — add each test ID to scenario.test_ids in the Feature artifact only after it passes validation.

7. Run and fix — see "Fix broken tests" below if a newly-written test fails.


"Fix broken tests" / "Tests are failing"

First: understand the failure pattern

Check recent code changes:

git diff --stat HEAD
git log --oneline -5

Map changed files to likely causes:

  • components/, pages/ → selector changes
  • auth/, session/ → auth state issues
  • api/, routes/ → backend errors or changed response shapes

Then get test history: helpmetest_status({id: "test-id", testRunLimit: 10})

Classify:

  • Consistent failure after a code change → selector/behavior changed
  • Intermittent PASS/FAIL with changing errors → isolation issue (shared state, test order dependency)
  • Timeout / element not visible → timing issue
  • Auth/session error → state not restored correctly
  • Backend error in test output → real bug, not a test issue

Reproduce interactively — always do this before fixing

Run the failing steps one at a time:

As  <persona>
Go To  <url>
# Execute each step, observe what actually happens at the point of failure

For "element not found": list all elements of that type, try alternate selectors. For "wrong value": check what's actually displayed vs what the test expected. For timeouts: try longer waits, check whether the element ever appears.

Decide: test issue or app bug?

  • Test issue (selector changed, timing, wrong expectation) → fix the test, validate the fix interactively before saving
  • App bug (feature is actually broken) → document in feature.bugs[], update Feature.status to "broken" or "partial"

Many tests broke after a UI change?

Work through them systematically one by one. For each:

  1. Classify the failure (usually selector or timing)
  2. Reproduce interactively
  3. Fix
  4. Run to confirm

Don't shotgun-fix by guessing — one wrong fix creates two broken tests.

Tests are out of date after a refactor?

  1. Get test list: helpmetest_status()
  2. For each failing test, check whether the Feature artifact scenario still matches intended behavior
  3. If the code is the source of truth → update the test
  4. If the test was right and the refactor broke behavior → document the regression

Writing Tests

Structure

As  <persona>          # auth state — always first
Go To  <url>

# Given — establish precondition
<steps>

# When — perform the action
<steps>

# Then — verify the outcome
<assertions>

# Persistence check (if relevant)
Reload
<re-assert that state survived>

Documentation format

Every test must have [Documentation] with four explicit lines:

[Documentation]
...    Given: <precondition — what state the system is in before the action>
...    When: <action — what the user/system does>
...    Then: <outcome — what is asserted, specifically>
...    Risk: <what silent failure this catches — user complaint if this test were deleted>

Full example:

[Documentation]
...    Given: registered user with valid account
...    When: submits login form with wrong password
...    Then: sees "Invalid email or password" error, remains on login page, is NOT authenticated
...    Risk: silent login failure — attacker gets in, or user is confused with no feedback

Given/When/Then — what makes them good:

  • Given: registered user with valid account — specific precondition
  • When: submits login form with wrong password — exact action
  • Then: sees "Invalid email or password" error, remains on login page, is NOT authenticated — concrete, multiple assertions named
  • Given: user is logged in | When: they do something | Then: it works — vague, tells you nothing when the test fails

Language rules — the description must be readable by a product manager:

  • ✅ Write in terms of user actions and visible outcomes
  • ❌ NEVER put CSS selectors, XPath, or DOM class names (.keyword-line.current, #submit-btn, div[data-id])
  • ❌ NEVER put JavaScript internals, variable names, or debug APIs (replayDebug.currentKeyword, window.__state)
  • ❌ NEVER put Robot Framework syntax, keyword names, or technical implementation details
  • The test body is where selectors live. The description is where the product manager lives.

Wrong:

Given: replay loaded with .banner-keywords visible
When: user clicks .banner-next and replayDebug.currentKeyword changes
Then: .keyword-line.current text matches window.replayDebug.currentKeyword.split(/ {2,}/)[0]

Right:

Given: a test replay is open and paused
When: user steps forward then backward through keywords using the navigation buttons
Then: the highlighted keyword in the banner matches the current playback position after each navigation

Risk — good examples:

  • Risk: users completing checkout get charged without receiving an order confirmation
  • Risk: users typing wrong passwords are silently logged in or shown a blank screen
  • Risk: profile email changes silently fail — user sees stale email with no indication
  • Risk: the login form breaks — too vague, what breaks? who notices?
  • Risk: the form doesn't submit — that's what the test does, not what it protects against

Inline comments

Every non-obvious step must have a # comment above it written for a product manager, not an engineer.

Comments explain *why* a step exists, what the user is experiencing, or what the test is checking — not what the keyword does.

# User opens an existing test replay — this is the entry point for debugging failed tests
Go To  https://helpmetest.example.com/test/some-test

# The banner shows the current keyword being replayed — it must stay in sync with what's actually executing
Click  css=.banner-next

# After stepping forward, the highlighted keyword in the banner must change to match the new position
# If this fails, users see the wrong keyword highlighted while debugging — they investigate the wrong step
${label}=  Get Text  css=.keyword-line.current .keyword-text
Should Contain  ${label}  ${expected_keyword}

Comments are mandatory for:

  • Any Javascript call — explain what user-visible state it reads or changes
  • Any Hover or Sleep — explain why the UI requires this (hover to reveal hidden elements, sleep for animation)
  • Any multi-step assertion group — explain what the group collectively verifies
  • Any setup step that isn't obvious navigation

What makes a good test

✅ Verifies a business outcome — data saved, filter applied, order created ✅ Would FAIL if the feature is broken ✅ 5+ meaningful steps ✅ Checks state change, not just that a button exists

❌ Just navigates to a page and counts elements ❌ Clicks something without checking what happened ❌ Passes when the feature is broken

Test naming

Format: User can <action> or <Feature> <behavior>

  • User can update profile email
  • Cart total updates when quantity changes
  • MyApp Login Test
  • SiteName Checkout

Auth

Use Save As <StateName> once to capture auth state. Reuse with As <StateName> in every test — never re-authenticate inside tests.

Emails

Use Create Fake Email — never hardcode test@example.com. Hardcoded emails break on second run.

${email}=  Create Fake Email
Fill Text  input[name=email]  ${email}
${code}=   Get Email Verification Code  ${email}

Localhost

If testing a local server, set up the proxy first:

helpmetest_proxy({ action: "start", domain: "dev.local", sourcePort: 3000 })

Verify it works before writing any tests. See the proxy skill for details.


Tags

  • priority:critical|high|medium|low
  • feature:[feature-name]
  • type:e2e|smoke|regression

Done means

  • ✅ All tests passing
  • ✅ All priority:critical scenarios have test_ids
  • ✅ Every test has Given:, When:, Then:, Risk: lines in [Documentation]
  • ✅ Every test passed /fix-tests before being linked
  • ✅ Bugs documented in feature.bugs[]
  • ✅ Feature.status updated (working / broken / partial)
  • ✅ Tasks artifact all done

Final summary format

Never end with "N tests created, M passing." End with this:

## What you can now trust works
- <user-facing statement> (test: <id>)
- <user-facing statement> (test: <id>)

## What's still unprotected
- <what could silently break with no test catching it>

## Bugs found
- <bug description> — documented in feature.bugs[]

If you can't write the first section in user-facing language, your tests are not done.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.36%
按下载量换算107

Claude

27.91%
按下载量换算78

Cursor

20.41%
按下载量换算57

Gemini CLI

9.93%
按下载量换算28

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills