agentleFS
MorningStar0709MorningStar0709/trae-agent-enhancements/skills/workflow-runner/SKILL.md

workflow-runner

Skill18 starsChanged 7 months agoMITView on GitHub

Run an agency-orchestrator style YAML workflow inside the current Trae conversation by simulating or coordinating multiple roles. Use when the user provides a `.yaml` or `.yml` workflow, asks for multi-role collaboration, says things like “用多个角色一起评审这个 PRD”“多角色协作”“先生成工作流再执行”“让产品经理、架构师、QA 一起看一下”, or wants roles such as product manager, architect, reviewer, or QA to work together. Supports layered execution, role prompting, variable interpolation, document-backed inputs, and parallel steps only when the current environment has a clear subagent mapping. Do not use for ordinary implementation plans, simple code changes, or tasks already covered by `writing-plans`, `executing-plans`, `subagent-driven-development`, or single-purpose review/debug skills.

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • shibit-netSkill

    chinese-code-review

    中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。

    Also in 3 projects that use this

  • shibit-netSkill

    chinese-commit-conventions

    中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。

    Also in 3 projects that use this

  • OpenAISkill

    using-superpowers

    Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions

    Also in 3 projects that use this

  • OpenAISkill

    writing-skills

    Use when creating new skills, editing existing skills, or verifying skills work before deployment

    Also in 3 projects that use this

  • MicrosoftSkill

    mcp-builder

    Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

    Also in 3 projects that use this

  • +1 more from shibit-net

The file

Show its rules and text

We split this skill into the rules it gives an agent

28 rules. About 0 are common, 20 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run an agency-orchestrator style multi-role workflow within the current Trae conversation.

    line 10
  2. Distinctive:

    Missing required inputs: Ask first; do not guess default values.

    line 48
  3. Distinctive:

    Ask the user if still missing.

    line 59
  4. Very specific:

    If the user provides both workflow_file and input values in the same message, extract the inputs first, then determine if follow-up …

    line 61
  5. Distinctive:

    If an input name clearly indicates a document path, such as:

    line 65
  6. Distinctive:

    Treat it as a "document input that must be read first" by default.

    line 73
  7. Distinctive:

    Verify the path exists and is readable.

    line 76
  8. Very specific:

    Use Read to read the document.

    line 77
  9. Distinctive:

    Do not just inject the path string into the task template.

    line 79
  10. Distinctive:

    If the document is too long, summarize it first, but state that execution is based on the summary.

    line 80
  11. Distinctive:

    Obtain Workflow: Read the YAML file, or generate a minimal draft if none exists.

    line 86
  12. Distinctive:

    Parallel Execution: Only execute same-layer steps in true parallel if there is an explicit subagent mapping.

    line 90
  13. Very specific:

    YAML provided: Use Read to extract name, agents_dir, inputs, steps.

    line 95
  14. Very specific:

    Use tools like LS, Glob, Read.

    line 107
  15. Distinctive:

    Read document inputs before providing them as context.

    line 117
  16. Distinctive:

    If a variable is undefined:

    line 121
  17. Distinctive:

    If it is a required input, pause and ask.

    line 122
  18. Very specific:

    If it should come from a previous step, check depends_on or output config.

    line 123
  19. Distinctive:

    Default to sequential execution in the main session layer by layer.

    line 135
  20. Distinctive:

    No dependencies between steps.

    line 143
  21. Distinctive:

    No shared mutable file state.

    line 144
  22. Distinctive:

    If any condition fails, fallback to "logical parallel layer, actual sequential execution in main session".

    line 149
  23. Distinctive:

    After each step, record at least:

    line 153
  24. Very specific:

    Write to variable context if output field exists.

    line 157
  25. Distinctive:

    Unread Document Inputs: Do not treat the file path as consumed context.

    line 176
  26. Distinctive:

    Use this fixed skeleton:

    line 191
  27. Distinctive:

    If still in the "generate YAML draft for confirmation" phase, do not say "工作流执行已完成。".

    line 211
  28. Very specific:

    Document input guidelines: resources/document-input-guidelines.md

    line 223

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Workflow Runner

Overview

