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.
npx agentmods add skills/caravanglory/magehub/testing-phpunitnpx skills add caravanglory/magehub --skill testing-phpunitgit clone --depth 1 https://github.com/caravanglory/magehubWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00032 | $0.02474 |
| Opus 5 | $0.00016 | $0.01237 |
| Sonnet 5 | $0.00006 | $0.00495 |
| Haiku 4.5 | $0.00003 | $0.00247 |
Grade A, and why
testing-phpunit 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 331 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PHPUnit Unit Tests
Activation
Use When
- The task is to write or update Magento PHPUnit unit tests for isolated PHP classes without framework bootstrap.
- The task mentions Test/Unit, PHPUnit mocks, data providers, exception assertions, or testing service logic.
Do Not Use When
- The behavior requires Magento integration tests, database fixtures, web API functional tests, or full ObjectManager bootstrap.
- The task is only to manually smoke-test UI behavior.
Required Inputs
- Class under test, constructor dependencies, observable behavior, edge cases, and the project PHPUnit version/config path.
- Whether collaborators should be mocks, stubs, real value objects, or in-memory fakes.
Workflow
- Read the production class and nearby tests before deciding the test shape.
- Instantiate the real class under test with mocks for direct dependencies only.
- Assert behavior, return values, state changes, exceptions, and meaningful collaborator side effects.
- Use data providers for repeated input matrices and keep test method names behavior-oriented.
Guardrails
- Do not use ObjectManager, Magento bootstrap, database fixtures, or integration-test helpers in unit tests.
- Do not mock the class under test.
- Ask before refactoring production code solely to make tests pass when the behavior contract is unclear. (approval required)
Verification
- Run the targeted PHPUnit test file or Test/Unit directory through the project environment wrapper.
- Run a broader suite when shared service behavior or public APIs are touched.
- Report skipped tests or unavailable PHPUnit config explicitly.
Output Contract
- State test files added/updated, behaviors covered, mocks used, and exact PHPUnit command result.
- Call out coverage gaps that remain outside unit-test scope.
Magento 2 Unit Test Strategy
Unit tests validate individual classes in isolation without the Magento
framework, database, or object manager. They run in milliseconds and catch
logic errors immediately. Place test classes in Test/Unit/ mirroring the
production namespace.
What ships with it
5 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.
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.
- 2d ago First seen · 331 lines · 32 tokens per session scan A 9fb84c03347e
testing-phpunit is a skill published in the GitHub repository caravanglory/magehub (2 stars, last pushed 2mo ago), licensed MIT. It adds 32 tokens to every session and 2,474 once invoked, about $0.0002 per session on Opus 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-31.
Other skills, from other repositories
pest-testing
Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to…
phpunit-skill
Generates PHPUnit tests in PHP. Covers assertions, data providers, mocking, and test doubles. Use when user mentions "PHPUnit", "TestCase", "assertEquals", "PHP test". Triggers on: "PHPUnit", "TestCase PHP", "assertEquals PHP", "PHP unit test".
codeception-skill
Generates Codeception tests in PHP covering acceptance, functional, and unit testing. BDD-style with Actor pattern. Use when user mentions "Codeception", "$I->amOnPage", "$I->see", "Cest". Triggers on: "Codeception", "$I->amOnPage", "AcceptanceTester", "Codeception PHP", "Cest".
laravel-testing
Laravel 13 testing with Pest PHP 4 or PHPUnit 12. Use when writing feature tests, unit tests, or any test code in a Laravel application. Triggers on tasks involving HTTP tests, model factories, database assertions, mocking facades, authentication testing, or test organisation patterns.
phpunit-unit-test-writing
Use this skill when the user asks to write, generate, create, or add PHPUnit unit tests for a Shopware 6 source class — phrases like "write unit tests for X", "generate tests for ClassName", "create PHPUnit tests", "add test coverage", "test this class", "cover this with tests", "I need tests for", "unit test this"…
php-conventions
PHP code conventions covering PHP 8.2+ strict types, PSR-12 formatting, PHPStan/Psalm static analysis, PHPUnit, Composer dependency management, PSR-4 autoloading, and security. Load when writing or reviewing PHP code.