Token导航 LogoToken导航

Agent Skill · 前端设计

drupal-backend(Drupal 后端)

drupal-backend 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

drupal-backend 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 3,260。

总安装 1,440周安装 60GitHub Stars 19下载 480核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:drupal-backend(Drupal 后端)
来源仓库:https://github.com/omedia/drupal-skill
仓库路径:skills/drupal-backend
安装命令:
npx skills add https://github.com/omedia/drupal-skill --skill drupal-backend
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/omedia/drupal-skill --skill drupal-backend

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

提供 Drupal 后端开发的全方位技术指导。支持自定义模块、钩子函数和服务组件开发。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。涵盖路由配置、实体操作和数据库交互方案。适用于 Drupal 系统的功能扩展和维护升级。

drupal-backend 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/drupal-backend

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/omedia/drupal-skill --skill drupal-backend;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

drupal-backend 怎么安装?

在终端执行 npx skills add https://github.com/omedia/drupal-skill --skill drupal-backend。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

drupal-backend 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

drupal-backend 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

drupal-backend 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

drupal-backend 用的人多吗?

公开数据是累计安装 1,440 次,近一周安装 60 次,下载 480 次,GitHub 19 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

drupal-backend 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
drupal-backend

Drupal 后端 · 本页

1,44019接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Drupal Back End Development

Overview

Enable expert-level Drupal back end development capabilities. Provide comprehensive guidance for custom module development, PHP programming, API usage, hooks, plugins, services, and database operations for Drupal 8, 9, 10, and 11+.

When to Use This Skill

Invoke this skill when working with:

  • Custom module development: Creating new Drupal modules
  • Hooks: Implementing Drupal hooks to alter system behavior
  • Controllers & routing: Building custom pages and routes
  • Forms: Creating configuration or custom forms
  • Entities: Working with content entities or config entities
  • Plugins: Building blocks, field types, formatters, or other plugins
  • Services: Creating reusable business logic services
  • Database operations: Custom queries and schema definitions
  • APIs: Entity API, Form API, Database API, Plugin API

Core Capabilities

1. Custom Module Development

Create complete, standards-compliant Drupal modules:

Quick start workflow:

  1. Use module template from assets/module-template/
  2. Replace MODULENAME with machine name (lowercase, underscores)
  3. Replace MODULELABEL with human-readable name
  4. Implement functionality using Drupal APIs
  5. Enable module and test: ddev drush en mymodule -y

Module structure:

  • .info.yml - Module metadata and dependencies
  • .module - Hook implementations
  • .routing.yml - Route definitions
  • .services.yml - Service definitions
  • .permissions.yml - Custom permissions
  • src/ - PHP classes (PSR-4 autoloading)
  • config/ - Configuration files

Reference documentation:

  • references/module_structure.md - Complete module patterns
  • references/hooks.md - Hook implementations

2. Hooks System

Implement hooks to alter Drupal behavior:

Common hooks:

  • hook_entity_presave() - Modify entities before saving
  • hook_entity_insert/update/delete() - React to entity changes
  • hook_form_alter() - Modify any form
  • hook_node_access() - Control node access
  • hook_cron() - Perform periodic tasks
  • hook_install/uninstall() - Module installation tasks

Hook pattern:

function MODULENAME_hook_name($param1, &$param2) {
  // Implementation
}

Best practices:

  • Implement hooks in .module file only
  • Use proper type hints
  • Document with PHPDoc blocks
  • Check for entity types before processing
  • Be mindful of performance

3. Controllers & Routing

Create custom pages and endpoints:

Route definition (.routing.yml):

mymodule.example:
  path: '/example/{param}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\ExampleController::content'
    _title: 'Example Page'
  requirements:
    _permission: 'access content'
    param: \d+

Controller pattern:

namespace Drupal\mymodule\Controller;

use Drupal\Core\Controller\ControllerBase;

class ExampleController extends ControllerBase {
  public function content() {
    return ['#markup' => $this->t('Hello!')];
  }
}

With dependency injection:

public function __construct(EntityTypeManagerInterface $entity_type_manager) {
  $this->entityTypeManager = $entity_type_manager;
}

