/drupal-ai-kit:drupal-performance-review <file, directory or route>from Drupal AI Kit
Reviews Drupal code for performance issues across queries, caching, rendering, memory, external calls, and config/state patterns. Walks a structured checklist with evidence-based findings.
Ships in Drupal AI Kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Review the performance of: $ARGUMENTS
Read the code first — every file in scope plus the services it calls — then walk the checklist. A finding needs
evidence: the line that causes it and the mechanism ("one load() per item in the loop at line 42"). Numbers
appear only when you measured them; an unmeasured impact is described, never estimated.
loadMultiple() or one query.->fields('alias') selecting every column when a few are used.hook_schema() / entity field storage).range() on tables that grow.#cache — tags, contexts and max-age all considered.user where user.roles or user.permissions is enough) or missing (output
varies by something that is not declared).max-age: 0 bubbling to a whole page: the Dynamic Page Cache skips the response, while the Internal Page Cache
ignores bubbled max-age and still stores the page for anonymous users — slow for logged-in users, stale for
anonymous ones. \Drupal::service('page_cache_kill_switch') turns both caches off for the response. In both
cases isolate the dynamic part with #lazy_builder and leave the page cacheable.content, access results
without addCacheableDependency().$node->field_x->entity->field_y->entity) inside lists.hook_cron().timeout and connect_timeout.$this->configFactory->get() inside a loop for the same object.Measure when the user asks for numbers or a finding's size is unclear:
ddev drush php:eval '<code that runs the path>' # with a query logger: Database::startLog('review')
ddev exec curl -sk -o /dev/null -w '%{time_total}\n' https://<project>.ddev.site/<path>
ddev drush sql:query 'EXPLAIN <query>'
X-Drupal-Cache and X-Drupal-Dynamic-Cache response headers show whether a page is cached and why not.
Findings ordered by severity, each with:
file:line;End with the checklist areas that had no findings, so the reader knows they were checked. Apply fixes only when the user asked for them.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/create-drupal-pluginCreate a Drupal plugin class (Block, FieldWidget, FieldFormatter, Condition, QueueWorker, etc.) in a custom module/create-drupal-serviceCreate a Drupal service class in a custom module and register it in the module's services.yml/drupal-refactor-to-diRefactor Drupal code from static \Drupal:: calls to dependency injection/git-commitGenerate a commit message in the project format (#329: Description.)npx claudepluginhub slivorezka/drupal-ai-kit --plugin drupal-ai-kitOther plugins' skills for the same job