Generate and validate pytest unit tests following custom guidelines with 100% coverage
Generate comprehensive pytest unit tests for a Python source file following strict guidelines
Analyze and enhance existing pytest tests for better quality, coverage, and guideline compliance
Configure pytest and coverage tools for the project with 100% coverage threshold
Validate pytest test files for compliance with guidelines and coverage requirements
Use this agent when the user wants to generate, write, or create pytest unit tests for Python source files. This agent specializes in generating comprehensive, production-ready test suites that follow strict pytest conventions and achieve high code coverage. Examples: <example>Context: User has just created a new Python module and wants tests for it. user: "Generate tests for my calculator.py file" assistant: "I'll analyze your calculator.py file and generate comprehensive pytest unit tests." <commentary>User explicitly requested test generation for a specific file - this is the agent's primary purpose.</commentary> assistant: "I'll use the test-generator agent to create comprehensive unit tests for your calculator module."</example> <example>Context: User has modified an existing Python file and the project has a tests/ directory. user: "I just added three new methods to the DataProcessor class" assistant: "I see you've enhanced the DataProcessor class. Would you like me to generate tests for the new methods?" <commentary>Proactive suggestion after code modification in a project with existing test structure.</commentary> assistant: "I'll use the test-generator agent to add test cases for your new methods."</example> <example>Context: User is working on a feature and mentions needing tests. user: "I need to write unit tests for this authentication module" assistant: "I'll create a comprehensive test suite for your authentication module." <commentary>Direct request for test creation - agent should handle full test generation workflow.</commentary> assistant: "I'll use the test-generator agent to generate comprehensive unit tests following best practices."</example> <example>Context: User invokes the generate-tests command through the plugin. user: "/pytest:generate-tests src/utils/validators.py" assistant: "I'll generate pytest tests for your validators module." <commentary>Explicit command invocation - agent should process the specified file and generate corresponding tests.</commentary> assistant: "I'll use the test-generator agent to create tests for the validators module."</example>
Validates that test files do not contain forbidden patterns (assert_called_with, return_value, __main__ tests, etc.). This is a focused validation agent that checks ONLY forbidden patterns.
Validates that test files use SimpleNamespace instead of MagicMock for return objects (HTTP responses, etc.). This is a focused validation agent that checks ONLY mock object usage.
Validates that ALL mocks in test files have mock_calls verification. This is a focused validation agent that checks ONLY mock verification completeness.
Validates that test files use pytest fixtures correctly (capsys instead of mock_print, etc.). This is a focused validation agent that checks ONLY pytest fixture usage.
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Plugins for Claude Code are combinations of skills, agents, slash commands, and other context to improve the effectiveness and autonomy of Claude Code for specialized tasks.
You can learn more about how they work here: https://code.claude.com/docs/en/plugins
These plugins requires a recent version of Claude Code. Always update claude to ensure you have the latest features.
claude update
Install uv for Python package management:
curl -LsSf https://astral.sh/uv/install.sh | sh
For log monitoring during deployment and user acceptance testing, install expect (provides the unbuffer command):
brew install expect
Add the marketplace and install plugins using Claude Code's plugin system:
# Add the Canvas Medical marketplace
/plugin marketplace add canvas-medical/coding-agents
# Install a plugin (e.g., cpa)
/plugin install cpa@canvas-medical
After installation, enable the plugin:
/plugin
Navigate to the Installed tab and enable the plugin. Once enabled, plugin commands are available with a namespace prefix (e.g., /cpa:new-plugin).
To view all available commands:
/help
To turn on the auto-update (recommanded):
/plugin
Go to Marketplaces with Tab key, then select canvas-medical with the Arrows keys and press Enter, then select Enable auto-update and press Enter.
Guided Canvas plugin development with SDK reference, patterns, security review, and deployment workflows.
Features:
Slash Commands (prefixed with cpa: when installed via marketplace):
| Command | Description |
|---|---|
:check-setup | Verify environment tools (uv, unbuffer, canvas CLI) |
:new-plugin | Start brainstorming a new plugin specification |
:create-icon | Generate SVG icon and convert to 48x48 PNG for Applications |
:analyze-instance | Analyze Canvas instance configuration |
:deploy | Deploy plugin and monitor logs |
:coverage | Run tests with coverage, offer to improve if below 90% |
:security-review | Comprehensive security audit (API auth, FHIR tokens, secrets) |
:database-performance-review | Review for N+1 queries and ORM optimization |
:wrap-up | Final checklist before calling a plugin "done" |
:run-evals | Execute eval cases to verify review commands |
Workflow Artifacts:
Review commands save timestamped reports to .cpa-workflow-artifacts/ at the git repository root. These reports are useful for code review and audit trails.
See canvas-plugin-assistant/README.md for full documentation.
Generate and validate pytest unit tests following strict guidelines with 100% code coverage.
Features:
Slash Commands (prefixed with pytest: when installed via marketplace):
| Command | Description |
|---|---|
:setup | Configure pytest and coverage tools for your project |
:generate-tests | Generate comprehensive tests for a Python source file |
:validate-tests | Check tests for guideline compliance and coverage gaps |
:improve-tests | Analyze and enhance existing tests |
Testing Guidelines Enforced:
test_method_name, test_method_name__case)tested, result, expected, exp_*)mock_calls instead of assert_called_with()side_effect preferred over return_valueSee pytest-forge/README.md for full documentation.
npx claudepluginhub canvas-medical/coding-agents --plugin pytest-forgeHelps solutions consultants build Canvas Medical plugins through guided dialogue and automated workflows
TestForge - Master of quality assurance through intelligent test generation. Analyzes code behavior to auto-generate comprehensive tests that catch real bugs, not just boost coverage numbers. Supports Jest, Pytest, Vitest, and more.
Generate comprehensive unit tests for any function or module
Comprehensive Pytest testing framework skills for Python projects with fixtures, plugins, and advanced testing patterns.
Unit testing with debugging and test automation
Test execution, TDD workflow, testing strategies, and quality analysis
Generate comprehensive tests for a specific file