public static function create(ContainerInterface $container) {
  return new static($container->get('entity_type.manager'));
}

4. Forms API

Build configuration and custom forms:

Configuration form:

class SettingsForm extends ConfigFormBase {
  protected function getEditableConfigNames() {
    return ['mymodule.settings'];
  }

  public function buildForm(array $form, FormStateInterface $form_state) {
    $config = $this->config('mymodule.settings');

    $form['api_key'] = [
      '#type' => 'textfield',
      '#title' => $this->t('API Key'),
      '#default_value' => $config->get('api_key'),
    ];

    return parent::buildForm($form, $form_state);
  }

  public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->config('mymodule.settings')
      ->set('api_key', $form_state->getValue('api_key'))
      ->save();
    parent::submitForm($form, $form_state);
  }
}

Form validation:

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (strlen($form_state->getValue('field')) < 5) {
    $form_state->setErrorByName('field', $this->t('Too short.'));
  }
}

5. Entity API

Work with content and configuration entities:

Loading entities:

// Load single entity
$node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);

// Load multiple entities
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple([1, 2, 3]);

// Load by properties
$nodes = \Drupal::entityTypeManager()->getStorage('node')->loadByProperties([
  'type' => 'article',
  'status' => 1,
]);

Creating/saving entities:

$node = \Drupal::entityTypeManager()->getStorage('node')->create([
  'type' => 'article',
  'title' => 'My Article',
  'body' => ['value' => 'Content', 'format' => 'basic_html'],
]);
$node->save();

Entity queries:

$query = \Drupal::entityQuery('node')
  ->condition('type', 'article')
  ->condition('status', 1)
  ->accessCheck(TRUE)
  ->sort('created', 'DESC')
  ->range(0, 10);
$nids = $query->execute();

6. Plugin System

Create custom plugins (blocks, fields, etc.):

Block plugin:

/**
 * @Block(
 *   id = "mymodule_custom_block",
 *   admin_label = @Translation("Custom Block"),
 * )
 */
class CustomBlock extends BlockBase {
  public function build() {
    return ['#markup' => 'Block content'];
  }

  public function blockForm($form, FormStateInterface $form_state) {
    $form['setting'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Setting'),
      '#default_value' => $this->configuration['setting'] ?? '',
    ];
    return $form;
  }

  public function blockSubmit($form, FormStateInterface $form_state) {
    $this->configuration['setting'] = $form_state->getValue('setting');
  }
}

7. Services & Dependency Injection

Create reusable services:

Service definition (.services.yml):

services:
  mymodule.custom_service:
    class: Drupal\mymodule\Service\CustomService
    arguments: ['@entity_type.manager', '@current_user']

Service class:

namespace Drupal\mymodule\Service;

class CustomService {
  protected $entityTypeManager;
  protected $currentUser;

  public function __construct(EntityTypeManagerInterface $entity_type_manager, AccountProxyInterface $current_user) {
    $this->entityTypeManager = $entity_type_manager;
    $this->currentUser = $current_user;
  }

  public function doSomething() {
    // Business logic
  }
}

8. Database Operations

Execute custom queries:

Using Database API:

$database = \Drupal::database();

// Select query
$query = $database->select('node_field_data', 'n')
  ->fields('n', ['nid', 'title'])
  ->condition('type', 'article')
  ->condition('status', 1)
  ->range(0, 10);
$results = $query->execute()->fetchAll();

// Insert
$database->insert('mymodule_table')
  ->fields(['name' => 'Example', 'value' => 123])
  ->execute();

// Update
$database->update('mymodule_table')
  ->fields(['value' => 456])
  ->condition('name', 'Example')
  ->execute();

Schema definition (.install file):

function mymodule_schema() {
  $schema['mymodule_table'] = [
    'fields' => [
      'id' => ['type' => 'serial', 'not null' => TRUE],
      'name' => ['type' => 'varchar', 'length' => 255, 'not null' => TRUE],
      'value' => ['type' => 'int', 'not null' => TRUE, 'default' => 0],
    ],
    'primary key' => ['id'],
    'indexes' => ['name' => ['name']],
  ];
  return $schema;
}

Development Workflow

