/cms-cultivator:test-scaffoldingfrom cms-cultivator
Generates test scaffolding for untested PHP and JavaScript code. Supports unit, integration, e2e, and data tests using Jest, Cypress, and PHPUnit.
Ships in cms-cultivator. 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.
Automatically generate test scaffolding for untested code.
Good tests are an investment, not a cost.
/test-generate command): Full project test coverage with test plansThis skill provides rapid test scaffolding. For complete coverage, use comprehensive test generation + manual refinement.
Activate this skill when the user:
Before generating test scaffolding, determine:
PHP (Drupal/WordPress):
JavaScript:
Unit tests (highest priority):
Don't test (waste of time):
Mock/stub:
Don't mock:
Critical code (90%+ coverage target):
Standard code (70-80% coverage target):
Low priority (minimal coverage ok):
AAA pattern (standard):
Test name convention:
test_methodName_scenario_expectedBehavior()test_calculateTotal_withDiscount_returnsReducedPrice()User requests tests for code
↓
Analyze code type (function/class/endpoint/UI)
↓
Determine test type (unit/integration/e2e)
↓
Identify framework (PHPUnit/Jest/Cypress)
↓
Determine what to test (happy/edge/error)
↓
Identify dependencies to mock
↓
Generate test scaffolding with descriptive names
↓
Include AAA structure comments
Identify:
Unit Tests - For isolated logic:
Integration Tests - For component interaction:
E2E Tests - For user workflows:
Complete test templates are available for reference:
Use these templates as starting points, adapting for the specific code being tested.
Generate basic test structure first:
For each public method:
Identify what needs mocking:
Check:
When user shows a class with 2-3 methods:
Example Response:
"I'll generate PHPUnit tests for your UserManager class.
I see 3 public methods:
- getUser() - retrieves user data
- createUser() - creates new user
- deleteUser() - removes user
I'll create:
- Unit tests for getUser() (no database needed)
- Integration tests for createUser() and deleteUser() (require database)
[Generates test file with 6-8 test methods covering happy paths,
error cases, and edge cases]
This gives you ~80% coverage to start."
When user shows WordPress function using WP APIs:
Example Response:
"For WordPress functions using WP_Query, you'll want an integration test.
I'll generate a WP_UnitTestCase test that:
1. Creates test posts using the factory
2. Calls your function
3. Verifies the query results
4. Cleans up automatically in tearDown()
[Generates test code]
The test uses wp_insert_post() to create test data."
When user shows Drupal service with dependencies:
Example Response:
"I'll generate unit tests for your DataProcessor service.
I see it depends on:
- EntityTypeManagerInterface
- LoggerInterface
I'll:
1. Create mocks for these dependencies
2. Test each public method in isolation
3. Verify interactions with dependencies
4. Add @covers annotations for coverage tracking
[Generates test file with mocked dependencies]
This keeps tests fast by avoiding database calls."
When user shows JS function or React component:
This skill complements the /test-generate slash command:
This Skill: Automatically triggered during conversation
/test-generate Command: Explicit batch generation
testCreateUserWithValidData() not testCreateUser())Example 1: Simple class
User: "I wrote this UserManager class, need tests"
[Shows class with 3 methods]
Skill: "I'll generate PHPUnit tests for your UserManager class.
I see 3 public methods: createUser(), getUser(), deleteUser().
I'll create tests for the happy path and error cases for each.
[Generates test file]
This gives you 80% coverage to start. You may want to add edge case
tests for boundary conditions."
Example 2: WordPress function
User: "How do I test this WordPress function?"
[Shows custom function that uses WP_Query]
Skill: "For WordPress functions using WP_Query, you'll want an
integration test. I'll generate a WP_UnitTestCase test that:
1. Creates test posts using the factory
2. Calls your function
3. Verifies the query results
[Generates test code]
The test uses wp_insert_post() to create test data, then cleans up
automatically in tearDown()."
Example 3: React component
User: "Need tests for this React component"
[Shows UserProfile component]
Skill: "I'll create React Testing Library tests for your UserProfile component.
I see it:
- Displays user data from props
- Has edit button that calls onEdit callback
- Shows loading state
I'll generate tests for:
1. Rendering with user data
2. Clicking edit button
3. Loading state display
[Generates test file using React Testing Library]
These tests verify the component behavior from a user perspective."
Don't. Test public interface instead. If private method needs testing, consider extracting to separate class.
// Avoid static methods when possible
// If you must, test directly
$result = MyClass::staticMethod($input);
$this->assertEquals($expected, $result);
// Use transactions for rollback
protected function setUp(): void {
parent::setUp();
$this->database->beginTransaction();
}
protected function tearDown(): void {
$this->database->rollbackTransaction();
parent::tearDown();
}
it('fetches user data', async () => {
const user = await fetchUser(123);
expect(user.name).toBe('John Doe');
});
// Or with promises
it('fetches user data', () => {
return fetchUser(123).then(user => {
expect(user.name).toBe('John Doe');
});
});
Drupal\Tests\mymodule\Unittest_method_name()$this->assertIsArray()What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
PHP, JavaScript, Jest, Cypress
test-generation, unit-testing, integration-testing, e2e-testing, phpunit
cms-cultivator@claude-toolbox is listed by kanopi/claude-toolbox — review the source before installing
npx claudepluginhub kanopi/claude-toolbox --plugin cms-cultivator30 skills in this plugin
/browser-validatorAutomatically validate implementations in real browsers after code is written or when user says "test this", "test what you built in the browser", "check it in a real browser", or "validate at the breakpoints". Uses Chrome DevTools MCP to test responsive breakpoints (320px, 768px, 1024px), check accessibility compliance (WCAG AA contrast, keyboard navigation, ARIA), validate interactions, and generate detailed technical reports with file paths and specific fixes./code-standards-checkerRun the right linting, formatting, and static-analysis commands after changing code, and check it against PHPCS, ESLint, WordPress Coding Standards, or Drupal Coding Standards. Reads the scripts blocks in composer.json and package.json to find the project's own commands, runs auto-fix before check-only and verifies after, and picks the most specific level (theme, plugin, module, or project root) covering the changed files. Invoke when the user mentions "coding standards", "code style", "linting", "lint", "PHPCS", "phpcbf", "PHPStan", "Rector", "ESLint", "stylelint", "twig-lint", asks what to run after editing PHP, Twig, JS, SCSS, or CSS, or asks whether code follows conventions./commit-message-generatorAutomatically generate conventional commit messages when user has staged changes and mentions committing. Analyzes git diff and status to create properly formatted commit messages following conventional commits specification. AI attribution comes from the tool's own trailer (Claude Code's Co-Authored-By); the skill never adds a second one. Invoke when user mentions "commit", "staged", "committing", or asks for help with commit messages./composer-patch-generatorGenerate and maintain patches for Composer-installed packages (Drupal contrib modules, WordPress packages, PHP libraries) using cweagans/composer-patches. Invoke when the user needs to modify a contrib or vendor package, mentions "composer patch", "patch a module", "patch a contrib module", "cweagans", "diff -ruN", "extra.patches", or needs a package change that applies cleanly in CI. Covers generating diff -ruN patches, handling new files, wiring composer.json, and verifying the patch applies./composer-security-updateThis skill should be used when the user asks to "run a Composer security update", "validate the security PR", "check the automated security PR", "run composer audit", "patch the security advisories", "update the vulnerable packages", "fix the CVEs in this project", "apply the Drupal core security release", or hands over a "Security Advisory:" Teamwork task or a `security/tw-*` pull request. Use it whenever a Drupal or WordPress Composer project needs its advisories resolved, even if the user only says "are we vulnerable?" or names a single CVE. It finds the PR the Kanopi security dashboard already opened, validates its branch locally (composer audit before and after, DDEV snapshot and refresh, update hooks, config drift, theme builds), and reports each advisory as cleared or blocked. Fix-ups and the PR update wait for user approval. It never creates a task, branch, or PR. Dependabot bumps belong to dependabot-branch-validation; patching contrib code belongs to composer-patch-generator./coverage-analyzerAutomatically analyze test coverage when user asks which code is tested, mentions coverage gaps, or shows code asking about testing. Identifies untested code paths and suggests test additions. Invoke when user asks "what's not tested?", "coverage", "untested code", or "which tests are missing?".Other plugins' skills for the same job