test-writer

Generate framework-compatible unit and integration tests with error paths first.

5|Updated Feb 3, 2024
One-click install
npx skills add https://github.com/ahkohd/dotfiles --skill test-writer-ahkohd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-writer
Source: https://github.com/ahkohd/dotfiles/tree/main/claude/.claude/skills/test-writer
Command: npx skills add https://github.com/ahkohd/dotfiles --skill test-writer-ahkohd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill generates comprehensive tests for code changes, with emphasis on error paths, edge cases, and regression coverage.

Core Features & Use Cases

  • Error-paths first: Generates tests for every error/exception variant to lock API contracts.
  • Happy path & edge cases: Covers standard usage plus boundary conditions, large inputs, and Unicode.
  • Test structure (AAA): Produces tests in the standard Arrange-Act-Assert pattern.
  • Use Case: Adding tests for a new function to prevent regressions in refactors.

Quick Start

Provide the function or module you want to test; the Skill will generate unit/integration tests, aligned to your project's framework, and structure them accordingly.

Frequently Asked Questions about test-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate unit tests that cover error paths and edge cases?

Unit tests covering error paths and edge cases validate boundary conditions and exception handling. This Skill automates generation of comprehensive test cases prioritizing error scenarios first, then happy paths and edge cases, using the Arrange-Act-Assert pattern aligned to your testing framework.

What's the best way to ensure test coverage for bug fixes and refactors?

Regression test coverage prevents bugs from reoccurring during refactors. This Skill analyzes code changes to generate prioritized test cases covering all error paths, dependencies, and side effects, emitting framework-compatible tests that validate functional and technical requirements.

Can I use this for integration and end-to-end tests, or only unit tests?

This Skill applies across unit, integration, and end-to-end testing contexts. It generates comprehensive tests for new features, bug fixes, and refactors by analyzing inputs, outputs, side effects, and dependencies to determine appropriate test types and coverage.

How do I handle edge cases like Unicode and boundary conditions in my tests?

Edge cases including large inputs, boundary conditions, and Unicode require explicit test coverage. This Skill generates test cases addressing these scenarios alongside error paths, ensuring robust validation of your code's handling of both standard and exceptional inputs.

What test structure and naming conventions does this Skill produce?

This Skill emits tests structured in the Arrange-Act-Assert pattern with proper imports, framework-compatible syntax, and descriptive naming. Generated test files include coverage checks and are formatted for immediate use in your project's testing framework.

Do I need to specify which testing framework to use?

Provide your project's testing framework and the function or module to test. This Skill generates tests aligned to your framework's conventions, structure, and syntax, automating test case generation without manual framework configuration.