skill-system-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill System Workflow
Skill系统工作流
Dynamic orchestration engine that plans multi-step agent work as DAGs (Directed Acyclic Graphs) and always produces a renderable Mermaid diagram.
This skill is designed to bridge: (1) repeatable best-practice playbooks (recipes) and (2) one-off, context-specific plans generated on demand.
这是一款动态编排引擎,可将多步骤Agent工作规划为DAG(有向无环图),并且始终生成可渲染的Mermaid图表。
该Skill旨在连接两类内容:(1) 可重复使用的最佳实践手册(recipes),以及(2) 根据需求生成的一次性、特定上下文的规划。
Overview
概述
- Input: a goal (and optional context)
- Output: a document plus a Mermaid
workflow-dag.yamldiagramflowchart TD - Planning strategy: try to match a pre-defined recipe first; otherwise generate a custom DAG in one pass
- 输入:目标(可选上下文)
- 输出:文档以及Mermaid
workflow-dag.yaml图表flowchart TD - 规划策略:首先尝试匹配预定义的recipe;否则一次性生成自定义DAG
Architecture
架构
1) Recipe matching (goal -> recipe)
1) Recipe匹配(目标 -> Recipe)
When a goal resembles a common workflow, the planner matches the goal against using each recipe's .
recipes/*.yamltrigger_patterns- Benefits: consistent structure, fewer planning errors, repeatable waves, easier to refine over time
- Output: a DAG derived from the recipe, then customized with goal-specific details (files, commands, constraints)
当目标与常见工作流相似时,规划器会使用每个recipe的将目标与进行匹配。
trigger_patternsrecipes/*.yaml- 优势:结构一致、规划错误更少、可重复执行、便于随时间优化
- 输出:基于recipe生成的DAG,然后根据目标的具体细节(文件、命令、约束)进行定制
2) Dynamic planning (no recipe -> custom DAG)
2) 动态规划(无匹配Recipe -> 自定义DAG)
If no recipe matches strongly, the planner uses to generate a custom workflow DAG.
prompts/plan-workflow.md- The planner explicitly separates independent tasks (parallelizable) from dependent tasks (sequential)
- The planner assigns an per task based on strengths (explore vs librarian vs oracle vs build)
agent_type - The planner keeps each task atomic and verifiable
如果没有找到匹配度高的Recipe,规划器会使用生成自定义工作流DAG。
prompts/plan-workflow.md- 规划器会明确区分独立任务(可并行执行)和依赖任务(需按顺序执行)
- 规划器会根据不同Agent的优势(探索型、图书馆型、先知型、构建型)为每个任务分配
agent_type - 规划器确保每个任务具备原子性和可验证性
3) Mermaid output (every plan -> diagram)
3) Mermaid输出(所有规划 -> 图表)
Every plan includes a Mermaid diagram so the workflow is easy to review, discuss, and iterate.
- One subgraph per wave
- Dependencies are explicit edges
- Nodes are styled by task
status
所有规划都会包含Mermaid图表,以便于工作流的审查、讨论和迭代。
- 每个wave对应一个子图
- 依赖关系通过明确的边表示
- 节点根据任务设置样式
status
How To Use
使用方法
plan
planplan
planAnalyze a goal and produce a workflow DAG plus Mermaid visualization.
- Read all files in
recipes/ - Match against
goaltrigger_patterns - If a match exists: use the recipe as the base plan and tailor it to the goal
- Otherwise: use to generate a custom DAG
prompts/plan-workflow.md - Generate Mermaid from the DAG using the conventions in this document
Procedure:
scripts/plan-and-visualize.md分析目标并生成工作流DAG及Mermaid可视化内容。
- 读取目录下的所有文件
recipes/ - 将与
goal进行匹配trigger_patterns - 如果找到匹配项:以Recipe为基础规划,并根据目标进行定制
- 否则:使用生成自定义DAG
prompts/plan-workflow.md - 根据本文档中的规范,基于DAG生成Mermaid图表
操作步骤:
scripts/plan-and-visualize.mdvisualize
visualizevisualize
visualizeConvert an existing DAG YAML into a Mermaid flowchart.
- Parse and build
waves[*].tasks[*]flowchart TD - Use one Mermaid per wave
subgraph - Add edges for
depends_on - Apply status styling (pending/running/done/failed)
将现有的DAG YAML转换为Mermaid流程图。
- 解析并构建
waves[*].tasks[*]flowchart TD - 每个wave对应一个Mermaid
subgraph - 为添加边
depends_on - 应用状态样式(pending/running/done/failed)
list-recipes
list-recipeslist-recipes
list-recipesList available workflow recipes.
- Enumerate files in
recipes/ - For each file: return and
namedescription
列出可用的工作流Recipe。
- 枚举目录下的文件
recipes/ - 对于每个文件:返回和
namedescription
File Layout
文件结构
- : one-pass dynamic DAG planning prompt
prompts/plan-workflow.md - : workflow DAG shape specification
schema/workflow-dag.yaml - : recipe shape specification
schema/recipe.yaml - : reusable workflow templates
recipes/*.yaml - : human procedure for plan -> DAG -> Mermaid
scripts/plan-and-visualize.md
- :一次性动态DAG规划提示词
prompts/plan-workflow.md - :工作流DAG结构规范
schema/workflow-dag.yaml - :Recipe结构规范
schema/recipe.yaml - :可复用的工作流模板
recipes/*.yaml - :从规划到DAG再到Mermaid的人工操作步骤
scripts/plan-and-visualize.md
Recipe Format Reference
Recipe格式参考
Recipes are small YAML documents that describe reusable waves and tasks.
- : recipe identifier (must match the filename without extension)
name - : goal keywords/phrases that indicate the recipe is applicable
trigger_patterns - : ordered execution waves
waves - : whether tasks in the wave can be performed simultaneously
waves[*].parallel - : task ids from earlier waves that must complete first
waves[*].tasks[*].depends_on
See:
schema/recipe.yamlRecipe是描述可复用wave和任务的小型YAML文档。
- :Recipe标识符(必须与不带扩展名的文件名一致)
name - :表明该Recipe适用的目标关键词/短语
trigger_patterns - :按顺序执行的wave
waves - :该wave中的任务是否可同时执行
waves[*].parallel - :必须先完成的早期wave中的任务ID
waves[*].tasks[*].depends_on
参考:
schema/recipe.yamlMermaid Conventions
Mermaid规范
Diagram structure
图表结构
- Graph direction:
flowchart TD - One subgraph per wave:
subgraph waveN [Wave N: <description>]
- Each task is a node with id
task_id - Node label format:
<agent_type>\n<task name>
- 图表方向:
flowchart TD - 每个wave对应一个子图:
subgraph waveN [Wave N: <描述>]
- 每个任务是一个ID为的节点
task_id - 节点标签格式:
<agent_type>\n<任务名称>
Node shapes
节点形状
- Task nodes: rounded rectangles:
task_id(["<agent_type>\\n<name>"]) - Optional start/end anchors (if used): circles: ,
start((Start))end((End))
- 任务节点:圆角矩形:
task_id(["<agent_type>\\n<名称>"]) - 可选的开始/结束锚点(若使用):圆形:,
start((Start))end((End))
Status styling
状态样式
Use Mermaid classes based on each task's :
statusclassDef pending fill:#fef3c7,stroke:#f59e0b,stroke-width:2px,color:#92400e
classDef running fill:#dbeafe,stroke:#3b82f6,stroke-width:2px,stroke-dasharray: 5 5,color:#1e40af
classDef done fill:#d1fae5,stroke:#10b981,stroke-width:2px,color:#065f46
classDef failed fill:#fee2e2,stroke:#ef4444,stroke-width:3px,color:#991b1bConvention:
- : not started
pending - : in progress
running - : completed successfully
done - : needs intervention
failed
根据每个任务的使用Mermaid类:
statusclassDef pending fill:#fef3c7,stroke:#f59e0b,stroke-width:2px,color:#92400e
classDef running fill:#dbeafe,stroke:#3b82f6,stroke-width:2px,stroke-dasharray: 5 5,color:#1e40af
classDef done fill:#d1fae5,stroke:#10b981,stroke-width:2px,color:#065f46
classDef failed fill:#fee2e2,stroke:#ef4444,stroke-width:3px,color:#991b1b规范:
- :未开始
pending - :进行中
running - :成功完成
done - :需要干预
failed
Operational Notes
操作注意事项
- Keep waves small (2-6 tasks) so the diagram remains readable.
- Prefer parallelism inside a wave; use for cross-wave ordering.
depends_on - Every task should have a clear verification outcome (tests, diagnostics, file outputs, or explicit checks).
skill
{
"schema_version": "2.0",
"id": "skill-system-workflow",
"version": "1.0.0",
"capabilities": ["workflow-plan", "workflow-visualize", "workflow-list-recipes"],
"effects": ["fs.read", "db.read"],
"operations": {
"plan": {
"description": "Analyze a goal and produce an execution plan as a DAG with Mermaid visualization.",
"input": {
"goal": {"type": "string", "required": true, "description": "User's goal or task description"},
"context": {"type": "string", "required": false, "description": "Additional context (files, constraints)"}
},
"output": {
"description": "Workflow DAG YAML + Mermaid diagram",
"fields": {"dag": "YAML", "mermaid": "string"}
},
"entrypoints": {
"agent": "Follow scripts/plan-and-visualize.md procedure"
}
},
"visualize": {
"description": "Convert an existing DAG YAML to a Mermaid flowchart.",
"input": {
"dag_yaml": {"type": "string", "required": true, "description": "DAG YAML content"}
},
"output": {
"description": "Mermaid flowchart string",
"fields": {"mermaid": "string"}
},
"entrypoints": {
"agent": "Apply Mermaid conventions from SKILL.md to the DAG"
}
},
"list-recipes": {
"description": "List available workflow recipes.",
"input": {},
"output": {
"description": "Array of recipe names and descriptions",
"fields": {"recipes": "array"}
},
"entrypoints": {
"agent": "List files in recipes/ directory"
}
}
},
"stdout_contract": {
"last_line_json": false,
"note": "Agent-executed procedures; output is DAG YAML + Mermaid text."
}
}- 保持wave规模较小(2-6个任务),以便图表保持可读性。
- 优先在wave内使用并行执行;跨wave的顺序依赖使用。
depends_on - 每个任务都应有明确的验证结果(测试、诊断、文件输出或显式检查)。
skill
{
"schema_version": "2.0",
"id": "skill-system-workflow",
"version": "1.0.0",
"capabilities": ["workflow-plan", "workflow-visualize", "workflow-list-recipes"],
"effects": ["fs.read", "db.read"],
"operations": {
"plan": {
"description": "Analyze a goal and produce an execution plan as a DAG with Mermaid visualization.",
"input": {
"goal": {"type": "string", "required": true, "description": "User's goal or task description"},
"context": {"type": "string", "required": false, "description": "Additional context (files, constraints)"}
},
"output": {
"description": "Workflow DAG YAML + Mermaid diagram",
"fields": {"dag": "YAML", "mermaid": "string"}
},
"entrypoints": {
"agent": "Follow scripts/plan-and-visualize.md procedure"
}
},
"visualize": {
"description": "Convert an existing DAG YAML to a Mermaid flowchart.",
"input": {
"dag_yaml": {"type": "string", "required": true, "description": "DAG YAML content"}
},
"output": {
"description": "Mermaid flowchart string",
"fields": {"mermaid": "string"}
},
"entrypoints": {
"agent": "Apply Mermaid conventions from SKILL.md to the DAG"
}
},
"list-recipes": {
"description": "List available workflow recipes.",
"input": {},
"output": {
"description": "Array of recipe names and descriptions",
"fields": {"recipes": "array"}
},
"entrypoints": {
"agent": "List files in recipes/ directory"
}
}
},
"stdout_contract": {
"last_line_json": false,
"note": "Agent-executed procedures; output is DAG YAML + Mermaid text."
}
}