定制 drupal/surge 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drupal/surge

Composer 安装命令:

composer require drupal/surge

包简介

A simple, focused coding standards system for Drupal development

README 文档

README

Surge 🌊

a sudden powerful forward or upward movement, especially by a crowd or by a natural force such as the tide.

Drupal Surge: An AI coding standard kit for Drupal development.

It gives AI tools the context they need to work with Drupal, not around it. By combining discoverable skills and open standards, Surge helps AI understand your codebase, conventions, and environment from day one.

Surge focuses on open standards and makes them easy to integrate in a flexible way. You can adopt only what you need, extend where it makes sense, and compose your own setup without locking yourself into specific tools or formats.

This is a foundation, not a finished product. A forward movement shaped by shared direction and collective effort within the Drupal ecosystem.

Open Standards

Drupal Surge is built on open standards to stay flexible, transparent, and future-proof.

By relying on open standards, Surge stays tool-agnostic and easy to extend as the AI ecosystem evolves.

Installation

composer require drupal/surge --dev

Automatic Setup

Note: You may need to allow the plugin to run by executing:

composer config allow-plugins.drupal/surge true

When you install this package, the Surge commands are automatically available through Composer scripts. The package includes a Composer plugin that automatically registers the necessary scripts in your project's composer.json.

And it will create a surge.yaml configuration file in your project root with sensible defaults.

Modular Architecture

Drupal Surge is organized into modules under src/:

  • Surge (src/Surge/) - Core framework (PathSecurity, Composer plugin, Console, Config)
  • Skills (src/Skills/) - Agent Skills discovery and aggregation

Skills

Surge aggregates Agent Skills from multiple sources into a configurable output directory (defaults to .agents/skills/) for use with Claude Code, Cursor, and other AI tools.

The ecosystem is converging on .agents/skills/ as a shared location (agentskills#15); Surge uses that as the default install target while still discovering .claude/skills/, plain skills/, and custom output_directory values.

Configuration

Note: Skills are enabled by default. A surge.yaml configuration file gets created automatically with sensible defaults. You can customize it to exclude specific skills or directories if needed.

See src/Skills/README.md for detailed documentation.

Usage

After installation and configuration, you can use Surge directly:

Commands

Skills

  • composer surge skills-install - Install Agent Skills to the configured output directory (defaults to .agents/skills/)
  • composer surge skills-list - List discovered skills with validation status

Agents

  • composer surge agents-generate - Generate AGENTS.md file for AI coding agents

The agents-generate command creates a customized AGENTS.md file tailored to your Drupal project by:

  • Auto-detecting your development environment (DDEV, Lando, Docker Compose, or Vanilla)
  • Detecting Drupal version and PHP requirements from composer.json
  • Composing sections from modular templates with environment-specific placeholders replaced
  • Supporting section toggles and project-local overrides via surge.yaml

How It Works

  1. Environment Detection: The command scans your project for indicators (.ddev/, .lando.yml, compose.yaml, etc.) to determine your development setup.

  2. Template Composition: It assembles AGENTS.md from modular markdown templates:

    • Shared sections (src/Agents/templates/sections/) - Drupal patterns, code style, security guidelines
    • Environment sections (src/Agents/templates/environments/{env}/) - Setup, commands, debugging specific to your environment
  3. Placeholder Replacement: Environment-specific values are automatically filled in:

    • Drupal version, PHP version, environment name
    • Docker Compose service names and database credentials (if applicable)
    • Environment-specific tool references
  4. Customization: You can customize the output by:

    • Disabling sections in surge.yaml:
      agents:
        sections:
          batch-queue-ajax: false  # Disable if not using
      
    • Overriding templates by creating files in .surge/agents/:
      .surge/agents/sections/code-style.md  # Override code style section
      .surge/agents/environments/ddev/commands.md  # Override DDEV commands
      
    • Configuring overrides in surge.yaml:
      agents:
        overrides:
          code-style: .surge/agents/sections/code-style.md
      

The generated AGENTS.md file provides comprehensive guidance for AI coding agents working on your Drupal project, ensuring consistent code quality and adherence to your project's conventions.

drupal/surge 适用场景与选型建议

drupal/surge 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 123 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 drupal/surge 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 drupal/surge 我们能提供哪些服务?
定制开发 / 二次开发

基于 drupal/surge 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 123
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-08-30