agentleFS
grasmashgrasmash/drupal-claude-skills/AGENTS.md

drupal-claude-skills

AGENTS.md81 starsChanged 42 days agoMITView on GitHub

A public collection of Claude Code skills and agents for Drupal development. This repository distributes reusable skills and agents that any Drupal project can install. It is NOT a Drupal project itself — it's a skill distribution repo. This copies skills from skills/ into your project's .claude/skills/ directory. Agents live in .claude/agents/ and must be copied manually: Copy the sample settings.json as a starting point: Review and customize for your project's needs. For Drupal Canvas Code Components, also install: The…

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After quality-gate passes and before telling the user work is complete, spawn the done-gate agent.

    line 73
  2. Very specific:

    When CI fails with test errors, fix the named tests locally and run them individually until green before re-running the full suite — don't …

    line 81
  3. Very specific:

    NEVER directly edit files in docroot/modules/contrib/ or docroot/core/.

    line 85
  4. Very specific:

    Create a .patch file in patches/

    line 87
  5. Very specific:

    Run composer patches-relock to add the patch to patches.lock.json.

    line 89
  6. Very specific:

    Run composer reinstall drupal/<module> (or composer patches-repatch) to apply.

    line 90
  7. Very specific:

    Commit the patch, composer.json, patches.lock.json, and the patched contrib file (hosts that deploy committed git state never run composer …

    line 91
  8. Distinctive:

    When ending a work session, complete these steps:

    line 97
  9. Very specific:

    Keep SKILL.md under 500 lines.

    line 126

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Drupal Claude Skills

A public collection of Claude Code skills and agents for Drupal development.

Repository Purpose

This repository distributes reusable skills and agents that any Drupal project can install. It is NOT a Drupal project itself — it's a skill distribution repo.

Install Skills

Via npx skills (recommended)

npx skills add grasmash/drupal-claude-skills

This copies skills from skills/ into your project's .claude/skills/ directory.

Manual

cp -r skills/* /path/to/your/project/.claude/skills/

Install Agents

Agents live in .claude/agents/ and must be copied manually:

cp -r .claude/agents/* /path/to/your/project/.claude/agents/

Install Settings

Copy the sample settings.json as a starting point:

cp .claude/settings.json /path/to/your/project/.claude/settings.json

Review and customize for your project's needs.

Canvas Ecosystem

For Drupal Canvas Code Components, also install:

npx skills add drupal-canvas/skills

Agent Workflow Guide

The following sections document how to use the included agents effectively in a Drupal project. Copy this guidance into your project's CLAUDE.md and adapt as needed.

Parallelization

Maximize parallel work. Spawn multiple sub-agents in a single message when tasks are independent. Use agent teams for features spanning Drupal + frontend. Research areas concurrently before implementing.

JavaScript Frameworks on Drupal

These skills cover the Drupal side only. When a task involves a JavaScript framework layered on Drupal (React, Vue, Angular, Svelte, Alpine, or whatever the project uses), in a theme, a decoupled front end, or Canvas code components, also find and load a skill for that framework (npx skills find <framework>, or the project's own skills). Follow that framework's current best practices, including its security guidance: XSS (v-html, dangerouslySetInnerHTML), build config, and dependency audit.

The Drupal skills here own the seam: JSON:API/REST auth and CSRF tokens, drupalSettings and its cache contexts, processed vs raw field values, and library/asset wiring.

Quality Gate (mandatory before commit)

Before committing code changes, spawn the quality-gate agent to review the diff. It checks security, performance, testing, and regressions. Proactively run the review before reaching the commit step — don't wait for a reminder. For agent teams, the team lead should spawn quality-gate after all teammates finish, not each teammate individually.

Done Gate (mandatory before declaring done)

After quality-gate passes and before telling the user work is complete, spawn the done-gate agent. It validates that the work actually works — builds succeed, tests pass, deliverables match the plan. Quality-gate checks code quality; done-gate checks functional correctness. Both must pass before declaring done.

Local Execution Verification (mandatory)

For any fix or feature that changes runtime behavior (cron jobs, drush commands, data processing, API endpoints, service logic), you MUST execute the changed code path locally via DDEV and verify the results before declaring done — passing unit tests is not sufficient. See the drupal-testing skill for the full discipline.

CI Test Fix Workflow

When CI fails with test errors, fix the named tests locally and run them individually until green before re-running the full suite — don't burn CI minutes iterating on known-broken tests. See the drupal-testing skill for the step-by-step workflow.

Contrib/Core Patch Policy

NEVER directly edit files in docroot/modules/contrib/ or docroot/core/. All changes to contributed modules and Drupal core MUST use patches:

  1. Create a .patch file in patches/
  2. Register it in composer.json under extra.patches
  3. Run composer patches-relock to add the patch to patches.lock.json. composer-patches v2 applies patches from the lock file, not from composer.json, so without the relock a new patch is silently dropped on every clean install.
  4. Run composer reinstall drupal/<module> (or composer patches-repatch) to apply. composer-patches patches a package only when Composer installs or updates it, so a plain composer install does not re-patch a module that is already installed.
  5. Commit the patch, composer.json, patches.lock.json, and the patched contrib file (hosts that deploy committed git state never run composer install)

Direct edits get overwritten by composer install/composer update. See the drupal-contrib-mgmt skill for full patch management workflows.

Session Completion (Landing the Plane)

When ending a work session, complete these steps:

  1. File issues for remaining work — Create issues for anything that needs follow-up
  2. Run quality gates (if code changed) — Tests, linters, builds
  3. Update issue status — Close finished work, update in-progress items
  4. Commit changes — Ensure all work is committed locally
  5. Ask before pushing — Ask the user if they want you to push to remote. Do NOT push automatically
  6. Hand off — Provide context for next session

Directory Structure

skills/                  # Skills (installed via `npx skills add`)
.claude/agents/          # Agent definitions (manual copy)
.claude/settings.json    # Sample settings (manual copy)
.claude/scripts/         # Sync scripts for upstream content

Contributing

See CONTRIBUTING.md for guidelines.

Skill Format

Skills follow the Agent Skills Specification:

  • Each skill is a directory under skills/ with a SKILL.md file
  • SKILL.md has YAML frontmatter with name and description
  • Keep SKILL.md under 500 lines; use references/ for details

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.