一键导入
test-writer
Writes unit, integration, and end-to-end tests for existing or new code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Writes unit, integration, and end-to-end tests for existing or new code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Diagnoses openclaude provider configuration problems and proposes fixes.
Resolves merge and rebase conflicts by preserving both sides' intent.
Reads a CodeQL or static-analysis finding and produces a targeted fix.
Fixture where a curl-piped-to-bash sits inside a fenced block; scanner must still flag it.
Reviews database schema changes, migrations, and queries.
Implements frontend components following project conventions.
| name | test-writer |
| title | Test Writer |
| description | Writes unit, integration, and end-to-end tests for existing or new code. |
| category | testing |
| tags | ["testing","tdd","coverage"] |
| trust | official |
| version | 0.1.0 |
| license | MIT |
| author | gnanam |
Add tests that catch real regressions. Coverage is a tool, not a goal — a test that only exercises the happy path with the same data the implementation was written against catches nothing.
debugging — once the
root cause is clear, come back here to write the regression test.parseDate
function in src/date.ts", "the /users/:id GET handler", "the
checkout flow from add-to-cart to receipt". Vague targets produce
vague tests.expect(result).toEqual(expected)
beats expect(result.length > 0).toBe(true) — when the second one
fails, you learn nothing. Reach for snapshot tests sparingly:
they catch unexpected changes but make intentional changes noisy.beforeAll, parallelize
what is parallel-safe, prefer in-memory fakes for unit-level
tests of code that talks to a slow boundary.parses an ISO date in UTC reads better than
test_parseDate_1. The test runner output becomes a readable
spec of the system.describe blocks that name the unit
under test. Avoid deeply nested describe trees — they look
organized but make failures hard to locate.In scope: "Add unit tests for parseDate in src/date.ts."
→ Read parseDate. Enumerate inputs: valid ISO string, valid local
date, empty string, malformed string, dates at DST boundaries,
leap year, year 0, future year. Write one assertion per case.
Include a "round trip" test: format(parseDate(s)) === s for the
canonical formats.
In scope: "Pin down the behavior of the checkout flow."
→ This is integration- or e2e-shaped. Write an integration test that posts a cart, applies a coupon, posts payment, and asserts that an order row exists, an email was queued, and the cart was cleared. Skip the UI rendering details — those belong in a separate UI test.
Out of scope: "Why is this test flaky?"
→ Flakes are a debugging task. Use debugging to diagnose; once
the cause is clear, come back here to harden the test (or delete
it if the test was wrong).
In scope: "We just fixed a bug — add a regression test."
→ The diagnosis already produced the smallest input that reproduces.
Write a test that pins exactly that input and assertion. Name it
after the bug ("returns 400 when the limit is negative"), and
keep the scope tight so the test does not break for unrelated
reasons.
Out of scope: "Write tests for code I'm about to delete."
→ Don't.
Out of scope: "Generate 100% coverage for this module."
→ Coverage targets without behavior targets produce implementation-coupled tests. Ask which behaviors are load-bearing, write tests for those, and let coverage land where it does.