orchestration:executing-workflows
Skill220 starsChanged 13 months agoMITView on GitHub
Use when user provides workflow syntax with arrows (-> || ~>), says "run workflow", "execute workflow", "run this", mentions step1 -> step2 patterns. Executes orchestration workflows with real-time visualization, steering, and error recovery.
- Deletes or force-pushes
In this repository8 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 20 are distinctive, and 10 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.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Ask to "run a workflow"
- Distinctive: line 17
Ask "how do I run this workflow?"
- Very specific: line 76
Before starting, I create/update .orchestration/state.json in the current working directory.
- Very specific: line 77
After EVERY successful node execution, I update the state.json with captured variables and the node's completed status.
- Distinctive: line 78
If the workflow is interrupted, crashes, or fails, I retain this state file.
- Distinctive: line 90
If you ask me to "resume" a workflow:
- Distinctive: line 121
If agent fails, I offer options:
- Distinctive: line 137
IMPORTANT: After workflow execution, check for temporary files and ask user before deleting.
- Distinctive: line 141
Check for existence of temporary files in the current working directory:
- Distinctive: line 177
If user chose "Yes, delete all":
- Distinctive: line 198
If user chose "Show me first":
- Distinctive: line 200
Ask again: "Delete these files?" with Yes/No options
- Very specific: line 204
If TOTAL == 0, skip cleanup silently (don't bother user).
- Very specific: line 206
Note for Scheduled/Headless runs: If the workflow is running automatically via @schedule, the interactive cleanup prompt is suppressed.
- Very specific: line 350
If you run a file with .flow.test extension or explicitly ask for a "dry-run with mocks":
- Distinctive: line 403
Start simple: - Test with small workflows first
- Distinctive: line 404
Use checkpoints: - Add review points for critical steps
- Distinctive: line 405
Capture outputs: - Use variables to pass data between agents
- Distinctive: line 406
Handle errors: - Add fallback paths for critical operations
- Distinctive: line 412
Check agent name spelling
- Very specific: line 413
Verify temp agent exists in ./temp-agents/
- Distinctive: line 414
Ensure namespace prefix for plugin agents
- Very specific: line 417
Verify variable was captured with :varname
- Very specific: line 418
Check variable name spelling in {varname}
- Distinctive: line 419
Ensure variable set before use
- Very specific: line 423
Check checkpoint syntax: @checkpoint-name
- Distinctive: line 426
Ensure parallel tasks are independent
- Very specific: line 427
Check bracket syntax: [a || b]
- Distinctive: line 428
Verify no shared state between parallel tasks
- Distinctive: line 433
managing-agents: Create and manage custom agents
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Executing Orchestration Workflows
I execute workflows with real-time visualization, progress tracking, and interactive steering at checkpoints.
When I Activate
I automatically activate when you:
- Provide workflow syntax to execute
- Ask to "run a workflow"
- Mention workflow execution
- Want to execute a template
- Ask "how do I run this workflow?"
Quick Start
Just provide workflow syntax and I'll handle the rest:
Explore:"Analyze codebase":analysis ->
implement:"Add feature based on {analysis}":code ->
general-purpose:"Run tests":resultsI automatically:
- Parse and validate syntax
- Show execution graph visualization
- Execute agents with progress updates
- Handle checkpoints and steering
- Manage errors gracefully
- Clean up temporary files (with user confirmation)
Execution Process
Phase 1: Parse & Validate
I analyze your workflow:
- Validate syntax correctness
- Check agent references
- Verify variable bindings
- Identify checkpoints
- Map execution graph
Phase 2: Visualize
I show you the execution plan using ASCII art:
Execution Graph:
+-----------------+
| Explore |
| (Analyze code) |
+--------+--------+
|
v
+-----------------+
| implement |
| (Add feature) |
+--------+--------+
|
v
+-----------------+
| general-purpose |
| (Run tests) |
+-----------------+Phase 3: Execute & Save State (Snapshots)
I run agents sequentially or in parallel. Crucially, I maintain a local execution state file to ensure reliability and enable "Time-Travel" recovery.
- Before starting, I create/update
.orchestration/state.jsonin the current working directory. - After EVERY successful node execution, I update the
state.jsonwith captured variables and the node'scompletedstatus. - If the workflow is interrupted, crashes, or fails, I retain this state file.
Sequential (->):
Running: Explore... [In Progress]
Result: Analysis complete -> State Saved.
Running: implement... [In Progress]
Result: Feature added -> State Saved.⏪ Time-Travel Recovery (Resuming)
If you ask me to "resume" a workflow:
- I read
./.orchestration/state.json. - I inject all previously captured variables back into the context.
- I skip all nodes marked as
completedand instantly start executing from the exact node where it left off.
Parallel (||):
Running: task1... [In Progress]
Running: task2... [In Progress]
Running: task3... [In Progress]
All complete! Merging results...Phase 4: Steering
At checkpoints (@review), you control flow:
@review-point reached
Options:
[C]ontinue - Proceed with workflow
[R]etry - Re-run previous step
[M]odify - Adjust and continue
[A]bort - Stop workflow
Your choice?Phase 5: Error Recovery
If agent fails, I offer options:
Agent 'implement' failed: Tests not passing
Options:
- Retry with same instruction
- Modify instruction and retry
- Skip this step (continue workflow)
- Abort workflow
What would you like to do?Phase 6: Cleanup (CONDITIONAL)
IMPORTANT: After workflow execution, check for temporary files and ask user before deleting.
Step 1: Detect Temporary Files
Check for existence of temporary files in the current working directory:
# Check temp-agents
TEMP_AGENTS=$(ls ./temp-agents/*.md 2>/dev/null | wc -l)
# Check temp-scripts
TEMP_SCRIPTS=$(ls ./temp-scripts/* 2>/dev/null | wc -l)
# Check temporary JSON (NOT .flow files!)
TEMP_JSON=$(ls ./examples/*.json 2>/dev/null | wc -l)
TOTAL=$((TEMP_AGENTS + TEMP_SCRIPTS + TEMP_JSON))Step 2: If Files Exist, Ask User
Only if TOTAL > 0, use AskUserQuestion:
AskUserQuestion({
questions: [{
question: "Found ${TOTAL} temporary files. Do you want to delete them?",
header: "Cleanup",
multiSelect: false,
options: [
{label: "Yes, delete all", description: "Remove all temporary files (temp-agents, temp-scripts, temp JSON)"},
{label: "Show me first", description: "List files before deciding"},
{label: "No, keep them", description: "Leave files for manual review"}
]
}]
})Step 3: Execute Cleanup if Confirmed
If user chose "Yes, delete all":
# Delete temp-agents (in current working directory)
rm -f ./temp-agents/*.md
# Delete temp-scripts (in current working directory)
rm -rf ./temp-scripts/*
# Delete temporary JSON only (keep .flow files!)
rm -f ./examples/*.jsonReport what was deleted:
Cleaned up ${TOTAL} temporary files:
- ${TEMP_AGENTS} temp agents removed
- ${TEMP_SCRIPTS} temp scripts removed
- ${TEMP_JSON} temporary JSON files removedIf user chose "Show me first":
- List all files with paths
- Ask again: "Delete these files?" with Yes/No options
Step 4: Skip if No Files
If TOTAL == 0, skip cleanup silently (don't bother user).
Note for Scheduled/Headless runs: If the workflow is running automatically via @schedule, the interactive cleanup prompt is suppressed. Temporary files will be left intact so they can be reused on the next run, saving computation time.
Syntax Reference
See syntax-reference.md for complete syntax documentation.
Quick reference:
| Syntax | Meaning | Example | ||
-> | Sequential | a -> b | ||
| ` | ` | Parallel | [a || b] | |
~> | Conditional | (if passed)~> next | ||
@ | Checkpoint | @review | ||
:var | Output capture | task:output | ||
{var} | Variable interpolation | "Use {output}" | ||
$agent | Temp agent | $scanner:"Scan" |
Agent Types
Built-in Claude Code agents (no prefix):
Explore- Fast codebase exploration and searchPlan- Planning and breaking down tasksgeneral-purpose- Versatile agent for complex multi-step tasks
Plugin agents (orchestration: prefix):
orchestration:workflow-socratic-designer- Workflow creation via Socratic methodorchestration:workflow-syntax-designer- Custom syntax design
External agents (registered via /orchestration:init):
- Agents from
~/.claude/agents/can be registered and used directly - Example:
expert-code-implementer,code-optimizer(if registered)
Temp agents ($name):
- Created during workflow execution in
./temp-agents/ - Automatically cleaned up after workflow (with user confirmation)
- Can be promoted to permanent agents if useful
Variable Passing
See variables.md for advanced variable usage.
Capture output:
Explore:"Find routes":routes ->
analyze:"Check {routes}":findingsConditional on variables:
test:"Run tests":results ->
(if results.passed)~> deploy ->
(if results.failed)~> debugError Handling
Common error patterns:
Retry on failure:
@attempt ->
operation:"Try task" ->
(if failed)~> wait:"Wait 5s" -> @attempt ~>
(if passed)~> continueFallback path:
primary:"Try primary" ->
(if failed)~> backup:"Use backup" ~>
(if passed)~> processStop on critical error:
security-scan:"Scan" ->
(if critical-issues)~> @emergency-stop -> abort ~>
(if clean)~> deployCheckpoints
See checkpoints.md for checkpoint details.
Basic checkpoint:
implement -> @review -> deployLabeled checkpoint:
@quality-gate:"Review code quality. Approve?"Conditional checkpoint:
(if security-critical)~> @security-reviewParallel Execution
See parallel.md for parallel execution patterns.
Basic parallel:
[task1 || task2 || task3] -> mergeParallel with individual variables:
[
task1:"First":result1 ||
task2:"Second":result2 ||
task3:"Third":result3
] ->
general-purpose:"Process {result1}, {result2}, {result3}"Conditional parallel:
(if needs-full-scan)~> [security || performance || style] ~>
(if needs-quick-check)~> basic-lintExamples
See examples/ for categorized workflow examples:
- sequential.md - Sequential workflows
- parallel.md - Parallel execution
- conditional.md - Conditional logic
- error-handling.md - Error recovery
- checkpoints.md - Manual gates
Execution Modes
Normal mode (default):
- Full execution with all phases
- Interactive checkpoints
- Error recovery prompts
Dry-Run Unit Tests (.flow.test / Mock Mode):
- Parse and validate only.
- If you run a file with
.flow.testextension or explicitly ask for a "dry-run with mocks":- I will look for a
mocks:section in the YAML frontmatter of the workflow (where you define fake outputs for variables). - I will traverse the execution graph without invoking any actual agents.
- Whenever a variable is needed for a conditional (
~>) or a semantic router (route() =>), I will use your provided mocked data to decide the path. - I will output the exact execution path taken based on the mocks, allowing you to unit-test complex logic before running on production code.
- I will look for a
Auto mode / Headless:
- Skip checkpoint prompts
- Automatic error retry (up to 3 times)
- Minimal user interaction
Progress Tracking
During execution, I show:
Workflow: TDD Implementation
Progress: [========..] 80%
Phase 1: Done - Requirements analyzed
Phase 2: Done - Tests written
Phase 3: Done - Tests verified failing
Phase 4: Paused - Checkpoint: review-test-coverage
Phase 5: In Progress - Implementing code...
Phase 6: Pending
Phase 7: PendingWorkflow Metadata
Track execution metadata:
Workflow: debug-and-fix.flow
Started: 2025-01-08 14:32:10
Duration: 5m 23s
Agents used: 8
Checkpoints: 2
Status: Complete
Agents executed:
- Explore (x1)
- general-purpose (x5)
- expert-code-implementer (x2)
Resources:
- Files read: 12
- Files modified: 3
- Tests run: 1Tips for Successful Execution
- Start simple - Test with small workflows first
- Use checkpoints - Add review points for critical steps
- Capture outputs - Use variables to pass data between agents
- Handle errors - Add fallback paths for critical operations
- Monitor progress - Watch execution visualization
Common Issues
Agent not found:
- Check agent name spelling
- Verify temp agent exists in
./temp-agents/ - Ensure namespace prefix for plugin agents
Variable not found:
- Verify variable was captured with
:varname - Check variable name spelling in
{varname} - Ensure variable set before use
Checkpoint skipped:
- Checkpoints only work in normal mode
- Check checkpoint syntax:
@checkpoint-name
Parallel execution failed:
- Ensure parallel tasks are independent
- Check bracket syntax:
[a || b] - Verify no shared state between parallel tasks
Related Skills
- creating-workflows: Design and create workflows
- managing-agents: Create and manage custom agents
- debugging-workflows: Debug workflow issues
- using-templates: Execute workflow templates
Commands
/orchestration:run- Execute workflow from file or inline/orchestration:template- Execute saved template/orchestration:explain- Explain workflow execution plan
Ready to execute? Provide your workflow syntax or template name!
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
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.

