/dev-workflow:test-driven-developmentfrom dev-workflow
Use when implementing any feature or bugfix, before writing implementation code
Ships in dev-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write the test first. Watch it fail. Write the minimal code to pass.
Core principle: if you didn't watch the test fail, you don't know it tests the right thing.
Test-first and test-after are not the same activity. A test written after the code is biased by the code you already wrote: it verifies the cases you remembered rather than the ones you would have discovered, and it passes on its first run — which proves nothing about whether it can catch the bug. Watching it fail first is the only evidence that the test has teeth.
Always: new features, bug fixes, refactoring, behavior changes.
Ask your human partner before skipping it for throwaway prototypes, generated code, or configuration files.
Wrote code before the test? Delete it and implement fresh from the test. Keeping it as "reference" and adapting it while writing the test is testing-after with extra steps.
One behavior, a name that describes that behavior, real code rather than mocks.
```typescript test('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; };const result = await retryOperation(operation);
expect(result).toBe('success'); expect(attempts).toBe(3); });
Clear name, tests real behavior, one thing
</Good>
<Bad>
```typescript
test('retry works', async () => {
const mock = jest.fn()
.mockRejectedValueOnce(new Error())
.mockRejectedValueOnce(new Error())
.mockResolvedValueOnce('success');
await retryOperation(mock);
expect(mock).toHaveBeenCalledTimes(3);
});
Vague name, asserts on the mock instead of the code
Run the test. Confirm it fails rather than errors, that the failure message is the one you expect, and that it fails because the feature is missing rather than because of a typo.
Passes already? You are testing existing behavior — fix the test. Errors instead of failing? Fix the error and re-run until it fails correctly.
Write the simplest code that passes the test.
```typescript async function retryOperation(fn: () => Promise): Promise { for (let i = 0; i < 3; i++) { try { return await fn(); } catch (e) { if (i === 2) throw e; } } throw new Error('unreachable'); } ```Don't add options the test doesn't demand, refactor neighbouring code, or "improve" beyond what makes it pass.
Run the test. Confirm it passes, that other tests still pass, and that the output is pristine — no stray errors or warnings. If it fails, fix the code, not the test.
Only once green: remove duplication, improve names, extract helpers. Keep the tests green and don't add behavior. Then write the next failing test.
| Quality | Good | Bad |
|---|---|---|
| Minimal | One thing. "and" in the name? Split it. | test('validates email and domain and whitespace') |
| Clear | Name describes the behavior | test('test1') |
| Shows intent | Demonstrates the desired API | Obscures what the code should do |
When writing or changing any test, read writing-good-tests.md for the rules that keep tests honest:
| Problem | Solution |
|---|---|
| Don't know how to test | Write the wished-for API. Write the assertion first. Ask your human partner. |
| Test too complicated | The design is too complicated. Simplify the interface. |
| Must mock everything | The code is too coupled. Use dependency injection. |
| Test setup huge | Extract helpers. Still complex? Simplify the design. |
Found a bug? Write a failing test that reproduces it, then follow the cycle. The test proves the fix and prevents the regression.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub usadamasa/agents-marketplace --plugin dev-workflowOther plugins' skills for the same job
8 skills in this plugin
/dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies/finishing-a-development-branch実装が終わってテストが通り、作業ブランチを PR にするとき、PR のマージを指示されたときに使う。/receiving-code-reviewUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation