craft-php-guidelines SKILL.md skillA

craft-php-guidelines from michtio/craftcms-claude-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add michtio/craftcms-claude-skills/craft-php-guidelines@git:20261005.8e2d9c5

Pins git:20261005.8e2d9c5 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
michtio/craftcms-claude-skills
Path
skills/craft-php-guidelines/SKILL.md
Versions recorded
7
Latest version
git:20261005.8e2d9c5, committed Oct 5, 2026
First version recorded
Jul 28, 2026
Size
18,635 bytes
Repository stars
88
License
MIT

Craft CMS 5 PHP coding standards and conventions. ALWAYS load when writing, editing, reviewing, or discussing any PHP in a Craft plugin or module — even small edits. Also when running ECS, PHPStan, or scaffolding with ddev craft make. Covers: PHPDoc blocks (@author, @since, @throws chains), section headers (=========), class organization, naming conventions (services, queue jobs, records, events, enums), defineRules() and validation, beforePrepare() and addSelect(), MemoizableArray…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# Craft CMS 5 PHP Guidelines

Complete PHP coding standards and conventions for Craft CMS 5 plugin and module development. These extend Craft's official coding guidelines with project-specific conventions.

**Core principles:** PHPDocs on everything — classes, methods, and properties — regardless of type hints. No `declare(strict_types=1)` in plugin source files (matching Craft core convention).

## Companion Skills — Always Load Together

- **`craftcms`** — Architecture patterns, element lifecycle, controllers, events, migrations. Required for any Craft plugin or module development.
- **`ddev`** — All commands run through DDEV. Required for running ECS, PHPStan, scaffolding, and tests.

## Documentation

- Official coding guidelines: https://craftcms.com/docs/5.x/extend/coding-guidelines.html
- Class reference: https://docs.craftcms.com/api/v5/
- Generator reference: https://craftcms.com/docs/5.x/extend/generator.html

When unsure about a convention, `WebFetch` the coding guidelines page for the authoritative answer.

## Common Pitfalls

- `addSelect()` is the convention in `beforePrepare()` — safely additive when multiple extensions contribute columns.
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add michtio/craftcms-claude-skills/craft-php-guidelines@sha256:d74772b94516a3e6

The line at the top of this page pins the label git:20261005.8e2d9c5, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_kmuwbheh3k4fodl3.svg)](https://markdownregistry.com/a/art_kmuwbheh3k4fodl3)

3 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 7 versions of this file, between Jul 28, 2026 and Oct 5, 2026, about one every 11 days.

versioncommittedcommitsizeaudit
git:20261005.8e2d9c5 latest2026-10-05 8e2d9c5 18,635 BA view · diff
git:20261005.e2e0a792026-10-05 e2e0a79 18,635 BA view · diff
git:20260914.614a89e2026-09-14 614a89e 18,620 BA view · diff
git:20260805.f744e202026-08-05 f744e20 18,070 BA view · diff
git:20260804.d3a91c12026-08-04 d3a91c1 17,454 BA view · diff
git:20260729.8079f3b2026-07-29 8079f3b 15,340 BA view · diff
git:20260728.b45663b2026-07-28 b45663b 14,327 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (18635 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

michtio/craftcms-claude-skills · 88 stars · license MIT · pushed 2026-11-04 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_kmuwbheh3k4fodl3
GET https://markdownregistry.com/api/v1/resolve?ref=michtio/craftcms-claude-skills/craft-php-guidelines
GET https://markdownregistry.com/api/v1/blob/d74772b94516a3e6f65f903c9f90d37ce6f8319250ce54080b378b044cca3692

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from michtio/craftcms-claude-skills

CLAUDE.md@project-template CLAUDE.md file
michtio/craftcms-claude-skills · project-template/CLAUDE.md
git:20261005.9d5d181 · audit A · 88 stars
CLAUDE.md@reference CLAUDE.md file
michtio/craftcms-claude-skills · reference/CLAUDE.md
git:20261005.954eba9 · audit A · 88 stars
craft-cloud SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-cloud/SKILL.md · Craft Cloud — Pixel & Tonic's serverless hosting platform for Craft CMS. Covers craft-cloud.yaml configuration, the…
git:20261005.163e2dd · audit A · 88 stars
craft-content-modeling SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-content-modeling/SKILL.md · Craft CMS 5 content modeling — sections, entry types, fields, Matrix, relations, project config, and content…
git:20261029.d656b83 · audit A · 88 stars
craft-garnish SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-garnish/SKILL.md · Garnish — Craft CMS's built-in JavaScript UI toolkit for the control panel. ALWAYS load when writing, editing, or…
git:20261005.8e2d9c5 · audit A · 88 stars
craft-pest SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-pest/SKILL.md · Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core…
git:20261005.8e2d9c5 · audit A · 88 stars
craft-plugin-release SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-plugin-release/SKILL.md · Releasing Craft CMS plugins — tagging, Packagist propagation, GitHub releases, branch promotion, shared-library…
git:20261005.8e2d9c5 · audit A · 88 stars
craft-plugins SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-plugins/SKILL.md · Index and router for plugin-specific Craft CMS 5 guidance — configuration, Twig API, PHP API, migrations, deployment…
git:20261005.8e2d9c5 · audit A · 88 stars
craft-project-setup SKILL.md skill
michtio/craftcms-claude-skills · skills/craft-project-setup/SKILL.md · Scaffold Claude Code configuration specifically for Craft CMS projects. Generates CLAUDE.md and .claude/rules/ files…
git:20261104.c1ed6b5 · audit A · 88 stars
CLAUDE.md@skills/craft-project-setup/templates/module CLAUDE.md file
michtio/craftcms-claude-skills · skills/craft-project-setup/templates/module/CLAUDE.md
git:20260412.a97ad5f · audit A · 88 stars
CLAUDE.md@skills/craft-project-setup/templates/plugin CLAUDE.md file
michtio/craftcms-claude-skills · skills/craft-project-setup/templates/plugin/CLAUDE.md
git:20261005.9d5d181 · audit A · 88 stars
CLAUDE.md@skills/craft-project-setup/templates/site CLAUDE.md file
michtio/craftcms-claude-skills · skills/craft-project-setup/templates/site/CLAUDE.md
git:20260412.a97ad5f · audit A · 88 stars

Every file in michtio/craftcms-claude-skills

Browse by kind, by grade A, or by owner.