Receber por email
← Voltar para o catálogo

craft-site

Craft CMS 5 front-end Twig development — atomic design, template architecture, components, Vite buildchain. Covers atoms/molecules/organisms, props/extends/block patterns, layout chains, view routing, content builders, image presets, Tailwind named-key collections, multi-brand CSS tokens, JavaScript boundaries (Alpine/DataStar/Vue, tabs, accordions), Vite asset loading, and front-end auth (login,

56estrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add michtio/craftcms-claude-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/craft-site/svg)](https://www.skillteca.com.br/skills/craft-site)

Alerta por categoria

Receba novas skills de Design e Frontend toda segunda

1 email curto, só com as skills novas de Design e Frontend. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Craft CMS 5 — Front-End Twig (Atomic Design)

Atomic design system patterns for Craft CMS 5 site templates. Vanilla Twig — no module dependency. Works with any Craft 5 project.

This skill is scoped to front-end template architecture — component design, routing, composition, theming, and buildchain. For extending Craft (plugins, modules, PHP), see the craftcms skill.

Companion Skills — Always Load Together

When this skill triggers, also load:

  • craft-twig-guidelines — Twig coding standards: variable naming, null handling, whitespace control, include isolation, Craft helpers. Required for any Twig code.
  • craft-content-modeling — Sections, entry types, fields, Matrix, relations. Required when deciding what content to query or how templates access data.
  • ddev — All commands run through DDEV. Required for running Vite, npm, and Craft CLI commands.
  • craft-cloud — When the site is hosted on Craft Cloud (detect via craft-cloud.yaml at the repo root or craftcms/cloud in composer.json). Required for edge static caching rules, cloud.esi(...) dynamic islands inside cached pages, edge image transform constraints, and the csrfInput() requirement on cacheable pages.
  • servd — When the site is hosted on Servd (detect via servd.yaml at the repo root or servd/craft-asset-storage in composer.json). Required for Servd static caching, {% dynamicInclude %} islands in cached pages, running Blitz in reverse-proxy mode, and off-server image transforms.

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 a reference file doesn't cover enough detail.

Common Pitfalls (Cross-Cutting)

  • Missing only on {% include %} — ambient variables leak in silently.
  • Variant logic via conditionals ({% if variant == 'x' %}) instead of extends/block.
  • Naming atoms by parent context (hero-button) instead of visual treatment (button--primary).
  • utilities prop used as override — it's additive. Override via named-slot merge.
  • Queries inside views — views receive data, they don't fetch it.
  • Missing .eagerly() on relation fields in views — causes N+1 queries.
  • Missing devMode fallback in builders for unknown block types.
  • Hardcoded Tailwind colors (bg-yellow-600) instead of brand tokens (bg-brand-accent).
  • Mixing buttons and links — buttons are actions (resolve to <a>, <button>, or <span> from props), links are navigation (always <a>). Separate atom categories.
  • Tracking/analytics inside components — decouple to data attributes at view/page level.
  • Forgetting project-config/touch after editing YAML outside the CP — Git pulls, manual edits, and merge conflict resolution don't update dateModified. Run ddev craft project-config/touch then ddev craft up, or craft up on other environments won't detect the change.

Reference Files

Read the relevant reference file(s) for your task. Multiple files often apply together.

Task examples:

  • "Build a new card component" → read atomic-patterns.md + composition-patterns.md + component-inventory.md + tailwind-conventions.md
  • "Set up a new project's template structure" → read boilerplate-routing.md + component-inventory.md
  • "Add a content builder for a Matrix field" → read boilerplate-routing.md + composition-patterns.md
  • "Handle responsive images" → read image-presets.md + plugins/image-optimize.md
  • "Add multi-brand theming" → read tailwind-conventions.md
  • "Decide between Alpine and Vue for a feature" → read javascript-boundaries.md
  • "Compose Tailwind classes without conflicts" → read tailwind-conventions.md + twig-collections.md
  • "Understand atomic design methodology" → read atomic-design.md
  • "Set up Vite + Tailwind in a new Craft project" → read vite-buildchain.md
  • "Debug why assets aren't loading in production" → read vite-buildchain.md
  • "Look up a craft.vite.* Twig function (asset, register, critical CSS)" → read plugins/vite.md
  • "Install GTM/analytics/CMP in a Craft project" → read third-party-integration.md
  • "Configure SEOMatic for a section" → read plugins/seomatic.md
  • "Set up Blitz caching with Cloudflare" → read plugins/blitz.md
  • "Add a form to a page" → read plugins/formie.md
  • "Configure CKEditor with nested entries" → read plugins/ckeditor.md
  • "Build a navigation menu" → read plugins/navigation.md
  • "Add a link field to a component" → read plugins/hyper.md
  • "Set up redirects for a site" → read plugins/retour.md
  • "Add recurring/repeating dates to entries" → read plugins/timeloop.md
  • "Create a JSON API endpoint" → read plugins/element-api.md
  • "Debug N+1 queries in templates" → read plugins/elements-panel.md
  • "Run a security audit" → read plugins/sherlock.md
  • "Embed a YouTube/Vimeo video as an asset" → read plugins/embedded-assets.md
  • "Configure email delivery via SES" → read plugins/amazon-ses.md + third-party-integration.md
  • "Build a language switcher" → read multi-site-patterns.md
  • "Add login/registration to the front end" → read auth-flows.md
  • "Build a user profile edit page" → read auth-account.md
  • "Set up password reset flow" → read auth-flows.md
  • "Set up hreflang tags" → read multi-site-patterns.md
  • "Plan a multi-language site architecture" → read multi-site-patterns.md
  • "Add live search without JavaScript" → read plugins/sprig.md
  • "Build reactive filtering or load-more" → read plugins/sprig.md
  • "Import data from an external feed" → read plugins/feed-me.md
  • "Set up responsive images with Imager-X" → read plugins/imager-x.md
  • "Build a search page" → read search.md
  • "Configure search settings" → read search.md (Search Configuration)
  • "Rebuild the search index" → read search.md (Rebuilding)
  • "Create an RSS feed" → read feeds.md
  • "Build an XML sitemap" → read feeds.md (XML Sitemap)
  • "Create a JSON Feed" → read feeds.md (JSON Feed)
  • "Set up a headless Craft CMS with Next.js" → read headless.md
  • "Fix GraphQL preview tokens" → read headless.md
  • "Consume Craft GraphQL API from a front-end framework" → read headless.md
  • "Use entry.render() for reusable card components" → read element-partials.md
  • "Set up _partials/ templates for entries" → read element-partials.md
  • "Render Matrix blocks with partials" → read element-partials.md

| Reference | Scope | |-----------|-------| | references/atomic-design.md | Methodology: Brad Frost's atomic design principles, 5-to-3 tier compression, composability, context-agnostic naming, classification problem, decompose-downward workflow. Technology-independent. | | references/atomic-patterns.md | Individual component construction: props/extends/block pattern, variant file mechanics, button/link/text/icon atom implementations | | references/composition-patterns.md | Component composition: molecule pattern, organism pattern, structural embed pattern, include/extends/embed decision table, calling conventions, creating new components | | references/component-inventory.md | Classification methodology: decision tree, naming conventions, file naming, props design, scaffold guidelines, tier promotion, audit checklist | | references/boilerplate-routing.md | Template chain: layout hierarchy, Craft section template paths, global variables, routers, views, content builders, directory structure | | references/tailwind-conventions.md | Class composition: named-key collections, standard key names, utilities prop, variant-based dark mode, spacing preference. Assumes Tailwind CSS — adapt patterns to your CSS framework. | | references/vite-buildchain.md | Craft CMS Vite setup: nystudio107 plugin bridge, config/vite.php, vite.config.ts, craft.vite.script(), condition

Compartilhar X LinkedIn