test-writing
@karmaloopai · 收录于 1 周前
Write comprehensive tests for code including unit tests, integration tests, and end-to-end tests. Use this to ensure code quality, catch bugs, and validate functionality.
适合你,如果你需要为代码编写测试来保证质量和捕获缺陷
/ 下载安装
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code
~/.claude/skills/(项目级 .claude/skills/)Codex CLI
~/.codex/skills/Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add karmaloopai/jiva/test-writing/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- karmaloopai/jiva/test-writing/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify karmaloopai/jiva/test-writing安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
35GitHub stars
~299上下文体积 · 单文件
镜像托管
怎么用
技能原文 SKILL.md
Test Writing Skill
Overview
Create thorough test coverage for software components.
Workflow
- Analyze Code: Understand what needs testing
- Identify Test Cases:
- Happy path scenarios
- Edge cases
- Error conditions
- Boundary values
- Write Tests: Create test files following project conventions
- Verify: Run tests to ensure they pass
- Document: Add test descriptions
Test Types
Unit Tests
- Test individual functions/methods
- Mock dependencies
- Fast execution
- High coverage
Integration Tests
- Test component interactions
- Real dependencies when possible
- Test data flow
- API contracts
End-to-End Tests
- Test complete user workflows
- Real environment
- Critical paths
- User scenarios
Test Quality Standards
- Clear test names describing what is tested
- Arrange-Act-Assert pattern
- One assertion per test (generally)
- Independent tests (no shared state)
- Fast and reliable
Tools
view: To read code being testedcreate_file: To create new test filesrun_terminal_command: To execute test suitesgrep_search: To find existing tests
Best Practices
- Test behavior, not implementation
- Cover edge cases thoroughly
- Keep tests maintainable
- Use descriptive test names
- Don't test framework code
- Mock external dependencies
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…