/ Каталог / Песочница / craftcms-claude-skills
● Сообщество michtio ⚡ Сразу

craftcms-claude-skills

автор michtio · michtio/craftcms-claude-skills

A Claude Code skill bundle that knows Craft CMS 5 inside out — writes modules, Twig templates, migrations, and GraphQL queries the Craft way.

Production-ready skills, agents and project templates that teach Claude Code how Craft CMS 5 actually works. Instead of generic PHP suggestions, you get idiomatic Craft patterns — proper element queries, field handles, module structure, Pixel & Tonic conventions.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

craftcms-claude-skill.replay ▶ готово
0/0

Установка

Репозиторий автора · Официальная документация Claude Skills

Сценарии использования

Реальные сценарии: craftcms-claude-skills

Scaffold a custom Craft CMS module without leaving Claude Code

👤 Craft CMS developers building site-specific modules ⏱ ~30 min intermediate

Когда использовать: You need a new module and don't want to hand-copy another one as a template.

Поток
  1. Describe the module's job
    Use 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
  2. Wire it up
    Register the module in config/app.php and add the bootstrap entry.✓ Скопировано
    → Config diff shown; module loads without errors on craft setup/check
  3. Add an element query
    Add 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
Сочетать с: filesystem · mysql

Refactor a mess of Twig templates into idiomatic Craft

👤 Front-end devs inheriting a Craft site with sketchy templates ⏱ ~45 min intermediate

Когда использовать: You took over a Craft project and the templates are full of raw SQL, inline PHP, and cache tags that don't work.

Поток
  1. Point Claude at the worst template
    Using craftcms-claude-skills, review templates/_entries/blog.twig and rewrite it using proper element queries and {% cache %} tags.✓ Скопировано
    → Refactored template with craft.entries, section handle, and correct cache scoping
  2. Extract reusable macros
    Pull the card markup into a macro in _macros/cards.twig and include it properly.✓ Скопировано
    → Macro file created; includes use {% from %} syntax

Итог: Templates that load faster and future devs can actually read.

Подводные камни
  • Cache tags wrap dynamic user data and show wrong content — Use {% cache %} with globally keyed variations, never around authenticated user data
Сочетать с: filesystem

Write a safe Craft migration for content model changes

👤 Craft devs shipping schema changes to production ⏱ ~30 min advanced

Когда использовать: You're adding a new field or restructuring an existing one and need a migration that won't eat data.

Поток
  1. Describe the change
    Use craftcms-claude-skills. Write a Craft migration that adds a 'featuredAt' datetime field to the News section, with a safe backfill from postDate.✓ Скопировано
    → Migration file with safeUp / safeDown; uses Craft's Fields service, not raw schema hacks
  2. Dry-run in dev
    Walk me through testing this with ./craft migrate/up --interactive=0 on a staging copy first.✓ Скопировано
    → Step-by-step checklist including DB backup

Итог: A migration you can ship on a Friday without panic.

Подводные камни
  • Forgetting to register the field type in project config — Always run craft project-config/write after the migration and commit the YAML
Сочетать с: mysql · git

Комбинации

Сочетайте с другими MCP — эффект x10

craftcms-claude-skill + filesystem

Skill provides Craft patterns; filesystem lets Claude actually apply them in your project

Apply the craftcms-claude-skills module scaffold to my current project directory.✓ Скопировано
craftcms-claude-skill + mysql

Inspect Craft's content tables while writing migrations

Show me the current schema of the elements_sites table before I write this migration.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
module_scaffold module name, element types Starting a new module 0
field_generator field name, type, handle Adding a custom field type 0
twig_refactor template path Cleaning up legacy templates 0

Стоимость и лимиты

Во что обходится

Квота API
None
Токенов на вызов
Moderate — reference files load on demand
Деньги
Free
Совет
Reference the skill by name only when working on Craft code; it adds context overhead to unrelated tasks.

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: No credentials
Исходящий трафик: None — local prompts and files only

Устранение неполадок

Частые ошибки и исправления

Claude generates Craft 3-era code (craft()->elements)

Mention 'Craft CMS 5' explicitly; the API namespace is craft\elements in 5.x

Проверить: grep -r 'craft()->' src/ should return nothing in Craft 5 code
Migration runs but field doesn't appear in CP

Run ./craft project-config/write and ./craft project-config/apply — project config drift is the usual cause

Проверить: ./craft project-config/diff

Альтернативы

craftcms-claude-skills в сравнении

АльтернативаКогда использоватьКомпромисс
Raw Claude CodeSimple Twig-only tweaks that don't need Craft-specific idiomsGeneric PHP suggestions, often wrong for Craft
symfony-hexagonal-skillYou're on Symfony, not CraftDifferent framework conventions

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills