From test-writing
Reviews Shopware PHPUnit unit tests for quality and compliance with conventions on structure, naming, attributes, mocking strategy, and behavior-focused testing.
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-writing:phpunit-unit-test-reviewingThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Reviews a Shopware PHPUnit unit test for compliance with testing guidelines and best practices.
Reviews a Shopware PHPUnit unit test for compliance with testing guidelines and best practices.
Performs MCP-driven review of PHPUnit unit tests against Shopware testing conventions, organized by rule group (convention → design → unit → isolation → provider).
Category-aware: Rules are scoped to test categories (A: DTO, B: Service, C: Flow/Event, D: DAL, E: Exception) via MCP mcp__plugin_test-writing_test-rules__list_rules filtering.
Output: Structured report with code snippets and suggested fixes per output-format.md.
Glob("tests/unit/**/*Test.php"))tests/unit/ directory (abort if tests/integration/)TestCase or appropriate base class#[CoversClass]) — needed by rules that analyze test-to-code-path coveragemcp__plugin_test-writing_test-rules__list_rules(test_type=unit, test_category={detected_category}) to get all applicable rule IDsgroup: convention, design, unit, isolation, providerCovers naming, attributes, TestDox, assertions, class structure, and method ordering.
group=conventionmcp__plugin_test-writing_test-rules__get_rules(ids={comma-separated convention IDs})Covers conditionals, single behavior, test redundancy, data provider usage, and coverage distribution.
group=designmcp__plugin_test-writing_test-rules__get_rules(ids={comma-separated design IDs})Covers behavior vs implementation focus, mocking strategy, and call-count coupling.
group=unitmcp__plugin_test-writing_test-rules__get_rules(ids={comma-separated unit IDs})Covers FIRST principles (Independent, Repeatable), shared state, fixtures, and feature flags.
group=isolationmcp__plugin_test-writing_test-rules__get_rules(ids={comma-separated isolation IDs})Covers data provider key quality, naming, yield patterns, and TestDox parameters.
group=providermcp__plugin_test-writing_test-rules__get_rules(ids={comma-separated provider IDs})For output format and examples, see output-format.md.
Report each issue using the rule's ID and title from mcp__plugin_test-writing_test-rules__get_rules:
### [{rule_id}] {title}
Include for each issue:
Include full passed checks list.
errors:
- rule_id: {from mcp__plugin_test-writing_test-rules__get_rules response}
title: {from mcp__plugin_test-writing_test-rules__get_rules response}
enforce: must-fix
location: ClassTest.php:45
current: |
# problematic code
suggested: |
# fixed code
warnings:
- rule_id: {from mcp__plugin_test-writing_test-rules__get_rules response}
title: {from mcp__plugin_test-writing_test-rules__get_rules response}
enforce: should-fix
location: ClassTest.php:78
current: |
# code
suggested: |
# improved code
When test characteristics match multiple categories:
#[CoversClass]expectException presentWhen a test class contains both unit and integration patterns:
If mcp__plugin_test-writing_test-rules__list_rules or mcp__plugin_test-writing_test-rules__get_rules tools are unavailable:
| Status | Condition |
|---|---|
| PASS | 0 errors, 0 warnings |
| NEEDS_ATTENTION | 0 errors, 1+ warnings |
| ISSUES_FOUND | 1+ errors |
For complete report structure and templates, see output-format.md.
npx claudepluginhub shopwarelabs/ai-coding-tools --plugin test-writingGenerates and validates PHPUnit unit tests for PHP classes with review-fix cycles using phpunit_run, phpstan_analyze, and ecs tools. For Shopware 6 unit test coverage.
Reviews test code for common maintenance issues like mock-heavy tests, duplicate bodies, and framework-verification. Supports pytest, Jest, Vitest, and PHPUnit.
Enforces Maverick's testing standards: behaviour-over-implementation unit tests, boundary-only mocking, 60% unit-coverage CI gate, and critical-path integration coverage with a no-decrease ratchet. Applied when writing or reviewing tests.