Run an agency-orchestrator style multi-role workflow within the current Trae conversation. Tasks:

  • Reading or generating a YAML workflow.
  • Maintaining DAG layers based on depends_on.
  • Reading role files and switching roles for execution.
  • Executing true parallel steps only when conditions are met.

Use This Skill

  • The user provides a .yaml or .yml workflow and requests to execute it.
  • The user explicitly asks for "multi-role collaboration" or "multiple roles analyzing/reviewing/creating together".
  • The user wants to generate a multi-role workflow first, then confirm and execute it.
  • The user wants to preserve role division, step dependencies, and execution layers, rather than just getting a plain summary.

Do Not Use

  • The user just wants a normal answer without the appearance of role orchestration.
  • The user wants to write an implementation plan or break down development tasks; use writing-plans instead.
  • The user already has an implementation plan and wants to execute it sequentially; use executing-plans instead.
  • The user has an implementation plan and the environment supports implementation subagents; use subagent-driven-development instead.
  • The user is only asking for a single code review, single debugging session, or single browser validation.

Input Contract

Required Inputs:

  • workflow_file: The path to the YAML file provided by the user; OR
  • workflow_intent: The multi-role collaboration goal described by the user, used to generate a workflow first.

Common Optional Inputs:

  • agents_dir
  • persist_outputs
  • output_dir
  • execution_mode_hint

Missing input handling:

  • No YAML, but multi-role orchestration requested: Generate a minimal workflow draft first; do not execute immediately.
  • Missing required inputs: Ask first; do not guess default values.
  • Missing role directory or role files: Report the missing items and search locations; do not skip steps.
  • Incomplete inputs but partial preview possible: Provide a pre-execution plan or YAML draft, but do not pretend it has been executed.

Input Extraction

Collect input values in this order:

  1. Explicit assignments in the user's current message (e.g., topic = "...", topic: ...).
  2. Values with the same name explicitly given by the user earlier in the session.
  3. The default value in the YAML.
  4. Ask the user if still missing.

If the user provides both workflow_file and input values in the same message, extract the inputs first, then determine if follow-up questions are needed.

Document-Backed Inputs

If an input name clearly indicates a document path, such as:

  • prd_file
  • spec_file
  • doc_file
  • brief_file
  • *_file
  • *_path

Treat it as a "document input that must be read first" by default.

Rules:

  1. Verify the path exists and is readable.
  2. Use Read to read the document.
  3. Include the key content of the document as part of the role context.
  4. Do not just inject the path string into the task template.
  5. If the document is too long, summarize it first, but state that execution is based on the summary.

Execution Protocol

Default execution path:

  1. Obtain Workflow: Read the YAML file, or generate a minimal draft if none exists.
  2. Locate Role Files: Find agents_dir and read role files.
  3. Collect Inputs: Extract inputs; read documents for document-backed inputs.
  4. Build Layered Plan: Group steps by depends_on and execute sequentially by layer.
  5. Parallel Execution: Only execute same-layer steps in true parallel if there is an explicit subagent mapping.
  6. Aggregate Results: Summarize the output; write to .ao-output/ only if persistence is requested.

1. Obtain Workflow

  • YAML provided: Use Read to extract name, agents_dir, inputs, steps.
  • Intent provided: Generate a minimal workflow draft and get confirmation before executing.
  • The workflow must have at least one step; otherwise, stop and report.

2. Locate Role Files

Locate agents_dir in this order:

  1. Same directory as the YAML file.
  2. Current workspace.
  3. Parent of current workspace.
  4. Common dependency directories (e.g., node_modules/<agents_dir>).

Use tools like LS, Glob, Read; do not rely on Unix shell checks.

Each step's role maps to <agents_dir>/<role>.md by default. Before execution, read at least:

  • Role name.
  • Stable frontmatter.
  • Role body after the second ---.

3. Collect Inputs and Interpolate Variables

  • Handle normal inputs via extraction rules.
  • Read document inputs before providing them as context.
  • {{input_name}} comes from input values.
  • {{previous_output}} comes from previous step outputs.

If a variable is undefined:

  • If it is a required input, pause and ask.
  • If it should come from a previous step, check depends_on or output config.

4. Build Layered Plan

