@markus-global/cli 0.8.1 → 0.8.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/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +52 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/markus.mjs +124247 -4767
- package/dist/web-ui/assets/index-CEBWX7wE.js +724 -0
- package/dist/web-ui/assets/index-DVGYGLou.css +1 -0
- package/dist/web-ui/index.html +3 -3
- package/package.json +1 -1
- package/templates/skills/agent-building/SKILL.md +1 -0
- package/templates/skills/skill-building/SKILL.md +3 -2
- package/templates/skills/team-building/SKILL.md +72 -3
- package/templates/skills/workflow-building/SKILL.md +467 -0
- package/templates/skills/workflow-building/skill.json +19 -0
- package/templates/teams/content-team/team.json +2 -1
- package/templates/teams/content-team/workflows/content-publishing.yaml +101 -0
- package/dist/web-ui/assets/browser-DMM1ORh5.js +0 -8
- package/dist/web-ui/assets/index-CCbspo7a.js +0 -711
- package/dist/web-ui/assets/index-DNRsw-vh.css +0 -1
|
@@ -21,6 +21,8 @@ This skill teaches you how to create Markus team packages — self-contained dir
|
|
|
21
21
|
├── README.md # Public-facing team overview for Hub/Builder (REQUIRED)
|
|
22
22
|
├── ANNOUNCEMENT.md # Team announcement (you write via file_write)
|
|
23
23
|
├── NORMS.md # Working norms (you write via file_write)
|
|
24
|
+
├── workflows/ # Workflow templates (optional)
|
|
25
|
+
│ └── {workflow-name}.yaml # YAML workflow DAG definition
|
|
24
26
|
└── members/
|
|
25
27
|
├── {manager-slug}/
|
|
26
28
|
│ ├── ROLE.md # Identity and system prompt (REQUIRED)
|
|
@@ -46,10 +48,11 @@ This skill teaches you how to create Markus team packages — self-contained dir
|
|
|
46
48
|
| `members/{name}/HEARTBEAT.md` | `~/.markus/agents/{agentId}/role/HEARTBEAT.md` | Periodic self-check checklist (every ~30 min) |
|
|
47
49
|
| `members/{name}/POLICIES.md` | `~/.markus/agents/{agentId}/role/POLICIES.md` | Additional agent constraints |
|
|
48
50
|
| `members/{name}/CONTEXT.md` | `~/.markus/agents/{agentId}/role/CONTEXT.md` | Domain context and references |
|
|
51
|
+
| `workflows/*.yaml` | `~/.markus/teams/{teamId}/workflows/*.yaml` | Workflow templates (runnable as task DAGs) |
|
|
49
52
|
|
|
50
|
-
##
|
|
53
|
+
## Creation Workflow
|
|
51
54
|
|
|
52
|
-
Output the team in
|
|
55
|
+
Output the team in up to three steps — manifest first, then content files, then optional workflow YAML. **Never put file content inline in the JSON.**
|
|
53
56
|
|
|
54
57
|
### Chat Mode vs Task Mode
|
|
55
58
|
|
|
@@ -94,7 +97,8 @@ This JSON contains ONLY metadata and structure — **no file content**.
|
|
|
94
97
|
"parallelImplementation": true,
|
|
95
98
|
"worktreeIsolation": true,
|
|
96
99
|
"requireReviewBeforeComplete": true
|
|
97
|
-
}
|
|
100
|
+
},
|
|
101
|
+
"workflows": ["workflows/my-workflow.yaml"]
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
```
|
|
@@ -157,6 +161,65 @@ file_write("~/.markus/builder-artifacts/teams/research-team/members/senior-resea
|
|
|
157
161
|
|
|
158
162
|
**IMPORTANT**: The member directory slug is derived from the member's `name` field — lowercased, spaces to hyphens, non-alphanumeric removed.
|
|
159
163
|
|
|
164
|
+
### Step 3: Write Workflow YAML (optional)
|
|
165
|
+
|
|
166
|
+
If the team has repeatable multi-step processes that should run as automated DAGs, add workflow templates. Each workflow is a YAML file that defines a sequence of tasks with dependencies, role assignments, and optional scheduling.
|
|
167
|
+
|
|
168
|
+
**When to include workflows:**
|
|
169
|
+
- The team has a process that runs repeatedly (e.g., weekly content publishing, daily reports)
|
|
170
|
+
- Multiple members need to collaborate in a defined sequence
|
|
171
|
+
- You want steps to run in parallel where possible and wait on dependencies automatically
|
|
172
|
+
|
|
173
|
+
**Write each workflow YAML to `workflows/`:**
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
file_write("~/.markus/builder-artifacts/teams/{team-name}/workflows/content-publishing.yaml", "<YAML content>")
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Make sure `team.workflows` in your manifest references the file:
|
|
180
|
+
```json
|
|
181
|
+
"workflows": ["workflows/content-publishing.yaml"]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Minimal workflow example:**
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
name: content-publishing
|
|
188
|
+
displayName: Content Publishing
|
|
189
|
+
description: Plan, write, and review content
|
|
190
|
+
version: "1.0.0"
|
|
191
|
+
|
|
192
|
+
params:
|
|
193
|
+
- name: topic
|
|
194
|
+
type: string
|
|
195
|
+
required: true
|
|
196
|
+
|
|
197
|
+
steps:
|
|
198
|
+
- id: plan
|
|
199
|
+
name: Plan Content
|
|
200
|
+
type: agent_task
|
|
201
|
+
role: editor
|
|
202
|
+
prompt: "Create a content plan for: {{topic}}"
|
|
203
|
+
|
|
204
|
+
- id: write
|
|
205
|
+
name: Write Draft
|
|
206
|
+
type: agent_task
|
|
207
|
+
role: writer
|
|
208
|
+
depends_on: [plan]
|
|
209
|
+
inputs: [{ from: plan, as: content_plan }]
|
|
210
|
+
prompt: "Write content about {{topic}} following the plan."
|
|
211
|
+
|
|
212
|
+
- id: review
|
|
213
|
+
name: Review & Publish
|
|
214
|
+
type: agent_task
|
|
215
|
+
role: editor
|
|
216
|
+
depends_on: [write]
|
|
217
|
+
inputs: [{ from: write, as: draft }]
|
|
218
|
+
prompt: "Review the draft and finalize for publishing."
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
For the full YAML format reference, DAG patterns, scheduling, and more examples, activate the **`workflow-building`** skill.
|
|
222
|
+
|
|
160
223
|
## Field Reference
|
|
161
224
|
|
|
162
225
|
### Top-level fields
|
|
@@ -182,6 +245,11 @@ file_write("~/.markus/builder-artifacts/teams/research-team/members/senior-resea
|
|
|
182
245
|
- **`worktreeIsolation`**: `true` if developers should work in isolated git worktrees (recommended for coding teams)
|
|
183
246
|
- **`requireReviewBeforeComplete`**: `true` if tasks must pass review before completion
|
|
184
247
|
|
|
248
|
+
### `team.workflows` — Workflow Template Files (optional)
|
|
249
|
+
- Array of YAML file paths relative to the package root, e.g. `["workflows/content-publishing.yaml"]`
|
|
250
|
+
- These files are copied to `~/.markus/teams/{teamId}/workflows/` on install and become runnable via the Workflows UI or `workflow_run` tool
|
|
251
|
+
- See the `workflow-building` skill for the full YAML format
|
|
252
|
+
|
|
185
253
|
## After Creation
|
|
186
254
|
|
|
187
255
|
> **CRITICAL**: Creating an artifact is NOT the same as installing/deploying it. Creating writes files to `builder-artifacts/`; installing deploys live agents that consume resources and join the org. **NEVER auto-install.** Only install when the user explicitly says "install", "deploy", or "hire". This applies to ALL modes (chat, task, A2A).
|
|
@@ -199,6 +267,7 @@ Once all files are written, tell the user:
|
|
|
199
267
|
- **DO NOT** put file content in the JSON. Always use `file_write` for files.
|
|
200
268
|
- **DO NOT** write artifacts to `~/.markus/shared/` or your working directory. Always use `~/.markus/builder-artifacts/teams/{name}/`.
|
|
201
269
|
- **The `name` field MUST be English kebab-case**.
|
|
270
|
+
- **All top-level fields must be the correct type**: `author` must be a plain string (e.g. `"John"`) — NOT an object. `tags` must be an array of strings. `version` must be semver string. `description` must be a string. The system validates the manifest on write and will reject malformed files.
|
|
202
271
|
- Every team MUST have exactly **one** member with `"role": "manager"` and at least **one** `"worker"`.
|
|
203
272
|
- Write each ROLE.md with **full attention** — at least 5 substantive paragraphs per member.
|
|
204
273
|
- Do NOT rush through members. Each one deserves careful, tailored content.
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-building
|
|
3
|
+
description: Design and create workflow templates — YAML format, DAG patterns, scheduling, and role mapping
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Building
|
|
7
|
+
|
|
8
|
+
This skill teaches you how to create **workflow templates** — YAML-based definitions of multi-step processes that are executed as a DAG (Directed Acyclic Graph) of tasks. Each step is assigned to a team member by role and runs automatically with dependency tracking.
|
|
9
|
+
|
|
10
|
+
## When to Use Workflows
|
|
11
|
+
|
|
12
|
+
Workflows are for **repeatable, multi-step processes** where:
|
|
13
|
+
- Multiple agents need to collaborate in a defined sequence
|
|
14
|
+
- Steps have clear dependencies (B waits for A to finish)
|
|
15
|
+
- The same process runs repeatedly with different parameters
|
|
16
|
+
- You want automatic scheduling (daily, weekly, etc.)
|
|
17
|
+
|
|
18
|
+
**Do NOT use workflows for**: one-off tasks, simple single-agent work, or ad-hoc coordination.
|
|
19
|
+
|
|
20
|
+
## How to Create Workflows
|
|
21
|
+
|
|
22
|
+
There are two ways to create a workflow, depending on context:
|
|
23
|
+
|
|
24
|
+
### For an existing (live) team
|
|
25
|
+
|
|
26
|
+
Use the `workflow_create` tool:
|
|
27
|
+
```
|
|
28
|
+
workflow_create(name: "content-publishing", yaml: "<full YAML content>")
|
|
29
|
+
```
|
|
30
|
+
This writes the YAML file directly to `~/.markus/teams/{teamId}/workflows/`.
|
|
31
|
+
|
|
32
|
+
### For a team package (builder artifact)
|
|
33
|
+
|
|
34
|
+
Write the YAML file via `file_write` to the team's artifact directory, then reference it in `team.json`:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
file_write("~/.markus/builder-artifacts/teams/{team-name}/workflows/my-workflow.yaml", "<YAML content>")
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
In `team.json`, add:
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"team": {
|
|
44
|
+
"members": [...],
|
|
45
|
+
"workflows": ["workflows/my-workflow.yaml"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The workflow YAML files are copied to `~/.markus/teams/{teamId}/workflows/` when the team is installed.
|
|
51
|
+
|
|
52
|
+
## YAML Format Reference
|
|
53
|
+
|
|
54
|
+
### Top-Level Fields
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
name: content-publishing # REQUIRED. Identifier (kebab-case, English)
|
|
58
|
+
displayName: Content Publishing # Optional. Human-readable name (any language)
|
|
59
|
+
description: Research, write, ... # REQUIRED. What this workflow does
|
|
60
|
+
version: "1.0.0" # REQUIRED. Semver
|
|
61
|
+
|
|
62
|
+
schedule: # Optional. Auto-trigger configuration
|
|
63
|
+
every: "1d" # Interval shorthand: 30m, 6h, 1d, 1w
|
|
64
|
+
cron: "0 9 * * 1-5" # OR cron expression
|
|
65
|
+
run_at: "2025-06-01T09:00:00Z" # OR one-shot ISO timestamp
|
|
66
|
+
timezone: "Asia/Shanghai" # IANA timezone (default: server local)
|
|
67
|
+
max_runs: 10 # Stop after N runs (0 = unlimited)
|
|
68
|
+
|
|
69
|
+
params: # Optional. User-provided or auto-generated inputs
|
|
70
|
+
- name: topic # Referenced as {{topic}} in step prompts
|
|
71
|
+
type: string # string | enum | text | agent
|
|
72
|
+
label: "Content Topic"
|
|
73
|
+
required: true
|
|
74
|
+
- name: platform
|
|
75
|
+
type: enum
|
|
76
|
+
options: ["wechat", "zhihu", "xiaohongshu", "x.com"]
|
|
77
|
+
default: "wechat"
|
|
78
|
+
|
|
79
|
+
steps: # REQUIRED. The task DAG (at least one step)
|
|
80
|
+
- id: research
|
|
81
|
+
name: Research Topic
|
|
82
|
+
type: agent_task
|
|
83
|
+
role: researcher
|
|
84
|
+
prompt: "Research {{topic}} thoroughly and produce a summary."
|
|
85
|
+
priority: high
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Step Fields
|
|
89
|
+
|
|
90
|
+
| Field | Required | Description |
|
|
91
|
+
|-------|----------|-------------|
|
|
92
|
+
| `id` | Yes | Unique identifier within the workflow |
|
|
93
|
+
| `name` | Yes | Human-readable step name |
|
|
94
|
+
| `type` | Yes | Always `agent_task` |
|
|
95
|
+
| `role` | Yes | Role placeholder mapped to a team member at run time |
|
|
96
|
+
| `prompt` | Yes | Task description. Supports `{{param}}` interpolation |
|
|
97
|
+
| `depends_on` | No | Array of step IDs that must complete first |
|
|
98
|
+
| `inputs` | No | Upstream deliverable references (see below) |
|
|
99
|
+
| `reviewer` | No | Role that reviews this step (defaults to team manager) |
|
|
100
|
+
| `priority` | No | `low`, `medium`, `high`, or `urgent` |
|
|
101
|
+
| `timeout` | No | Step timeout shorthand, e.g. `"30m"`, `"2h"` |
|
|
102
|
+
| `retry_count` | No | Number of retries on failure (default: 0) |
|
|
103
|
+
|
|
104
|
+
### Parameter Types
|
|
105
|
+
|
|
106
|
+
| Type | Description |
|
|
107
|
+
|------|-------------|
|
|
108
|
+
| `string` | Free-form text input |
|
|
109
|
+
| `enum` | Dropdown selection from `options[]` |
|
|
110
|
+
| `text` | Multi-line text input |
|
|
111
|
+
| `agent` | Agent ID picker |
|
|
112
|
+
|
|
113
|
+
### Built-in Template Variables
|
|
114
|
+
|
|
115
|
+
These are available in all step prompts without declaring params:
|
|
116
|
+
- `{{date}}` — Current date (YYYY-MM-DD)
|
|
117
|
+
- `{{time}}` — Current date and time (YYYY-MM-DD HH:MM)
|
|
118
|
+
- `{{run_number}}` — Sequential run number for this workflow
|
|
119
|
+
|
|
120
|
+
### Upstream Inputs
|
|
121
|
+
|
|
122
|
+
When a step depends on another step's output, use `inputs` to create a named reference:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
steps:
|
|
126
|
+
- id: research
|
|
127
|
+
name: Research
|
|
128
|
+
type: agent_task
|
|
129
|
+
role: researcher
|
|
130
|
+
prompt: "Research {{topic}} and produce a summary document."
|
|
131
|
+
|
|
132
|
+
- id: write
|
|
133
|
+
name: Write Draft
|
|
134
|
+
type: agent_task
|
|
135
|
+
role: writer
|
|
136
|
+
depends_on: [research]
|
|
137
|
+
inputs:
|
|
138
|
+
- from: research # Step ID of the upstream step
|
|
139
|
+
as: research_notes # Variable name in this step's context
|
|
140
|
+
prompt: "Write a draft about {{topic}} using the upstream research."
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The system automatically injects context about upstream deliverables into the step's prompt. The downstream agent can use `task_get` to retrieve the upstream step's full deliverables.
|
|
144
|
+
|
|
145
|
+
## DAG Design Patterns
|
|
146
|
+
|
|
147
|
+
### Linear Chain
|
|
148
|
+
|
|
149
|
+
Steps run one after another. Simple and predictable.
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
# A → B → C
|
|
153
|
+
steps:
|
|
154
|
+
- id: research
|
|
155
|
+
name: Research
|
|
156
|
+
type: agent_task
|
|
157
|
+
role: researcher
|
|
158
|
+
prompt: "Research the topic."
|
|
159
|
+
|
|
160
|
+
- id: write
|
|
161
|
+
name: Write
|
|
162
|
+
type: agent_task
|
|
163
|
+
role: writer
|
|
164
|
+
depends_on: [research]
|
|
165
|
+
prompt: "Write based on research."
|
|
166
|
+
|
|
167
|
+
- id: review
|
|
168
|
+
name: Review
|
|
169
|
+
type: agent_task
|
|
170
|
+
role: editor
|
|
171
|
+
depends_on: [write]
|
|
172
|
+
prompt: "Review and finalize the draft."
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Fan-Out (Parallel)
|
|
176
|
+
|
|
177
|
+
Multiple independent steps run simultaneously after a shared predecessor.
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
# ┌→ write_cn
|
|
181
|
+
# plan ──┤
|
|
182
|
+
# └→ write_en
|
|
183
|
+
steps:
|
|
184
|
+
- id: plan
|
|
185
|
+
name: Plan Content
|
|
186
|
+
type: agent_task
|
|
187
|
+
role: editor
|
|
188
|
+
prompt: "Create content outline for {{topic}}."
|
|
189
|
+
|
|
190
|
+
- id: write_cn
|
|
191
|
+
name: Write Chinese Version
|
|
192
|
+
type: agent_task
|
|
193
|
+
role: chinese_writer
|
|
194
|
+
depends_on: [plan]
|
|
195
|
+
inputs: [{ from: plan, as: outline }]
|
|
196
|
+
prompt: "Write the Chinese version based on the outline."
|
|
197
|
+
|
|
198
|
+
- id: write_en
|
|
199
|
+
name: Write English Version
|
|
200
|
+
type: agent_task
|
|
201
|
+
role: english_writer
|
|
202
|
+
depends_on: [plan]
|
|
203
|
+
inputs: [{ from: plan, as: outline }]
|
|
204
|
+
prompt: "Write the English version based on the outline."
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Fan-In (Aggregation)
|
|
208
|
+
|
|
209
|
+
One step waits for multiple parallel steps to complete.
|
|
210
|
+
|
|
211
|
+
```yaml
|
|
212
|
+
# write_cn ──┐
|
|
213
|
+
# ├→ publish
|
|
214
|
+
# write_en ──┘
|
|
215
|
+
steps:
|
|
216
|
+
# ... (plan, write_cn, write_en as above)
|
|
217
|
+
|
|
218
|
+
- id: publish
|
|
219
|
+
name: Final Review & Publish
|
|
220
|
+
type: agent_task
|
|
221
|
+
role: editor
|
|
222
|
+
depends_on: [write_cn, write_en]
|
|
223
|
+
inputs:
|
|
224
|
+
- { from: write_cn, as: chinese_draft }
|
|
225
|
+
- { from: write_en, as: english_draft }
|
|
226
|
+
prompt: "Review both drafts and prepare for publishing."
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Diamond
|
|
230
|
+
|
|
231
|
+
Combination of fan-out and fan-in — a common pattern for parallel work with consolidation.
|
|
232
|
+
|
|
233
|
+
```yaml
|
|
234
|
+
# ┌→ B ──┐
|
|
235
|
+
# A ────┤ ├→ D
|
|
236
|
+
# └→ C ──┘
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Role Design
|
|
240
|
+
|
|
241
|
+
Roles are **placeholders** that get mapped to actual team members at run time. The system auto-resolves roles by matching role names to agent names, skills, or role types.
|
|
242
|
+
|
|
243
|
+
**Best practices:**
|
|
244
|
+
- Use descriptive role names that match your team composition: `editor`, `chinese_writer`, `researcher`, `reviewer`
|
|
245
|
+
- Each role should map to a distinct team member or function
|
|
246
|
+
- The `reviewer` field defaults to the team manager — only override if a specific specialist should review
|
|
247
|
+
- Keep role names consistent across workflows in the same team
|
|
248
|
+
|
|
249
|
+
## Schedule Configuration
|
|
250
|
+
|
|
251
|
+
### Interval-Based
|
|
252
|
+
|
|
253
|
+
```yaml
|
|
254
|
+
schedule:
|
|
255
|
+
every: "6h" # Run every 6 hours
|
|
256
|
+
timezone: "Asia/Shanghai"
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Supported units: `s` (seconds), `m` (minutes), `h` (hours), `d` (days), `w` (weeks).
|
|
260
|
+
|
|
261
|
+
### Cron-Based
|
|
262
|
+
|
|
263
|
+
```yaml
|
|
264
|
+
schedule:
|
|
265
|
+
cron: "0 9 * * 1-5" # Weekdays at 9am
|
|
266
|
+
timezone: "Asia/Shanghai"
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Standard 5-field cron: minute, hour, day-of-month, month, day-of-week.
|
|
270
|
+
|
|
271
|
+
### One-Shot
|
|
272
|
+
|
|
273
|
+
```yaml
|
|
274
|
+
schedule:
|
|
275
|
+
run_at: "2025-07-01T09:00:00+08:00"
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Fires once at the specified time, then stops.
|
|
279
|
+
|
|
280
|
+
## Complete Examples
|
|
281
|
+
|
|
282
|
+
### Example 1: Content Publishing Pipeline
|
|
283
|
+
|
|
284
|
+
A 4-step pipeline for a content team: plan → parallel writing → review.
|
|
285
|
+
|
|
286
|
+
```yaml
|
|
287
|
+
name: content-publishing
|
|
288
|
+
displayName: Content Publishing Pipeline
|
|
289
|
+
description: Plan content, write in parallel across platforms, then review and publish
|
|
290
|
+
version: "1.0.0"
|
|
291
|
+
|
|
292
|
+
params:
|
|
293
|
+
- name: topic
|
|
294
|
+
type: string
|
|
295
|
+
label: Content Topic
|
|
296
|
+
required: true
|
|
297
|
+
description: The main topic or theme for this content batch
|
|
298
|
+
- name: target_platforms
|
|
299
|
+
type: text
|
|
300
|
+
label: Target Platforms
|
|
301
|
+
default: "WeChat, Xiaohongshu, X.com"
|
|
302
|
+
|
|
303
|
+
steps:
|
|
304
|
+
- id: plan
|
|
305
|
+
name: Content Planning
|
|
306
|
+
type: agent_task
|
|
307
|
+
role: editor
|
|
308
|
+
priority: high
|
|
309
|
+
prompt: |
|
|
310
|
+
Create a detailed content plan for: {{topic}}
|
|
311
|
+
Target platforms: {{target_platforms}}
|
|
312
|
+
|
|
313
|
+
Produce:
|
|
314
|
+
1. Content angle and key messages
|
|
315
|
+
2. Platform-specific adaptation notes
|
|
316
|
+
3. Target audience for each platform
|
|
317
|
+
4. SEO keywords / hashtags
|
|
318
|
+
|
|
319
|
+
- id: write_chinese
|
|
320
|
+
name: Write Chinese Content
|
|
321
|
+
type: agent_task
|
|
322
|
+
role: chinese_writer
|
|
323
|
+
depends_on: [plan]
|
|
324
|
+
inputs: [{ from: plan, as: content_plan }]
|
|
325
|
+
prompt: |
|
|
326
|
+
Write Chinese content about {{topic}} following the content plan.
|
|
327
|
+
Produce drafts for WeChat public account and Zhihu.
|
|
328
|
+
|
|
329
|
+
- id: write_xhs
|
|
330
|
+
name: Write Xiaohongshu Notes
|
|
331
|
+
type: agent_task
|
|
332
|
+
role: xhs_operator
|
|
333
|
+
depends_on: [plan]
|
|
334
|
+
inputs: [{ from: plan, as: content_plan }]
|
|
335
|
+
prompt: |
|
|
336
|
+
Create Xiaohongshu notes about {{topic}} following the content plan.
|
|
337
|
+
Produce 2-3 note drafts with title, body, hashtags, and image descriptions.
|
|
338
|
+
|
|
339
|
+
- id: review_and_publish
|
|
340
|
+
name: Editorial Review
|
|
341
|
+
type: agent_task
|
|
342
|
+
role: editor
|
|
343
|
+
depends_on: [write_chinese, write_xhs]
|
|
344
|
+
inputs:
|
|
345
|
+
- { from: write_chinese, as: chinese_drafts }
|
|
346
|
+
- { from: write_xhs, as: xhs_drafts }
|
|
347
|
+
prompt: |
|
|
348
|
+
Review all content drafts for {{topic}}.
|
|
349
|
+
Check for consistency, quality, and brand voice alignment.
|
|
350
|
+
Provide final approval or revision notes for each piece.
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Example 2: Research Report
|
|
354
|
+
|
|
355
|
+
A linear pipeline: research → analyze → write report.
|
|
356
|
+
|
|
357
|
+
```yaml
|
|
358
|
+
name: research-report
|
|
359
|
+
displayName: Research & Report
|
|
360
|
+
description: Deep research on a topic, data analysis, and formatted report
|
|
361
|
+
version: "1.0.0"
|
|
362
|
+
|
|
363
|
+
params:
|
|
364
|
+
- name: research_question
|
|
365
|
+
type: text
|
|
366
|
+
label: Research Question
|
|
367
|
+
required: true
|
|
368
|
+
- name: depth
|
|
369
|
+
type: enum
|
|
370
|
+
options: ["brief", "standard", "deep-dive"]
|
|
371
|
+
default: "standard"
|
|
372
|
+
|
|
373
|
+
steps:
|
|
374
|
+
- id: research
|
|
375
|
+
name: Gather Sources
|
|
376
|
+
type: agent_task
|
|
377
|
+
role: researcher
|
|
378
|
+
priority: high
|
|
379
|
+
timeout: "2h"
|
|
380
|
+
prompt: |
|
|
381
|
+
Research: {{research_question}}
|
|
382
|
+
Depth level: {{depth}}
|
|
383
|
+
|
|
384
|
+
Gather information from multiple sources. Save key findings,
|
|
385
|
+
data points, and source references as deliverables.
|
|
386
|
+
|
|
387
|
+
- id: analyze
|
|
388
|
+
name: Analyze Findings
|
|
389
|
+
type: agent_task
|
|
390
|
+
role: analyst
|
|
391
|
+
depends_on: [research]
|
|
392
|
+
inputs: [{ from: research, as: raw_findings }]
|
|
393
|
+
prompt: |
|
|
394
|
+
Analyze the research findings for: {{research_question}}
|
|
395
|
+
Identify patterns, insights, and actionable conclusions.
|
|
396
|
+
Produce a structured analysis document.
|
|
397
|
+
|
|
398
|
+
- id: report
|
|
399
|
+
name: Write Final Report
|
|
400
|
+
type: agent_task
|
|
401
|
+
role: writer
|
|
402
|
+
depends_on: [analyze]
|
|
403
|
+
inputs: [{ from: analyze, as: analysis }]
|
|
404
|
+
prompt: |
|
|
405
|
+
Write a comprehensive report on: {{research_question}}
|
|
406
|
+
Use the analysis to structure the report with:
|
|
407
|
+
- Executive summary
|
|
408
|
+
- Key findings
|
|
409
|
+
- Detailed analysis
|
|
410
|
+
- Recommendations
|
|
411
|
+
Format as a polished HTML deliverable.
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Example 3: Scheduled Daily Digest
|
|
415
|
+
|
|
416
|
+
An automatically triggered daily workflow.
|
|
417
|
+
|
|
418
|
+
```yaml
|
|
419
|
+
name: daily-digest
|
|
420
|
+
displayName: Daily Content Digest
|
|
421
|
+
description: Automatically gather and summarize daily updates
|
|
422
|
+
version: "1.0.0"
|
|
423
|
+
|
|
424
|
+
schedule:
|
|
425
|
+
cron: "0 9 * * 1-5"
|
|
426
|
+
timezone: "Asia/Shanghai"
|
|
427
|
+
|
|
428
|
+
steps:
|
|
429
|
+
- id: gather
|
|
430
|
+
name: Gather Updates
|
|
431
|
+
type: agent_task
|
|
432
|
+
role: researcher
|
|
433
|
+
prompt: |
|
|
434
|
+
Gather today's updates and news for {{date}}.
|
|
435
|
+
Check industry trends, competitor activity, and team progress.
|
|
436
|
+
|
|
437
|
+
- id: summarize
|
|
438
|
+
name: Write Daily Summary
|
|
439
|
+
type: agent_task
|
|
440
|
+
role: writer
|
|
441
|
+
depends_on: [gather]
|
|
442
|
+
inputs: [{ from: gather, as: updates }]
|
|
443
|
+
prompt: |
|
|
444
|
+
Write a concise daily digest for {{date}} (run #{{run_number}}).
|
|
445
|
+
Summarize the key updates and highlight action items.
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
## Validation Rules
|
|
449
|
+
|
|
450
|
+
The system validates your YAML before saving. Common errors:
|
|
451
|
+
- **Missing required fields**: `name`, `description`, `version`, and at least one step
|
|
452
|
+
- **Each step requires**: `id`, `name`, `role`, `prompt`
|
|
453
|
+
- **Duplicate step IDs**: every `id` must be unique
|
|
454
|
+
- **Invalid `depends_on` references**: must reference existing step IDs
|
|
455
|
+
- **Circular dependencies**: the DAG must be acyclic (A→B→C→A is invalid)
|
|
456
|
+
- **Enum params without options**: `type: enum` requires a non-empty `options[]`
|
|
457
|
+
- **Invalid schedule**: must have at least one of `every`, `cron`, or `run_at`
|
|
458
|
+
|
|
459
|
+
## Rules
|
|
460
|
+
|
|
461
|
+
- **Keep workflows focused**: each workflow should serve one clear purpose. Don't combine unrelated processes.
|
|
462
|
+
- **Role names must match team composition**: roles are resolved to team members. Use names that correspond to the team's actual member names or skills.
|
|
463
|
+
- **Write clear prompts**: each step's prompt should be self-contained enough for the assigned agent to execute without ambiguity. Include expected outputs.
|
|
464
|
+
- **Use `depends_on` for ALL dependencies**: if step B needs output from step A, it MUST list A in `depends_on`. Without this, steps run in parallel.
|
|
465
|
+
- **Use `inputs` for deliverable passing**: when a downstream step needs to reference upstream output, declare it in `inputs` so the system injects the context.
|
|
466
|
+
- **Test incrementally**: start with 2-3 steps and validate before adding complexity.
|
|
467
|
+
- **The `name` field MUST be English kebab-case** (e.g., `content-publishing`, `daily-report`).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "skill",
|
|
3
|
+
"name": "workflow-building",
|
|
4
|
+
"displayName": "Workflow Building",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Design and create workflow templates — YAML format, DAG patterns, scheduling, parameter systems, and role mapping for multi-step automated processes",
|
|
7
|
+
"author": "markus",
|
|
8
|
+
"category": "development",
|
|
9
|
+
"tags": ["builder", "workflow", "automation", "dag", "template"],
|
|
10
|
+
"i18n": {
|
|
11
|
+
"zh-CN": {
|
|
12
|
+
"displayName": "工作流构建",
|
|
13
|
+
"description": "设计和创建工作流模板 — YAML 格式、DAG 模式、调度、参数系统和多步骤自动化流程的角色映射"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"skill": {
|
|
17
|
+
"skillFile": "SKILL.md"
|
|
18
|
+
}
|
|
19
|
+
}
|