agency-orchestrator 0.3.2 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +539 -0
- package/README.md +391 -256
- package/dist/cli/compose.d.ts +4 -2
- package/dist/cli/compose.js +35 -39
- package/dist/cli/demo.d.ts +8 -0
- package/dist/cli/demo.js +301 -0
- package/dist/cli.js +47 -10
- package/dist/connectors/claude-code.d.ts +11 -0
- package/dist/connectors/claude-code.js +23 -0
- package/dist/connectors/cli-base.d.ts +16 -0
- package/dist/connectors/cli-base.js +53 -0
- package/dist/connectors/codex-cli.d.ts +11 -0
- package/dist/connectors/codex-cli.js +19 -0
- package/dist/connectors/copilot-cli.d.ts +11 -0
- package/dist/connectors/copilot-cli.js +19 -0
- package/dist/connectors/factory.d.ts +5 -0
- package/dist/connectors/factory.js +42 -0
- package/dist/connectors/gemini-cli.d.ts +11 -0
- package/dist/connectors/gemini-cli.js +19 -0
- package/dist/connectors/ollama.js +1 -1
- package/dist/connectors/openclaw-cli.d.ts +15 -0
- package/dist/connectors/openclaw-cli.js +37 -0
- package/dist/core/parser.js +7 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -27
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +288 -0
- package/dist/types.d.ts +2 -2
- package/examples/sample-code-for-review.md +43 -0
- package/examples/sample-prd.md +31 -0
- package/examples/sample-premise.txt +1 -0
- package/integrations/aider/CONVENTIONS.md +50 -0
- package/integrations/aider/README.md +112 -0
- package/integrations/antigravity/AGENTS.md +1 -1
- package/integrations/antigravity/README.md +2 -2
- package/integrations/claude-code/README.md +27 -11
- package/integrations/codex/README.md +2 -2
- package/integrations/codex/instructions.md +1 -1
- package/integrations/copilot/README.md +111 -0
- package/integrations/copilot/copilot-instructions.md +50 -0
- package/integrations/cursor/README.md +31 -3
- package/integrations/cursor/workflow-runner.mdc +1 -1
- package/integrations/deerflow/README.md +2 -2
- package/integrations/deerflow/SKILL.md +1 -1
- package/integrations/gemini-cli/GEMINI.md +1 -1
- package/integrations/gemini-cli/README.md +2 -2
- package/integrations/kiro/README.md +1 -1
- package/integrations/kiro/ao-workflow-runner.md +1 -1
- package/integrations/openclaw/README.md +2 -2
- package/integrations/opencode/README.md +72 -0
- package/integrations/opencode/instructions.md +50 -0
- package/integrations/qwen/README.md +104 -0
- package/integrations/qwen/ao-workflow-runner.md +50 -0
- package/integrations/trae/README.md +1 -1
- package/integrations/trae/ao-workflow-runner.md +1 -1
- package/integrations/windsurf/.windsurfrules +50 -0
- package/integrations/windsurf/README.md +110 -0
- package/package.json +26 -4
- package/workflows/ai-opinion-article.yaml +122 -0
- package/workflows/content-pipeline.yaml +1 -1
- package/workflows/department-collab/ceo-org-delegation.yaml +189 -0
- package/workflows/dev/pr-review.yaml +20 -10
- package/workflows/dev/tech-design-review.yaml +115 -0
- package/workflows/hr/interview-questions.yaml +108 -0
- package/workflows/legal/contract-review.yaml +106 -0
- package/workflows/marketing/competitor-analysis.yaml +99 -0
- package/workflows/marketing/seo-content-matrix.yaml +98 -0
- package/workflows/marketing/xiaohongshu-content.yaml +103 -0
- package/workflows/ops/weekly-report.yaml +90 -0
- package/workflows/product-review.yaml +56 -21
- package/workflows/story-creation.yaml +48 -33
- package/workflows/strategy/business-plan.yaml +122 -0
- package/README.zh-CN.md +0 -471
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# PR Description
|
|
2
|
+
|
|
3
|
+
Add user search API endpoint with database filtering.
|
|
4
|
+
|
|
5
|
+
## Code Changes
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// src/routes/users.ts
|
|
9
|
+
import { Router } from 'express';
|
|
10
|
+
import { db } from '../database';
|
|
11
|
+
|
|
12
|
+
const router = Router();
|
|
13
|
+
const API_SECRET = 'sk-prod-a8f3b2c1d4e5'; // TODO: move to env
|
|
14
|
+
|
|
15
|
+
router.get('/search', async (req, res) => {
|
|
16
|
+
const { name, department } = req.query;
|
|
17
|
+
|
|
18
|
+
// Search users by name
|
|
19
|
+
const query = `SELECT * FROM users WHERE name LIKE '%${name}%'`;
|
|
20
|
+
const users = await db.raw(query);
|
|
21
|
+
|
|
22
|
+
// Get department info for each user
|
|
23
|
+
const results = [];
|
|
24
|
+
for (const user of users) {
|
|
25
|
+
const dept = await db('departments').where('id', user.department_id).first();
|
|
26
|
+
results.push({ ...user, department: dept });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
res.json({ users: results });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
router.post('/batch-update', async (req, res) => {
|
|
33
|
+
const { userIds, updates } = req.body;
|
|
34
|
+
|
|
35
|
+
for (const id of userIds) {
|
|
36
|
+
await db('users').where('id', id).update(updates);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
res.json({ updated: userIds.length });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default router;
|
|
43
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Team Notification System PRD
|
|
2
|
+
|
|
3
|
+
## Background
|
|
4
|
+
Team members miss important updates because messages are scattered across Slack, email, and project management tools.
|
|
5
|
+
|
|
6
|
+
## Goal
|
|
7
|
+
Build a unified notification center that aggregates messages from multiple sources and delivers them based on urgency and user preferences.
|
|
8
|
+
|
|
9
|
+
## Core Requirements
|
|
10
|
+
1. **Aggregation**: Pull notifications from Slack, GitHub, and Jira
|
|
11
|
+
2. **Priority**: Auto-classify notifications as urgent/normal/low based on content and sender
|
|
12
|
+
3. **Delivery**: Push to mobile app, browser extension, or daily digest email
|
|
13
|
+
4. **Preferences**: Users can set quiet hours, mute specific channels, configure per-source rules
|
|
14
|
+
|
|
15
|
+
## Target Users
|
|
16
|
+
- Engineering teams (10-50 people)
|
|
17
|
+
- Using at least 3 collaboration tools
|
|
18
|
+
|
|
19
|
+
## Success Metrics
|
|
20
|
+
- 80% of users check notifications daily within first month
|
|
21
|
+
- Average response time to urgent notifications < 5 minutes
|
|
22
|
+
- 50% reduction in "I didn't see that message" incidents
|
|
23
|
+
|
|
24
|
+
## Timeline
|
|
25
|
+
- MVP: 6 weeks
|
|
26
|
+
- V1 with all integrations: 12 weeks
|
|
27
|
+
|
|
28
|
+
## Open Questions
|
|
29
|
+
- Should we support custom webhook sources?
|
|
30
|
+
- How to handle notification deduplication across platforms?
|
|
31
|
+
- Mobile app vs PWA for push notifications?
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
一个程序员发现 AI 的回复里包含了它不该知道的信息——他女儿昨晚说的梦话。
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
## Multi-Role Workflow Runner
|
|
2
|
+
|
|
3
|
+
When the user asks to run a workflow (YAML file) or a multi-role collaboration task, follow these steps:
|
|
4
|
+
|
|
5
|
+
### 1. Parse Workflow
|
|
6
|
+
Read the specified YAML file. Extract name, inputs, steps, depends_on, conditions, and loops.
|
|
7
|
+
|
|
8
|
+
### 2. Collect Inputs
|
|
9
|
+
- `required: true` inputs must be provided by the user
|
|
10
|
+
- Optional inputs with `default` use the default value
|
|
11
|
+
- Optional inputs without default are set to empty string
|
|
12
|
+
|
|
13
|
+
### 3. Build Execution Order
|
|
14
|
+
Topological sort by `depends_on`. Steps without dependencies belong to the same level and can run in parallel.
|
|
15
|
+
|
|
16
|
+
### 4. Execute Steps
|
|
17
|
+
For each step:
|
|
18
|
+
1. Read `agency-agents-zh/{role}.md` (search order: YAML's agents_dir → ./agency-agents-zh/ → ../agency-agents-zh/ → node_modules/agency-agents-zh/)
|
|
19
|
+
2. Extract all markdown content after the frontmatter (`---`) as the role personality
|
|
20
|
+
3. Replace `{{variables}}` in the task with context values (from inputs or previous step outputs)
|
|
21
|
+
4. **Evaluate conditions**: if `condition` is set, evaluate it. Skip the step if the condition is not met. Operators: `contains`, `equals`, `not_contains`, `not_equals`
|
|
22
|
+
5. **Fully embody the role** — use that role's expertise, frameworks, and communication style. Output should be substantive.
|
|
23
|
+
6. Store the step's output text into the context variable (if step has an `output` field)
|
|
24
|
+
7. **Check loops**: if `loop` is set and exit_condition is not met, jump back to `loop.back_to` step (max: `loop.max_iterations` rounds)
|
|
25
|
+
|
|
26
|
+
Label each step: `### Step N/Total: step_id (Role Name)`
|
|
27
|
+
|
|
28
|
+
### 5. Save Results
|
|
29
|
+
Save all outputs to files:
|
|
30
|
+
```
|
|
31
|
+
ao-output/{workflow-name}-{date}/
|
|
32
|
+
├── steps/
|
|
33
|
+
│ ├── 1-{step_id}.md
|
|
34
|
+
│ └── ...
|
|
35
|
+
├── summary.md # Final step's full output
|
|
36
|
+
└── metadata.json # Step states, timing, token counts
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 6. Suggest Iteration
|
|
40
|
+
After completion, always tell the user:
|
|
41
|
+
|
|
42
|
+
> To improve a specific step, ask me to re-run from that step. I'll reuse all upstream outputs.
|
|
43
|
+
> For CLI: `ao run <workflow> --resume last --from <step-id>`
|
|
44
|
+
|
|
45
|
+
### Important Rules
|
|
46
|
+
- Each step must genuinely embody the assigned role — no generic responses
|
|
47
|
+
- Never skip or merge steps; execute strictly in topological order
|
|
48
|
+
- If a role file is missing, tell the user to install agency-agents-zh
|
|
49
|
+
- If a condition is not met, mark the step as "skipped" and continue
|
|
50
|
+
- For `depends_on_mode: "any_completed"`, proceed when ANY upstream step completes (not all)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Aider 集成
|
|
2
|
+
|
|
3
|
+
在 Aider(开源 AI 编程终端工具)中直接运行多角色工作流,无需额外 API key。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 1. 下载 186 个 AI 角色
|
|
9
|
+
cd your-project
|
|
10
|
+
git clone --depth 1 https://github.com/jnMetaCode/agency-agents-zh.git
|
|
11
|
+
|
|
12
|
+
# 2. 下载工作流模板和约定文件
|
|
13
|
+
git clone --depth 1 https://github.com/jnMetaCode/agency-orchestrator.git .ao-tmp
|
|
14
|
+
cp -r .ao-tmp/workflows ./workflows
|
|
15
|
+
cp .ao-tmp/integrations/aider/CONVENTIONS.md ./CONVENTIONS.md
|
|
16
|
+
rm -rf .ao-tmp
|
|
17
|
+
|
|
18
|
+
# 3. 开始使用
|
|
19
|
+
# 启动 aider 时会自动加载 CONVENTIONS.md
|
|
20
|
+
aider
|
|
21
|
+
# 然后说:运行 workflows/story-creation.yaml
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
如果项目根目录已有 `CONVENTIONS.md`,可将内容追加而非覆盖:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# 替换上面第 2 步中的 cp 命令为:
|
|
28
|
+
cat .ao-tmp/integrations/aider/CONVENTIONS.md >> ./CONVENTIONS.md
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 使用方式
|
|
32
|
+
|
|
33
|
+
### 方式一:Aider 会话模式(推荐)
|
|
34
|
+
|
|
35
|
+
启动 aider 后,CONVENTIONS.md 会自动加载。直接说:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
运行 workflows/story-creation.yaml,创意是"一个程序员在凌晨发现AI回复不该知道的事"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
或者不用 YAML 文件,直接描述协作需求:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
用叙事学家设计结构,心理学家塑造人物,内容创作者执笔,帮我写一个关于时间旅行的故事
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Aider 会自动:
|
|
48
|
+
- 解析工作流 / 生成工作流
|
|
49
|
+
- 按 DAG 顺序加载每个角色
|
|
50
|
+
- 扮演角色执行每一步
|
|
51
|
+
- 将结果保存到 `ao-output/`
|
|
52
|
+
|
|
53
|
+
### 方式二:CLI 模式(需要 API key)
|
|
54
|
+
|
|
55
|
+
如果你需要批量执行、CI/CD 集成或脚本调用:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install -g agency-orchestrator
|
|
59
|
+
export DEEPSEEK_API_KEY=sk-xxx # 或 ANTHROPIC_API_KEY / OPENAI_API_KEY
|
|
60
|
+
ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 对比
|
|
64
|
+
|
|
65
|
+
| 特性 | Aider 会话模式 | CLI 模式 |
|
|
66
|
+
|------|:----------:|:--------:|
|
|
67
|
+
| 需要 API key | 使用 Aider 自身的 key | 需要 |
|
|
68
|
+
| 需要安装 | CONVENTIONS.md → 项目根目录 | agency-orchestrator |
|
|
69
|
+
| 执行环境 | Aider 会话内 | 终端 |
|
|
70
|
+
| 并行执行 | 代理按 DAG 层级依次执行 | Promise.allSettled |
|
|
71
|
+
| 适合场景 | 交互式、一次性任务 | 批量、自动化、CI/CD |
|
|
72
|
+
| 输出 | 会话内 + 文件 | 文件 |
|
|
73
|
+
|
|
74
|
+
## 可用工作流
|
|
75
|
+
|
|
76
|
+
| 工作流 | 文件 | 说明 |
|
|
77
|
+
|--------|------|------|
|
|
78
|
+
| 短篇小说创作 | `story-creation.yaml` | 叙事学家 → 心理学家 + 叙事设计师 → 内容创作者 |
|
|
79
|
+
| 产品需求评审 | `product-review.yaml` | 产品经理 → 架构师 + UX 研究员 → 产品经理 |
|
|
80
|
+
| 内容流水线 | `content-pipeline.yaml` | 策略师 → 创作者 + SEO → 编辑 |
|
|
81
|
+
|
|
82
|
+
## 自定义工作流
|
|
83
|
+
|
|
84
|
+
创建你自己的 YAML 工作流文件:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
name: "我的工作流"
|
|
88
|
+
agents_dir: "agency-agents-zh"
|
|
89
|
+
|
|
90
|
+
inputs:
|
|
91
|
+
- name: topic
|
|
92
|
+
description: "主题"
|
|
93
|
+
required: true
|
|
94
|
+
|
|
95
|
+
steps:
|
|
96
|
+
- id: research
|
|
97
|
+
role: "marketing/marketing-content-strategist"
|
|
98
|
+
task: "研究以下主题的内容策略:{{topic}}"
|
|
99
|
+
output: strategy
|
|
100
|
+
|
|
101
|
+
- id: write
|
|
102
|
+
role: "marketing/marketing-content-creator"
|
|
103
|
+
task: "根据以下策略撰写文章:{{strategy}}"
|
|
104
|
+
depends_on: [research]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
查看所有可用角色:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
ao roles
|
|
111
|
+
# 或在 Aider 中说:列出 agency-agents-zh 里的所有角色
|
|
112
|
+
```
|
|
@@ -41,7 +41,7 @@ Antigravity 会根据 AGENTS.md 中的 workflow-runner 指令:
|
|
|
41
41
|
- 解析 YAML 工作流
|
|
42
42
|
- 加载每个角色的 .md 定义
|
|
43
43
|
- 按 DAG 顺序逐步执行
|
|
44
|
-
- 保存结果到
|
|
44
|
+
- 保存结果到 `ao-output/`
|
|
45
45
|
|
|
46
46
|
### 方式二:自然语言模式
|
|
47
47
|
|
|
@@ -69,4 +69,4 @@ ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
|
69
69
|
|
|
70
70
|
## 自定义工作流
|
|
71
71
|
|
|
72
|
-
参见 [工作流格式文档](../../README.
|
|
72
|
+
参见 [工作流格式文档](../../README.md)。
|
|
@@ -2,28 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
在 Claude Code 中直接运行多角色工作流,**无需 API key**。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
### 方式一:Skill 模式(推荐,零配置)
|
|
8
|
-
|
|
9
|
-
安装 [superpowers-zh](https://github.com/jnMetaCode/superpowers-zh) 后,Claude Code 会自动获得 `workflow-runner` 技能。
|
|
5
|
+
## 安装
|
|
10
6
|
|
|
11
7
|
```bash
|
|
12
8
|
# 1. 安装 superpowers-zh(如果还没有)
|
|
13
9
|
npx superpowers-zh
|
|
14
10
|
|
|
15
|
-
# 2.
|
|
11
|
+
# 2. 下载 186 个 AI 角色
|
|
16
12
|
cd your-project
|
|
17
13
|
git clone --depth 1 https://github.com/jnMetaCode/agency-agents-zh.git
|
|
14
|
+
|
|
15
|
+
# 3. 下载工作流模板
|
|
16
|
+
git clone --depth 1 https://github.com/jnMetaCode/agency-orchestrator.git .ao-tmp
|
|
17
|
+
cp -r .ao-tmp/workflows ./workflows
|
|
18
|
+
rm -rf .ao-tmp
|
|
19
|
+
|
|
20
|
+
# 4. 开始使用
|
|
21
|
+
# 在 Claude Code 中直接说:运行 workflows/story-creation.yaml
|
|
18
22
|
```
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
## 使用方式
|
|
25
|
+
|
|
26
|
+
### 方式一:Skill 模式(推荐,零配置)
|
|
27
|
+
|
|
28
|
+
安装 [superpowers-zh](https://github.com/jnMetaCode/superpowers-zh) 后,Claude Code 会自动获得 `workflow-runner` 技能。
|
|
29
|
+
|
|
30
|
+
在 Claude Code 中直接说:
|
|
21
31
|
|
|
22
32
|
```
|
|
23
33
|
运行 workflows/story-creation.yaml,创意是"一个程序员在凌晨发现AI回复不该知道的事"
|
|
24
34
|
```
|
|
25
35
|
|
|
26
|
-
或者不用 YAML
|
|
36
|
+
或者不用 YAML 文件,直接描述协作需求:
|
|
27
37
|
|
|
28
38
|
```
|
|
29
39
|
用叙事学家设计结构,心理学家塑造人物,内容创作者执笔,帮我写一个关于时间旅行的故事
|
|
@@ -33,7 +43,7 @@ Claude Code 会自动:
|
|
|
33
43
|
- 解析工作流 / 生成工作流
|
|
34
44
|
- 按 DAG 顺序加载每个角色
|
|
35
45
|
- 扮演角色执行每一步
|
|
36
|
-
- 将结果保存到
|
|
46
|
+
- 将结果保存到 `ao-output/`
|
|
37
47
|
|
|
38
48
|
### 方式二:CLI 模式(需要 API key)
|
|
39
49
|
|
|
@@ -41,9 +51,7 @@ Claude Code 会自动:
|
|
|
41
51
|
|
|
42
52
|
```bash
|
|
43
53
|
npm install -g agency-orchestrator
|
|
44
|
-
|
|
45
54
|
export DEEPSEEK_API_KEY=sk-xxx # 或 ANTHROPIC_API_KEY / OPENAI_API_KEY
|
|
46
|
-
|
|
47
55
|
ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
48
56
|
```
|
|
49
57
|
|
|
@@ -58,6 +66,14 @@ ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
|
58
66
|
| 适合场景 | 交互式、一次性任务 | 批量、自动化、CI/CD |
|
|
59
67
|
| 输出 | 会话内 + 文件 | 文件 |
|
|
60
68
|
|
|
69
|
+
## 可用工作流
|
|
70
|
+
|
|
71
|
+
| 工作流 | 文件 | 说明 |
|
|
72
|
+
|--------|------|------|
|
|
73
|
+
| 短篇小说创作 | `story-creation.yaml` | 叙事学家 → 心理学家 + 叙事设计师 → 内容创作者 |
|
|
74
|
+
| 产品需求评审 | `product-review.yaml` | 产品经理 → 架构师 + UX 研究员 → 产品经理 |
|
|
75
|
+
| 内容流水线 | `content-pipeline.yaml` | 策略师 → 创作者 + SEO → 编辑 |
|
|
76
|
+
|
|
61
77
|
## 自定义工作流
|
|
62
78
|
|
|
63
79
|
创建你自己的 YAML 工作流文件:
|
|
@@ -42,7 +42,7 @@ Codex CLI 会根据 `.codex/instructions.md` 中的 workflow-runner 指令:
|
|
|
42
42
|
- 解析 YAML 工作流
|
|
43
43
|
- 加载每个角色的 .md 定义
|
|
44
44
|
- 按 DAG 顺序逐步执行
|
|
45
|
-
- 保存结果到
|
|
45
|
+
- 保存结果到 `ao-output/`
|
|
46
46
|
|
|
47
47
|
### 方式二:自然语言模式
|
|
48
48
|
|
|
@@ -70,4 +70,4 @@ ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
|
70
70
|
|
|
71
71
|
## 自定义工作流
|
|
72
72
|
|
|
73
|
-
参见 [工作流格式文档](../../README.
|
|
73
|
+
参见 [工作流格式文档](../../README.md)。
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# GitHub Copilot 集成
|
|
2
|
+
|
|
3
|
+
在 GitHub Copilot(VS Code / JetBrains)中直接运行多角色工作流,无需额外 API key。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 1. 下载 186 个 AI 角色
|
|
9
|
+
cd your-project
|
|
10
|
+
git clone --depth 1 https://github.com/jnMetaCode/agency-agents-zh.git
|
|
11
|
+
|
|
12
|
+
# 2. 下载工作流模板和指令文件
|
|
13
|
+
git clone --depth 1 https://github.com/jnMetaCode/agency-orchestrator.git .ao-tmp
|
|
14
|
+
cp -r .ao-tmp/workflows ./workflows
|
|
15
|
+
mkdir -p .github
|
|
16
|
+
cp .ao-tmp/integrations/copilot/copilot-instructions.md .github/copilot-instructions.md
|
|
17
|
+
rm -rf .ao-tmp
|
|
18
|
+
|
|
19
|
+
# 3. 开始使用
|
|
20
|
+
# 在 Copilot Chat 中直接说:运行 workflows/story-creation.yaml
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
如果项目已有 `.github/copilot-instructions.md`,可将内容追加而非覆盖:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# 替换上面第 2 步中的 cp 命令为:
|
|
27
|
+
cat .ao-tmp/integrations/copilot/copilot-instructions.md >> .github/copilot-instructions.md
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 使用方式
|
|
31
|
+
|
|
32
|
+
### 方式一:Copilot Chat 模式(推荐)
|
|
33
|
+
|
|
34
|
+
将 `copilot-instructions.md` 放入 `.github/` 后,Copilot Chat 会自动加载项目级指令。在 Copilot Chat 中直接说:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
运行 workflows/story-creation.yaml,创意是"一个程序员在凌晨发现AI回复不该知道的事"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
或者不用 YAML 文件,直接描述协作需求:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
用叙事学家设计结构,心理学家塑造人物,内容创作者执笔,帮我写一个关于时间旅行的故事
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Copilot 会自动:
|
|
47
|
+
- 解析工作流 / 生成工作流
|
|
48
|
+
- 按 DAG 顺序加载每个角色
|
|
49
|
+
- 扮演角色执行每一步
|
|
50
|
+
- 将结果保存到 `ao-output/`
|
|
51
|
+
|
|
52
|
+
### 方式二:CLI 模式(需要 API key)
|
|
53
|
+
|
|
54
|
+
如果你需要批量执行、CI/CD 集成或脚本调用:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm install -g agency-orchestrator
|
|
58
|
+
export DEEPSEEK_API_KEY=sk-xxx # 或 ANTHROPIC_API_KEY / OPENAI_API_KEY
|
|
59
|
+
ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 对比
|
|
63
|
+
|
|
64
|
+
| 特性 | Copilot Chat 模式 | CLI 模式 |
|
|
65
|
+
|------|:----------:|:--------:|
|
|
66
|
+
| 需要 API key | 不需要 | 需要 |
|
|
67
|
+
| 需要安装 | copilot-instructions.md → .github/ | agency-orchestrator |
|
|
68
|
+
| 执行环境 | Copilot Chat 会话内 | 终端 |
|
|
69
|
+
| 并行执行 | 代理按 DAG 层级依次执行 | Promise.allSettled |
|
|
70
|
+
| 适合场景 | 交互式、一次性任务 | 批量、自动化、CI/CD |
|
|
71
|
+
| 输出 | 会话内 + 文件 | 文件 |
|
|
72
|
+
|
|
73
|
+
## 可用工作流
|
|
74
|
+
|
|
75
|
+
| 工作流 | 文件 | 说明 |
|
|
76
|
+
|--------|------|------|
|
|
77
|
+
| 短篇小说创作 | `story-creation.yaml` | 叙事学家 → 心理学家 + 叙事设计师 → 内容创作者 |
|
|
78
|
+
| 产品需求评审 | `product-review.yaml` | 产品经理 → 架构师 + UX 研究员 → 产品经理 |
|
|
79
|
+
| 内容流水线 | `content-pipeline.yaml` | 策略师 → 创作者 + SEO → 编辑 |
|
|
80
|
+
|
|
81
|
+
## 自定义工作流
|
|
82
|
+
|
|
83
|
+
创建你自己的 YAML 工作流文件:
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
name: "我的工作流"
|
|
87
|
+
agents_dir: "agency-agents-zh"
|
|
88
|
+
|
|
89
|
+
inputs:
|
|
90
|
+
- name: topic
|
|
91
|
+
description: "主题"
|
|
92
|
+
required: true
|
|
93
|
+
|
|
94
|
+
steps:
|
|
95
|
+
- id: research
|
|
96
|
+
role: "marketing/marketing-content-strategist"
|
|
97
|
+
task: "研究以下主题的内容策略:{{topic}}"
|
|
98
|
+
output: strategy
|
|
99
|
+
|
|
100
|
+
- id: write
|
|
101
|
+
role: "marketing/marketing-content-creator"
|
|
102
|
+
task: "根据以下策略撰写文章:{{strategy}}"
|
|
103
|
+
depends_on: [research]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
查看所有可用角色:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
ao roles
|
|
110
|
+
# 或在 Copilot Chat 中说:列出 agency-agents-zh 里的所有角色
|
|
111
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
## Multi-Role Workflow Runner
|
|
2
|
+
|
|
3
|
+
When the user asks to run a workflow (YAML file) or a multi-role collaboration task, follow these steps:
|
|
4
|
+
|
|
5
|
+
### 1. Parse Workflow
|
|
6
|
+
Read the specified YAML file. Extract name, inputs, steps, depends_on, conditions, and loops.
|
|
7
|
+
|
|
8
|
+
### 2. Collect Inputs
|
|
9
|
+
- `required: true` inputs must be provided by the user
|
|
10
|
+
- Optional inputs with `default` use the default value
|
|
11
|
+
- Optional inputs without default are set to empty string
|
|
12
|
+
|
|
13
|
+
### 3. Build Execution Order
|
|
14
|
+
Topological sort by `depends_on`. Steps without dependencies belong to the same level and can run in parallel.
|
|
15
|
+
|
|
16
|
+
### 4. Execute Steps
|
|
17
|
+
For each step:
|
|
18
|
+
1. Read `agency-agents-zh/{role}.md` (search order: YAML's agents_dir → ./agency-agents-zh/ → ../agency-agents-zh/ → node_modules/agency-agents-zh/)
|
|
19
|
+
2. Extract all markdown content after the frontmatter (`---`) as the role personality
|
|
20
|
+
3. Replace `{{variables}}` in the task with context values (from inputs or previous step outputs)
|
|
21
|
+
4. **Evaluate conditions**: if `condition` is set, evaluate it. Skip the step if the condition is not met. Operators: `contains`, `equals`, `not_contains`, `not_equals`
|
|
22
|
+
5. **Fully embody the role** — use that role's expertise, frameworks, and communication style. Output should be substantive.
|
|
23
|
+
6. Store the step's output text into the context variable (if step has an `output` field)
|
|
24
|
+
7. **Check loops**: if `loop` is set and exit_condition is not met, jump back to `loop.back_to` step (max: `loop.max_iterations` rounds)
|
|
25
|
+
|
|
26
|
+
Label each step: `### Step N/Total: step_id (Role Name)`
|
|
27
|
+
|
|
28
|
+
### 5. Save Results
|
|
29
|
+
Save all outputs to files:
|
|
30
|
+
```
|
|
31
|
+
ao-output/{workflow-name}-{date}/
|
|
32
|
+
├── steps/
|
|
33
|
+
│ ├── 1-{step_id}.md
|
|
34
|
+
│ └── ...
|
|
35
|
+
├── summary.md # Final step's full output
|
|
36
|
+
└── metadata.json # Step states, timing, token counts
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 6. Suggest Iteration
|
|
40
|
+
After completion, always tell the user:
|
|
41
|
+
|
|
42
|
+
> To improve a specific step, ask me to re-run from that step. I'll reuse all upstream outputs.
|
|
43
|
+
> For CLI: `ao run <workflow> --resume last --from <step-id>`
|
|
44
|
+
|
|
45
|
+
### Important Rules
|
|
46
|
+
- Each step must genuinely embody the assigned role — no generic responses
|
|
47
|
+
- Never skip or merge steps; execute strictly in topological order
|
|
48
|
+
- If a role file is missing, tell the user to install agency-agents-zh
|
|
49
|
+
- If a condition is not met, mark the step as "skipped" and continue
|
|
50
|
+
- For `depends_on_mode: "any_completed"`, proceed when ANY upstream step completes (not all)
|
|
@@ -57,7 +57,7 @@ alwaysApply: false
|
|
|
57
57
|
每步开始时标注:### Step N/Total: step_id(角色名)
|
|
58
58
|
|
|
59
59
|
### 5. 保存结果
|
|
60
|
-
保存到
|
|
60
|
+
保存到 ao-output/{名称}-{日期}/ 目录:
|
|
61
61
|
- steps/1-{id}.md — 每步输出
|
|
62
62
|
- summary.md — 最终成果
|
|
63
63
|
```
|
|
@@ -96,6 +96,34 @@ ao run workflows/story-creation.yaml -i 'premise=时间旅行'
|
|
|
96
96
|
| 产品需求评审 | `product-review.yaml` | 产品经理 → 架构师 + UX 研究员 → 产品经理 |
|
|
97
97
|
| 内容流水线 | `content-pipeline.yaml` | 策略师 → 创作者 + SEO → 编辑 |
|
|
98
98
|
|
|
99
|
-
##
|
|
99
|
+
## 自定义工作流
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
创建你自己的 YAML 工作流文件:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
name: "我的工作流"
|
|
105
|
+
agents_dir: "agency-agents-zh"
|
|
106
|
+
|
|
107
|
+
inputs:
|
|
108
|
+
- name: topic
|
|
109
|
+
description: "主题"
|
|
110
|
+
required: true
|
|
111
|
+
|
|
112
|
+
steps:
|
|
113
|
+
- id: research
|
|
114
|
+
role: "marketing/marketing-content-strategist"
|
|
115
|
+
task: "研究以下主题的内容策略:{{topic}}"
|
|
116
|
+
output: strategy
|
|
117
|
+
|
|
118
|
+
- id: write
|
|
119
|
+
role: "marketing/marketing-content-creator"
|
|
120
|
+
task: "根据以下策略撰写文章:{{strategy}}"
|
|
121
|
+
depends_on: [research]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
查看所有可用角色:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
ao roles
|
|
128
|
+
# 或在 Cursor 中说:列出 agency-agents-zh 里的所有角色
|
|
129
|
+
```
|
|
@@ -35,7 +35,7 @@ DeerFlow 会通过 ao-workflow-runner 技能:
|
|
|
35
35
|
- 解析 YAML 工作流
|
|
36
36
|
- 加载每个角色的 .md 定义
|
|
37
37
|
- 按 DAG 顺序逐步执行
|
|
38
|
-
- 保存结果到
|
|
38
|
+
- 保存结果到 `ao-output/`
|
|
39
39
|
|
|
40
40
|
### 方式二:自然语言模式
|
|
41
41
|
|
|
@@ -64,4 +64,4 @@ ao run workflows/product-review.yaml -i prd_content=@prd.md
|
|
|
64
64
|
|
|
65
65
|
## 自定义工作流
|
|
66
66
|
|
|
67
|
-
参见 [工作流格式文档](../../README.
|
|
67
|
+
参见 [工作流格式文档](../../README.md)。
|
|
@@ -41,7 +41,7 @@ Gemini CLI 会根据 GEMINI.md 中的 workflow-runner 指令:
|
|
|
41
41
|
- 解析 YAML 工作流
|
|
42
42
|
- 加载每个角色的 .md 定义
|
|
43
43
|
- 按 DAG 顺序逐步执行
|
|
44
|
-
- 保存结果到
|
|
44
|
+
- 保存结果到 `ao-output/`
|
|
45
45
|
|
|
46
46
|
### 方式二:自然语言模式
|
|
47
47
|
|
|
@@ -69,4 +69,4 @@ ao run workflows/story-creation.yaml -i 'premise=时间旅行的故事'
|
|
|
69
69
|
|
|
70
70
|
## 自定义工作流
|
|
71
71
|
|
|
72
|
-
参见 [工作流格式文档](../../README.
|
|
72
|
+
参见 [工作流格式文档](../../README.md)。
|
|
@@ -28,7 +28,7 @@ OpenClaw 会通过 superpowers-zh 的 `workflow-runner` 技能:
|
|
|
28
28
|
- 解析 YAML 工作流
|
|
29
29
|
- 加载每个角色的 .md 定义
|
|
30
30
|
- 按 DAG 顺序逐步执行
|
|
31
|
-
- 保存结果到
|
|
31
|
+
- 保存结果到 `ao-output/`
|
|
32
32
|
|
|
33
33
|
### 方式二:自然语言模式
|
|
34
34
|
|
|
@@ -57,4 +57,4 @@ ao run workflows/product-review.yaml -i prd_content=@prd.md
|
|
|
57
57
|
|
|
58
58
|
## 自定义工作流
|
|
59
59
|
|
|
60
|
-
参见 [工作流格式文档](../../README.
|
|
60
|
+
参见 [工作流格式文档](../../README.md)。
|