Skip to content
Skill

Craft garnish

Guides agents writing Craft CMS control panel JavaScript with the Garnish UI toolkit

Craft garnish is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
shell
Platforms
Claude Code, Codex, Cursor
GitHub stars
91
Last commit
License
MIT
Listing updated

Similar skills

About Craft garnish

This skill is a reference for Garnish, the JavaScript UI library built into Craft CMS for its control panel. It covers the class system used to define widgets, the built-in UI components such as modals, menus, selects and HUDs, drag-and-drop sorting, and the helpers for keyboard handling and focus management.

The reference is split into focused files for class inheritance and listener cleanup, UI widgets, drag interactions, utilities and integration with Craft's asset bundles and webpack externals. It points the agent to the right file for each task, such as building a custom slideout, adding ARIA attributes to a modal, or loading an element index class. It also lists common pitfalls, including memory leaks from unmanaged listeners, bundling Garnish instead of using the external, and deprecated managers.

A small bash script reads the project's Craft version so version-specific advice matches the installed release. Without that output, the skill tells the agent to check composer files before giving version-dependent guidance.

When your agent uses it

Garnish, Craft CMS's built-in JavaScript UI toolkit for the control panel. ALWAYS load when writing, editing, or reviewing JavaScript that runs in the Craft CP: plugin CP assets, custom field type JS, element index JS, CP webpack config, or code importing garnishjs / referencing window.Garnish. Also for CP accessibility, keyboard interactions, drag-sort, and CP JS memory issues.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 7 files (103 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the craftcms-claude-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add michtio/craftcms-claude-skills
/plugin install craftcms-claude-skills@craftcms-claude-skills

Or copy only this skill to ~/.claude/skills/craft-garnish:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michtio/craftcms-claude-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/craft-garnish &&
cp -R "$tmp/skills/craft-garnish" ~/.claude/skills/craft-garnish &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/craft-garnish inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/craft-garnish to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michtio/craftcms-claude-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/craft-garnish &&
cp -R "$tmp/skills/craft-garnish" ~/.agents/skills/craft-garnish &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/craft-garnish inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/craft-garnish to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michtio/craftcms-claude-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/craft-garnish &&
cp -R "$tmp/skills/craft-garnish" ~/.cursor/skills/craft-garnish &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/craft-garnish inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/michtio/craftcms-claude-skills.git --path skills/craft-garnish

Or copy the folder to ~/.gemini/skills/craft-garnish yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/craft-garnish:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michtio/craftcms-claude-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/craft-garnish &&
cp -R "$tmp/skills/craft-garnish" ~/.copilot/skills/craft-garnish &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/craft-garnish inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/michtio/craftcms-claude-skills.git

Then copy craftcms-claude-skills/skills/craft-garnish into your agent's skills folder as craft-garnish. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Class system guidance
Explains extending Garnish base classes, initialization, events and listener cleanup on destroy.
UI widget reference
Covers modals, HUDs, disclosure menus, custom selects and other built-in controls.
Drag interaction patterns
Describes drag-sort and drag-drop classes, their settings, events and insertion behavior.
Accessibility and focus helpers
Documents keyboard constants, focus trapping, ARIA attributes and layer-aware shortcuts.
Integration with Craft
Covers asset bundles, webpack externals, element index loading and form widgets.
Version-aware checks
Reads the project's Craft version so advice matches the installed release.

Good for

  • Build a custom modal dialog for a plugin's control panel page
  • Add drag-to-reorder to a custom field type
  • Fix a memory leak in a slideout that is repeatedly created and destroyed
  • Make a custom menu keyboard accessible with Escape handling
  • Set up webpack externals so a plugin uses window.Garnish

Craft garnish FAQ

When does Craft garnish load?

It is meant to load when writing, editing or reviewing JavaScript that runs in the Craft control panel, including plugin CP assets, custom field type JS and code that references window.Garnish. It is not intended for front-end JavaScript or Twig templates.

Does Craft garnish need anything installed?

It uses a bash script to read the Craft version from the project. If that output is missing, it advises checking composer.lock or composer.json to establish the version.

Is there official documentation Craft garnish relies on?

The skill states that no official external documentation exists for Garnish and that the skill itself serves as the reference, pointing to the Garnish source in the Craft CMS repository.

How do I install Craft garnish in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/craft-garnish to use it in all your projects, or to .claude/skills/craft-garnish in one project. Or install the craftcms-claude-skills plugin, which includes it: /plugin marketplace add michtio/craftcms-claude-skills, then /plugin install craftcms-claude-skills@craftcms-claude-skills.

Does Craft garnish run scripts?

Yes. It runs shell scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Craft garnish?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Craft garnish?

The closest alternatives to Craft garnish are Craftcms, Craft twig guidelines, Frontend UI engineering, Craft content modeling and Craft site.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from michtio/craftcms-claude-skills

  1. Gives agents a safe Pest workflow for testing Craft CMS 5 plugins without touching live

    • Open source
    • 91 GitHub stars
    • Developer tools
  2. Guides an agent through Craft Cloud config, deploys, caching, and Cloud-specific limits

    • Open source
    • 91 GitHub stars
    • Databases
  3. Guides Craft CMS 5 content architecture: sections, entry types, fields, Matrix

    • Open source
    • 91 GitHub stars
    • Developer tools
  4. Deploys and runs Craft CMS on fortrabbit managed PHP hosting with safe git workflows

    • Open source
    • 91 GitHub stars
    • Developer tools
  5. Runs one approved Craft CMS slice through outside builders under locked test gates

    • Open source
    • 91 GitHub stars
    • Developer tools
  6. Guides setting up and extending Craft CMS 5.12+ MCP servers and OAuth access

    • Open source
    • 91 GitHub stars
    • Developer tools