In short.
craft-twig-guidelines is an AI assistant skill for Craft CMS 5 template developers, with the catch that its opinionated rules depend on companion guidance and version-specific features. It provides concrete examples for component boundaries, null handling, HTML helpers, collections and safe output. It is useful as a template-writing reference, but some prescriptions are house style rather than independently established language requirements. Assistant compatibility, API accuracy and generated-template behavior remain untested.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is limited to skills/craft-twig-guidelines at revision 822f3177187ddf146d11ab158b2cc5244f92bc25, whose supplied manifest contains one selected file, SKILL.md. The repository-root LICENSE is the accompanying notice outside that folder. Other repository skills, referenced documents, host integration and project implementations are excluded. No files or code were executed, and assistant behavior, API accuracy and runtime compatibility remain untested.
The overview
Identity
craft-twig-guidelines is the SKILL.md instruction file in skills/craft-twig-guidelines within michtio/craftcms-claude-skills. It targets writing, editing and reviewing Craft CMS 5 Twig templates. Twig is the template language used here to combine content and page markup.
Its front matter supplies a skill name, description and detailed activation cues. The folder is available at [https://github.com/michtio/craftcms-claude-skills/tree/main/skills/craft-twig-guidelines]. This report concerns revision 822f3177187ddf146d11ab158b2cc5244f92bc25.
Assessment
The strongest feature is specificity: examples explain how to pass component inputs explicitly, handle missing values, assemble attributes and avoid common template mistakes. Beginners get concrete patterns; experienced developers get detailed conventions for reviewing assistant-generated Twig.
Fit depends on agreement with its house style. Requiring only on every include, avoiding UI macros, prescribing comment headers and banning abbreviations are strong conventions. They should be evaluated against an existing project's design rather than assumed to be universal Twig requirements. No measured improvement in correctness, speed or consistency is established.
Users
The intended users are developers and reviewers working with Craft CMS 5 components, views, layouts, builders and partials. It particularly suits teams that want an assistant to follow explicit naming, component-isolation and collection conventions.
Beginners will still need knowledge of their project's fields, templates and dependencies. Developers seeking PHP standards, content-model design or complete template architecture are directed to other skills whose contents are outside this resource.
Capabilities
The instructions cover descriptive camelCase variables, null fallbacks, whitespace trimming, isolated includes, component headers and collection-based class construction. Examples show dynamic HTML elements through Craft's tag helpers, attribute manipulation, SVG decoration and collection operations such as grouping and sorting.
The document also addresses translation, HTML sanitization, inline asset registration, configurable control-panel URLs and debugging output. It warns about request-specific values inside template caches, including CSRF inputs, CSP nonces and active-navigation state. These are instructional capabilities; no automated enforcement or successful code generation is demonstrated.
Using it
Requirements
The target environment is a Craft CMS 5 project using Twig. The document calls for companion craft-site and craft-content-modeling skills and refers to additional guidance in craft-php-guidelines and craftcms. Those companion files are not included in the selected scope.
Some examples have explicit version boundaries: the source labels heading helpers and several formatting additions as Craft 5.10+, and query-parameter removal through url(..., false) as Craft 5.11+. It permits the ??? operator only when craft-emptycoalesce or SEOmatic is already installed. These compatibility claims were not independently verified.
The evidence does not establish a supported assistant application, model, subscription, installation location or minimum assistant version.
Mechanism
The resource works through written instructions and examples loaded into an AI assistant's context. Its metadata describes when it should apply, while the body supplies conventions and preferred patterns for the assistant to follow.
There is no executable validator, formatter or test suite in the selected folder. Whether an assistant activates the skill, follows its rules or resolves conflicts with project instructions depends on the host environment and was not assessed.
Setup
The selected file does not provide a host-specific installation command. Use the intended assistant's documented skill-loading method; the exact procedure is unknown from this evidence.
Before applying its examples, identify the project's Craft version, review composer.json for any optional operator-providing plugins, and resolve the referenced companion skills. Agree which naming, component and copy conventions should govern the project. The source explicitly advises against installing a plugin solely to obtain ???.
Example
For a reusable button, the source shows an include that passes text and URL explicitly: {% include '_atoms/buttons/button--primary' with { text: entry.title, url: entry.url } only %}. The purpose of only is to prevent the component from silently depending on ordinary variables inherited from its parent template.
For an optional heading, another source pattern is {% set heading = entry.heading ?? '' %}. These illustrate the intended style; the button template, project fields and rendered output were not supplied or executed.
Assessment & evidence
Limitations
This is guidance rather than a complete template architecture or an enforcement tool. Several examples assume project components, fields, props collections and companion patterns whose implementations are not included. Exact compatibility across Craft 5 releases is unverified.
Security-related advice still requires project-specific judgment. For example, the instruction to reserve raw output for trusted content does not establish that a particular rich-text field is trustworthy. No assistant session, installation, template compilation, rendered-output check or security test was performed.
Reasoning
The conventions have understandable aims: explicit include inputs expose component dependencies, descriptive names make code easier to read, and named collection keys organize styling concerns. The source explains these intentions through examples and common pitfalls.
It is reasonable to expect these patterns to make assistant output more consistent when a project already follows them. That is an inference from the instructions, not a demonstrated outcome. Their benefit could be smaller where the existing architecture uses different conventions.
Alternatives
For direct language and API references, the resource links to Craft's Twig documentation [https://craftcms.com/docs/5.x/development/twig.html], Craft template functions [https://craftcms.com/docs/5.x/reference/twig/functions.html] and Twig 3 documentation [https://twig.symfony.com/doc/3.x/]. These are documentation alternatives to relying on assistant-loaded conventions; their contents were not included for comparison.
The referenced craft-site and craft-content-modeling skills are described as complementary guidance for architecture and content decisions. Their quality, completeness and compatibility were not assessed.
Evidence
The resource evidence is the complete selected SKILL.md snapshot at [https://raw.githubusercontent.com/michtio/craftcms-claude-skills/822f3177187ddf146d11ab158b2cc5244f92bc25/skills/craft-twig-guidelines/SKILL.md], accompanied by the repository-root LICENSE at the same revision.
The retained manifest identifies SKILL.md as 19,030 bytes with SHA-256 330bd6adb1946a66dc7df19627e8aa0e9758c516566d175c1083e3300269b5b6. LICENSE is 1,064 bytes with SHA-256 d13b090844198c395a77215be39f2ad69cadfeafc198828650ae7dc45b70a0d2. These identify the source artifacts; they do not validate the technical claims or demonstrate runtime behavior.
Access & freshness
Costs
No price, subscription plan, token usage or operating-cost estimate is supplied. The MIT licence permits use and redistribution, but does not establish the cost of an assistant, Craft CMS or optional plugins. Those costs are unknown from the evidence.
Rights
The repository-root MIT licence names copyright holder michtio, dated 2025. It permits use, copying, modification, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions. It supplies the software without warranty.
The captured notice is at [https://raw.githubusercontent.com/michtio/craftcms-claude-skills/822f3177187ddf146d11ab158b2cc5244f92bc25/LICENSE]. Its permissions support redistribution of the captured skill with that notice; they do not establish rights for separately linked documentation or companion resources.
Freshness
The snapshot was captured on 2026-11-16 at 21:20:36.234 UTC from revision 822f3177187ddf146d11ab158b2cc5244f92bc25. This is a capture timestamp, not an author update date or release date.
The evidence does not establish subsequent changes, release history or ongoing maintenance. The document's Craft 5.10+ and 5.11+ annotations make matching its examples to the installed Craft version particularly relevant.
Actions
Check the installed Craft version and optional plugins before adopting version-dependent examples. Obtain the companion guidance if following the document's intended approach, and reconcile its mandatory style rules with the project's existing conventions.
Begin with one representative component and inspect the assistant's proposed changes. Verify component inputs, missing and empty values, escaping, translations and rendered attributes in the actual project. Where caching is involved, check that request-specific values remain correct across requests. These are suggested validation steps, not completed tests.
