Generate unit tests, integration tests, and test fixtures for code. Supports Jest, Mocha, pytest. Use when writing tests or improving test coverage. This skill provides automated test generation: - Unit tests with AAA pattern (Arrange, Act, Assert) - Integration tests for APIs and databases - Test fixtures and mocks - Edge case identification - Test coverage recommendations Triggers: "generate tests", "create unit test", "add test coverage", "write tests", "テスト生成", "テストコード作成", "カバレッジ向上"
View on GitHubtakemi-ohama/ai-agent-marketplace
ndf
January 18, 2026
Select agents to install to:
npx add-skill https://github.com/takemi-ohama/ai-agent-marketplace/blob/main/plugins/ndf/skills/corder-test-generation/SKILL.md -a claude-code --skill corder-test-generationInstallation paths:
.claude/skills/corder-test-generation/# Corder Test Generation Skill
## 概要
このSkillは、corderエージェントが既存のコードに対してテストを自動生成する際に使用します。Jest、Mocha、pytestなどの主要なテストフレームワークに対応し、ユニットテスト、統合テスト、テストフィクスチャを生成します。
## 主な機能
1. **ユニットテスト生成**: AAA(Arrange-Act-Assert)パターンに従った構造化されたテスト
2. **統合テスト生成**: API、データベース、外部サービスの統合テスト
3. **テストフィクスチャ生成**: モックデータ、スタブ、スパイ
4. **エッジケース識別**: 境界値、null/undefined、エラーケース
5. **カバレッジ推奨**: テストすべき重要な関数/メソッドの特定
## 使用方法
### テンプレート一覧
```
templates/
├── jest-unit-test.test.js # Jest ユニットテスト
├── mocha-test.test.js # Mocha テスト
├── pytest-test.py # pytest
├── test-fixtures.json # テストデータ
└── integration-test.test.js # 統合テスト
```
### 使用例
**1. 既存関数のユニットテスト生成**
```javascript
// 元のコード: src/utils/calculator.js
function add(a, b) {
return a + b;
}
function divide(a, b) {
if (b === 0) {
throw new Error('Division by zero');
}
return a / b;
}
module.exports = { add, divide };
```
**生成されるテスト**:
```javascript
// tests/utils/calculator.test.js
const { add, divide } = require('../../src/utils/calculator');
describe('calculator', () => {
describe('add', () => {
test('should add two positive numbers', () => {
// Arrange
const a = 2;
const b = 3;
const expected = 5;
// Act
const result = add(a, b);
// Assert
expect(result).toBe(expected);
});
test('should handle negative numbers', () => {
expect(add(-2, -3)).toBe(-5);
});
test('should handle zero', () => {
expect(add(0, 5)).toBe(5);
expect(add(5, 0)).toBe(5);
});
});
describe('divide', () => {
test('should divide two numbers', () => {
expect(divide(10, 2)).toBe(5);
});
test('should throw error when dividing by zero', () => {
expect(() => divide(10, 0)).toThrow('Division by zero');
});
test('should handle negative numbers', () => {
expect(divide(-10, 2)).toBe(-5);
});
});
});
```
**2. API統合テスト生成**
```javascript
// tests/api/users.integration.test.js
const request