用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/yansongda/supports --skill dev-guide命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | dev-guide |
| description | Use when developing or testing yansongda/supports. Covers commands, code standards, and project structure. |
对 src/ PHP 代码的任何修改,需运行以下三项检查:
composer cs-fix && composer analyse && composer test
本地无 PHP 时使用 Container 备选,详见 container-dev Skill。
composer test # PHPUnit 11.5 + Mockery 1.6
#[CoversNothing]),不要用 doc-comment 注解(PHPUnit 12 起不再支持)composer cs-fix # 代码格式化检查(dry-run)
@PhpCsFixer + declare_strict_types,见 .php-cs-fixer.phpcomposer analyse # PHPStan level 5
tester.yml:PHPUnit,PHP 8.2 / 8.3 / 8.4 / 8.5style.yml:php-cs-fixer(PHP 8.3)+ PHPStan,PHP 8.2 / 8.3 / 8.4 / 8.5declare(strict_types=1); 必须use 导入,禁止在代码中直接写 \Yansongda\Supports\... 完整命名空间null 排在末尾(如 int|string|null)require.php 最低版本为 8.2,禁止使用更高版本语法src/
├── Arr.php # 数组工具(accessible/get/set/has/pluck/...)
├── Collection.php # 集合类(实现 ArrayAccess/Countable/IteratorAggregate/JsonSerializable)
├── Config.php # 配置类(继承 Collection)
├── Functions.php # 命名空间函数:collect()/value()/data_get()(Yansongda\Supports 下,勿加 function_exists guard)
├── Pipeline.php # 管道
├── Str.php # 字符串工具
└── Traits/
├── Accessable.php # ArrayAccess 访问能力
├── Arrayable.php # toArray 能力
└── Serializable.php # 序列化能力(防御式 method_exists guard 勿删,见 @phpstan-ignore-next-line)
tests/ # 与 src/ 一一对应;tests/Stubs/ 为测试桩
declare(strict_types=1);Functions.php 中的命名空间函数加 function_exists('xxx') guard(无效且多余:guard 查的是全局函数,composer files autoload 已保证单次加载)Traits/Serializable.php 时删除防御式 method_exists 检查(trait 可被无 toArray/set 方法的类复用)