agentleFS
vosslabvosslab/vosslab-skills/skills/quality/unit-test-starter/SKILL.md

unit-test-starter

Skill5 starsChanged 21 days agoMITView on GitHub

Add focused Python pytest coverage when a repository needs behavior-level tests; not for mechanical test-per-file generation or whole-system workflows.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create small, durable Python pytest coverage from repository evidence.

    line 8
  2. Distinctive:

    Read the target repository's pytest policy and test configuration before choosing coverage.

    line 15
  3. Very specific:

    Keep permanent tests offline, deterministic, and focused on observable behavior.

    line 25
  4. Very specific:

    Use tmp_path for test-owned filesystem contracts.

    line 26
  5. Distinctive:

    Do not import a module whose import performs uncontrolled I/O, network work, subprocess execution, or other unsafe side effects.

    line 38
  6. Distinctive:

    Put real-process, service, browser, or whole-system checks in the repository's E2E lane when they earn permanent coverage.

    line 41
  7. Distinctive:

    Add only coverage that survives the permanent-test decision.

    line 44
  8. Distinctive:

    Prefer table-driven tests where several inputs demonstrate one contract.

    line 49
  9. Very specific:

    Keep import setup repository-wide and minimal.

    line 52
  10. Distinctive:

    Run focused tests after each coherent change, then report the command, result, behaviors covered, and deliberately untested behavior with …

    line 54
  11. Distinctive:

    When delegated execution is explicitly requested, give one fresh subagent one bounded testing task and one verification step.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Unit test starter

Create small, durable Python pytest coverage from repository evidence. This skill is for a bounded coverage task or an intentional repository-wide testing pass; it is not a request to mirror every source file with a test or to test incidental implementation details.

Start with the test contract

Read the target repository's pytest policy and test configuration before choosing coverage. Follow its test lanes, permanent-test criteria, command conventions, and import arrangements. If this repository provides them, read:

  • docs/PYTEST_STYLE.md for what merits permanent coverage and fragile-test exclusions.
  • docs/E2E_TESTS.md when a proposed case might require a whole-system or browser workflow.
  • docs/PYTHON_STYLE.md before writing Python tests.

Keep permanent tests offline, deterministic, and focused on observable behavior. Use tmp_path for test-owned filesystem contracts. Do not add a permanent test for dates, inventories, hardcoded defaults, internal names, unstable output, or other incidental structure unless the repository declares it a contract.

Scope and triage

  1. Identify the requested modules, existing tests, repository test configuration, and safe import boundary. Ask only when the requested boundary cannot be inferred from the task and repository.
  2. Inspect the code and existing tests before deciding which behavior is worth protecting. Prefer pure functions, explicit errors, data invariants, and isolated filesystem behavior.
  3. Do not import a module whose import performs uncontrolled I/O, network work, subprocess execution, or other unsafe side effects. Record a precise reason when behavior cannot safely receive pytest coverage.
  4. Put real-process, service, browser, or whole-system checks in the repository's E2E lane when they earn permanent coverage; use temporary verification when they only prove the present implementation.
  5. Add only coverage that survives the permanent-test decision. A source file without a justified test needs no placeholder test module or blanket skip.

Write and verify

  • Prefer table-driven tests where several inputs demonstrate one contract.
  • Assert a few stable results or invariants; use pytest.raises for explicit error contracts.
  • Keep import setup repository-wide and minimal. Add tests/conftest.py only for a genuine shared import or environment boundary, never as a per-test hack.
  • Run focused tests after each coherent change, then report the command, result, behaviors covered, and deliberately untested behavior with reasons.

For detailed source discovery, mapping, import setup, test construction, and incremental-run procedure, read Python pytest workflow when performing a multi-module or repository-wide coverage pass.

Completion

Return the tests added or changed, the behavior each protects, skipped or uncovered behavior and its reason, and focused test evidence. Flag a design problem rather than papering it over with a fragile test.

When delegated execution is explicitly requested, give one fresh subagent one bounded testing task and one verification step. The manager workflow owns general delegation mechanics.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.