No slash command · from test-writing
Internal sub-skill for adversarial review of PHPUnit tests. Stress-tests reviewer consensus by forming independent judgments, challenging weak consensus, resurrecting premature withdrawals, and discovering missed violations.
Ships in test-writing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Stress-test reviewer consensus for any test type (unit, integration, or migration): form independent judgment before exposure to findings, then challenge weak consensus, resurrect premature withdrawals, and discover missed violations.
{consensus} (required) — the consensus package: consensus_findings, withdrawn_findings, and the reconciliation record per file, provided in full in your prompt.{impressions} (optional) — impressions pre-formed in an earlier wave. When set, Phase 1 is already done and is skipped.{rules} (optional) — the pre-rendered rule catalog as text, provided in your prompt. When set, Phase 4 selects rules from it instead of calling get_rules.digraph adversarial_review {
"Adversarial review request" [shape=doublecircle];
"impressions supplied?" [shape=diamond];
"Phase 1: read each test file and its source class with no rules framework, apply every heuristic lens from references/intuitive-scan-guidance.md, record concerns with a severity estimate" [shape=box];
"test file and source class readable?" [shape=diamond];
"STOP: report the failure with the file path and the error; form no impressions, fabricate no files entry" [shape=octagon, style=filled, fillcolor=red];
"Phase 2: parse the consensus package, validate it carries consensus_findings, withdrawn_findings and a reconciliation record per file" [shape=box];
"Phase 3: contrast impressions against consensus per references/comparison-strategies.md - intuition-consensus gaps, weak consensus findings, premature withdrawals, unstated premises - into a prioritized candidate list" [shape=box];
"rules set?" [shape=diamond];
"Select the candidate's rules from the inline catalog by rule area; open no rule file" [shape=box];
"Call get_rules for the file's test_type, adding test_category only for unit tests" [shape=box];
"get_rules available?" [shape=diamond];
"STOP: report that the test-rules MCP server is unavailable; no candidate can be promoted without evidence, so emit a files entry with endorsements only and no promoted items, noting the limitation to the caller" [shape=octagon, style=filled, fillcolor=red];
"Phase 4: apply each detection algorithm against the actual code" [shape=box];
"does a detection algorithm substantiate the candidate?" [shape=diamond];
"Drop the candidate - intuition proposes, evidence disposes" [shape=box];
"Promote to a formal challenge, resurrection or new finding; endorse each consensus finding that Phase 1 independently confirmed and a detection algorithm supports" [shape=box];
"more than one file assigned?" [shape=diamond];
"Phase 5: compare rule treatment and shared patterns across the assigned files; promote a cross-file inconsistency only through the same evidence gate" [shape=box];
"Phase 6: group promoted items by file path, add endorsements and cross-file inconsistencies" [shape=box];
"Emit the challenges report per references/output-format.md" [shape=doublecircle];
"Adversarial review request" -> "impressions supplied?";
"impressions supplied?" -> "Phase 2: parse the consensus package, validate it carries consensus_findings, withdrawn_findings and a reconciliation record per file" [label="yes - Phase 1 already done"];
"impressions supplied?" -> "Phase 1: read each test file and its source class with no rules framework, apply every heuristic lens from references/intuitive-scan-guidance.md, record concerns with a severity estimate" [label="no"];
"Phase 1: read each test file and its source class with no rules framework, apply every heuristic lens from references/intuitive-scan-guidance.md, record concerns with a severity estimate" -> "test file and source class readable?";
"test file and source class readable?" -> "STOP: report the failure with the file path and the error; form no impressions, fabricate no files entry" [label="no"];
"test file and source class readable?" -> "Phase 2: parse the consensus package, validate it carries consensus_findings, withdrawn_findings and a reconciliation record per file" [label="yes"];
"Phase 2: parse the consensus package, validate it carries consensus_findings, withdrawn_findings and a reconciliation record per file" -> "Phase 3: contrast impressions against consensus per references/comparison-strategies.md - intuition-consensus gaps, weak consensus findings, premature withdrawals, unstated premises - into a prioritized candidate list";
"Phase 3: contrast impressions against consensus per references/comparison-strategies.md - intuition-consensus gaps, weak consensus findings, premature withdrawals, unstated premises - into a prioritized candidate list" -> "rules set?";
"rules set?" -> "Select the candidate's rules from the inline catalog by rule area; open no rule file" [label="yes"];
"rules set?" -> "Call get_rules for the file's test_type, adding test_category only for unit tests" [label="no"];
"Call get_rules for the file's test_type, adding test_category only for unit tests" -> "get_rules available?";
"get_rules available?" -> "STOP: report that the test-rules MCP server is unavailable; no candidate can be promoted without evidence, so emit a files entry with endorsements only and no promoted items, noting the limitation to the caller" [label="no"];
"get_rules available?" -> "Phase 4: apply each detection algorithm against the actual code" [label="yes"];
"Select the candidate's rules from the inline catalog by rule area; open no rule file" -> "Phase 4: apply each detection algorithm against the actual code";
"Phase 4: apply each detection algorithm against the actual code" -> "does a detection algorithm substantiate the candidate?";
"does a detection algorithm substantiate the candidate?" -> "Drop the candidate - intuition proposes, evidence disposes" [label="no"];
"does a detection algorithm substantiate the candidate?" -> "Promote to a formal challenge, resurrection or new finding; endorse each consensus finding that Phase 1 independently confirmed and a detection algorithm supports" [label="yes"];
"Drop the candidate - intuition proposes, evidence disposes" -> "more than one file assigned?";
"Promote to a formal challenge, resurrection or new finding; endorse each consensus finding that Phase 1 independently confirmed and a detection algorithm supports" -> "more than one file assigned?";
"more than one file assigned?" -> "Phase 5: compare rule treatment and shared patterns across the assigned files; promote a cross-file inconsistency only through the same evidence gate" [label="yes"];
"more than one file assigned?" -> "Phase 6: group promoted items by file path, add endorsements and cross-file inconsistencies" [label="no"];
"Phase 5: compare rule treatment and shared patterns across the assigned files; promote a cross-file inconsistency only through the same evidence gate" -> "Phase 6: group promoted items by file path, add endorsements and cross-file inconsistencies";
"Phase 6: group promoted items by file path, add endorsements and cross-file inconsistencies" -> "Emit the challenges report per references/output-format.md";
}
Read each assigned test file and its source class (from #[CoversClass]). Do NOT use MCP rule tools (get_rules) in this phase.
Load references/intuitive-scan-guidance.md for heuristic lenses, then for each file:
#[CoversClass])Output per file:
impressions:
- file_path: tests/unit/Path/To/ClassTest.php
concerns:
- area: "brief description of concern"
severity: high | medium | low
Validate the package carries consensus_findings, withdrawn_findings, and reconciliation_record per file. This is the first exposure to reviewer reasoning — note your initial reactions before proceeding.
Load references/comparison-strategies.md. Per file, contrast impressions against consensus:
Intuition-consensus gaps — Phase 1 concerns that no reviewer raised. These are the highest-value candidates for new findings. For each unmatched concern, note which area of the code it targets.
Weak consensus findings — for each consensus finding, apply the "would this survive harder pushback?" test:
Premature withdrawals — for each withdrawn finding, check:
Assumption excavation — for each consensus finding, state the unstated premise:
Output: prioritized list of candidate challenges, resurrections, and new findings — not yet evidence-backed.
Per candidate, highest priority first:
{rules} is set, the inline text is the full rule catalog for this file's test type — select the rules relevant to the candidate finding and your lens axis. For unit tests, select those whose Categories include the detected A–E category; integration and migration rules carry Categories: all, so select by rule area, not category. The text holds every rule, so NEVER read, open, search, or locate a rule file by any means (no Read/Grep/Glob, no get_rules); reading the test/source code is unaffected. Otherwise call mcp__plugin_test-writing_test-rules__get_rules(test_type={the file's test type}), adding test_category={category} only for unit tests.Promotion gate: promote a candidate to a formal challenge ONLY if a detection algorithm substantiates it. Drop candidates where the evidence doesn't hold up. This is the filter against contrarianism — intuition proposes, evidence disposes.
Endorsement: consensus findings that Phase 1 intuition independently confirmed AND that have strong detection algorithm support get endorsed. Endorsements are part of the output — they strengthen findings in the final report.
Compare patterns across all assigned files:
For each rule_id that appears in any file's consensus, check if the same pattern exists in other files:
Compare treatment of similar code patterns:
Cross-file inconsistencies use the same promotion gate as Phase 4 — cite the detection algorithm.
Load references/output-format.md. Assemble the structured output: promoted challenges grouped by file path, every endorsement, and the Phase 5 cross-file inconsistencies.
The report carries no top-level status or failure-reason field — NO_CHALLENGES is simply a files entry with no challenges_to_consensus, resurrections, or cross_file_inconsistencies (endorsements only, or none). Failure to form impressions in Phase 1 is handled per Troubleshooting below, not by a status field here.
adversary: reviewer-2
files:
- path: tests/unit/Path/To/ClassTest.php
challenges_to_consensus:
- finding_id: "CONV-004|testFoo"
rule_id: CONV-004
consensus_was: UNANIMOUS | MAJORITY
challenge: "Detection algorithm requires X but..."
verdict_sought: overturn | weaken
resurrections:
- finding_id: "DESIGN-005|testBar"
rule_id: DESIGN-005
withdrawn_reason: "Conceded without evidence"
resurrection_argument: "The concession was premature because..."
code_evidence: "ClassTest.php:72 — ..."
new_findings:
- rule_id: ISOLATION-002
enforce: must-fix
location: ClassTest.php:88
method: testBaz
summary: "Description"
current: |
# code
suggested: |
# fix
implies_src_change: false # true ONLY when the fix cannot be made in the test alone
deleted_methods: [] # bare names of test methods this fix deletes outright
removed_assertions: [] # [{assertion, covered_by_test}] per assertion this fix drops
endorsements:
- rule_id: UNIT-003
reason: "Strong finding, correctly applied"
cross_file_inconsistencies:
- rule_id: CONV-004
this_file_status: accepted
other_file: tests/unit/Other/ClassTest.php
other_file_status: flagged
inconsistency: "Same pattern, divergent treatment"
finding_id on a challenge or resurrection is quoted verbatim from the consensus/withdrawn finding under scrutiny — never invented or altered. new_findings carries no detection_algorithm_citation field; cite the detection algorithm in summary instead.
Every new_findings entry carries implies_src_change, deleted_methods and removed_assertions — always, including when nothing applies (false, [], []). Set implies_src_change: true when the fix cannot be made in the test alone and requires a change under src/. Emit these fields whether or not a consensus package instructed you to: omitting them under-counts the source-change escalation and hides deletions from the after-state guard.
If the test file or source class cannot be read:
files entry to fit the schemaIf mcp__plugin_test-writing_test-rules__get_rules is unavailable:
files entry with no challenges, resurrections, or new_findings (endorsements only, if any), noting the limitation in the report handed back to the callerIf Phase 4 drops all candidates (none substantiated by detection algorithms):
files entry with no challenges, resurrections, or new_findingsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shopwarelabs/ai-coding-tools --plugin test-writing11 skills in this plugin
/phpunit-integration-test-generationUse this skill when the user asks to generate, write, or create integration tests for a Shopware 6 source class whose contract requires wired-up code — phrases like "generate integration tests for X", "write an integration test for this controller", "test this indexer", "create an integration test for the message handler". Detects supported integration patterns (controller/route, scheduled-task, message-handler, indexer, DAL-persistence flow, multi-service coordinator) and applies a template producing an INTEGRATION-001..008-compliant test using IntegrationTestBehaviour against the real DAL, container, and HTTP/messaging. When the source class is unit-shape (no persistence, no kernel state, no wiring under test), returns SKIPPED and points at phpunit-unit-test-writing. Do NOT activate for unit tests or migration tests (use phpunit-migration-test-generation)./phpunit-integration-test-reviewingInternal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent./phpunit-integration-to-unit-migratingUse this skill ONLY when the user explicitly requests an audit, migration, or evaluation of whether a Shopware integration test belongs in the unit suite — trigger phrases like "audit integration tests", "migrate integration tests to unit", "is this an integration test or a unit test", "evaluate integration tests for migration", "should this be a unit test instead". Audits tests under tests/integration/ for misplacement and migrates load-bearing-free tests to tests/unit/ using one of six codified refactoring patterns. NOT invoked automatically by reviewing skills — phpunit-integration-test-reviewing emits a placement smoke-alarm hint pointing here, but the user must invoke this skill explicitly to run the deep audit./phpunit-migration-test-generationUse this skill when the user asks to generate, write, or create migration tests for a Shopware 6 migration class — phrases like "generate migration tests", "write a migration test", "create migration test", "test this migration", "test Migration1234Foo". Analyzes the source migration's SQL operations to pick an appropriate pattern (schema-add, schema-remove, data-update, config, mail template), then generates a test that runs against a real database and passes PHPStan and PHPUnit validation. Do NOT activate for unit tests (use phpunit-unit-test-writing) or integration tests of non-migration source classes (use phpunit-integration-test-generation)./phpunit-migration-test-reviewingInternal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent./phpunit-test-reconcilingInternal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent.Other plugins' skills for the same job