Skip to content

Skill

Generating Unit Tests

Writes focused unit tests that follow the project's existing test conventions, runs them when possible, and reports the actual result.

Back to Skills

When to use

Generates focused unit tests for specified code in a repository, ZIP, or code sample, following the project's existing test framework, runner, file layout, fixtures, and conventions, then runs the narrowest relevant test command when possible and reports the actual result.

  • Use when

    Use when new unit tests are needed for a file, function, class, module, or component.

  • Limits

    Not for auditing whether existing tests are adequate.

Skill package

SKILL.md

This Skill is a single file. The download is its SKILL.md, with the complete frontmatter and instructions.

  • generating-unit-tests/SKILL.md

Inputs required

Repository, ZIP, or code
Enough of the project to identify the implementation, test framework, file structure, configuration, and existing conventions.
Target code
The file, function, class, module, or component to test.

Access needed

Needs read access to the project and its existing tests. Writing test files and running tests require file-write and command-execution permission; without them, returns the proposed tests and marks them not written and not run.