Topologically sort by depends_on and organize steps into layers:

  • Layer 1: Steps with no dependencies.
  • Subsequent layers: Steps whose dependencies are met.

Provide a brief layered plan before execution, stating total steps, steps per layer, and whether parallelism is "logical only".

5. Execute Layer by Layer

Default to sequential execution in the main session layer by layer. Even if logically parallelizable, do not violate DAG dependencies.

For single-step layers:

  • Explicitly switch roles.
  • State the step name, role name, and task goal.
  • The output must reflect the role's perspective, not a generic answer.

For multi-step layers, true parallel execution is only allowed if ALL conditions are met:

  • No dependencies between steps.
  • No shared mutable file state.
  • Suitable subagent capabilities exist in the current environment.
  • Each step can be written as a self-contained prompt.
  • Explicit mapping exists between the role task and subagent type.

If any condition fails, fallback to "logical parallel layer, actual sequential execution in main session". Do not force parallel execution for generic text roles (content creation, analysis, review) without explicit mapping.

6. Record and Persist

After each step, record at least:

  • step_id
  • role
  • Output body
  • Write to variable context if output field exists.

Force persistence only when:

  • User explicitly requests saving artifacts.
  • The workflow is an artifact-generating task by nature.

Default output directory: .ao-output/<workflow-name>-<YYYY-MM-DD>/

Common outputs include:

  • steps/<index>-<step-id>.md
  • summary.md
  • metadata.json

Failure Handling

  • Missing/Invalid YAML: Explain the location of the error. If the user just expressed an intent, switch to draft generation mode.
  • Missing Role Directory/Files: Report attempted locations and the specific missing role. Do not skip the step and pretend to continue.
  • Undefined Variables: Distinguish between missing inputs and workflow config errors. Clarify first; do not guess replacements.
  • Unread Document Inputs: Do not treat the file path as consumed context. Read the document first. If a step heavily depends on an unreadable document, stop and report.
  • Step Failure: Mark the step as failed, skip downstream dependent steps, and continue with other independent steps. Clearly state success, failure, and skipped items in the final report.
  • Environment Lacks True Parallelism: Explicitly state that "logical parallel layer, actual sequential execution" is being used. Do not pretend the environment has general multi-agent capabilities if it doesn't.

Output Contract

The final output must include:

  • Workflow name
  • Execution mode (YAML execution or draft generation)
  • Number of layers and steps
  • Status of each step
  • Whether true parallelism was used
  • Final deliverables
  • Output directory (if persisted)

Use this fixed skeleton:

## 工作流运行总结

**名称:** <workflow-name>
**层级/步骤:** <层级数> / <步骤数>
**状态:** `成功` | `部分成功` | `失败`

**产出物:**
- [交付物摘要;如果较长可在下方展开说明]
- [若无产出物,请写 "- 无"]

**未解决的冲突/阻碍:**
- [若无冲突,请写 "- 无"]

**下一步建议:**
- [继续下一步计划 | 等待用户确认 | 退出]

If still in the "generate YAML draft for confirmation" phase, do not say "工作流执行已完成。"; explicitly state "工作流草稿已生成,等待确认后执行。".

Resources

The main file only defines the execution contract; examples and test-run assets are in companion directories:

  • evals: evals/evals.json
  • examples: examples/input.md, examples/output.md
  • Minimal test run: resources/try-it.md
  • Sample YAML: resources/sample-workflow.yaml
  • Document-driven sample: resources/sample-prd-review-workflow.yaml
  • Sample document: resources/sample-prd.md
  • Directory convention: resources/role-directory-convention.md
  • Document input guidelines: resources/document-input-guidelines.md

Integration

  • writing-plans: Downstream — after workflow-runner completes its multi-role analysis (e.g., PRD review, architect assessment), the conclusions can serve as input for writing-plans to generate an implementation plan. The handoff output should include key decisions, open risks, and recommended next steps.
  • executing-plans: Sequentially executes implementation plans, does not emphasize role-playing.
  • subagent-driven-development: Subagent-driven development, not equivalent to role workflows.
  • dispatching-parallel-agents: Can be referenced for parallel decisions, but does not replace the workflow semantics of this skill.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.