Creating a Custom Module

  1. Scaffold the module: cp -r assets/module-template/ /path/to/drupal/modules/custom/mymodule/ cd /path/to/drupal/modules/custom/mymodule/ mv MODULENAME.info.yml mymodule.info.yml mv MODULENAME.module mymodule.module mv MODULENAME.routing.yml mymodule.routing.yml
  2. Update module files:

- Replace MODULENAME with machine name - Replace MODULELABEL with readable name - Update .info.yml dependencies - Customize controller, routes, logic

  1. Enable and test: ddev drush en mymodule -y ddev drush cr
  2. Develop iteratively:

- Implement functionality - Clear cache: ddev drush cr - Test thoroughly - Check logs: ddev drush watchdog:tail

Standard Development Workflow

  1. Plan: Identify what APIs/hooks you need
  2. Code: Implement using Drupal APIs
  3. Test: Enable module, clear cache, test functionality
  4. Debug: Check logs, use Xdebug if needed
  5. Refine: Optimize, add tests, improve code quality

Best Practices

Module Development

  1. PSR-4 autoloading: Follow namespace conventions
  2. Dependency injection: Use DI in classes
  3. Hooks: Implement only in .module files
  4. Type hints: Use proper PHP type declarations
  5. Documentation: Add PHPDoc blocks
  6. Testing: Write automated tests

Code Quality

  1. Drupal coding standards: Follow PHPCS rules
  2. Security: Validate input, sanitize output, check permissions
  3. Performance: Cache when possible, optimize queries
  4. Accessibility: Ensure forms and pages are accessible
  5. Internationalization: Use $this->t() for all strings

API Usage

  1. Entity API: Prefer entity operations over direct DB queries
  2. Configuration: Use Config API for settings
  3. State API: Use for temporary/non-exportable data
  4. Cache API: Implement caching for expensive operations
  5. Queue API: Use for long-running tasks

Common Patterns

Event Subscriber

class MyModuleSubscriber implements EventSubscriberInterface {
  public static function getSubscribedEvents() {
    return [KernelEvents::REQUEST => ['onRequest', 0]];
  }

  public function onRequest(RequestEvent $event) {
    // Handle event
  }
}

Custom Permission

# mymodule.permissions.yml
administer mymodule:
  title: 'Administer My Module'
  restrict access: true

Custom Access Check

class CustomAccessCheck implements AccessInterface {
  public function access(AccountInterface $account) {
    return AccessResult::allowedIf($account->hasPermission('access content'));
  }
}

Troubleshooting

Module Not Appearing

  • Check .info.yml syntax
  • Verify core_version_requirement
  • Clear cache: ddev drush cr

Hooks Not Working

  • Verify hook name is correct
  • Clear cache after adding hooks
  • Check module weight if hook order matters

Class Not Found

  • Verify PSR-4 namespace matches directory
  • Clear cache to rebuild class registry
  • Check autoloading with composer dump-autoload

Database Errors

  • Check schema definition syntax
  • Run ddev drush updb after schema changes
  • Verify table/column names in queries

Resources

Reference Documentation

  • references/hooks.md - Common hooks with examples

- Entity hooks - Form hooks - Node hooks - Installation hooks - Token hooks

  • references/module_structure.md - Module patterns

- Controllers and routing - Forms (config and custom) - Plugins (blocks, fields, etc.) - Services and DI - Event subscribers

Asset Templates

  • assets/module-template/ - Module scaffold

- .info.yml metadata - .module hook file - .routing.yml routes - Example controller

Version Compatibility

Drupal 8 vs 9 vs 10 vs 11

  • Core APIs: Largely consistent across versions
  • PHP requirements: 8.x (7.0+), 9.x (7.3+), 10.x (8.1+), 11.x (8.3+)
  • Deprecations: Check change records when upgrading
  • Symfony: Different Symfony versions in each Drupal version

See Also

  • drupal-frontend - Theme development, Twig templates
  • drupal-tooling - DDEV and Drush development tools
  • Drupal API - Official API documentation

平台分布

Codex

36.46%
按下载量换算175

Claude

30.65%
按下载量换算147

Cursor

18.97%
按下载量换算91

Gemini CLI

10.74%
按下载量换算52

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills