write-tests

Automate creation and updating of pytest unit tests for changed code.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/JetBrains/databao-cli --skill write-tests-jetbrains
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-tests
Source: https://github.com/JetBrains/databao-cli/tree/main/.claude/skills/write-tests
Command: npx skills add https://github.com/JetBrains/databao-cli --skill write-tests-jetbrains

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation and updating of unit tests for changed code, ensuring consistency with project conventions and maintaining 80% coverage.

Core Features & Use Cases

  • Identify changed modules and determine the tests to update or create
  • Mirror source modules under tests/ with properly named test files, following pytest conventions and project layout
  • Validate coverage targets and provide guidance for deterministic tests, including mocking external I/O

Quick Start

Run the write-tests workflow to generate or update tests for modified modules and verify coverage targets are met.

Frequently Asked Questions about write-tests

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

FAQPage Schema
How do I automate unit test generation for changed code to maintain coverage?

Automate unit test generation by identifying changed source modules and mirroring them under tests/ with properly named pytest files, ensuring 80% coverage. The workflow creates or updates tests automatically to match project conventions and maintain target thresholds.

What's the best way to structure pytest files when automating tests for existing source modules?

Structure pytest files by mirroring source modules from src/ under tests/ with properly named test files following project layout conventions. The automation enforces one-behavior-per-test discipline and applies naming conventions to support reliable, reproducible results.

How do you mock external I/O in pytest to ensure deterministic unit tests?

Mock external I/O in pytest by isolating CLI command handlers and source modules during automated test creation. The workflow mocks external dependencies to enforce deterministic, reproducible results and maintain the one-behavior-per-test discipline.

Can I use this automated testing workflow for CLI command handlers across my project?

Yes, the automated testing workflow applies to CLI command handlers across the project alongside source modules under src and tests under tests. It guides test placement and naming conventions for CLI handlers to ensure consistency with project conventions.

Why does my unit test coverage drop below 80% after modifying source modules?

Unit test coverage drops below 80% when changed code lacks corresponding test updates. The automation identifies modified modules, determines which tests to create or update, and validates coverage targets to ensure the 80% threshold is consistently maintained.

Does pytest automation enforce one-behavior-per-test discipline for reliable results?

Yes, pytest automation enforces one-behavior-per-test discipline to support reliable, reproducible results. Each generated test validates a single behavior, mocking external I/O and following project conventions to maintain 80% coverage across changed modules.