Claude-Code-Workflow ccw-chain
Chain-based CCW workflow orchestrator. Intent analysis, workflow routing, and Skill pipeline execution via progressive chain loading. Triggers on "ccw chain", "chain ccw", "workflow chain".
install
source · Clone the upstream repo
git clone https://github.com/catlog22/Claude-Code-Workflow
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/catlog22/Claude-Code-Workflow "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/ccw-chain" ~/.claude/skills/catlog22-claude-code-workflow-ccw-chain && rm -rf "$T"
manifest:
.claude/skills/ccw-chain/SKILL.mdsource content
CCW Chain Orchestrator
Chain-based workflow orchestrator using
chain_loader for progressive step loading and LLM-driven decision routing.
Discovery
— list all chains with triggers, entries, and descriptionschain_loader list- Match user intent to chain
/triggers.task_typestriggers.keywords
— preview chain node graph and available entrieschain_loader inspect
— begin from default entry, named entry (chain_loader start
), or any node (entry_name
)node
Execution Protocol
When
chain_loader delivers a step node with a skill/command doc:
- Read the loaded doc content to understand the skill's purpose and interface
- Assemble the Skill call:
Skill(skill_name, args)- First step:
args = "${analysis.goal}" - Subsequent steps:
(auto-receives session context)args = "" - Special args noted in step name (e.g.,
,--bugfix
,--hotfix
)--plan-only
- First step:
- Propagate -y: If auto mode active, append
to args-y - Execute:
— blocking, wait for completionSkill(skill_name, args) - Advance:
to proceed to next stepchain_loader done
const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS); function assembleCommand(skillName, args, previousResult) { if (!args && previousResult?.session_id) { args = `--session="${previousResult.session_id}"`; } if (autoYes && !args.includes('-y') && !args.includes('--yes')) { args = args ? `${args} -y` : '-y'; } return { skill: skillName, args }; }
Auto Mode (-y
/ --yes
)
-y--yes- D1 Clarity Check: always choose "Clear" (skip clarification)
- Confirmation: skip, execute directly
- Error handling: auto-skip failed steps, continue pipeline
- Propagation:
injected into every downstream Skill call-y
Delegation Protocol
When
chain_loader returns delegate_depth > 0:
- Continue normal execution (read content, assemble Skill, execute)
- On
, resume parent chain contextreturned_from_delegate: true - Variables received from child chain are available for subsequent steps
Preloaded Context
When
chain_loader start returns preloaded_keys:
- Preloaded content is available via
for the entire sessionchain_loader content - Reference preloaded context when assembling Skill calls
- Use preloaded memory/project context to inform all downstream steps
Progress Visualization
After each
chain_loader done, call chain_loader visualize to show progress.
Display the visualization in execution log for user awareness.
Variable Propagation
Intent analysis results (
task_type, goal, auto_yes) are stored as chain variables.
assembleCommand() reads variables from chain_loader status for Skill args.
Variables automatically flow through delegation via pass_variables/receive_variables.
Phase-Level Execution (Skill Chain Delegation)
When the current chain is a skill-level chain (entered via delegation from a category chain):
- Each step delivers phase doc content directly (not SKILL.md)
- Execute phase instructions inline — do NOT wrap in
callSkill() - Reference preloaded
for orchestration patterns (TodoWrite, data flow, error handling)skill-context - Phase execution produces artifacts (files, session state) consumed by the next phase
- The chain system controls phase progression — no need for internal phase orchestration
Architecture: Chain Definition Layers
- Category chains (8):
— routing and orchestration (ccw-main, ccw-standard, etc.)ccw-chain/chains/ - Workflow skill chains (7):
— skill-level chains with phase content.claude/workflow-skills/*/chains/ - Phase content:
— original phase files, referenced via.claude/skills/*/phases/
prefix@skills/ - Category chains delegate to workflow skill chains via
fallbackfindChainAcrossSkills() - Content refs:
= skill-relative,@phases/
= project@skills/
relative.claude/skills/