phpunit-migration-test-generation

phpunit-migration-test-generation is a skill for Claude Code from shopwareLabs/ai-coding-tools. It costs 141 tokens per session (1,397 once invoked), scanned A, original, MIT.

A workflow for generating PHPUnit tests for Shopware 6 database-migration classes. A database migration is code that changes tables or stored data as an application version changes.

In plain words
What is it for?
Use it when testing a Shopware migration class. It creates tests only in the migration test directory and validates them with PHPStan and PHPUnit.
Why use it?
It chooses tests based on the migration's SQL operations instead of relying on a generic template. It also catches style, static-analysis, and test failures before reporting completion.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: agent in frontmatter.

Part of the test-writing plugin — 11 skills, 3 agents shipped together

Good fit Use it when testing a Shopware migration class. It creates tests only in the migration test directory and validates them with PHPStan and PHPUnit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add shopwareLabs/ai-coding-tools --skill phpunit-migration-test-generation
Clone the repo
git clone --depth 1 https://github.com/shopwareLabs/ai-coding-tools

Made for: Claude Code.

Or install test-writing, the plugin that ships this one along with the rest of its 11 skills, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for phpunit-migration-test-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation/github.svg)](https://agentmods.dev/skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation)
Your own site
<a href="https://agentmods.dev/skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation"><img src="https://agentmods.dev/badge/skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for phpunit-migration-test-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation"><img src="https://agentmods.dev/badge/skills/shopwarelabs/ai-coding-tools/phpunit-migration-test-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,397 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.01397
Opus 5.5 $0.00056 $0.00559
Sonnet 5.5 $0.00028 $0.00279
Haiku 4.5 $0.00014 $0.00140

Measured 1mo ago against content hash 92edeea30e54, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

phpunit-migration-test-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/test-writing/skills/phpunit-migration-test-generation/SKILL.md · 169 lines

How it starts

The opening of the file, as written. The whole thing — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHPUnit Migration Test Generation

Generate Shopware-compliant PHPUnit migration tests that pass PHPStan and PHPUnit validation.

File Write Restrictions

Write ONLY to:

  • tests/migration/** — Migration test files

NEVER write to:

  • src/** — Source code (read-only)
  • tests/unit/** — Unit tests (out of scope)
  • tests/integration/** — Integration tests (out of scope)
  • Any other directory

Quick Start

  1. Read the target migration source class
  2. Analyze SQL operations to determine test pattern
  3. Apply the migration test template with conditional sections
  4. Validate with PHPStan and PHPUnit
  5. Fix any errors and repeat
  6. Generate completion report

Phase 1: Validate Input

  1. Verify single file provided
  2. Verify file exists and is a PHP class (not interface/trait)
  3. Verify path contains Migration/V6_
  4. Verify class extends Shopware\Core\Framework\Migration\MigrationStep

If validation fails, return FAILED with reason.

Phase 2: Analyze Source

Read the migration class and extract information needed for test generation. See references/source-analysis.md for detection patterns.

Step 1: Extract Metadata

  • Class name, full namespace
  • Timestamp from getCreationTimestamp() return value
  • #[Package('...')] attribute value — the test class carries the same value. When the migration class carries none, take the value from the nearest src/ directory the test path mirrors, walking up until one exists and using the value its .php files carry. When that yields no value, emit no #[Package] and report that in the Phase 5 report's Package field (none, per references/output-format.md) rather than guessing a value.
  • Area from namespace (Core, Administration, Storefront, Elasticsearch)
  • Version from namespace (V6_6, V6_7, V6_8)

Step 2: Classify SQL Operations

Read update() and updateDestructive() method bodies. Classify:

  • Schema-add: CREATE TABLE, addColumn(), ALTER TABLE ... ADD
  • Schema-remove: DROP TABLE, DROP COLUMN, dropColumnIfExists(), dropTableIfExists()
  • Data-update: UPDATE, INSERT, DELETE on non-config tables
  • Config: system_config operations
  • Mail-template: mail_template operations

Read the full file on GitHub · 169 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 92edeea30e54
  2. 1mo ago Changed 3c1a895d3d04
  3. 1mo ago Changed 752e9c240c1d
  4. 1mo ago Changed cd72be8a8d4e
  5. 1mo ago First seen · 169 lines · 141 tokens per session scan A 14c7bc272374

Subscribe to this mod's changes

phpunit-migration-test-generation is a skill published in the GitHub repository shopwareLabs/ai-coding-tools (45 stars, last pushed 5d ago), licensed MIT. It adds 141 tokens to every session and 1,397 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.