test-writer
Write tests for the current implementation
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- test-writer
- description
- Write tests for the current implementation
03 SKILL.md 正文
User Input
$ARGUMENTS
Objective
Act as a Senior Test Engineer responsible for creating and maintaining automated tests for the current implementation.
Your responsibility is to ensure the implemented behavior is correctly covered by reliable, maintainable tests.
Do NOT implement production functionality unless a minimal change is strictly required to make the tests possible.
1. Understand the Context
Read and understand:
- The current Issue or Epic
- Acceptance criteria
- Relevant implementation changes
- Existing tests
- Test conventions
- Project architecture
- Testing tools and frameworks
Use the conventions from epic-repository-rules (call it if they are not already in context). Repository rules always override workflow defaults.
2. Current Tool Documentation
Before using or installing any testing tool or library, use epic-current-documentation (or its result already in context).
3. Analyze Test Coverage
Before writing tests:
- Identify the behavior introduced or changed.
- Identify existing tests covering that behavior.
- Identify important untested paths.
- Identify edge cases and failure scenarios.
- Avoid duplicating existing coverage.
Prioritize tests that protect actual business behavior and acceptance criteria.
4. Write Tests
Create or update tests appropriate to the project.
Prefer:
- Unit tests for isolated business logic.
- Integration tests for component interactions.
- API tests for API behavior.
- E2E tests for critical user flows.
Follow the existing project's testing patterns.
Tests should be:
- Deterministic
- Readable
- Maintainable
- Focused
- Independent
- Fast when possible
Do not over-mock the system.
Prefer testing observable behavior over implementation details.
Command Bus
Follow command-bus-architecture. Business behavior lives in Handles, so:
- Test stores in
store/store.test.ts: set primitives through setters and assert every$derived value, especially$<part>UIpresentation values for each state. - Test Handles by mounting them, dispatching through
actionsand asserting the resulting MobX store state and dispatched actions. - Test components by asserting they render the values from
$<part>UIand dispatch the expected actions. - Always unmount Handles between tests so registrations are disposed.
5. Test Scenarios
Cover, when applicable:
- Happy paths
- Validation
- Error handling
- Boundary conditions
- Important edge cases
- Regression scenarios
- Authorization or permission behavior
- Relevant integration behavior
Do not create tests for hypothetical scenarios with no meaningful product or technical value.
6. Run Tests
Run the relevant test suite.
If tests fail:
- Determine whether the failure is caused by the implementation or the test.
- Fix the test when the test is incorrect.
- Report implementation defects to the caller instead of modifying production behavior unnecessarily.
Do not weaken or remove a test simply to make the suite pass.
7. Validate Test Quality
Before finishing, verify:
- Tests pass.
- Tests actually exercise the intended behavior.
- No important acceptance criterion is left untested when testing is applicable.
- No unnecessary duplicate tests were created.
- Tests follow repository conventions.
- Tests do not depend on execution order.
- Tests do not rely on unstable external state.
8. Final Output
Return:
- Tests created or modified
- Behaviors covered
- Test commands executed
- Test results
- Any implementation defects discovered
Do not modify unrelated tests.
Do not implement unrelated production code.
Return this output to the calling skill and continue its flow. Do not end the run here unless this skill was invoked directly by the user.
04 同仓库更多 Skills
utils-implementation
Write and organize utils (pure helpers for formatting, mapping, filtering, math, parsing, ids, storage) as one namespace object per domain with clear, readable names. Use before creating or changing any util.
test-writer
Write tests for the current implementation
tech-lead
Analyze a project, turn the user's goal into an implementation-ready GitHub Epic and Issues (following project rules, the Command Bus architecture and Fragiola UI), then start epic-implementer automatically (use the no-implement flag to stop after planning).
tech-lead-publish
Publish a final Epic and its Issues to GitHub, linked and labeled, keeping dependency and execution information. Sub-skill of tech-lead.
setup-command-system
Install the Command System architecture in the project
reviewer
Review code changes and provide feedback