add-tests

Analyze code changes, identify test coverage gaps, and write approved tests for Rust, Swift, and Python.

Updated Jun 4, 2026
One-click install
npx skills add https://github.com/PeteRichardson/skills --skill add-tests-peterichardson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-tests
Source: https://github.com/PeteRichardson/skills/tree/main/add-tests
Command: npx skills add https://github.com/PeteRichardson/skills --skill add-tests-peterichardson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After writing new code, developers often struggle to determine which tests are actually needed, risking either missing critical coverage or writing redundant tests. This Skill analyzes your current changes, finds gaps in existing test coverage, and proposes a focused test plan for your approval before writing anything. ## Core Features & Use Cases - Change Analysis: Reads staged or unstaged git diffs to understand exactly what behavior was added or modified. - Coverage Gap Detection: Compares changed code against existing tests to identify untested behaviors, edge cases, and regression risks. - Approval-Gated Test Writing: Proposes a structured, named test plan grouped by file and priority (Core, Edge case, Regression), then writes tests only after explicit approval. - Use Case: You just finished implementing a new validation function in Rust. Run this Skill to get a proposal of five targeted tests, approve the three core ones, and have them added to your existing #[cfg(test)] module in the project's established style. ## Quick Start Ask the assistant to analyze my current changes and propose what tests I need before writing any code.

Frequently Asked Questions about add-tests

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

FAQPage Schema
How do I know what tests to write for new code?

Analyze the git diff of your changes to identify new behaviors, modified code paths, and error cases, then compare against existing tests. This Skill automates that analysis and proposes a named test plan grouped by file and priority for your approval.

How to add tests without duplicating existing coverage?

First read existing test files to understand what is already covered, then propose only tests for uncovered behaviors. This Skill skips private helpers exercised through public APIs, trivial getters, and tests that duplicate current coverage.

Does this test planning approach work with Rust, Swift, and Python?

Yes, it supports Rust tests in #[cfg(test)] modules or tests/ directories, Swift tests via XCTest or Swift Testing, and Python tests via pytest. It detects the language from Cargo.toml, Package.swift, or pyproject.toml and matches each project's existing test style.

Will the AI write tests automatically without my approval?

No, tests are written only after explicit approval. You can approve all proposed tests, approve core tests only, select specific tests by name, or request edits before anything is written.

What kinds of tests should not be proposed for a code change?

Avoid tests that duplicate existing coverage, test implementation details that break on refactoring, exhaustively permute inputs without reason, or test the language and framework itself. Focus on meaningful behavior within the scope of the current diff.