
workflow-orchestration
by jwwelbor
simple cli driven task managent for use with spec-driven development and ai agents
SKILL.md
name: Workflow Orchestration description: Coordinate SDLC workflow execution, manage state, and orchestrate agent handoffs when_to_use: when coordinating multi-agent workflows, managing workflow state, or handling agent-to-agent transitions version: 1.0.0
Workflow Orchestration
Overview
The Orchestration skill enables Product Managers and other coordinating agents to manage complex SDLC workflows involving multiple agents, subgraphs, and state transitions.
Core principle: Workflows are state machines defined in CSV files. Each node represents an agent task. Transitions happen via artifact creation and hook automation.
Announce at start: "I'm using the Workflow Orchestration skill to coordinate the SDLC workflow."
When to Use This Skill
Use Orchestration when:
- Starting a new workflow (/vision, /feature, /develop, /release)
- Coordinating parallel subgraphs
- Managing workflow state transitions
- Handling agent handoffs
- Monitoring workflow progress
- Resuming interrupted workflows
- Debugging workflow issues
Key Concepts
Workflow Graphs
Defined in CSV files at /home/jwwelbor/projects/ai-dev-team/docs/plan/E01-SDLC-Workflow/csv/:
01-pdlc.csv- Product Development Lifecycle02-feature-refinement.csv- Feature Refinement03-story-elaboration.csv- Story Elaboration Subgraph04-prototyping.csv- Prototyping Subgraph05-tech-spec.csv- Technical Specification06-development.csv- Development Subgraph07-infrastructure.csv- Infrastructure Setup08-release.csv- Release Cycle
Workflow State
Tracked in /home/jwwelbor/projects/ai-dev-team/docs/workflow/state.json:
current_workflow: Which graph and node is activepending_artifacts: What outputs are expectedcompleted_nodes: History of finished nodessubgraph_stack: Nested workflow tracking
Artifacts
Work products created by agents, stored in /home/jwwelbor/projects/ai-dev-team/docs/workflow/artifacts/:
- Discovery: D01-, D02-, etc.
- Feature: F01-, F02-, etc.
- Technical: T01-, T02-, etc.
- Development: DEV-*
- Release: R01-, R02-, etc.
Orchestration Workflows
1. Starting a Workflow
See: workflows/start-workflow.md
When initiating a new workflow:
- Identify the entry point (command or manual trigger)
- Load the workflow CSV definition
- Initialize state.json with starting node
- Launch the first agent with context
- Set up artifact watchers
2. Managing State Transitions
See: workflows/state-transitions.md
When coordinating node-to-node transitions:
- Verify current node completion
- Check required artifacts are produced
- Consult CSV for next_nodes
- Update state.json with new current_node
- Prepare context for next agent
- Hand off control
3. Launching Subgraphs
See: workflows/subgraph-invocation.md
When a node triggers a subgraph:
- Push current state to subgraph_stack
- Initialize subgraph as new current_workflow
- Set return_to_node for when subgraph completes
- Launch subgraph entry node
- Monitor subgraph progress
4. Handling Subgraph Returns
See: workflows/subgraph-return.md
When a subgraph completes:
- Collect subgraph output artifacts
- Pop from subgraph_stack
- Restore parent workflow as current_workflow
- Resume at return_to_node
- Provide subgraph outputs as inputs to next node
5. Monitoring Progress
See: workflows/monitor-progress.md
To track workflow status:
- Read state.json current position
- Check completed_nodes history
- Verify pending_artifacts status
- Identify blockers or missing inputs
- Report progress to stakeholders
6. Error Handling
See: workflows/error-handling.md
When a workflow encounters errors:
- Identify failure point (node, agent, artifact)
- Log error in state.json
- Determine if retry is possible
- Optionally rollback to previous stable state
- Notify stakeholders
- Provide recovery options
Working with Workflow State
Reading State
import json
from pathlib import Path
state_path = Path('/home/jwwelbor/projects/ai-dev-team/docs/workflow/state.json')
with open(state_path) as f:
state = json.load(f)
current_graph = state['current_workflow']['graph_name']
current_node = state['current_workflow']['current_node']
current_agent = state['current_workflow']['current_agent']
Updating State
state['current_workflow']['current_node'] = 'Next_Node_Name'
state['current_workflow']['current_agent'] = 'NextAgent'
state['current_workflow']['updated_at'] = datetime.now().isoformat()
with open(state_path, 'w') as f:
json.dump(state, f, indent=2)
Recording Completed Nodes
completed = {
"node_name": "Product_Vision_Definition",
"agent": "Client",
"completed_at": datetime.now().isoformat(),
"artifacts_produced": ["D01-vision-statement.md", "D02-success-criteria.md"]
}
state['completed_nodes'].append(completed)
Working with Workflow CSVs
Reading Workflow Definition
import csv
csv_path = Path('/home/jwwelbor/projects/ai-dev-team/docs/plan/E01-SDLC-Workflow/csv/01-pdlc.csv')
with open(csv_path) as f:
reader = csv.DictReader(f)
nodes = {row['node_name']: row for row in reader}
current_node_def = nodes[current_node]
next_node_name = current_node_def['next_nodes']
required_outputs = current_node_def['outputs'].split('|')
Finding Next Agent
next_node_def = nodes[next_node_name]
next_agent = next_node_def['agent_type']
required_inputs = next_node_def['inputs'].split('|')
Integration with Hooks
Orchestration works seamlessly with hooks:
artifact-watcher.py (PostToolUse)
- Detects when artifacts are created
- Updates state.json with artifact status
- Marks pending artifacts as created
- Can auto-advance workflow if all outputs complete
workflow-router.py (Stop)
- Runs when current agent finishes
- Reads state.json to determine next step
- Launches next agent with context
- Handles end terminal nodes
context-loader.py (SessionStart)
- Loads workflow state when agent starts
- Provides agent with current context
- Includes relevant artifacts and history
Coordination Patterns
Sequential Execution
Node A → produces artifacts → Node B → produces artifacts → Node C
Parallel Subgraphs
Node A → launches → [Subgraph 1, Subgraph 2] → both complete → Node B
Conditional Branching
Node A → check condition → Node B (success path) OR Node C (failure path)
Human Checkpoints
Node A → produces output → Human Review → approve/reject → Node B or retry
Best Practices
For Product Managers
- Always check state.json before starting new workflows
- Verify required artifacts exist before advancing nodes
- Document decision points in workflow context
- Keep stakeholders informed of progress
- Plan for failure scenarios
For Workflow Designers
- Define clear artifact names in CSV outputs column
- Ensure next_nodes mapping is unambiguous
- Include failure_node for error paths
- Document hooks column for automation triggers
- Keep node names descriptive and unique
For Agent Developers
- Produce artifacts with exact names from CSV definition
- Update state.json when completing work
- Check inputs exist before starting
- Handle missing artifacts gracefully
- Log progress for debugging
Troubleshooting
Workflow Stuck
- Check state.json status field
- Verify pending_artifacts - are any missing?
- Review completed_nodes - did last node finish?
- Check hooks are configured and firing
Wrong Agent Launched
- Verify CSV next_nodes mapping
- Check state.json current_node matches CSV
- Ensure workflow-router.py is using correct CSV
Subgraph Not Returning
- Check subgraph_stack in state.json
- Verify subgraph has end terminal node
- Ensure SubagentStop hook is registered
- Check return_to_node is valid in parent graph
Artifacts Not Detected
- Verify artifact matches naming pattern (D01-, F01-, etc.)
- Check artifact is in docs/workflow/artifacts/ directory
- Ensure artifact-watcher.py hook is firing
- Review hook configuration in settings.json
Related Skills
specification-writing- Creating PRDs, stories, and documentationbrainstorming- Ideation and solution explorationarchitecture- System design and technical planningquality- Testing and validationdevops- Infrastructure and deployment
Examples
See individual workflow files in workflows/ directory for detailed examples:
start-workflow.md- Initiating workflowsstate-transitions.md- Managing node transitionssubgraph-invocation.md- Launching nested workflowssubgraph-return.md- Returning from subgraphsmonitor-progress.md- Tracking workflow statuserror-handling.md- Dealing with failures
Remember
- Workflows are state machines - respect the state
- CSVs are the source of truth - don't modify them
- Artifacts are the handoff mechanism - name them correctly
- Hooks automate transitions - configure them properly
- State.json tracks everything - keep it updated
- Announce skill usage at start
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です