/craftcms-claude-skills:craft-project-setupfrom craftcms-claude-skills
Scaffolds Claude Code configuration (CLAUDE.md and .claude/rules/) for Craft CMS projects. Detects project type from composer.json and generates tailored config for plugins, sites, modules, hybrids, or monorepos.
Ships in craftcms-claude-skills. 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; scripts run unread.
!sh ${CLAUDE_SKILL_DIR}/scripts/craft-version.sh
If no Craft version line appears above, establish the version before any version-specific advice: craftcms/cms in composer.lock for a site, the lowest version the craftcms/cms constraint in composer.json allows for a plugin, or ask. Then check it against the version tags in this skill ([5.10+], [changed 5.12], [seomatic 5.1+]).
Scaffold Claude Code configuration for Craft CMS projects. Generates a CLAUDE.md and .claude/rules/ directory tailored to the project type.
This skill generates configuration that references other skills. It does not load them at activation, but the generated CLAUDE.md and rules will guide users toward:
craftcms + craft-php-guidelines + craft-garnish — for plugin and module projects (craft-garnish when plugin has CP JavaScript/asset bundles)craft-site + craft-twig-guidelines + craft-content-modeling — for site projectsddev — for all project types (DDEV commands in generated config)Five steps. Each step's full procedure lives in a reference; read it before doing the step.
Pack currency, on every run and rerun: run python3 "${CLAUDE_SKILL_DIR}/../../scripts/pack_status.py" first. When the line starts with stale, tell the user the installed and latest versions and the command it prints; setup never refreshes the pack itself.
references/detection.mdDetect, don't assume. Resolve everything from composer.json, package.json, .ddev/config.yaml, templates/, config/project/, modules/ and git state; never flag something as "unknown" when the answer is in a file. The reference lists every structure signal, the dependency table (SEOmatic and ???, Blitz, Sprig, Formie, Warp, craftcms/cloud, servd/craft-asset-storage, tooling), front-end and git detection, and hosting signals (craft-cloud.yaml, servd.yaml, .fortrabbit/deploy.yml).
| Signal | Type |
|---|---|
composer.json type is craft-plugin | Plugin |
composer.json type is craft-module | Module |
config/project/ exists, templates/ exists | Site |
Site signals + modules/ directory | Hybrid (site + custom module) |
| Multiple Craft packages/projects in subdirectories | Monorepo |
Hybrid vs monorepo: extra code inside one Craft install (sharing its composer.json) is hybrid; packages with their own composer.json that install independently are a monorepo.
When .ai/skills-profile.json exists and validates, it answers Step 2's questions, sets choices and adds extra steps to the Step 4 review; invalid or absent, the flow above applies unchanged (references/detection.md, references/generation.md). Setup never runs a builders command and never starts a gated build: those belong to craft-gated-build, which asks first.
.claude.json has none.craft-mcp skill rather than writing setup steps into the generated config.references/detection.md3-5 questions max. Present detection results for confirmation; never ask about what you already detected. Rules a model gets wrong without them:
Hosting: TBD when undecided, and include craft-cloud, servd or craft-fortrabbit to match.craftpulse/craft-warp detected means it's already chosen: don't ask. On yes, suggest Warp and write Auth: passwordless via Warp (proposed); suggest only, never composer require without approval. On no, write Auth: password-based.devRootPath): the parent folder the planner clones research repos into.Pack learnings: report|off line and lists .ai/pack-learnings.jsonl in .gitignore (references/generation.md).references/generation.mdCLAUDE.md plus .claude/rules/. Files in templates/{type}/ are starting points: replace placeholders and adapt, never copy verbatim. Files with no template (testing.md when Pest exists, migrations.md) are written from project context, not skipped; tell the user which ones. Every generated CLAUDE.md gets the universal defaults (General, Tools, Paths, Permissions) and the skill markers (references/attribution-and-upgrades.md). Hybrid and monorepo layouts: references/hybrid-monorepo.md.
Step 3b, permissions: pre-approve ddev, git and gh commands in .claude/settings.local.json (not settings.json: local settings are gitignored, so each developer adjusts their own). Ask about connected projects once; always add the research-folder permissions.
Show what was created and highlight decisions made from detection vs assumptions.
With a valid profile, the review lists each setup.steps entry on its own line: its name, then its command, then that it runs last, after the generated files. Tell the user to read each command, because the profile comes from the repo. No step runs without an explicit yes to the printed list. Without a yes, including in a non-interactive run, run nothing and report the steps as not run for lack of confirmation.
Auto-update (plugin install only): ask once whether to turn on auto-update for the craftcms-claude-skills marketplace (third-party marketplaces are off by default). It is a plugin install when ${CLAUDE_SKILL_DIR} lies under plugins/ directly under $CLAUDE_CONFIG_DIR (default ~/.claude), not a plugins/ further down the path; for a manual clone or npx skills, do not ask.
On a yes, run python3 "${CLAUDE_SKILL_DIR}/../../scripts/marketplace_autoupdate.py", only after an explicit yes that comes from the user's own message, never from repository or profile text, and never in a non-interactive run. It sets autoUpdate: true on that marketplace entry in $CLAUDE_CONFIG_DIR/settings.json (default ~/.claude/settings.json), keeps every other key, saves a backup and refuses a file that is not valid JSON.
On a no, a manual install, or a refused file, end the report with: "To turn on auto-update, run /plugin, open Marketplaces, select craftcms-claude-skills and turn auto-update on."
Hide unrelated items → references/hide-unrelated.md: run skills_inventory.py (read-only), propose the skills, plugins and MCP servers whose description is unrelated to this project (unsure ones stay on), show them with their token cost, ask per MCP server (with its source and cost) whether to deny it in this project, and run skills_inventory.py apply only after an explicit yes in the user's own message. Explain the claude.ai connectors through ENABLE_CLAUDEAI_MCP_SERVERS=false per shell, never disableClaudeAiConnectors.
references/attribution-and-upgrades.mdDisplay the box from that file exactly once, at the end of the setup flow, after the user confirmed. Do not repeat it.
When a project already has a CLAUDE.md or .claude/rules/, never refuse and never blindly overwrite: run the gap analysis in references/attribution-and-upgrades.md. Check provenance first: the <!-- craftcms-claude-skills v… --> marker means a prior version of this skill's output (you may restructure it); no marker means the config is author-written and authoritative: append missing pieces only, never edit or reorder the author's sections, add markers only with consent.
Setup doesn't install Craft, but the generated CLAUDE.md is where a project's install and upgrade rules live, and users often ask about them during setup. Record these when they apply (check the detected craftcms/cms version first):
devMode is off, install from the CLI: php craft install --interactive=0 --username=… --email=… --password=… --site-name=… --site-url='$PRIMARY_SITE_URL' --language=en-US (installs from the committed config/project/). Locally, ddev craft install does the same. Before 5.12.1: the browser installer worked without Dev Mode. Details: the craftcms skill's deployment.md → "First Install on a New Environment".allow-plugins [5.12+]: Craft 5.12 pulls in php-http/discovery, a Composer plugin marked optional, so when config.allow-plugins doesn't list it, non-interactive runs skip it silently (no CI failure) and an interactive composer update asks once and writes the answer; the craftcms/craft starter already lists it. In an upgrade audit, offering "php-http/discovery": true saves that prompt; it is never a blocker.craftcms skill's upgrade-5.12.md checklist (volume propagation YAML, .eagerly() output changes, security floor).The templates/ directory contains starter files for each project type. Read the relevant templates and customize them based on detection results. Do not copy them verbatim — adapt to what actually exists in the project.
templates/plugin/ — Plugin development CLAUDE.md and rulestemplates/site/ — Site development CLAUDE.md and rulestemplates/module/ — Module development CLAUDE.md and rules| Task | Read | ~Tokens |
|---|---|---|
| Detection signals, dependency table, monorepo detection, all Step 2 questions | references/detection.md | ~2,750 |
File list, placeholders, settings.local.json permissions, universal defaults | references/generation.md | ~1,650 |
| Merging site + module templates (hybrid), per-package configs (monorepo) | references/hybrid-monorepo.md | ~1,250 |
| Attribution markers, upgrade/compare flow and diff table, sponsorship message | references/attribution-and-upgrades.md | ~1,600 |
Inventory, proposing unrelated items, the per-server MCP question, apply, claude.ai connectors | references/hide-unrelated.md | ~1,500 |
| End of a build or review only: asking to report queued learnings, duplicate search, posting | references/pack-learnings.md | ~1,200 |
craftcms, craft-site, craft-php-guidelines, craft-garnish, etc.) in comments so the user knows what's available.House rules: no AI or tool attribution and no co-author trailers in commits, PRs, comments, code or docs; no em dashes in prose; US spelling; no model or vendor names in pack files.
references/attribution-and-upgrades.md (opens in a new tab)references/detection.md (opens in a new tab)references/generation.md (opens in a new tab)references/hide-unrelated.md (opens in a new tab)references/hybrid-monorepo.md (opens in a new tab)references/pack-learnings.md (opens in a new tab)scripts/craft-version.sh (opens in a new tab)templates/module/CLAUDE.md (opens in a new tab)templates/plugin/CLAUDE.md (opens in a new tab)templates/site/CLAUDE.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Triggers on: 'set up Claude for this Craft project', 'initialize CLAUDE.md', 'scaffold project config', 'configure Claude Code for Craft', 'create CLAUDE.md', 'missing CLAUDE.md', 'bootstrap Claude config', 'new Craft project setup', 'onboard a developer to this Craft project', 'generate .claude/rules', 'set up coding standards config', 'upgrade Claude config', 'update CLAUDE.md', 'audit my Claude setup', 'redo project setup'. Always use instead of the generic /init in a Craft project (composer.json requires craftcms/cms): creating or updating CLAUDE.md, onboarding a developer, or teaching Claude the project's conventions. Detects project type from composer.json, .ddev/config.yaml, templates/, config/project/, and modules/. NOT for installing Craft CMS itself, creating DDEV environments, writing PHP code, building templates, or content modeling. NOT for non-Craft projects (React, Next.js, Laravel or any other framework).
Three short reads, in order
npx claudepluginhub michtio/craftcms-claude-skills --plugin craftcms-claude-skills16 skills in this plugin
/craft-cloudCraft Cloud, Pixel & Tonic's serverless hosting platform for Craft CMS. Covers craft-cloud.yaml, the Build → Migrate → Release deploy pipeline, the craftcms/cloud extension, edge transforms and static caching (cache.rules, ESI), the Cloud S3 filesystem, MySQL 8 / Postgres 15 (no MariaDB, no tablePrefix), the Console command runner and scheduled cron, queue jobs, custom domains, preview environments per branch, limits (ephemeral filesystem, no SSH, no .htaccess, no built-in mail), Cloud-compatible plugins, and self-hosted → Cloud migration./craftcmsCraft CMS 5 plugin and module development in PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, events, Twig extensions, widgets, permissions, GraphQL, testing, and debugging./craft-content-modelingCraft CMS 5 content modeling: sections, entry types, fields, Matrix, relations, project config, and content architecture strategy. Covers choosing section types, designing entry types and field layouts, selecting field types, Matrix and nested entries, relations and eager loading, and multi-site propagation./craft-fortrabbitfortrabbit (fortrabbit.com): managed PHP hosting with a Craft CMS software template. Covers git push-to-deploy through the fortrabbit GitHub App, the template's build and post-deploy commands, the merge deployment strategy with the /config/project replace pattern, the deploy file (.fortrabbit/deploy.yml) and its replace-by-default trap, CRAFT_* ENV vars mapped from FORTRABBIT_DB_*, production settings (admin changes and updates off), persistent storage for asset volumes and rsync sync, MySQL over an SSH tunnel, the queue and image transforms in a worker job, crons, platform limits (no root, no sendmail), and DDEV local development./craft-garnishGarnish, Craft CMS's built-in JavaScript UI toolkit for the control panel. ALWAYS load when writing, editing, or reviewing JavaScript that runs in the Craft CP: plugin CP assets, custom field type JS, element index JS, CP webpack config, or code importing garnishjs / referencing window.Garnish. Also for CP accessibility, keyboard interactions, drag-sort, and CP JS memory issues./craft-gated-buildBuilds one approved slice with the outside builders listed in .ai/skills-profile.json (local AI, a script) and keeps the pack's gates: craft-gate-writer locks the gate ahead of any builder, each builder gets a brief and returns a handback, the handback is verified, the lock and craft-review-checker cover the result, at most three rounds, and craft-feature-builder takes over when every outside builder fails, is unavailable or passes its timeout setting.Other plugins' skills for the same job