agents/skills
Composer 安装命令:
composer require agents/skills
包简介
Discover and install AI agent skills from Composer dependencies
README 文档
README
Discover and install AI agent skills from Composer dependencies. This library provides a mechanism for PHP packages to distribute AI agent skills (prompts, instructions, templates) that can be automatically discovered and synced into your project.
Key features:
- Automatic skill discovery from installed Composer packages
- Sync skills to your project with a single command
- Override protection to preserve local modifications
- Custom target directory support
- Post-update hook for automatic syncing
your/library
├── .claude
│ └── skills
│ ├── commit
│ │ └── SKILL.md
│ └── review
│ └── SKILL.md
└── composer.json
Installation
This library requires PHP 8.2 or higher.
composer require agents/skills
Quick Start
- Install the package via Composer
- Configure automatic syncing in your
composer.json:
{
"require": {
"php": ">=8.2"
},
"require-dev": {
"agents/skills": "^0.1.0"
},
"scripts": {
"post-update-cmd": [
"@composer agents:skills --override"
]
},
"config": {
"allow-plugins": {
"agents/skills": true
}
}
}
- Run
composer updateto automatically sync skills, or use the commands manually viacomposer skills.
Console
composer agents:skills [options]
| Option | Short | Description |
|---|---|---|
--skill |
-s |
Sync only the specified skill by name |
--override |
-o |
Override existing files instead of skipping them |
--target |
-t |
Target directory for skills (default: .claude/skills) |
Examples
composer agents:skills # Syncs all skills (default) composer agents:skills -s commit -o # Sync specific skill with override
Custom Skill
Package authors can distribute skills by adding configuration to their composer.json. Both skills and agentskills keys are supported (with skills taking precedence).
Skill Structure
your-package/
├── composer.json
└── .claude/
└── skills/
├── commit/
│ └── SKILL.md
└── review/
└── SKILL.md
Discovery Mode (Recommended)
The simplest way to distribute skills. Each subfolder in the source directory becomes a skill, and all files within are included.
{
"extra": {
"skills": {
"discovery": {
"source": [".claude/skills"]
}
}
}
}
Features:
- Each folder name becomes the skill name
- All files in each folder are included (non-recursive)
- Hidden files/folders (starting with
.) are skipped - Supports multiple source directories as an array
- Also supports a single string:
"source": ".claude/skills"
Explicit Mode
For fine-grained control over file mappings and output paths.
{
"extra": {
"skills": {
"skills": [
{
"name": "commit",
"description": "Git commit helper",
"source": ".claude/skills/commit",
"files": [
{"input": "SKILL.md", "output": "commit/SKILL.md"}
]
}
]
}
}
}
Mixed Mode
Combine discovery with explicit overrides. Explicit skills take precedence over discovered ones.
{
"extra": {
"skills": {
"discovery": {
"source": [".claude/skills"]
},
"skills": [
{
"name": "commit",
"description": "Custom commit description",
"source": ".claude/skills/commit",
"files": [
{"input": "SKILL.md", "output": ".claude/custom/commit.md"}
]
}
]
}
}
}
Configuration Reference
| Field | Required | Description |
|---|---|---|
discovery.source |
No | Array of directories to scan for folder-based skills |
skills |
No | Array of explicit skill definitions |
skills[].name |
Yes | Unique identifier for the skill |
skills[].description |
No | Human-readable description |
skills[].source |
Yes | Path to skill files relative to package root |
skills[].files |
Yes | Array of file mappings |
skills[].files[].input |
Yes | Source file path relative to source |
skills[].files[].output |
Yes | Destination path relative to target directory |
Example
See the playground for a complete example of skills in action.
agents/skills 适用场景与选型建议
agents/skills 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 401 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 01 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 agents/skills 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 agents/skills 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 401
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-23