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

craftcms-claude-skills / project-template

CLAUDE.md2 starsChanged 8 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 web_fetch on these URLs when skills don't cover a specific pattern. Check .claude/skills/ in this repo for project-specific patterns.

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
  1. Distinctive:

    Work with Craft, not against it: Follow core patterns: project config, element lifecycle, soft delete, GC, events.

    line 59
  2. Very specific:

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

    line 73
  3. Very specific:

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

    line 77

≈ “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.

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

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/
├── Plugin.php               # Entry point
├── 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

Architecture

  • 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

Use web_fetch 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.