craft-twig-guidelines SKILL.md skillB
craft-twig-guidelines from michtio/craftcms-claude-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add michtio/craftcms-claude-skills/craft-twig-guidelines@git:20261027.6fe7941Pins git:20261027.6fe7941 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- B, 16 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- michtio/craftcms-claude-skills
- Path
skills/craft-twig-guidelines/SKILL.md- Versions recorded
- 9
- Latest version
- git:20261027.6fe7941, committed Oct 27, 2026
- First version recorded
- May 30, 2026
- Size
- 19,030 bytes
- Repository stars
- 88
- License
- MIT
Twig coding standards and conventions for Craft CMS 5 templates. ALWAYS load this skill when writing, editing, or reviewing any .twig file in a Craft CMS project — even for small edits. Covers: variable naming (camelCase, no abbreviations), null handling (?? operator, ??? with empty-coalesce plugin), whitespace control ({%- trimming, NOT {%- minify -%}), include isolation (always use 'only'), Craft Twig helpers ({% tag %}, tag(), attr(), |attr filter, |parseAttr, |append, svg()), collect() for…
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
# Twig Coding Standards — Craft CMS 5 Coding conventions for Twig templates in Craft CMS 5 projects. These apply to all Twig code — atomic components, views, layouts, builders, partials. ## Companion Skills — Always Load Together When this skill triggers, also load: - **`craft-site`** — Template architecture and component patterns. Required when creating or editing components, layouts, views, or builders. - **`craft-content-modeling`** — Content architecture. Required when template code involves element queries, field access, or section decisions. For Twig **architecture** patterns (atomic design, routing, builders), see the `craft-site` skill. For PHP coding standards, see `craft-php-guidelines`. ## Documentation - Twig in Craft: https://craftcms.com/docs/5.x/development/twig.html - Template tags: https://craftcms.com/docs/5.x/reference/twig/tags.html - Template functions: https://craftcms.com/docs/5.x/reference/twig/functions.html - Twig 3 docs: https://twig.symfony.com/doc/3.x/ Use `WebFetch` on specific doc pages when something isn't covered here. ## Variable Naming Single-word, descriptive, lowercase preferred. When multi-word is needed, use camelCase. ```twig …
Read the whole file at its exact version.
How to install
mdr add michtio/craftcms-claude-skills/craft-twig-guidelines@sha256:330bd6adb1946a66The line at the top of this page pins the label git:20261027.6fe7941, 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.
[](https://markdownregistry.com/a/art_h2seizjkrqu22izy)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 9 versions of this file, between May 30, 2026 and Oct 27, 2026, about one every 19 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261027.6fe7941 latest | 2026-10-27 | 6fe7941 | 19,030 B | B | view · diff |
| git:20261005.8e2d9c5 | 2026-10-05 | 8e2d9c5 | 18,531 B | B | view · diff |
| git:20261005.e2e0a79 | 2026-10-05 | e2e0a79 | 18,531 B | B | view · diff |
| git:20261005.607d72c | 2026-10-05 | 607d72c | 18,516 B | B | view · diff |
| git:20260914.614a89e | 2026-09-14 | 614a89e | 18,515 B | B | view · diff |
| git:20260812.31832ec | 2026-08-12 | 31832ec | 17,748 B | B | view · diff |
| git:20260713.45a5d71 | 2026-07-13 | 45a5d71 | 17,345 B | B | view · diff |
| git:20260709.01d5167 | 2026-07-09 | 01d5167 | 16,392 B | B | view · diff |
| git:20260530.d4d24ab | 2026-05-30 | d4d24ab | 15,630 B | B | view |
Audit of the latest version
- fail: No script tag (matched: <script)
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (19030 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
Starting a new one? Use a template for SKILL.md on mdpantry, which passes every one of these checks and says what to change in it.
Source
michtio/craftcms-claude-skills · 88 stars · license MIT · pushed 2026-11-04 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_h2seizjkrqu22izy GET https://markdownregistry.com/api/v1/resolve?ref=michtio/craftcms-claude-skills/craft-twig-guidelines GET https://markdownregistry.com/api/v1/blob/330bd6adb1946a66dc7df19627e8aa0e9758c516566d175c1083e3300269b5b6
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.