unit-test-writer

Generate pytest and Jest unit tests with AAA structure and coverage benchmarks.

25|2|Updated Oct 26, 2025
One-click install
npx skills add https://github.com/matteocervelli/llms --skill unit-test-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test-writer
Source: https://github.com/matteocervelli/llms/tree/main/.claude/skills/unit-test-writer
Command: npx skills add https://github.com/matteocervelli/llms --skill unit-test-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers to craft comprehensive unit tests with proper structure, mocking, and coverage guidance.

Core Features & Use Cases

  • AAA test structure guidance (Arrange-Act-Assert)
  • Naming conventions for Python and JavaScript
  • Template test file skeletons and coverage goals
  • Workflow guidance from analysis to test file creation

Quick Start

Create tests for a module following the provided template and run pytest to verify coverage.

Frequently Asked Questions about unit-test-writer

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

FAQPage Schema
How do I generate unit tests with proper coverage for my Python or JavaScript code?

Unit test generation uses AAA structure (Arrange-Act-Assert) to scaffold comprehensive tests with mocking and coverage targets. This Skill produces test files following pytest for Python and Jest for JavaScript, with explicit benchmarks: ≥80% overall coverage, ≥90% for critical logic, 100% for error paths, and ≥85% for utilities.

What's the best way to structure unit tests following TDD principles?

TDD test structure follows AAA organization with proper naming conventions, fixture patterns, and mock setups tailored to Python and JavaScript. This Skill generates template test skeletons that enforce functional requirements and guide workflow from code analysis through test file creation.

Can I use this for improving test coverage on existing modules?

Yes. This Skill targets both new code and existing modules needing coverage improvement. It generates maintainable tests with mocking strategies and coverage guidance, helping you reach and exceed minimum benchmarks across error paths and critical logic sections.

Does this work with both Python and JavaScript projects?

Unit test generation supports multi-language codebases, including Python with pytest and JavaScript/TypeScript with Jest. Each framework receives language-specific naming conventions, fixture patterns, and mocking strategies aligned to its ecosystem.

How do I know what coverage targets to set for different code types?

This Skill provides explicit coverage benchmarks: overall ≥80%, critical logic ≥90%, error paths 100%, and utilities ≥85%. It categorizes code sections by risk and scaffolds tests with these targets built in, automating the decision of where to focus testing effort.