[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EM7J0EP4FXPBMDCVXPQWEE":3,"skill-same:01M6EM7J0EP4FXPBMDCVXPQWEE":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6EM7J0EP4FXPBMDCVXPQWEE","test-generator",null,"Generate comprehensive test boilerplate following project TDD conventions. Use when creating new tests for modules, classes, or functions. Automatically creates tests with proper structure, type hints, docstrings, and AAA pattern.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32],"test","test generator","tdd","generate","use","modules","functions","structure","pattern","conventions","project","tests","type","boilerplate","2026-11-10 10:12:30",false,"---\nname: test-generator\ndescription: Generate comprehensive test boilerplate following project TDD conventions. Use when creating new tests for modules, classes, or functions. Automatically creates tests with proper structure, type hints, docstrings, and AAA pattern.\n---\n\n# Test Boilerplate Generator\n\n## ⚠️ MANDATORY: Read Project Documentation First\n\n**BEFORE generating tests, you MUST read and understand the following project documentation:**\n\n### Core Project Documentation\n\n1. **README.md** - Project overview, features, and getting started\n2. **AI_DOCS\u002Fproject-context.md** - Tech stack, architecture, development workflow\n3. **AI_DOCS\u002Fcode-conventions.md** - Code style, formatting, best practices (especially for tests)\n4. **AI_DOCS\u002Ftdd-workflow.md** - TDD process, testing standards, coverage requirements (CRITICAL)\n\n### Session Context (if available)\n\n5. **.ai-context\u002FACTIVE_TASKS.md** - Current tasks and priorities\n6. **.ai-context\u002FCONVENTIONS.md** - Project-specific conventions\n7. **.ai-context\u002FRECENT_DECISIONS.md** - Recent architectural decisions\n8. **.ai-context\u002FLAST_SESSION_SUMMARY.md** - Previous session summary\n\n### Additional AI Documentation\n\n9. **AI_DOCS\u002Fai-tools.md** - Session management workflow\n10. **AI_DOCS\u002Fai-skills.md** - Other specialized skills\u002Fagents available\n\n### Why This Matters\n\n- **Testing Standards**: Follow project-specific test structure and conventions\n- **TDD Patterns**: Use AAA pattern, proper fixtures, and parametrization\n- **Code Quality**: Generate tests with type hints, docstrings, proper imports\n- **Mock Guidelines**: Understand when to mock vs. use real code\n- **Coverage Goals**: Generate tests that help reach 80%+ coverage\n\n**After reading these files, proceed with your test generation task below.**\n\n---\n\n## Overview\n\nAutomatically generate comprehensive test boilerplate that follows this project's strict TDD and quality standards.\n\n## When to Use\n\n- Creating tests for a new module, class, or function\n- Starting TDD workflow (write tests FIRST!)\n- Need test templates with proper structure\n- Want parametrized test examples\n- Creating test fixtures\n\n## What This Skill Generates\n\n✅ Test files with proper imports and structure\n✅ Test classes organized by functionality\n✅ Parametrized test templates\n✅ AAA pattern (Arrange-Act-Assert) structure\n✅ Complete type hints\n✅ Google-style docstrings\n✅ Fixture templates (when needed)\n\n## Usage Examples\n\n### Generate Tests for a Module\n\n```bash\n# User provides source file\ngenerate tests for src\u002Fpython_modern_template\u002Fvalidators.py\n```\n\n**Output:** Creates `tests\u002Ftest_validators.py` with:\n- Test class for each function\u002Fclass\n- Parametrized test cases\n- Edge case test templates\n- Proper imports and structure\n\n### Generate Tests for a Specific Function\n\n```bash\n# User describes the function\ngenerate tests for validate_email function that checks email format\n```\n\n**Output:** Creates test class with:\n- Basic functionality tests\n- Edge cases (empty, invalid format, special characters)\n- Parametrized test cases\n- Error handling tests\n\n### Generate Fixture Template\n\n```bash\n# User needs test fixtures\ngenerate pytest fixture for database connection\n```\n\n**Output:** Creates conftest.py entry with proper fixture structure\n\n## Step-by-Step Process\n\n### Step 1: Analyze Source Code\n\nIf source file provided:\n1. Read the source file\n2. Identify all public functions and classes\n3. Analyze function signatures (parameters, return types)\n4. Identify error cases (raises clauses)\n\nIf described by user:\n1. Extract function\u002Fclass name\n2. Understand parameters and return type\n3. Identify test scenarios from description\n\n### Step 2: Choose Template\n\nSelect appropriate template from `templates\u002F`:\n- `test_function.py` - Simple function tests\n- `test_class.py` - Class with methods tests\n- `test_parametrized.py` - Data-driven tests\n- `test_async.py` - Async function tests\n- `test_exception.py` - Error handling tests\n- `conftest_fixture.py` - Pytest fixtures\n\n### Step 3: Generate Test Code\n\nUse templates from `.claude\u002Fskills\u002Ftest-generator\u002Ftemplates\u002F` directory.\n\n**Template Variables:**\n- `{module_name}` - Source module name\n- `{class_name}` - Class being tested\n- `{function_name}` - Function being tested\n- `{test_class_name}` - Generated test class name\n- `{import_path}` - Full import path\n- `{param_names}` - Function parameters\n- `{return_type}` - Function return type\n\n### Step 4: Add Test Cases\n\nGenerate test cases for:\n1. **Happy path** - Normal successful execution\n2. **Edge cases** - Boundary values, empty inputs, None values\n3. **Error cases** - Invalid inputs, exceptions\n4. **Parametrized cases** - Multiple input combinations\n\n### Step 5: Format and Save\n\n1. Apply proper formatting (Black, isort)\n2. Ensure type hints and docstrings\n3. Save to appropriate test file\n4. Display summary of generated tests\n\n## Templates Reference\n\n### Template: Simple Function Test\n\n**File:** `templates\u002Ftest_function.py`\n\n```python\n\"\"\"Tests for {module_name}.{function_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {function_name}\n\n\nclass Test{FunctionNameCamelCase}:\n    \"\"\"Test cases for {function_name}.\"\"\"\n\n    def test_{function_name}_basic(self) -> None:\n        \"\"\"Test basic functionality of {function_name}.\"\"\"\n        # Arrange\n        # TODO: Set up test data\n\n        # Act\n        result = {function_name}()\n\n        # Assert\n        # TODO: Add assertions\n        assert result is not None\n\n    def test_{function_name}_with_valid_input(self) -> None:\n        \"\"\"Test {function_name} with valid input.\"\"\"\n        # Arrange\n        # TODO: Prepare valid input\n\n        # Act\n        # TODO: Call function\n\n        # Assert\n        # TODO: Verify result\n        pass\n\n    def test_{function_name}_with_invalid_input(self) -> None:\n        \"\"\"Test {function_name} handles invalid input.\"\"\"\n        # Arrange\n        # TODO: Prepare invalid input\n\n        # Act & Assert\n        with pytest.raises(ValueError):\n            {function_name}()  # TODO: Add invalid input\n\n    def test_{function_name}_edge_cases(self) -> None:\n        \"\"\"Test {function_name} edge cases.\"\"\"\n        # TODO: Test empty input, None, boundary values\n        pass\n```\n\n### Template: Parametrized Test\n\n**File:** `templates\u002Ftest_parametrized.py`\n\n```python\n\"\"\"Tests for {module_name}.{function_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {function_name}\n\n\nclass Test{FunctionNameCamelCase}:\n    \"\"\"Parametrized test cases for {function_name}.\"\"\"\n\n    @pytest.mark.parametrize(\n        \"input_value,expected\",\n        [\n            # Happy path cases\n            (\"valid_input_1\", \"expected_output_1\"),\n            (\"valid_input_2\", \"expected_output_2\"),\n\n            # Edge cases\n            (\"\", \"expected_for_empty\"),\n            (None, \"expected_for_none\"),\n\n            # TODO: Add more test cases\n        ],\n    )\n    def test_{function_name}_parametrized(\n        self,\n        input_value: str,  # TODO: Adjust type\n        expected: str,  # TODO: Adjust type\n    ) -> None:\n        \"\"\"Test {function_name} with various inputs.\"\"\"\n        # Act\n        result = {function_name}(input_value)\n\n        # Assert\n        assert result == expected\n\n    @pytest.mark.parametrize(\n        \"invalid_input,expected_error\",\n        [\n            (\"invalid_1\", ValueError),\n            (\"invalid_2\", TypeError),\n            # TODO: Add more error cases\n        ],\n    )\n    def test_{function_name}_error_cases(\n        self,\n        invalid_input: str,  # TODO: Adjust type\n        expected_error: type[Exception],\n    ) -> None:\n        \"\"\"Test {function_name} raises appropriate errors.\"\"\"\n        # Act & Assert\n        with pytest.raises(expected_error):\n            {function_name}(invalid_input)\n```\n\n### Template: Class with Methods Test\n\n**File:** `templates\u002Ftest_class.py`\n\n```python\n\"\"\"Tests for {module_name}.{class_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {class_name}\n\n\nclass Test{ClassName}:\n    \"\"\"Test cases for {class_name}.\"\"\"\n\n    @pytest.fixture\n    def instance(self) -> {class_name}:\n        \"\"\"Create {class_name} instance for testing.\"\"\"\n        return {class_name}()  # TODO: Add initialization parameters\n\n    def test_initialization(self, instance: {class_name}) -> None:\n        \"\"\"Test {class_name} initialization.\"\"\"\n        # Assert\n        assert isinstance(instance, {class_name})\n        # TODO: Verify initial state\n\n    def test_method_name(self, instance: {class_name}) -> None:\n        \"\"\"Test method_name behavior.\"\"\"\n        # Arrange\n        # TODO: Set up test data\n\n        # Act\n        result = instance.method_name()  # TODO: Add actual method\n\n        # Assert\n        # TODO: Verify result\n        assert result is not None\n```\n\n### Template: Async Function Test\n\n**File:** `templates\u002Ftest_async.py`\n\n```python\n\"\"\"Tests for async {module_name}.{function_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {function_name}\n\n\nclass Test{FunctionNameCamelCase}:\n    \"\"\"Test cases for async {function_name}.\"\"\"\n\n    @pytest.mark.asyncio\n    async def test_{function_name}_basic(self) -> None:\n        \"\"\"Test basic async functionality.\"\"\"\n        # Arrange\n        # TODO: Set up test data\n\n        # Act\n        result = await {function_name}()\n\n        # Assert\n        assert result is not None\n\n    @pytest.mark.asyncio\n    async def test_{function_name}_concurrent(self) -> None:\n        \"\"\"Test concurrent execution.\"\"\"\n        # Arrange\n        import asyncio\n\n        # Act\n        results = await asyncio.gather(\n            {function_name}(),\n            {function_name}(),\n        )\n\n        # Assert\n        assert len(results) == 2\n```\n\n### Template: Pytest Fixture\n\n**File:** `templates\u002Fconftest_fixture.py`\n\n```python\n\"\"\"Pytest fixtures for {test_module}.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Generator\n\nimport pytest\n\n\n@pytest.fixture\ndef {fixture_name}() -> Generator[{ResourceType}, None, None]:\n    \"\"\"Provide {description} for tests.\n\n    Yields:\n        {ResourceType}: {Description of what is yielded}\n    \"\"\"\n    # Setup\n    resource = {ResourceType}()  # TODO: Initialize resource\n\n    try:\n        yield resource\n    finally:\n        # Teardown\n        pass  # TODO: Add cleanup code\n```\n\n## Quality Standards\n\nAll generated tests MUST include:\n\n✅ **Type Hints**\n- All test functions annotated with `-> None`\n- All fixture functions with proper return types\n- All parameters with type hints\n\n✅ **Docstrings**\n- Every test function has descriptive docstring\n- Docstring explains WHAT is being tested, not HOW\n- Clear and concise\n\n✅ **AAA Pattern**\n```python\ndef test_example() -> None:\n    \"\"\"Test description.\"\"\"\n    # Arrange - Set up test data\n    data = prepare_test_data()\n\n    # Act - Execute the function\n    result = function_under_test(data)\n\n    # Assert - Verify the result\n    assert result == expected\n```\n\n✅ **Proper Imports**\n```python\nfrom __future__ import annotations  # Always first\n\nimport pytest\n\nfrom python_modern_template.module import function\n```\n\n✅ **No Excessive Mocking**\n- Use real code where possible\n- Only mock: HTTP, DB, File I\u002FO, time, random\n- Never mock: internal functions, validators, processors\n\n## Output Format\n\nAfter generating tests, provide:\n\n```markdown\n## Generated Test File: tests\u002Ftest_{module}.py\n\n**Summary:**\n- Test Classes: X\n- Test Functions: X\n- Parametrized Tests: X\n- Fixtures: X\n- Lines of Code: ~XXX\n\n**Test Coverage:**\n- Function 1: 4 test cases (happy path, edge cases, error handling)\n- Function 2: 3 test cases\n- Total: X test cases\n\n**Next Steps:**\n1. Review generated tests and customize TODO sections\n2. Add specific test data for your use case\n3. Run tests to verify they fail (TDD red phase):\n   ```bash\n   make test\n   ```\n4. Implement the functionality\n5. Run tests again to verify they pass\n6. Check coverage:\n   ```bash\n   make coverage\n   ```\n\n**Files Created\u002FModified:**\n- ✅ tests\u002Ftest_{module}.py (NEW)\n- ⚠️  Remember to implement tests before the actual code (TDD!)\n```\n\n## Integration with Project Tools\n\nThis skill integrates with:\n- `make test` - Run generated tests\n- `make coverage` - Verify test coverage\n- `make format` - Format generated code\n- `tdd-reviewer` agent - Verify TDD compliance\n\n## Script Usage\n\nFor programmatic generation, use:\n\n```bash\n# Generate from source file\npython .claude\u002Fskills\u002Ftest-generator\u002Fscripts\u002Fgenerate.py \\\n  --source src\u002Fpython_modern_template\u002Fmodule.py \\\n  --output tests\u002Ftest_module.py\n\n# Generate from function name\npython .claude\u002Fskills\u002Ftest-generator\u002Fscripts\u002Fgenerate.py \\\n  --function validate_email \\\n  --module validators \\\n  --template parametrized\n```\n\n## Best Practices\n\n1. **Start with generated boilerplate, then customize**\n2. **Review all TODO comments** - replace with actual test data\n3. **Run tests immediately** - they should fail initially (TDD)\n4. **Use parametrized tests** for multiple input cases\n5. **Avoid over-mocking** - use real code where possible\n6. **Aim for edge cases** - empty, None, invalid, boundary values\n7. **Test one thing per test** - focused, clear assertions\n\n## Examples in Action\n\n### Example 1: Generate tests for email validator\n\n**User Request:**\n```\ngenerate tests for the validate_email function in src\u002Fpython_modern_template\u002Fvalidators.py\n```\n\n**Skill Actions:**\n1. Read src\u002Fpython_modern_template\u002Fvalidators.py\n2. Identify validate_email function signature\n3. Choose parametrized template (multiple test cases)\n4. Generate tests\u002Ftest_validators.py with:\n   - Valid email cases\n   - Invalid email cases (no @, multiple @, etc.)\n   - Edge cases (empty, whitespace, very long)\n   - Error handling tests\n\n### Example 2: Generate tests for a new class\n\n**User Request:**\n```\nI'm creating a UserManager class with methods: create_user, delete_user, find_user. Generate tests.\n```\n\n**Skill Actions:**\n1. Choose class template\n2. Generate test class with:\n   - Fixture for UserManager instance\n   - Test for each method\n   - Test initialization\n   - Test error cases\n3. Add parametrized tests for find_user (various search criteria)\n\n### Example 3: Generate async tests\n\n**User Request:**\n```\nGenerate tests for async function fetch_data(url: str) -> dict\n```\n\n**Skill Actions:**\n1. Choose async template\n2. Generate async tests with:\n   - Basic fetch test with mock HTTP\n   - Error handling (timeout, 404, 500)\n   - Concurrent fetch tests\n3. Add pytest-asyncio marker\n\n## Remember\n\n**TDD Workflow:**\n1. Generate tests FIRST (this skill)\n2. Run tests (they should FAIL)\n3. Implement code\n4. Run tests (they should PASS)\n5. Refactor while keeping tests green\n\nThis skill helps you start TDD right—tests first, always!\n","# Test Boilerplate Generator\n\n## ⚠️ MANDATORY: Read Project Documentation First\n\n**BEFORE generating tests, you MUST read and understand the following project documentation:**\n\n### Core Project Documentation\n\n1. **README.md** - Project overview, features, and getting started\n2. **AI_DOCS\u002Fproject-context.md** - Tech stack, architecture, development workflow\n3. **AI_DOCS\u002Fcode-conventions.md** - Code style, formatting, best practices (especially for tests)\n4. **AI_DOCS\u002Ftdd-workflow.md** - TDD process, testing standards, coverage requirements (CRITICAL)\n\n### Session Context (if available)\n\n5. **.ai-context\u002FACTIVE_TASKS.md** - Current tasks and priorities\n6. **.ai-context\u002FCONVENTIONS.md** - Project-specific conventions\n7. **.ai-context\u002FRECENT_DECISIONS.md** - Recent architectural decisions\n8. **.ai-context\u002FLAST_SESSION_SUMMARY.md** - Previous session summary\n\n### Additional AI Documentation\n\n9. **AI_DOCS\u002Fai-tools.md** - Session management workflow\n10. **AI_DOCS\u002Fai-skills.md** - Other specialized skills\u002Fagents available\n\n### Why This Matters\n\n- **Testing Standards**: Follow project-specific test structure and conventions\n- **TDD Patterns**: Use AAA pattern, proper fixtures, and parametrization\n- **Code Quality**: Generate tests with type hints, docstrings, proper imports\n- **Mock Guidelines**: Understand when to mock vs. use real code\n- **Coverage Goals**: Generate tests that help reach 80%+ coverage\n\n**After reading these files, proceed with your test generation task below.**\n\n---\n\n## Overview\n\nAutomatically generate comprehensive test boilerplate that follows this project's strict TDD and quality standards.\n\n## When to Use\n\n- Creating tests for a new module, class, or function\n- Starting TDD workflow (write tests FIRST!)\n- Need test templates with proper structure\n- Want parametrized test examples\n- Creating test fixtures\n\n## What This Skill Generates\n\n✅ Test files with proper imports and structure\n✅ Test classes organized by functionality\n✅ Parametrized test templates\n✅ AAA pattern (Arrange-Act-Assert) structure\n✅ Complete type hints\n✅ Google-style docstrings\n✅ Fixture templates (when needed)\n\n## Usage Examples\n\n### Generate Tests for a Module\n\n```bash\n# User provides source file\ngenerate tests for src\u002Fpython_modern_template\u002Fvalidators.py\n```\n\n**Output:** Creates `tests\u002Ftest_validators.py` with:\n- Test class for each function\u002Fclass\n- Parametrized test cases\n- Edge case test templates\n- Proper imports and structure\n\n### Generate Tests for a Specific Function\n\n```bash\n# User describes the function\ngenerate tests for validate_email function that checks email format\n```\n\n**Output:** Creates test class with:\n- Basic functionality tests\n- Edge cases (empty, invalid format, special characters)\n- Parametrized test cases\n- Error handling tests\n\n### Generate Fixture Template\n\n```bash\n# User needs test fixtures\ngenerate pytest fixture for database connection\n```\n\n**Output:** Creates conftest.py entry with proper fixture structure\n\n## Step-by-Step Process\n\n### Step 1: Analyze Source Code\n\nIf source file provided:\n1. Read the source file\n2. Identify all public functions and classes\n3. Analyze function signatures (parameters, return types)\n4. Identify error cases (raises clauses)\n\nIf described by user:\n1. Extract function\u002Fclass name\n2. Understand parameters and return type\n3. Identify test scenarios from description\n\n### Step 2: Choose Template\n\nSelect appropriate template from `templates\u002F`:\n- `test_function.py` - Simple function tests\n- `test_class.py` - Class with methods tests\n- `test_parametrized.py` - Data-driven tests\n- `test_async.py` - Async function tests\n- `test_exception.py` - Error handling tests\n- `conftest_fixture.py` - Pytest fixtures\n\n### Step 3: Generate Test Code\n\nUse templates from `.claude\u002Fskills\u002Ftest-generator\u002Ftemplates\u002F` directory.\n\n**Template Variables:**\n- `{module_name}` - Source module name\n- `{class_name}` - Class being tested\n- `{function_name}` - Function being tested\n- `{test_class_name}` - Generated test class name\n- `{import_path}` - Full import path\n- `{param_names}` - Function parameters\n- `{return_type}` - Function return type\n\n### Step 4: Add Test Cases\n\nGenerate test cases for:\n1. **Happy path** - Normal successful execution\n2. **Edge cases** - Boundary values, empty inputs, None values\n3. **Error cases** - Invalid inputs, exceptions\n4. **Parametrized cases** - Multiple input combinations\n\n### Step 5: Format and Save\n\n1. Apply proper formatting (Black, isort)\n2. Ensure type hints and docstrings\n3. Save to appropriate test file\n4. Display summary of generated tests\n\n## Templates Reference\n\n### Template: Simple Function Test\n\n**File:** `templates\u002Ftest_function.py`\n\n```python\n\"\"\"Tests for {module_name}.{function_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {function_name}\n\n\nclass Test{FunctionNameCamelCase}:\n    \"\"\"Test cases for {function_name}.\"\"\"\n\n    def test_{function_name}_basic(self) -> None:\n        \"\"\"Test basic functionality of {function_name}.\"\"\"\n        # Arrange\n        # TODO: Set up test data\n\n        # Act\n        result = {function_name}()\n\n        # Assert\n        # TODO: Add assertions\n        assert result is not None\n\n    def test_{function_name}_with_valid_input(self) -> None:\n        \"\"\"Test {function_name} with valid input.\"\"\"\n        # Arrange\n        # TODO: Prepare valid input\n\n        # Act\n        # TODO: Call function\n\n        # Assert\n        # TODO: Verify result\n        pass\n\n    def test_{function_name}_with_invalid_input(self) -> None:\n        \"\"\"Test {function_name} handles invalid input.\"\"\"\n        # Arrange\n        # TODO: Prepare invalid input\n\n        # Act & Assert\n        with pytest.raises(ValueError):\n            {function_name}()  # TODO: Add invalid input\n\n    def test_{function_name}_edge_cases(self) -> None:\n        \"\"\"Test {function_name} edge cases.\"\"\"\n        # TODO: Test empty input, None, boundary values\n        pass\n```\n\n### Template: Parametrized Test\n\n**File:** `templates\u002Ftest_parametrized.py`\n\n```python\n\"\"\"Tests for {module_name}.{function_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {function_name}\n\n\nclass Test{FunctionNameCamelCase}:\n    \"\"\"Parametrized test cases for {function_name}.\"\"\"\n\n    @pytest.mark.parametrize(\n        \"input_value,expected\",\n        [\n            # Happy path cases\n            (\"valid_input_1\", \"expected_output_1\"),\n            (\"valid_input_2\", \"expected_output_2\"),\n\n            # Edge cases\n            (\"\", \"expected_for_empty\"),\n            (None, \"expected_for_none\"),\n\n            # TODO: Add more test cases\n        ],\n    )\n    def test_{function_name}_parametrized(\n        self,\n        input_value: str,  # TODO: Adjust type\n        expected: str,  # TODO: Adjust type\n    ) -> None:\n        \"\"\"Test {function_name} with various inputs.\"\"\"\n        # Act\n        result = {function_name}(input_value)\n\n        # Assert\n        assert result == expected\n\n    @pytest.mark.parametrize(\n        \"invalid_input,expected_error\",\n        [\n            (\"invalid_1\", ValueError),\n            (\"invalid_2\", TypeError),\n            # TODO: Add more error cases\n        ],\n    )\n    def test_{function_name}_error_cases(\n        self,\n        invalid_input: str,  # TODO: Adjust type\n        expected_error: type[Exception],\n    ) -> None:\n        \"\"\"Test {function_name} raises appropriate errors.\"\"\"\n        # Act & Assert\n        with pytest.raises(expected_error):\n            {function_name}(invalid_input)\n```\n\n### Template: Class with Methods Test\n\n**File:** `templates\u002Ftest_class.py`\n\n```python\n\"\"\"Tests for {module_name}.{class_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {class_name}\n\n\nclass Test{ClassName}:\n    \"\"\"Test cases for {class_name}.\"\"\"\n\n    @pytest.fixture\n    def instance(self) -> {class_name}:\n        \"\"\"Create {class_name} instance for testing.\"\"\"\n        return {class_name}()  # TODO: Add initialization parameters\n\n    def test_initialization(self, instance: {class_name}) -> None:\n        \"\"\"Test {class_name} initialization.\"\"\"\n        # Assert\n        assert isinstance(instance, {class_name})\n        # TODO: Verify initial state\n\n    def test_method_name(self, instance: {class_name}) -> None:\n        \"\"\"Test method_name behavior.\"\"\"\n        # Arrange\n        # TODO: Set up test data\n\n        # Act\n        result = instance.method_name()  # TODO: Add actual method\n\n        # Assert\n        # TODO: Verify result\n        assert result is not None\n```\n\n### Template: Async Function Test\n\n**File:** `templates\u002Ftest_async.py`\n\n```python\n\"\"\"Tests for async {module_name}.{function_name}.\"\"\"\n\nfrom __future__ import annotations\n\nimport pytest\n\nfrom {import_path} import {function_name}\n\n\nclass Test{FunctionNameCamelCase}:\n    \"\"\"Test cases for async {function_name}.\"\"\"\n\n    @pytest.mark.asyncio\n    async def test_{function_name}_basic(self) -> None:\n        \"\"\"Test basic async functionality.\"\"\"\n        # Arrange\n        # TODO: Set up test data\n\n        # Act\n        result = await {function_name}()\n\n        # Assert\n        assert result is not None\n\n    @pytest.mark.asyncio\n    async def test_{function_name}_concurrent(self) -> None:\n        \"\"\"Test concurrent execution.\"\"\"\n        # Arrange\n        import asyncio\n\n        # Act\n        results = await asyncio.gather(\n            {function_name}(),\n            {function_name}(),\n        )\n\n        # Assert\n        assert len(results) == 2\n```\n\n### Template: Pytest Fixture\n\n**File:** `templates\u002Fconftest_fixture.py`\n\n```python\n\"\"\"Pytest fixtures for {test_module}.\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Generator\n\nimport pytest\n\n\n@pytest.fixture\ndef {fixture_name}() -> Generator[{ResourceType}, None, None]:\n    \"\"\"Provide {description} for tests.\n\n    Yields:\n        {ResourceType}: {Description of what is yielded}\n    \"\"\"\n    # Setup\n    resource = {ResourceType}()  # TODO: Initialize resource\n\n    try:\n        yield resource\n    finally:\n        # Teardown\n        pass  # TODO: Add cleanup code\n```\n\n## Quality Standards\n\nAll generated tests MUST include:\n\n✅ **Type Hints**\n- All test functions annotated with `-> None`\n- All fixture functions with proper return types\n- All parameters with type hints\n\n✅ **Docstrings**\n- Every test function has descriptive docstring\n- Docstring explains WHAT is being tested, not HOW\n- Clear and concise\n\n✅ **AAA Pattern**\n```python\ndef test_example() -> None:\n    \"\"\"Test description.\"\"\"\n    # Arrange - Set up test data\n    data = prepare_test_data()\n\n    # Act - Execute the function\n    result = function_under_test(data)\n\n    # Assert - Verify the result\n    assert result == expected\n```\n\n✅ **Proper Imports**\n```python\nfrom __future__ import annotations  # Always first\n\nimport pytest\n\nfrom python_modern_template.module import function\n```\n\n✅ **No Excessive Mocking**\n- Use real code where possible\n- Only mock: HTTP, DB, File I\u002FO, time, random\n- Never mock: internal functions, validators, processors\n\n## Output Format\n\nAfter generating tests, provide:\n\n```markdown\n## Generated Test File: tests\u002Ftest_{module}.py\n\n**Summary:**\n- Test Classes: X\n- Test Functions: X\n- Parametrized Tests: X\n- Fixtures: X\n- Lines of Code: ~XXX\n\n**Test Coverage:**\n- Function 1: 4 test cases (happy path, edge cases, error handling)\n- Function 2: 3 test cases\n- Total: X test cases\n\n**Next Steps:**\n1. Review generated tests and customize TODO sections\n2. Add specific test data for your use case\n3. Run tests to verify they fail (TDD red phase):\n   ```bash\n   make test\n   ```\n4. Implement the functionality\n5. Run tests again to verify they pass\n6. Check coverage:\n   ```bash\n   make coverage\n   ```\n\n**Files Created\u002FModified:**\n- ✅ tests\u002Ftest_{module}.py (NEW)\n- ⚠️  Remember to implement tests before the actual code (TDD!)\n```\n\n## Integration with Project Tools\n\nThis skill integrates with:\n- `make test` - Run generated tests\n- `make coverage` - Verify test coverage\n- `make format` - Format generated code\n- `tdd-reviewer` agent - Verify TDD compliance\n\n## Script Usage\n\nFor programmatic generation, use:\n\n```bash\n# Generate from source file\npython .claude\u002Fskills\u002Ftest-generator\u002Fscripts\u002Fgenerate.py \\\n  --source src\u002Fpython_modern_template\u002Fmodule.py \\\n  --output tests\u002Ftest_module.py\n\n# Generate from function name\npython .claude\u002Fskills\u002Ftest-generator\u002Fscripts\u002Fgenerate.py \\\n  --function validate_email \\\n  --module validators \\\n  --template parametrized\n```\n\n## Best Practices\n\n1. **Start with generated boilerplate, then customize**\n2. **Review all TODO comments** - replace with actual test data\n3. **Run tests immediately** - they should fail initially (TDD)\n4. **Use parametrized tests** for multiple input cases\n5. **Avoid over-mocking** - use real code where possible\n6. **Aim for edge cases** - empty, None, invalid, boundary values\n7. **Test one thing per test** - focused, clear assertions\n\n## Examples in Action\n\n### Example 1: Generate tests for email validator\n\n**User Request:**\n```\ngenerate tests for the validate_email function in src\u002Fpython_modern_template\u002Fvalidators.py\n```\n\n**Skill Actions:**\n1. Read src\u002Fpython_modern_template\u002Fvalidators.py\n2. Identify validate_email function signature\n3. Choose parametrized template (multiple test cases)\n4. Generate tests\u002Ftest_validators.py with:\n   - Valid email cases\n   - Invalid email cases (no @, multiple @, etc.)\n   - Edge cases (empty, whitespace, very long)\n   - Error handling tests\n\n### Example 2: Generate tests for a new class\n\n**User Request:**\n```\nI'm creating a UserManager class with methods: create_user, delete_user, find_user. Generate tests.\n```\n\n**Skill Actions:**\n1. Choose class template\n2. Generate test class with:\n   - Fixture for UserManager instance\n   - Test for each method\n   - Test initialization\n   - Test error cases\n3. Add parametrized tests for find_user (various search criteria)\n\n### Example 3: Generate async tests\n\n**User Request:**\n```\nGenerate tests for async function fetch_data(url: str) -> dict\n```\n\n**Skill Actions:**\n1. Choose async template\n2. Generate async tests with:\n   - Basic fetch test with mock HTTP\n   - Error handling (timeout, 404, 500)\n   - Concurrent fetch tests\n3. Add pytest-asyncio marker\n\n## Remember\n\n**TDD Workflow:**\n1. Generate tests FIRST (this skill)\n2. Run tests (they should FAIL)\n3. Implement code\n4. Run tests (they should PASS)\n5. Refactor while keeping tests green\n\nThis skill helps you start TDD right—tests first, always!\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill test-generator",{"tool":53,"command":54},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill test-generator",{"tool":56,"command":57},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill test-generator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002FSKILL.md",true,[61,67,73,77,81,85],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"skill-report.json","REFERENCE","参考文档",16043,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002Fskill-report.json",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"templates\u002Fconftest_fixture.py","SCRIPT","脚本",507,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002Ftemplates\u002Fconftest_fixture.py",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"templates\u002Ftest_async.py",865,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002Ftemplates\u002Ftest_async.py",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"templates\u002Ftest_class.py",925,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002Ftemplates\u002Ftest_class.py",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"templates\u002Ftest_function.py",1259,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002Ftemplates\u002Ftest_function.py",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"templates\u002Ftest_parametrized.py",1483,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fatyantik\u002Ftest-generator\u002Ftemplates\u002Ftest_parametrized.py",[90,99,108,117,123,129],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":33},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[96,97,98],"model","model hierarchy","model hierarchy skill",{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":33},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[105,106,107],"MCP","zoom","zoom mcp",{"skillNo":109,"name":110,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":33},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[114,115,116,106],"sdk","zoom apps sdk","apps",{"skillNo":118,"name":119,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":33},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[119],{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":33},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[125],{"skillNo":130,"name":131,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":33},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[131]]