Scaffold a custom Craft CMS module without leaving Claude Code
언제 쓸까: You need a new module and don't want to hand-copy another one as a template.
사전 조건
- Craft CMS 5 project set up locally — composer create-project craftcms/craft my-project
- Skill cloned — git clone https://github.com/michtio/craftcms-claude-skills ~/.claude/skills/craftcms-claude-skills
흐름
-
Describe the module's jobUse craftcms-claude-skills. Create a new module called 'Inventory' that registers a custom element type for warehouse items.✓ 복사됨→ Claude scaffolds modules/inventory/ with src/Inventory.php, elements/WarehouseItem.php, and a config entry
-
Wire it upRegister the module in config/app.php and add the bootstrap entry.✓ 복사됨→ Config diff shown; module loads without errors on craft setup/check
-
Add an element queryAdd a WarehouseItemQuery class with a custom 'sku' parameter that filters on the content table.✓ 복사됨→ Query class with proper WHERE clauses, not raw SQL soup
결과: A working Craft module that follows Pixel & Tonic conventions — ready for your first migration.
함정
- Claude writes Craft 3/4 style code — Explicitly state Craft CMS 5 in every prompt — the API surface changed