agentleFS
suxiao1824308603suxiao1824308603/Qoder-devtools-skills/skills/test-generator/SKILL.md

test-generator

Skill3 starsChanged 9 months agoMITView on GitHub

Generate unit tests and integration tests for Python code. Use when the user wants to create tests, improve test coverage, or add test cases for existing functions.

21 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-doc-updater, git-precommit and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • u9401066Skill

    git-doc-updater

    Auto-check and update key documentation before Git commits to keep docs in sync with code. Triggers: docs, 文檔, 更新文檔, sync docs, release, 發布.

    Also in 3 projects that use this

  • u9401066Skill

    git-precommit

    Orchestrate pre-commit workflow including Memory Bank sync, README/CHANGELOG/ROADMAP updates. Triggers: GIT, gc, push, commit, 提交, 準備 commit, 要提交了, git commit, pre-commit, 推送.

    Also in 3 projects that use this

  • nilecuiSkill

    code-refactor

    Perform bulk code refactoring operations like renaming variables/functions across files, replacing patterns, and updating API calls. Use when users request renaming identifiers, replacing deprecated code patterns, updating method calls, or making consistent changes across multiple locations.

    Also in 3 projects that use this

  • AutumnsGroveSkill

    api-designer

    Design and document RESTful and GraphQL APIs with OpenAPI/Swagger specifications, authentication patterns, versioning strategies, and best practices. Use for: (1) Creating API specifications, (2) Designing REST endpoints, (3) GraphQL schema design, (4) API authentication and authorization, (5) API versioning strategies, (6) Documentation generation

    Also in 3 projects that use this

  • +7 more from u9401066

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run tests to verify

    line 15

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “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

Test Generator

Generate comprehensive tests for Python code using pytest.

Quick Start

  1. Analyze the function/class to test
  2. Identify test cases (happy path, edge cases, errors)
  3. Generate test code using patterns below
  4. Run tests to verify

Basic Test Template

import pytest
from module import function_to_test

class TestFunctionName:
    """Tests for function_name."""
    
    def test_happy_path(self):
        """Test normal expected behavior."""
        result = function_to_test(valid_input)
        assert result == expected_output
    
    def test_edge_case(self):
        """Test boundary conditions."""
        result = function_to_test(edge_input)
        assert result == edge_expected
    
    def test_error_handling(self):
        """Test error conditions."""
        with pytest.raises(ExpectedError):
            function_to_test(invalid_input)

Test Case Categories

CategoryWhat to Test
Happy pathNormal inputs, expected behavior
Edge casesEmpty, null, min/max values
Error casesInvalid inputs, exceptions
BoundaryLimits, off-by-one

Fixtures

@pytest.fixture
def sample_data():
    """Provide test data."""
    return {"id": 1, "name": "test"}

def test_with_fixture(sample_data):
    result = process(sample_data)
    assert result.id == 1

Additional Resources

  • For Python-specific patterns: python-patterns.md
  • Validation script: python scripts/check_coverage.py

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.