michtio/craftcms-claude-skills / skills/craft-project-setup
craft-project-setup
VerifiedScaffold Claude Code configuration specifically for Craft CMS projects. Generates CLAUDE.md and .claude/rules/ files tailored to the project type (plugin, site, module, hybrid, or monorepo). Only for Craft CMS projects — not for Next.js, Laravel, or other frameworks.
templates/plugin/.claude/rules/testing.md
View on GitHub# Testing
- Write tests alongside each layer, not after. Service tests with the service, controller tests with the controller.
- Pest over PHPUnit. Run the suite from the plugin's own root so its `phpunit.xml.dist` `<env>` pins load: `ddev exec --dir /var/www/html/vendor/{{composerName}} vendor/bin/pest` when the plugin is installed in a host project, `ddev exec vendor/bin/pest` when the plugin has its own DDEV project. Never `ddev craft pest/test` from a host project root (Craft boots against the development database), and never `vendor/bin/pest` on the host.
- `--filter=ClassName` for targeted runs during development. Full suite before committing.
- `->site('*')` and `->status(null)` in test queries to avoid false negatives from site/status scoping.
- `actingAs($user)->post()` for controller tests. Assert both HTTP status and DB state.
- Test edge cases: empty results, missing entities, expired elements, permission denials.
- Factories for element setup. Never rely on database seeding or fixture ordering.
- Multi-site: test propagation behavior when the plugin touches elements across sites.
- Queue jobs: dispatch and assert the job processed correctly, not just that it was pushed.
- `Craft::$app->getProjectConfig()->muteEvents = true` when tests modify project config directly.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |