003-skills/.claude/skills/nixtla-test-generator/SKILL.md
Generate comprehensive pytest test suites from PRD functional requirements with fixtures, parameterization, and coverage tracking. Use when creating tests for new plugins, validating PRD requirements, or scaffolding test infrastructure. Trigger with 'generate tests from PRD', 'create test suite', or 'scaffold pytest tests'.
npx skillsauth add intent-solutions-io/plugins-nixtla nixtla-test-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate production-ready pytest test suites from PRD (Product Requirements Document) functional requirements, ensuring comprehensive test coverage for Nixtla plugins.
This skill automates the tedious process of creating test infrastructure for new plugins. It:
Key Benefits:
The script automatically:
PRD Structure Expected:
## Functional Requirements
### FR-1: Feature Name
- Requirement detail 1
- Requirement detail 2
### FR-2: Another Feature
- More requirements
Creates the following test files:
test_unit.py - Unit tests for individual functions
import pytest
from plugin_name.core import function_name
class TestFR1FeatureName:
"""Test FR-1: Feature Name"""
def test_basic_functionality(self):
"""Test basic happy path for FR-1"""
result = function_name(input_data)
assert result.success
def test_error_handling(self):
"""Test error handling for FR-1"""
with pytest.raises(ValueError):
function_name(invalid_input)
test_integration.py - Integration tests for MCP tools
import pytest
from mcp_server import ToolName
class TestMCPToolName:
"""Test MCP tool: tool_name"""
@pytest.mark.integration
def test_tool_execution(self, mock_api_client):
"""Test tool_name MCP tool end-to-end"""
result = ToolName.execute(params)
assert result["status"] == "success"
conftest.py - Shared fixtures
import pytest
@pytest.fixture
def sample_data():
"""Provide sample test data"""
return {"series": [...], "horizon": 14}
@pytest.fixture
def mock_api_client(monkeypatch):
"""Mock external API calls"""
class MockClient:
def forecast(self, **kwargs):
return {"predictions": [...]}
return MockClient()
Generated tests include appropriate markers:
@pytest.mark.unit - Fast, isolated tests@pytest.mark.integration - Tests with external dependencies@pytest.mark.slow - Long-running tests (>1 second)@pytest.mark.parametrize - Multiple input scenariosGenerates tests/COVERAGE_MATRIX.md:
# Test Coverage Matrix
| Requirement | Test File | Test Function | Status |
|-------------|-----------|---------------|--------|
| FR-1: Feature Name | test_unit.py | test_basic_functionality | ✅ |
| FR-2: Another Feature | test_unit.py | test_feature_2 | ✅ |
| MCP: tool_name | test_integration.py | test_tool_execution | ✅ |
# Install test dependencies
pip install -r requirements-dev.txt
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=plugin_name --cov-report=html
# Run only unit tests
pytest tests/ -m unit
The script generates:
Missing PRD File:
Error: PRD not found at /path/to/PRD.md
Solution: Verify PRD path and ensure file exists
No Functional Requirements Found:
Warning: No FR-X sections found in PRD
Solution: Ensure PRD has "### FR-X: Title" format sections
Invalid Python Syntax in Generated Tests:
Error: Generated test file has syntax errors
Solution: Run black formatter on generated files
Import Errors in Generated Tests:
Error: Cannot import plugin_name module
Solution: Update import paths in generated tests to match actual module structure
python {baseDir}/scripts/generate_test_suite.py \
--prd 000-docs/000a-planned-plugins/implemented/nixtla-roi-calculator/02-PRD.md \
--output 005-plugins/nixtla-roi-calculator/tests \
--plugin-name nixtla-roi-calculator
Output:
✓ Parsed PRD: Found 5 functional requirements, 4 MCP tools
✓ Generated tests/test_unit.py (15 test functions)
✓ Generated tests/test_integration.py (4 MCP tool tests)
✓ Generated tests/conftest.py (6 fixtures)
✓ Generated tests/COVERAGE_MATRIX.md
✓ Generated tests/README.md
Test Coverage: 19/19 requirements (100%)
python {baseDir}/scripts/generate_test_suite.py \
--prd /path/to/PRD.md \
--output /path/to/tests \
--unit-only
python {baseDir}/scripts/generate_test_suite.py \
--prd /path/to/PRD.md \
--output /path/to/tests \
--dry-run
{baseDir}/scripts/generate_test_suite.py{baseDir}/assets/templates/pytest_template.py000-docs/000a-planned-plugins/implemented/nixtla-roi-calculator/02-PRD.mdtesting
This skill enables Claude to manage isolated test environments using Docker Compose, Testcontainers, and environment variables. It is used to create consistent, reproducible testing environments for software projects. Claude should use this skill when the user needs to set up a test environment with specific configurations, manage Docker Compose files for test infrastructure, set up programmatic container management with Testcontainers, manage environment variables for tests, or ensure cleanup after tests. Trigger terms include "test environment", "docker compose", "testcontainers", "environment variables", "isolated environment", "env-setup", and "test setup".
tools
This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.
tools
This skill enables Claude to generate realistic test data for software development. It uses the test-data-generator plugin to create users, products, orders, and custom schemas for comprehensive testing. Use this skill when you need to populate databases, simulate user behavior, or create fixtures for automated tests. Trigger phrases include "generate test data", "create fake users", "populate database", "generate product data", "create test orders", or "generate data based on schema". This skill is especially useful for populating testing environments or creating sample data for demonstrations.
development
This skill analyzes code coverage metrics to identify untested code and generate comprehensive coverage reports. It is triggered when the user requests analysis of code coverage, identification of coverage gaps, or generation of coverage reports. The skill is best used to improve code quality by ensuring adequate test coverage and identifying areas for improvement. Use trigger terms like "analyze coverage", "code coverage report", "untested code", or the shortcut "cov".