AgentSkillsCN

hyperf-best-practices

高性能协程 PHP 应用的最佳实践——Hyperf 框架。涵盖依赖注入、协程安全性,以及性能调优等内容。

SKILL.md
--- frontmatter
name: hyperf-best-practices
description: Hyperf framework best practices for high-performance coroutine-based PHP applications. Covers Dependency Injection, Coroutine safety, and Performance tuning.
license: MIT
metadata:
  author: TraeAI
  version: "1.0.0"

Capability Rules

RuleKeywordsDescription
no-global-variablesglobal, request, singletonAvoid using global variables for request data
di-singleton-state-safetydi, singleton, state, race conditionEnsure DI singletons are stateless
avoid-magic-methods-coroutine-switchmagic method, coroutine, deadlockAvoid I/O in magic methods

Efficiency Rules

RuleKeywordsDescription
blocking-code-in-coroutineblocking, sleep, io, performanceAvoid blocking code in coroutines
production-deployment-scandeployment, optimization, scanOptimize autoloader and scan cache

Reference