テストファースト開発ワークフロー(plan → write_tests → implement → review → fix)。 新規インストラクション write-tests-first, implement-after-tests を追加。 piece-categories に Mini カテゴリとテストファーストカテゴリとして登録。
1.7 KiB
1.7 KiB
Write tests based on the plan before implementing production code. Refer only to files within the Report Directory shown in the Piece Context. Do not search or reference other report directories.
Important: Do NOT create or modify production code. Only test files may be created.
Actions:
- Review the plan report and understand the planned behavior and interfaces
- Examine existing code and tests to learn the project's test patterns
- Write unit tests for the planned features
- Write E2E tests if appropriate
- Run the build (type check) to verify test code has no syntax errors
Test writing guidelines:
- Follow the project's existing test patterns (naming conventions, directory structure, helpers)
- Write tests in Given-When-Then structure
- One concept per test. Do not mix multiple concerns in a single test
- Cover happy path, error cases, boundary values, and edge cases
- Write tests that are expected to pass after implementation is complete
Scope output contract (create at the start):
# Change Scope Declaration
## Task
{One-line task summary}
## Planned changes
| Type | File |
|------|------|
| Create | `src/__tests__/example.test.ts` |
## Estimated size
Small / Medium / Large
## Impact area
- {Affected modules or features}
Decisions output contract (at completion, only if decisions were made):
# Decision Log
## 1. {Decision}
- **Context**: {Why the decision was needed}
- **Options considered**: {List of options}
- **Rationale**: {Reason for the choice}
Required output (include headings)
Work results
- {Summary of actions taken}
Changes made
- {List of test files created}
Build results
- {Build execution results}