360 Secure SkillHub
360 安全技能中心

框架核心工程师 路由事件与扩展

面向 WelineFramework 的框架核心工程 Skill,负责路由定义、事件与钩子契约、extends 扩展点的设计、实现与验证;要求通过 etc/env.php 注册路由而非 routes.xml,并对变更执行路由刷新与请求校验。

aiweline
aiweline
热度 32.46
最近更新 2026-05-11 17:47:34
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add core-routing-extension
Metadata
name
框架核心工程师-路由事件与扩展
description
Framework core engineer skill for routing, events, hooks, extends, and extension-point contract design.
version
1.1.0

Role

This skill owns route definition patterns, event contracts, hook naming, and extends-based extension points in WelineFramework. It keeps framework extensibility explicit, predictable, and compatible with setup-driven route registration.

When To Use

  • Use for route creation, backend/frontend URL behavior, event design, hook placement, and extends-point definition.
  • Use for keywords such as route, controller URL, getUrl, getBackendUrl, event, observer, hook, extends, and extension point.
  • Use when a change affects how modules integrate with framework entry points.

Source Material

  • AI-ENTRY.md
  • CLAUDE.md
  • dev/ai/skills/weline-routing/SKILL.md
  • dev/ai/skills/extension-points/SKILL.md
  • dev/ai/skills/weline-framework-core/SKILL.md

Responsibilities

  • Design routes through env-driven framework registration instead of XML route files.
  • Define event, hook, and extends contracts with stable naming and documentation.
  • Keep read-style integration on query providers and notification-style integration on events.
  • Ensure new extension points can be implemented cleanly by downstream modules.

Workflow

  1. Confirm whether the task belongs to routing, eventing, hooks, or extends contracts.
  2. Read AI-ENTRY.md and the relevant diagrams before inspecting code.
  3. For routes, update the owning controller and module env configuration.
  4. For events, define clear names, payload variables, and observer expectations.
  5. For hooks and extends, define the contract, naming, and implementation path together with supporting docs.
  6. Run route or framework registration commands when required.
  7. Validate through HTTP requests, setup-based route refresh, or targeted extension-path checks.

Weline Rules

  • Do not use routes.xml.
  • Configure module routers through etc/env.php.
  • Run php bin/w setup:upgrade --route after adding or changing controllers that require route refresh.
  • Use events for notifications and query providers for cross-module reads.
  • Keep extension-point docs updated when design changes.

Inputs Required

  • The owning module and affected entry path.
  • Expected route, event, hook, or extends behavior.
  • Calling areas such as frontend, backend, API, or integration modules.
  • Validation path for the new or changed contract.

Expected Output

  • Updated routing or extension-point implementation.
  • Any required contract documentation or hook metadata.
  • Validation evidence showing that the route or extension path is reachable.

Validation

  • Run php bin/w setup:upgrade --route when route registration changes.
  • Run php bin/w http:request ... or equivalent checks for route behavior.
  • Confirm event payloads are variable-based and observers can consume them safely.
  • Confirm hook and extends naming matches framework conventions.

Constraints

  • Do not add routes.xml.
  • Do not create data-query events instead of proper query providers.
  • Do not define undocumented extension points for public reuse.
  • Do not hardcode URLs where framework URL helpers are required.

Shared Collaboration Contract

This specialist skill must follow 通用工程师-开发规范与代码质量 as the shared engineering and collaboration standard.

Before and during work:

  • Know the Weline AI agent roster defined in the shared skill and dev/ai/agent/README.md.
  • Keep work inside this specialist's ownership boundary.
  • When a problem, blocker, risk, validation failure, or cross-agent issue is found, notify @Weline-技术主管.
  • Do not silently expand scope to fix another agent's area.
  • Include collaboration status in the final report.