reusable_agent/extensions/extension_selection.md
2026-06-04 22:26:03 +08:00

63 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 扩展自动选择规则
这份文件给 pipeline 和产品 Agent 使用。用户不需要手动指定 extension;Agent 必须先根据需求判断项目类型,再选择是否加载扩展。
## 默认原则
1. 先读取通用流程和通用 agent。
2. 产品 Agent 或 pipeline router 根据需求、PRD、参考产品和资源类型判断项目类型。
3. 只有项目类型匹配时才读取对应 extension。
4. 如果没有匹配扩展,只使用通用 agent,并在项目包里生成项目特有补充规则。
5. 不能因为当前仓库曾经做过环境音 App,就默认给所有项目加载环境音扩展。
## 扩展匹配表
| 扩展 | 触发关键词 / 项目类型 | 不应触发的情况 |
| --- | --- | --- |
| `ambient-sleep/` | 环境音、助眠、白噪音、自然声景、专注音乐、阅读陪伴、冥想放松、HiFi 播放器场景模式、音乐播放器里的睡眠模式、需要音频/图片/视频声景资源 | 记账、电商、CRM、健身打卡、工具箱、普通内容资讯、没有媒体播放或声景资源需求的 App |
## PM / Router 必须输出
每次选择扩展前,先输出简短判断:
```text
扩展选择:
- 项目类型判断:<一句话>
- 需要加载的扩展:<extension slug 或 无>
- 选择理由:<1-3 条>
- 不加载的扩展:<如果有,说明原因>
```
## 示例
### 根据已有 PRD 生成 UI
用户说:
```text
请读取 reusable_agent_kit,根据已有 PRD 生成一个高级黑金风格的 UI。
```
Agent 应该:
1. 读取 `pipeline/SKILL.md`。
2. 读取 `agents/product/SKILL.md`,用 PM/Router 判断 PRD 属于什么项目类型。
3. 如果 PRD 是环境音/助眠/HiFi 声景类,加载 `extensions/ambient-sleep/SKILL.md`。
4. 读取 `agents/ui/SKILL.md` 和 UI 参考文件。
5. 执行 UI 设计,不要求用户手动指定 extension。
### 普通工具类 App
用户说:
```text
请读取 reusable_agent_kit,根据已有 PRD 生成一个任务管理 App 的 UI。
```
Agent 应该:
1. 判断这是效率工具类。
2. 当前没有专用 extension。
3. 只加载通用 Product/UI agent。
4. 如有必要,在 `project_agent_pack/<project_slug>/` 生成任务管理领域补充。