agentleFS
michtiomichtio/craftcms-claude-skills/project-template/CLAUDE.md

craftcms-claude-skills / project-template

CLAUDE.md90 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 @.claude/rules/migrations.md @.claude/rules/testing.md Be critical. We're equals — push back when something doesn't make sense. Do not excessively use emojis. Do not include AI attribution in commits, PRs, issues, or comments. Do not include "Test plan" sections in PR descriptions. Use ddev shorthand commands: ddev composer, ddev craft, ddev npm. Never run php, composer, or npm on the host — everything goes through DDEV. Use gh for all GitHub operations. Nothing gets built without an approved…

The file

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not excessively use emojis.

    line 15
  2. Distinctive:

    Do not include "Test plan" sections in PR descriptions.

    line 17
  3. Very specific:

    Use ddev shorthand commands: ddev composer, ddev craft, ddev npm.

    line 21
  4. Very specific:

    Use gh for all GitHub operations.

    line 23
  5. Very specific:

    Use WebFetch on these URLs when skills don't cover a specific pattern.

    line 89
  6. Very specific:

    Check .claude/skills/ in this repo for project-specific patterns.

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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 @.claude/rules/migrations.md @.claude/rules/testing.md

General

Be critical. We're equals — push back when something doesn't make sense.

Do not excessively use emojis. Do not include AI attribution in commits, PRs, issues, or comments.

Do not include "Test plan" sections in PR descriptions.

Tools

Use ddev shorthand commands: ddev composer, ddev craft, ddev npm. Never run php, composer, or npm on the host — everything goes through DDEV.

Use gh for all GitHub operations.

Spec-driven development

Nothing gets built without an approved spec. A spec is two documents in specs/YYYY-MM-DD-<slug>/ (git-ignored, e.g. internal-docs/specs/, when the repo is public):

  • prd.md: what and why. Numbered requirements (R1, R2, ..., each MUST or SHOULD), Given/When/Then acceptance criteria tagged with their R id, non-goals, constraints, open questions (empty before approval), decisions log.
  • plan.md: how. Architecture decisions and vertical slices (S1, S2, ...), each listing its R ids and a runnable verification gate.

Only the project owner approves; no build before both are approved. A one-line fix or a pure chore may skip the spec; when unsure, ask. Briefs cite the slice and its R ids, reviews report per R id, and scope changes update the PRD, then the plan, then the code. Use the spec-driven-development skill if your team has one.

Environment

ddev composer check-cs               # ECS code style
ddev composer fix-cs                 # ECS auto-fix
ddev composer phpstan                # PHPStan analysis
ddev exec --dir /var/www/html/vendor/acme/my-plugin vendor/bin/pest   # Pest, from the plugin's own root
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 widgets

Documentation

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.