craftcms-claude-skills / project-template
CLAUDE.md82 starsChanged 4 months agoMITView on GitHub
@.claude/rules/coding-style.md @.claude/rules/architecture.md @.claude/rules/git-workflow.md @.claude/rules/scaffolding.md @.claude/rules/security.md Use WebFetch on these URLs when skills don't cover a specific pattern. Check .claude/skills/ in this repo for project-specific patterns.
In this repository15 other files it gives its agents.
- docs/agents.mdAGENTS.md
- reference/CLAUDE.mdCLAUDE.md
- craft-cloudSkill
- craftcmsSkill
- craft-content-modelingSkill
- craft-garnishSkill
- craft-pestSkill
- craft-php-guidelinesSkill
- craft-plugin-releaseSkill
- craft-pluginsSkill
- craft-project-setupSkill
- craft-siteSkill
- craft-twig-guidelinesSkill
- ddevSkill
- servdSkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 59
Work with Craft, not against it: Follow core patterns: project config, element lifecycle, soft delete, GC, events.
- Very specific: line 73
Use WebFetch on these URLs when skills don't cover a specific pattern.
- Very specific: line 77
Check .claude/skills/ in this repo for project-specific patterns.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Craft CMS 5 Plugin Development
@.claude/rules/coding-style.md @.claude/rules/architecture.md @.claude/rules/git-workflow.md @.claude/rules/scaffolding.md @.claude/rules/security.md
Environment
ddev composer check-cs # ECS code style
ddev composer fix-cs # ECS auto-fix
ddev composer phpstan # PHPStan analysis
ddev craft pest/test # Pest tests
ddev craft up # Migrations + project config
ddev composer install # Install deps (auto-runs craft up)Craft CMS Plugin Structure
src/
├── Forum.php # Entry point — class name matches the plugin handle in PascalCase
├── assetbundles/ # CP asset bundles
├── base/ # Abstract base classes, shared traits
├── behaviors/ # Yii2 behaviors
├── console/controllers/ # CLI commands
├── controllers/ # CP web controllers
├── db/ # Table constants
├── elements/ # Custom element types
│ ├── actions/ # Element index actions
│ ├── conditions/ # Element condition rules
│ ├── db/ # Element queries
│ └── exporters/ # Element exporters
├── enums/ # PHP backed enums
├── errors/ # Custom exceptions
├── events/ # Event classes
├── fieldlayoutelements/ # Custom field layout elements
├── fields/ # Custom field types
├── gql/ # GraphQL types, queries, mutations
├── helpers/ # Static utility helpers
├── jobs/ # Queue jobs
├── migrations/ # Database migrations + Install.php
├── models/ # Settings, data models
├── records/ # ActiveRecord classes
├── services/ # Business logic services
├── templates/ # CP Twig templates
├── translations/ # Translation files
├── utilities/ # CP utilities
├── validators/ # Custom validators
├── variables/ # Twig variable classes
├── web/ # Twig extensions, asset bundles
└── widgets/ # Dashboard widgetsArchitecture
- Work with Craft, not against it. Follow core patterns: project config, element lifecycle, soft delete, GC, events.
- Abstract base classes for shared controller structure. Traits for cross-cutting concerns.
- Element operations in services, not controllers or helpers.
- DateTimeHelper in elements/queries, Carbon in services.
- Project config for settings that sync. Dedicated paths for managed entities.
Craft::$app->onInit()for deferred initialization needing a fully-booted app.
Documentation
- Plugin development guide: https://craftcms.com/docs/5.x/extend/
- Class/API reference: https://docs.craftcms.com/api/v5/
- Scaffolding (Generator): https://craftcms.com/docs/5.x/extend/generator.html
- Craft source code:
vendor/craftcms/cms/src/
Use WebFetch on these URLs when skills don't cover a specific pattern.
Project-Specific Skills
Check .claude/skills/ in this repo for project-specific patterns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

