بنقرة واحدة
workflow-building
Design and create workflow templates — YAML format, DAG patterns, scheduling, and role mapping
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Design and create workflow templates — YAML format, DAG patterns, scheduling, and role mapping
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Feishu/Lark platform interaction via MCP - documents, tasks, calendar, Bitable, messaging
Use the Claude Code CLI for complex refactors, multi-file changes, and sustained codebase exploration
Use the OpenAI Codex CLI for quick fixes, targeted edits, and non-interactive automation
Use external coding tools (Claude Code, Codex, Cursor) via invoke_coding_tool and coding_tool_apply to implement, debug, and refactor code
Use the Cursor CLI agent mode for IDE-integrated coding with project rules and repo-aware edits
Learn from experience — capture insights, organize knowledge, share reusable practices as skills, and refine your role over time
| name | workflow-building |
| description | Design and create workflow templates — YAML format, DAG patterns, scheduling, and role mapping |
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.
Workflows are for repeatable, multi-step processes where:
Do NOT use workflows for: one-off tasks, simple single-agent work, or ad-hoc coordination.
There are two ways to create a workflow, depending on context:
Use the workflow_create tool:
workflow_create(name: "content-publishing", yaml: "<full YAML content>")
This writes the YAML file directly to ~/.markus/teams/{teamId}/workflows/.
Write the YAML file via file_write to the team's artifact directory, then reference it in team.json:
file_write("~/.markus/builder-artifacts/teams/{team-name}/workflows/my-workflow.yaml", "<YAML content>")
In team.json, add:
{
"team": {
"members": [...],
"workflows": ["workflows/my-workflow.yaml"]
}
}
The workflow YAML files are copied to ~/.markus/teams/{teamId}/workflows/ when the team is installed.
name: content-publishing # REQUIRED. Identifier (kebab-case, English)
displayName: Content Publishing # Optional. Human-readable name (any language)
description: Research, write, ... # REQUIRED. What this workflow does
version: "1.0.0" # REQUIRED. Semver
schedule: # Optional. Auto-trigger configuration
every: "1d" # Interval shorthand: 30m, 6h, 1d, 1w
cron: "0 9 * * 1-5" # OR cron expression
run_at: "2025-06-01T09:00:00Z" # OR one-shot ISO timestamp
timezone: "Asia/Shanghai" # IANA timezone (default: server local)
max_runs: 10 # Stop after N runs (0 = unlimited)
params: # Optional. User-provided or auto-generated inputs
- name: topic # Referenced as {{topic}} in step prompts
type: string # string | enum | text | agent
label: "Content Topic"
required: true
- name: platform
type: enum
options: ["wechat", "zhihu", "xiaohongshu", "x.com"]
default: "wechat"
steps: # REQUIRED. The task DAG (at least one step)
- id: research
name: Research Topic
type: agent_task
role: researcher
prompt: "Research {{topic}} thoroughly and produce a summary."
priority: high
| Field | Required | Description |
|---|---|---|
id | Yes | Unique identifier within the workflow |
name | Yes | Human-readable step name |
type | Yes | Always agent_task |
role | Yes | Role placeholder mapped to a team member at run time |
prompt | Yes | Task description. Supports {{param}} interpolation |
depends_on | No | Array of step IDs that must complete first |
inputs | No | Upstream deliverable references (see below) |
reviewer | No | Role that reviews this step (defaults to team manager) |
priority | No | low, medium, high, or urgent |
timeout | No | Step timeout shorthand, e.g. "30m", "2h" |
retry_count | No | Number of retries on failure (default: 0) |
| Type | Description |
|---|---|
string | Free-form text input |
enum | Dropdown selection from options[] |
text | Multi-line text input |
agent | Agent ID picker |
These are available in all step prompts without declaring params:
{{date}} — Current date (YYYY-MM-DD){{time}} — Current date and time (YYYY-MM-DD HH:MM){{run_number}} — Sequential run number for this workflowWhen a step depends on another step's output, use inputs to create a named reference:
steps:
- id: research
name: Research
type: agent_task
role: researcher
prompt: "Research {{topic}} and produce a summary document."
- id: write
name: Write Draft
type: agent_task
role: writer
depends_on: [research]
inputs:
- from: research # Step ID of the upstream step
as: research_notes # Variable name in this step's context
prompt: "Write a draft about {{topic}} using the upstream research."
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.
Steps run one after another. Simple and predictable.
# A → B → C
steps:
- id: research
name: Research
type: agent_task
role: researcher
prompt: "Research the topic."
- id: write
name: Write
type: agent_task
role: writer
depends_on: [research]
prompt: "Write based on research."
- id: review
name: Review
type: agent_task
role: editor
depends_on: [write]
prompt: "Review and finalize the draft."
Multiple independent steps run simultaneously after a shared predecessor.
# ┌→ write_cn
# plan ──┤
# └→ write_en
steps:
- id: plan
name: Plan Content
type: agent_task
role: editor
prompt: "Create content outline for {{topic}}."
- id: write_cn
name: Write Chinese Version
type: agent_task
role: chinese_writer
depends_on: [plan]
inputs: [{ from: plan, as: outline }]
prompt: "Write the Chinese version based on the outline."
- id: write_en
name: Write English Version
type: agent_task
role: english_writer
depends_on: [plan]
inputs: [{ from: plan, as: outline }]
prompt: "Write the English version based on the outline."
One step waits for multiple parallel steps to complete.
# write_cn ──┐
# ├→ publish
# write_en ──┘
steps:
# ... (plan, write_cn, write_en as above)
- id: publish
name: Final Review & Publish
type: agent_task
role: editor
depends_on: [write_cn, write_en]
inputs:
- { from: write_cn, as: chinese_draft }
- { from: write_en, as: english_draft }
prompt: "Review both drafts and prepare for publishing."
Combination of fan-out and fan-in — a common pattern for parallel work with consolidation.
# ┌→ B ──┐
# A ────┤ ├→ D
# └→ C ──┘
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.
Best practices:
editor, chinese_writer, researcher, reviewerreviewer field defaults to the team manager — only override if a specific specialist should reviewschedule:
every: "6h" # Run every 6 hours
timezone: "Asia/Shanghai"
Supported units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
schedule:
cron: "0 9 * * 1-5" # Weekdays at 9am
timezone: "Asia/Shanghai"
Standard 5-field cron: minute, hour, day-of-month, month, day-of-week.
schedule:
run_at: "2025-07-01T09:00:00+08:00"
Fires once at the specified time, then stops.
A 4-step pipeline for a content team: plan → parallel writing → review.
name: content-publishing
displayName: Content Publishing Pipeline
description: Plan content, write in parallel across platforms, then review and publish
version: "1.0.0"
params:
- name: topic
type: string
label: Content Topic
required: true
description: The main topic or theme for this content batch
- name: target_platforms
type: text
label: Target Platforms
default: "WeChat, Xiaohongshu, X.com"
steps:
- id: plan
name: Content Planning
type: agent_task
role: editor
priority: high
prompt: |
Create a detailed content plan for: {{topic}}
Target platforms: {{target_platforms}}
Produce:
1. Content angle and key messages
2. Platform-specific adaptation notes
3. Target audience for each platform
4. SEO keywords / hashtags
- id: write_chinese
name: Write Chinese Content
type: agent_task
role: chinese_writer
depends_on: [plan]
inputs: [{ from: plan, as: content_plan }]
prompt: |
Write Chinese content about {{topic}} following the content plan.
Produce drafts for WeChat public account and Zhihu.
- id: write_xhs
name: Write Xiaohongshu Notes
type: agent_task
role: xhs_operator
depends_on: [plan]
inputs: [{ from: plan, as: content_plan }]
prompt: |
Create Xiaohongshu notes about {{topic}} following the content plan.
Produce 2-3 note drafts with title, body, hashtags, and image descriptions.
- id: review_and_publish
name: Editorial Review
type: agent_task
role: editor
depends_on: [write_chinese, write_xhs]
inputs:
- { from: write_chinese, as: chinese_drafts }
- { from: write_xhs, as: xhs_drafts }
prompt: |
Review all content drafts for {{topic}}.
Check for consistency, quality, and brand voice alignment.
Provide final approval or revision notes for each piece.
A linear pipeline: research → analyze → write report.
name: research-report
displayName: Research & Report
description: Deep research on a topic, data analysis, and formatted report
version: "1.0.0"
params:
- name: research_question
type: text
label: Research Question
required: true
- name: depth
type: enum
options: ["brief", "standard", "deep-dive"]
default: "standard"
steps:
- id: research
name: Gather Sources
type: agent_task
role: researcher
priority: high
timeout: "2h"
prompt: |
Research: {{research_question}}
Depth level: {{depth}}
Gather information from multiple sources. Save key findings,
data points, and source references as deliverables.
- id: analyze
name: Analyze Findings
type: agent_task
role: analyst
depends_on: [research]
inputs: [{ from: research, as: raw_findings }]
prompt: |
Analyze the research findings for: {{research_question}}
Identify patterns, insights, and actionable conclusions.
Produce a structured analysis document.
- id: report
name: Write Final Report
type: agent_task
role: writer
depends_on: [analyze]
inputs: [{ from: analyze, as: analysis }]
prompt: |
Write a comprehensive report on: {{research_question}}
Use the analysis to structure the report with:
- Executive summary
- Key findings
- Detailed analysis
- Recommendations
Format as a polished HTML deliverable.
An automatically triggered daily workflow.
name: daily-digest
displayName: Daily Content Digest
description: Automatically gather and summarize daily updates
version: "1.0.0"
schedule:
cron: "0 9 * * 1-5"
timezone: "Asia/Shanghai"
steps:
- id: gather
name: Gather Updates
type: agent_task
role: researcher
prompt: |
Gather today's updates and news for {{date}}.
Check industry trends, competitor activity, and team progress.
- id: summarize
name: Write Daily Summary
type: agent_task
role: writer
depends_on: [gather]
inputs: [{ from: gather, as: updates }]
prompt: |
Write a concise daily digest for {{date}} (run #{{run_number}}).
Summarize the key updates and highlight action items.
The system validates your YAML before saving. Common errors:
name, description, version, and at least one stepid, name, role, promptid must be uniquedepends_on references: must reference existing step IDstype: enum requires a non-empty options[]every, cron, or run_atdepends_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.inputs for deliverable passing: when a downstream step needs to reference upstream output, declare it in inputs so the system injects the context.name field MUST be English kebab-case (e.g., content-publishing, daily-report).