Drupal Views Patterns

Working with Drupal Views — both the build/optimize mechanics (cache plugins, exposed filters, pager, relationships, row plugins, REST/data_export displays, render caching, query cost) AND the decision of whether to use a View at all vs. a custom controller/query/JSON:API. Load when creating ANY listing/feed/table/grid/leaderboard/block-of-rows or REST/JSON listing endpoint; when a View is slow or loads full entities it does not render; when adding/editing exposed filters, sorts, pagers, relationships, or a view's cache settings; or when deciding "View vs custom vs JSON:API" for a new query su

84 stars 5 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add grasmash/drupal-claude-skills --skill drupal-views-patterns
Manual install
git clone --depth 1 https://github.com/grasmash/drupal-claude-skills.git /tmp/drupal-claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/drupal-claude-skills/skills/drupal-views-patterns ~/.claude/skills/drupal-views-patterns

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Drupal Views Patterns

Views is load-bearing on most mature Drupal sites — and it is routinely the
**#1 cold-render query-cost source**. This skill has two halves: **(A)
general Views best practices** and **(B) the "View vs custom" decision.**
The lessons here were empirically verified on a large production Drupal 11
codebase (59 views / ~250 displays); measure claims the way
`drupal-performance` says: **cold-render real-SQL query COUNT, not local
wall-clock.**

On some projects the primary listing surfaces (library, leaderboard, events,
profile) are hand-built SDC routes via custom controllers rather than Views;
apply part B before reaching for a View for any new listing.

---

## A. General Views best practices

### A1. Cache plugin: pick the freshness class deliberately (`Tag` vs `Time` vs `None`)
Every Views display has a **results cache** (the SQL result) and an
**output/render cache** (the themed markup), governed by its cache plugin:
- **`Tag`** (default for content views) — cached until a relevant entity/list
  cache tag is invalidated. Use for surfaces that must update **immediately**
  when content changes (a newly published item must appear). The "immediate"
  freshness bucket.
- **`Time`** — the same tag invalidation as `Tag`, PLUS a TTL. In core
  (11.4) `Time` inherits `CachePluginBase::cacheSet()`, which stores results
  with `getCacheTags()`; the lifespan only adds an expiry. Precisely: the
Read the full skill on GitHub

Details

Skill name
drupal-views-patterns
Path
skills/drupal-views-patterns/SKILL.md
License
MIT
Repo updated
1 October 2026

FAQ

What does the Drupal Views Patterns skill do?

Working with Drupal Views — both the build/optimize mechanics (cache plugins, exposed filters, pager, relationships, row plugins, REST/data_export displays, render caching, query cost) AND the decision of whether to use a View at all vs. a custom controller/query/JSON:API. Load when creating ANY listing/feed/table/grid/leaderboard/block-of-rows or REST/JSON listing endpoint; when a View is slow or loads full entities it does not render; when adding/editing exposed filters, sorts, pagers, relationships, or a view's cache settings; or when deciding "View vs custom vs JSON:API" for a new query su

How do I install the Drupal Views Patterns skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add grasmash/drupal-claude-skills --skill drupal-views-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Drupal Views Patterns popular?

It lives in grasmash/drupal-claude-skills, which has 84 GitHub stars and 5 forks.

Related skills

Acquia Source

84

grasmash/drupal-claude-skills

Connect to an Acquia Source ("Source powered by Drupal CMS") site — its JSON:API and MCP endpoints, OAuth2 auth, the @drupal-canvas CLI, and the Canvas Page API deploy workflow. Use when wiring an AI agent or app to a Source CMS site, building/uploading Drupal Canvas Code Components, deploying landing pages via the Page API, or registering the Source MCP server with Claude Code/Cursor.

Frontend & Design

Canvas Contribution

84

grasmash/drupal-claude-skills

Workflow for contributing features and fixes to the Drupal Canvas module on drupal.org while consuming it from a separate project: the two-repository setup, Canvas UI development, issue forks, merge requests, and composer patches. Use when developing a Canvas feature or bug fix intended for upstream, or when moving a local Canvas change onto a drupal.org issue. Extends drupal-contrib-mgmt with Canvas-specific details.

Frontend & Design

Claude Code MCP Setup

84

grasmash/drupal-claude-skills

Add and configure MCP (Model Context Protocol) servers in Claude Code. Use when adding new MCP servers, configuring remote MCP, setting up OAuth MCP servers, troubleshooting MCP connections, or running /mcp diagnostics. Covers stdio, HTTP, and SSE transport types.

AI, LLMs & Agents

Insforge CLI

47

InsForge/insforge-skills

Use this skill whenever someone needs a backend, or a task touches InsForge backend or cloud infrastructure through the InsForge CLI: projects, SQL, migrations, RLS policies, functions, storage, backups, deployments, compute, secrets, config, schedules, logs, diagnostics, advisor scans and suppressions, import/export, AI/OpenRouter setup and usage overview, Stripe/Razorpay payments, Apify web scraping / data sources, PostHog product analytics, backend branches, organization membership (invite, leave, delete), agent memory (remember/recall project facts and decisions), reporting InsForge-side b

Software Development13

Drupal Simple Oauth

84

grasmash/drupal-claude-skills

Explains OAuth2 authentication in Drupal with the simple_oauth module - TokenAuthUser AND-permission logic, scope/role intersection, OAuth2 scope entities and the dynamic scope provider, mobile app password-grant token requests, field_permissions and JSON:API field access under a token, Bearer-token CSRF 403s, consumer TTLs, and debugging token permission denials. Use when an OAuth/Bearer token is denied a permission the user has, configuring consumers, clients or scopes, requesting tokens from a mobile or decoupled app, or getting 403s on JSON:API requests made with a Bearer token.

Software Development

Insforge Debug

47

InsForge/insforge-skills

Use when diagnosing problems in an InsForge project — reactive failures (SDK error object, HTTP 4xx/5xx, gateway timeout 502/503/504, edge function failure or timeout, login/OAuth/auth errors, RLS denial, realtime channel issues, slow query on one endpoint, edge function or Vercel deploy failure), proactive audits (security/RLS review, performance/index review, system health check, pre-launch readiness), or when the user has an error but doesn't know where to start.

Software Development13

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.