AGENT SKILL

tdd

Test-first cycle and red-step evidence rule for skills that implement behavior a test can assert. Binds when the verification skill resolves a test command; defines what the red run must quote and when the cycle is skipped with a reason.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 1.6k
Forks
490

01 前言 Front Matter

name
tdd
description
Test-first cycle and red-step evidence rule for skills that implement behavior a test can assert. Binds when the verification skill resolves a test command; defines what the red run must quote and when the cycle is skipped with a reason.
user-invocable
false

02 资源文件 1

03 SKILL.md 正文

TDD

Reference skill read by /plan Step 5, /work Phase 3 and skills/work/orchestrator.md, and /hypothesis-debugging Step 7; /ship names it where it hands the build to /work. It is never invoked and runs nothing itself: the consumer resolves the test command per skills/verification/SKILL.md, follows the cycle here, and quotes the evidence.

Applicability

The cycle binds to a change when both hold:

  • The consumer resolved the test command per skills/verification/SKILL.md and the value is not none.
  • The change produces behavior a test can assert. Documentation, a config value, a rename with no behavior change, and a migration with no code path do not.

When either fails, the outcome is skipped: <reason>, and the reason names which one: test command none (<verification's reason>) or no testable behavior (<what the change is>). A skipped cycle is a recorded fact, not an error, and it never blocks the consumer.

The user's own project instructions win. A project whose CLAUDE.md says not to use TDD settles it.

The Cycle

  • Red. Write the test that names the behavior, in the project's existing test layout and framework. Run the resolved test command exactly as written. Record the red line: this run's exit code, the name of the test just written, and its first error line. When the runner fails before naming a test -- a compile or import error in the new test file -- the file path stands in for the name. A failure in a test that was not written in this step is a pre-existing failure, not red evidence.
  • Green. Write the least implementation that makes that test pass. Run the resolved test command again. The pass line is the existing verification evidence: this run's exit code plus the runner's summary line.
  • Refactor. Optional. Any further edit is followed by another run, and the most recent pass line is the one reported. The refactor step produces no evidence of its own.

The red run is not an attempt. A consumer with a fix-attempt budget counts only runs made after the implementation exists; the red run precedes the implementation, is expected to fail, and spends nothing.

Evidence

red:     <command> -> exit <code>: <failing test> -- <first error line>
skipped: <reason>

Green has no line of its own: it is the pass: line skills/verification/SKILL.md defines, reported where the consumer already reports it. A consumer that receives neither a red: nor a skipped: line records skipped: no red evidence. The three skipped reasons are test command none (...), no testable behavior (...), and no red evidence.

For Skill Authors

  • Read this file at the build step, after the verification command is resolved and before the first implementation starts.
  • Order the work test-first in the consumer's own instruction list: the test step and its run precede the implementation step and its run.
  • Add a TDD | line to any subagent return contract that already carries a TESTS | line, with the two forms above, and treat a missing line as skipped: no red evidence.
  • Paste the ### Subagent restatement below into the subagent prompt verbatim. It is the only text from this file that is copied anywhere, and tests/skills/test-tdd-contract.sh compares the copies to it.

Subagent restatement

Write the test for the behavior before the implementation and run the test command you were given exactly as written, then report the red step by quoting that run's exit code, the new test's name, and its first error line -- a test that was never seen failing, or a red line naming a test you did not write in this task, is not red evidence; when no test can be written, report skipped with the reason.

04 同仓库更多 Skills

hashgraph-online
hashgraph-online/awesome-codex-plugins

migrate-to-e2e

Moves an existing Playwright, Cypress, Selenium, Appium, Detox, Maestro, or TesterArmy suite to e2e one slice at a time, with the old suite running beside the new one until each ported test is proven. Keeps a MIGRATION.md progress file so any later session resumes where the last stopped. Optionally plants a defect to show both suites catch it. Use for /migrate-to-e2e, "migrate our tests to e2e", "port these Maestro flows", "move our TesterArmy tests", or when a project has an e2e config and an older suite still running.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

e2e

Writes, runs, and debugs end-to-end tests for web and mobile apps with e2e, the agentic test runner, which mixes agent.act goals with exact locator assertions on a Playwright browser or an iOS or Android device. Also drives a project's running app live over the e2e MCP server to look at a screen, check a UI change, take a screenshot or record a video, and try a locator; and runs bug bashes, parallel e2e explore runs with each bug proven by a repro test. Use when a project depends on e2e or has an e2e.config.ts, when asked for end-to-end, browser, mobile, or agentic UI tests, to check a change in the running app, to QA or bug bash an app or branch, or when an e2e run fails.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

create-verification-skill

Generate a project-local verify-<app> skill on top of e2e, so any coding agent can launch the app, check it is worth driving, exercise a feature the way a user does, keep evidence, and bug bash it. Writes the skill, a feature map with one explore charter per feature, and proves it once. Use for /create-verification-skill, "make a verification skill for this repo", or when a project has no scripted way to prove UI behavior.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

deja-search

deja-vu memory — search the user's past AI coding sessions with the deja CLI. Holds what they already settled and never wrote into the repo (naming rules, banned or already-tried tools, required checks before merge, preferred values, who owns what). Use before your first edit in a task, before you call a change done or ready to merge, before you recommend a tool, library, design or reviewer, before re-debugging an error that may already be solved, when they say 'didn't we fix this before', 'what did we decide about X' or 'I already have that', and before telling them something on this machine does not exist.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

deja-reflect

End-of-session reflection and memory curation with deja-vu. Review what was decided, what commands broke and what repaired them, and record durable project rules or decisions with deja remember so the next session starts with them.

★ 1.6k
hashgraph-online
hashgraph-online/awesome-codex-plugins

revid

Make, edit, export and post AI videos with Revid (revid.ai) through the Revid MCP server. Use whenever the user wants a short-form or long-form video made (from an idea, a script, a URL, an article, a PDF, a tweet, a product page, their own clips, or a song), wants to find what is going viral on TikTok, YouTube, Instagram or X before making something, wants to edit or re-export an existing Revid project, generate a standalone AI image or clip, make a series episode, or publish and schedule a finished video to connected social accounts. Covers setup (hosted MCP with OAuth, or an API key), the 36 tools, credits, polling and the rules for publishing. Routes to the more specific revid-* skills when one fits.

图像与多媒体Skill与智能体开发
★ 1.6k