AGENT SKILL

tdd

Use when implementing or fixing production code with tests.

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

01 前言 Front Matter

name
tdd
description
Use when implementing or fixing production code with tests.

03 SKILL.md 正文

TDD

If topology=multi-module (triage announcement or coordinator spec/plan declaration), read ../references/multi-module.md. Run implementation and local acceptance inside the task's registered repository/module. Update that module's spec and plan; update the coordinator only for shared-contract reality or workspace state.

Acceptance mode

Read the current plan task's acceptance: (or equivalent).

Automated acceptance (test, command, or script that must fail before the change and pass after):

  • No production code without a failing check first. Wrote code before the failing check? Delete it. Rewrite from the check.
  • RED (fail for the right reason) → GREEN (minimum to pass) → refactor → sync docs → commit → flip the plan checkbox.

Manual acceptance (explicit steps + expected result in the plan — config, docs, infra, prompts, content, or other non-testable deliverables):

  • Do not invent an automated test solely to satisfy RED-GREEN.
  • Perform the manual check; keep the change minimal; run any declared mechanical checks; sync docs; commit when appropriate; flip the plan checkbox.

No acceptance at all (prototypes, generated code, throwaway scripts only): ask the user before writing production code.

After green / manual pass

edit docs/staging/plans/YYYY-MM-DD-<topic>.md and change this task's - [ ] to - [x]. Do not start the next task without this edit.

Sync docs means:

  • If staging spec exists (docs/staging/specs/*.md): update it to match code reality.
  • If no staging spec (small task): update living docs (README, tech-spec, comments) directly.

When local module tasks are complete and green, run the coordinator's cross-module acceptance against the current workspace contents before handing off to ship.

For a linked multi-repository change, defer commits until integration passes, then follow the commit protocol in ../references/multi-module.md. This is the exception to the per-cycle commit order above. If any commit fails, stop at partial-commit; never rewrite or discard completed commits automatically.

Refactor

Passing tests are not a quality bar.

<gate> Before committing: (1) run lint/format/typecheck — green if declared; (2) evaluate against convention; (3) assess design — coupling, cohesion, abstraction, idiomatic for the stack. State what you ran, assessed, and changed — or why not. See ../references/quality.md. </gate>

Don't

  • Test passes without the impl (tests nothing).
  • Mock the unit under test (tests the mock).
  • Assert many behaviors in one test (split).
  • Skip "watch it fail" when acceptance is automated (you don't know what it tests).
  • Edit the test to match buggy code (tests the bug).
  • Add abstractions not required by the current acceptance (GREEN phase — not refactor).
  • Edit files outside the failing check's scope.
  • Create ad-hoc summary, notes, or analysis files not defined in the plan or required by a loaded skill.

04 同仓库更多 Skills

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

worktable-review-with-annotations

Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.

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

worktable-find-and-synthesize-context

Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.

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

worktable-create-or-update-docs

Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.

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

worktable-create-or-manage-records

Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.

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

worktable-create-or-manage-interactive-html

Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.

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

worktable-collaborate-threads

Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.

★ 1.6k