drupal-coding-standards
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDrupal Coding Standards Skill
Drupal编码标准Skill
This skill provides AI agents with the ability to review code according to Drupal's official coding standards. The standards are maintained by the Drupal community and automatically kept up-to-date via Composer dependency.
本Skill为AI Agent提供根据Drupal官方编码标准审查代码的能力。这些标准由Drupal社区维护,并通过Composer依赖自动保持更新。
When to Use
使用场景
Activate this skill when:
- Reviewing code in Drupal projects (modules, themes, profiles)
- Checking code for compliance with Drupal coding standards
- Performing code reviews on PHP, JavaScript, CSS, Twig, YAML, or SQL files
- Ensuring code follows Drupal best practices and conventions
在以下情况激活本Skill:
- 审查Drupal项目(模块、主题、配置文件)中的代码
- 检查代码是否符合Drupal编码标准
- 对PHP、JavaScript、CSS、Twig、YAML或SQL文件执行代码审查
- 确保代码遵循Drupal最佳实践与约定
How It Works
工作原理
This skill uses dynamic context discovery to load only the relevant standards based on the file type being reviewed:
- Identify the file type being reviewed (,
.php,.js,.css,.twig, etc.).yml - Consult the routing table in to find the corresponding standard file
standards-index.md - Load the specific standard from
assets/standards/[category]/[file].md - Apply the standards to review the code
本Skill采用动态上下文发现机制,仅加载与待审查文件类型相关的标准:
- 识别待审查文件类型(、
.php、.js、.css、.twig等).yml - 查阅中的路由表,找到对应的标准文件
standards-index.md - 从加载特定标准
assets/standards/[category]/[file].md - 应用标准审查代码
Review Workflow
审查流程
- Read to determine which standard file applies to the code being reviewed
standards-index.md - Load the relevant standard file from
assets/standards/ - Review the code against the standards
- Provide specific, actionable feedback referencing the relevant sections of the standards
- 读取以确定哪份标准文件适用于待审查代码
standards-index.md - 从加载相关标准文件
assets/standards/ - 对照标准审查代码
- 提供具体、可操作的反馈,并引用标准的相关章节