协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
test-writer【开发与工程】Write unit tests for any function — happy path, edge cases, and error cases. Use when the user asks for tests, wants to add test coverage, or is practicing TDD.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Ask the user to share the function or code they want tests for.
Then write tests covering:
[functionName]Testing framework: [detect from package.json — Jest, Vitest, pytest, etc. Ask if unclear]
Test the expected behavior with valid inputs. One test per meaningful variation.
test('returns [expected] when given [input]', () => {
// arrange
// act
// assert
})
Tests for boundary conditions and unusual but valid inputs:
Tests that verify the function fails correctly:
List any external dependencies (API calls, database queries, file system) that need mocking, with example mock setup.
Coverage target: Aim for all branches, not just lines. Flag any branch that is difficult to test and explain why.
Write tests that read like documentation — the test name should be a sentence explaining what the function does in that scenario.