スキル一覧に戻る
ljchg12-hue

test-writer

by ljchg12-hue

Windows Claude Code dotfiles and configurations

0🍴 0📅 2025年12月30日
GitHubで見るManusで実行

SKILL.md


name: test-writer description: Expert test writing including unit, integration, e2e tests, mocking, and coverage strategies version: 1.0.0 author: USER tags: [testing, unit-test, integration, e2e, jest, pytest, coverage]

Test Writer

Purpose

Write comprehensive tests including unit, integration, and e2e tests with proper mocking, fixtures, and coverage targets.

Activation Keywords

  • test, testing, unit test
  • integration test, e2e, end-to-end
  • mock, stub, fixture
  • coverage, assertion
  • jest, pytest, vitest, playwright

Core Capabilities

1. Test Types

  • Unit tests (isolated logic)
  • Integration tests (component interaction)
  • E2E tests (user flows)
  • Snapshot tests
  • Property-based tests

2. Testing Frameworks

  • Jest / Vitest (JavaScript)
  • pytest (Python)
  • Go testing
  • Rust testing

3. Mocking Strategies

  • Mock functions
  • Module mocking
  • API mocking (MSW)
  • Database mocking

4. Test Patterns

  • Arrange-Act-Assert (AAA)
  • Given-When-Then
  • Test fixtures
  • Factory patterns

5. Coverage

  • Line coverage
  • Branch coverage
  • Function coverage
  • Critical path coverage

Test Writing Guidelines

// Good test structure
describe('UserService', () => {
  describe('createUser', () => {
    it('should create user with valid data', async () => {
      // Arrange
      const userData = { name: 'Test', email: 'test@example.com' };

      // Act
      const result = await userService.createUser(userData);

      // Assert
      expect(result).toMatchObject({
        id: expect.any(String),
        name: 'Test',
        email: 'test@example.com',
      });
    });

    it('should throw on duplicate email', async () => {
      // Arrange
      const existingEmail = 'existing@example.com';

      // Act & Assert
      await expect(
        userService.createUser({ name: 'Test', email: existingEmail })
      ).rejects.toThrow('Email already exists');
    });
  });
});

Instructions

When activated:

  1. Analyze Code

    • Identify testable units
    • Find edge cases
    • Note dependencies to mock
  2. Plan Tests

    • List test cases
    • Identify fixtures needed
    • Plan mock strategy
  3. Write Tests

    • Follow AAA pattern
    • One assertion per test (ideally)
    • Clear test names
    • Cover edge cases
  4. Verify

    • Run all tests
    • Check coverage
    • Review assertions

Coverage Targets

TypeTarget
Unit80%+
Integration70%+
Critical paths100%

Example Usage

User: "Write tests for the payment service"

Test Writer Response:
1. Analyze payment service functions
2. Identify edge cases (invalid cards, timeouts)
3. Create mock for payment gateway
4. Write unit tests for each function
5. Write integration test for full flow
6. Verify coverage meets targets

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です