phpunit-unit-test-writing

phpunit-unit-test-writing is a skill for Claude Code from shopwareLabs/ai-coding-tools. It costs 187 tokens per session (2,847 once invoked), scanned A, original, MIT.

A workflow for creating PHPUnit unit tests for Shopware 6 PHP classes. Unit tests check a class in isolation, usually by replacing its outside dependencies with controlled test objects.

In plain words
What is it for?
Use it to add unit-test coverage for one or more Shopware source classes. It generates tests, reviews them, applies needed fixes, and reports the results.
Why use it?
It removes the repetitive work of writing, reviewing, and correcting tests. It also keeps multi-file test generation organized one source file at a time.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the TodoWrite tool.

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

Good fit Use it to add unit-test coverage for one or more Shopware source classes. It generates tests, reviews them, applies needed fixes, and reports the results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing
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-unit-test-writing
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-unit-test-writing

README.md
[![agentmods](https://agentmods.dev/badge/skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing/github.svg)](https://agentmods.dev/skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing)
Your own site
<a href="https://agentmods.dev/skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing"><img src="https://agentmods.dev/badge/skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing/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-unit-test-writing

Your own site · 80×15
<a href="https://agentmods.dev/skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing"><img src="https://agentmods.dev/badge/skills/shopwarelabs/ai-coding-tools/phpunit-unit-test-writing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 187 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,847 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 43
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00187 $0.02847
Opus 5.5 $0.00075 $0.01139
Sonnet 5.5 $0.00037 $0.00569
Haiku 4.5 $0.00019 $0.00285

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

Security

Grade A, and why

phpunit-unit-test-writing 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-unit-test-writing/SKILL.md · 326 lines

How it starts

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

PHPUnit Unit Test Writing

Orchestrates the complete workflow for generating and reviewing Shopware 6 unit tests.

Core Principle

Execute immediately. Report work AFTER completion, never before.


Execution Strategy

Single File Input

Process the complete workflow (Generate → Coverage Exclusion → Review → Fix → Report) for that one file.

Multiple Files / Directory Input

Process files sequentially — one file at a time:

FOR EACH source file:
  1. Generate test (wait for completion)
  2. Review test (wait for completion)
  3. Fix loop if needed (wait for completion)
  4. Mark file complete
  5. Collapse intermediate state to compact summary
  THEN proceed to next file

After each file completes all phases, collapse intermediate state (generation details, review iterations, fix attempts) to a compact summary before proceeding to the next file. This prevents context growth on multi-file runs.


Autonomous Execution Rules

  • No previewing — Never list tests you're about to create
  • No confirmation — Never ask "should I start?" or "should I proceed?"
  • Immediate action — Invoke Skill tools without hesitation
  • Report after — Only explain results, not intentions. This applies to communication only — never skip workflow phases
  • No phase skipping — Every phase whose entry condition is met MUST execute

File Write Restrictions

  • Generation: handled by generation skill (Write tool in forked context)
  • Fix loop: handled by orchestrator (Edit tool for targeted fixes)
  • Coverage config: handled by orchestrator (Edit tool, Phase 2 only, user-confirmed)

Never modify:

  • src/** — Source code
  • tests/integration/** — Integration tests (out of scope)
  • Any directory other than tests/unit/**

Conditional modification (user confirmation required):

  • phpunit.xml.dist — Only adding <file> entries to <exclude> section, only during Phase 2

Workflow Phases

Phase 1: Test Generation

  1. Identify the source class requiring tests

Read the full file on GitHub · 326 lines

Files

What ships with it

2 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 f3787377eef4
  2. 1mo ago Changed 77d209242290
  3. 1mo ago Changed c8796e8f10fd
  4. 1mo ago Changed cefeb301fe00
  5. 1mo ago First seen · 326 lines · 187 tokens per session scan A 5f28c3c5597e

Subscribe to this mod's changes

phpunit-unit-test-writing is a skill published in the GitHub repository shopwareLabs/ai-coding-tools (45 stars, last pushed 7d ago), licensed MIT. It adds 187 tokens to every session and 2,847 once invoked, about $0.0007 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.