Skip to main content

workflow-skill-designer

Meta-skill for designing orchestrator+phases structured workflow skills. Creates SKILL.md coordinator with progressive phase loading, TodoWrite patterns, and data flow. Triggers on "design workflow skill", "create workflow skill", "workflow skill designer".

Source facts

Repository
catlog22/Claude-Code-Workflow
Last source activity
March 5, 2026 at 13:14
Detected SKILL.md language
Mixed languages
Stars
2,128
Forks
166

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
5 files

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
workflow-skill-designer
description
Meta-skill for designing orchestrator+phases structured workflow skills. Creates SKILL.md coordinator with progressive phase loading, TodoWrite patterns, and data flow. Triggers on "design workflow skill", "create workflow skill", "workflow skill designer".
allowed-tools
Agent, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep
# Workflow Skill Designer Meta-skill for creating structured workflow skills following the orchestrator + phases pattern. Generates complete skill packages with SKILL.md as coordinator and phases/ folder for execution details. ## Architecture Overview ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Workflow Skill Designer โ”‚ โ”‚ โ†’ Analyze requirements โ†’ Design orchestrator โ†’ Generate phases โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ†“ โ†“ โ†“ โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Phase 1 โ”‚ โ”‚ Phase 2 โ”‚ โ”‚ Phase 3 โ”‚ โ”‚ Phase 4 โ”‚ โ”‚ Require โ”‚ โ”‚ Orch โ”‚ โ”‚ Phases โ”‚ โ”‚ Valid โ”‚ โ”‚ Analysisโ”‚ โ”‚ Design โ”‚ โ”‚ Design โ”‚ โ”‚ & Integ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ โ†“ โ†“ โ†“ workflow SKILL.md phases/ Complete config generated 0N-*.md skill pkg ``` ## Target Output Structure The skill this meta-skill produces follows this structure: ``` .claude/skills/{skill-name}/ โ”œโ”€โ”€ SKILL.md # Orchestrator: coordination, data flow, TodoWrite โ”œโ”€โ”€ phases/ โ”‚ โ”œโ”€โ”€ 01-{phase-name}.md # Phase execution detail (full content) โ”‚ โ”œโ”€โ”€ 02-{phase-name}.md โ”‚ โ”œโ”€โ”€ ... โ”‚ โ””โ”€โ”€ 0N-{phase-name}.md โ”œโ”€โ”€ specs/ # [Optional] Domain specifications โ””โ”€โ”€ templates/ # [Optional] Reusable templates ``` ## Core Design Patterns Patterns extracted from successful workflow skill implementations (workflow-plan, project-analyze, etc.): ### Pattern 1: Orchestrator + Progressive Loading **SKILL.md** = Pure coordinator. Contains: - Architecture diagram (ASCII) - Execution flow with `Ref: phases/0N-xxx.md` markers - Phase Reference Documents table (read on-demand) - Data flow between phases - Core rules and error handling **Phase files** = Full execution detail. Contains: - Complete agent prompts, bash commands, code implementations - Validation checklists, error handling - Input/Output specification - Next Phase link **Key Rule**: SKILL.md references phase docs via `Ref:` markers. Phase docs are read **only when that phase executes**, not all at once. ### Pattern 2: TodoWrite Attachment/Collapse ``` Phase starts: โ†’ Sub-tasks ATTACHED to TodoWrite (in_progress + pending) โ†’ Orchestrator executes sub-tasks sequentially Phase ends: โ†’ Sub-tasks COLLAPSED back to high-level summary (completed) โ†’ Next phase begins ``` ### Pattern 3: Inter-Phase Data Flow ``` Phase N output โ†’ stored in memory/variable โ†’ Phase N+1 input โ””โ”€ or written to session file for persistence ``` Each phase receives outputs from prior phases via: - In-memory variables (sessionId, contextPath, etc.) - Session directory files (.workflow/active/{sessionId}/...) - Planning notes (accumulated constraints document) ### Pattern 4: Conditional Phase Execution ``` Phase N output contains condition flag โ”œโ”€ condition met โ†’ Execute Phase N+1 โ””โ”€ condition not met โ†’ Skip to Phase N+2 ``` ### Pattern 5: Input Structuring User input (free text) โ†’ Structured format before Phase 1: ``` GOAL: [objective] SCOPE: [boundaries] CONTEXT: [background/constraints] ``` ### Pattern 6: Interactive Preference Collection (SKILL.md Responsibility) Workflow preferences (auto mode, force explore, etc.) MUST be collected via AskUserQuestion in SKILL.md **before** dispatching to phases. Phases reference these as `workflowPreferences.{key}` context variables. **Anti-Pattern**: Command-line flags (`--yes`, `-e`, `--explore`) parsed within phase files via `$ARGUMENTS.includes(...)`. ```javascript // CORRECT: In SKILL.md (before phase dispatch) const prefResponse = AskUserQuestion({ questions: [ { question: "ๆ˜ฏๅฆ่ทณ่ฟ‡็กฎ่ฎค๏ผŸ", header: "Auto Mode", options: [ { label: "Interactive (Recommended)", description: "ไบคไบ’ๆจกๅผ" }, { label: "Auto", description: "่ทณ่ฟ‡ๆ‰€ๆœ‰็กฎ่ฎค" } ]} ] }) workflowPreferences = { autoYes: prefResponse.autoMode === 'Auto' } // CORRECT: In phase files (reference only) const autoYes = workflowPreferences.autoYes // WRONG: In phase files (flag parsing) const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y') ``` ### Pattern 7: Direct Phase Handoff When one phase needs to invoke another phase within the same skill, read and execute the phase document directly. Do NOT use Skill() routing back through SKILL.md. ```javascript // CORRECT: Direct handoff (executionContext already set) Read("phases/02-lite-execute.md") // Execute with executionContext (Mode 1) // WRONG: Skill routing (unnecessary round-trip) Skill(skill="workflow-lite-plan", args="--in-memory") ``` ### Pattern 8: Phase File Hygiene Phase files are internal execution documents. They MUST NOT contain: | Prohibited | Reason | Correct Location | |------------|--------|------------------| | Flag parsing (`$ARGUMENTS.includes(...)`) | Preferences collected in SKILL.md | SKILL.md via AskUserQuestion | | Invocation syntax (`/skill-name "..."`) | Not user-facing docs | Removed or SKILL.md only | | Conversion provenance (`Source: Converted from...`) | Implementation detail | Removed | | Skill routing for inter-phase (`Skill(skill="...")`) | Use direct phase read | Direct `Read("phases/...")` | ### Pattern 9: Compact Recovery (Phase Persistence) Multi-phase workflows span long conversations. Context compression (compact) will naturally summarize earlier phase documents. The strategy uses **ๅŒ้‡ไฟ้™ฉ**: TodoWrite ่ทŸ่ธช active phase ไฟๆŠคๅ…ถไธ่ขซๅŽ‹็ผฉ๏ผŒsentinel ไฝœไธบๅ…œๅบ•ๅœจๅŽ‹็ผฉๅ‘็”Ÿๆ—ถ่งฆๅ‘ๆขๅคใ€‚ **Design principle**: TodoWrite `in_progress` = active phase โ†’ protect from compact | Sentinel = re-read fallback if protection fails. **Double insurance mechanism**: | Layer | Role | Mechanism | |-------|------|-----------| | **1. Active Phase Protection** | ้ข„้˜ฒ | TodoWrite `in_progress` ๆ ‡่ฎฐๅฝ“ๅ‰ phase โ†’ compact ๆ—ถไฟ็•™่ฏฅ phase ๅฎŒๆ•ดๅ†…ๅฎน๏ผŒไธๅŽ‹็ผฉ | | **2. Sentinel Re-read** | ๆขๅค | Phase ๆ–‡ไปถๅตŒๅ…ฅๆ ‡่ฏ†็ฌฆ โ†’ ่‹ฅไป่ขซๅŽ‹็ผฉ๏ผŒๆฃ€ๆต‹ๅˆฐ sentinel-only ็Šถๆ€ๆ—ถ็ซ‹ๅณ re-read | **When to apply**: ไปปไฝ•้€š่ฟ‡ direct handoff (Pattern 7) ่ทจ phase ๆ‰ง่กŒ็š„ๅœบๆ™ฏ๏ผŒๅฐคๅ…ถๆ˜ฏๅŽ็ปญ phase ๅŒ…ๅซๅคๆ‚ๆ‰ง่กŒๅ่ฎฎ๏ผˆๅคš Stepใ€agent ่ฐƒๅบฆใ€CLI ็ผ–ๆŽ’๏ผ‰ๆ—ถใ€‚ --- #### Layer 1: Active Phase Protection (TodoWrite ่”ๅŠจ) TodoWrite ๅทฒ็ป่ทŸ่ธชๆฏไธช phase ็š„ๆ‰ง่กŒ็Šถๆ€ใ€‚ๅˆฉ็”จๆญคไฟกๆฏ้ฉฑๅŠจ compact ็ญ–็•ฅ๏ผš ``` TodoWrite status โ†’ Compact behavior: โ”Œโ”€ completed โ†’ โœ… ๅฏๅŽ‹็ผฉ๏ผˆๅทฒๅฎŒๆˆ๏ผŒไธๅ†้œ€่ฆๅฎŒๆ•ดๅ†…ๅฎน๏ผ‰ โ”œโ”€ in_progress โ†’ ๐Ÿ›ก๏ธ ็ฆๆญขๅŽ‹็ผฉ๏ผˆๆญฃๅœจๆ‰ง่กŒ๏ผŒๅฟ…้กปไฟ็•™ๅฎŒๆ•ดๅ่ฎฎ๏ผ‰ โ””โ”€ pending โ†’ โœ… ๅฏๅŽ‹็ผฉ๏ผˆๅฐšๆœชๅŠ ่ฝฝ๏ผŒๆ— ๅ†…ๅฎน๏ผ‰ ``` **SKILL.md Execution Flow** ไธญๆ ‡ๆณจ compact ่”ๅŠจ: ```markdown ## Execution Flow > **โš ๏ธ COMPACT DIRECTIVE**: Context compression MUST check TodoWrite phase status. > The phase currently marked `in_progress` is the active execution phase โ€” preserve its FULL content. > Only compress phases marked `completed` or `pending`. Phase 1: Requirements Analysis โ† TodoWrite tracks status โ””โ”€ Ref: phases/01-xxx.md Phase 2: Execution Engine โ† TodoWrite tracks status โ””โ”€ Ref: phases/02-xxx.md ... ``` **TodoWrite ็Šถๆ€่ฝฌๆข** ๆ—ถ่‡ชๅŠจๆ›ดๆ–ฐ compact ไฟๆŠค่Œƒๅ›ด: ``` Phase 1: in_progress ๐Ÿ›ก๏ธ โ†’ completed โœ… (compact ๅฏๅŽ‹็ผฉ Phase 1) Phase 2: pending โœ… โ†’ in_progress ๐Ÿ›ก๏ธ (compact ไฟๆŠค Phase 2) ``` --- #### Layer 2: Sentinel Re-read (ๅ…œๅบ•ๆขๅค) ๅณไฝฟๆœ‰ Layer 1 ไฟๆŠค๏ผŒcompact ไปๅฏ่ƒฝๅœจๆž็ซฏๅœบๆ™ฏ๏ผˆ่ถ…้•ฟไธŠไธ‹ๆ–‡ใ€ๅคš่ฝฎ agent ่ฐƒๅบฆ๏ผ‰ไธ‹ๅŽ‹็ผฉ active phaseใ€‚Sentinel ็กฎไฟๆขๅค่ƒฝๅŠ›๏ผš **Phase ๆ–‡ไปถ้กถ้ƒจๅตŒๅ…ฅ sentinel**: ```markdown > **๐Ÿ“Œ COMPACT SENTINEL [Phase N: {phase-name}]** > This phase contains {M} execution steps (Step N.1 โ€” N.{M}). > If you can read this sentinel but cannot find the full Step protocol below, context has been compressed. > Recovery: `Read("phases/0N-xxx.md")` ``` Sentinel ่ฎพ่ฎก็‰น็‚น๏ผš - ็ป“ๆž„ๅŒ–ใ€้†’็›ฎ โ†’ compact ไผšๅฐ†ๅ…ถไฝœไธบๅ…ณ้”ฎไฟกๆฏไฟ็•™ๅœจๆ‘˜่ฆไธญ - ๅŒ…ๅซ step ๆ•ฐ้‡ โ†’ ๆไพ›่‡ชๆฃ€ไพๆฎ๏ผˆ"ๅบ”่ฏฅ็œ‹ๅˆฐ M ไธช Step๏ผŒไฝ†ๅชๆœ‰ๆ‘˜่ฆ"๏ผ‰ - ๅŒ…ๅซ re-read ่ทฏๅพ„ โ†’ ๆ— ้œ€ๆŸฅ่กจๅณๅฏๆขๅค --- #### Phase Reference Table (ๆ•ดๅˆๅŒ้‡ไฟ้™ฉ) ```markdown | Phase | Document | Purpose | Compact | |-------|----------|---------|---------| | 1 | phases/01-xxx.md | Planning | TodoWrite ้ฉฑๅŠจ | | 2 | phases/02-xxx.md | Execution | TodoWrite ้ฉฑๅŠจ + ๐Ÿ”„ sentinel | **Compact Rules**: 1. **TodoWrite `in_progress`** โ†’ ไฟ็•™ๅฎŒๆ•ดๅ†…ๅฎน๏ผŒ็ฆๆญขๅŽ‹็ผฉ 2. **TodoWrite `completed`** โ†’ ๅฏๅŽ‹็ผฉไธบๆ‘˜่ฆ 3. **๐Ÿ”„ sentinel fallback** โ†’ ๅธฆๆญคๆ ‡่ฎฐ็š„ phase ๅŒ…ๅซ compact sentinel๏ผ›่‹ฅ compact ๅŽไป…ๅญ˜ sentinel ่€Œๆ— ๅฎŒๆ•ด Step ๅ่ฎฎ๏ผŒ**ๅฟ…้กป็ซ‹ๅณ `Read("phases/0N-xxx.md")` ๆขๅคๅŽๅ†็ปง็ปญ** ``` --- #### Checkpoint (ๆ‰ง่กŒๆญฅ้ชคๅ‰ๅŒ้‡้ชŒ่ฏ) ```markdown > **โš ๏ธ CHECKPOINT**: Before proceeding, verify: > 1. This phase is TodoWrite `in_progress` (active phase protection) > 2. Full protocol (Step N.X โ€” N.{M}) is in active memory, not just sentinel > If only sentinel remains โ†’ `Read("phases/0N-xxx.md")` now. ``` #### Handoff ๆณจ้‡Š ```javascript // Phase N is tracked by TodoWrite โ€” active phase protection applies. // Sentinel fallback: if compressed despite protection, re-read triggers automatically. Read("phases/0N-xxx.md") ``` ## Execution Flow ``` Phase 1: Requirements Analysis โ””โ”€ Ref: phases/01-requirements-analysis.md โ”œโ”€ Input source: commands, descriptions, user interaction โ””โ”€ Output: workflowConfig (phases, data flow, agents, conditions) Phase 2: Orchestrator Design (SKILL.md) โ””โ”€ Ref: phases/02-orchestrator-design.md โ”œโ”€ Input: workflowConfig โ””โ”€ Output: .claude/skills/{name}/SKILL.md Phase 3: Phase Files Design โ””โ”€ Ref: phases/03-phase-design.md โ”œโ”€ Input: workflowConfig + source content โ””โ”€ Output: .claude/skills/{name}/phases/0N-*.md Phase 4: Validation & Integration โ””โ”€ Ref: phases/04-validation.md โ””โ”€ Output: Validated skill package ``` **Phase Reference Documents** (read on-demand): | Phase | Document | Purpose | |-------|----------|---------| | 1 | [phases/01-requirements-analysis.md](phases/01-requirements-analysis.md) | Analyze workflow requirements from various sources | | 2 | [phases/02-orchestrator-design.md](phases/02-orchestrator-design.md) | Generate SKILL.md with orchestration patterns | | 3 | [phases/03-phase-design.md](phases/03-phase-design.md) | Generate phase files preserving full execution detail | | 4 | [phases/04-validation.md](phases/04-validation.md) | Validate structure, references, and integration | ## Input Sources This meta-skill accepts workflow definitions from multiple sources: | Source | Description | Example | |--------|-------------|---------| | **Existing commands** | Convert `.claude/commands/` orchestrator + sub-commands | `plan.md` + `session/start.md` + `tools/*.md` | | **Text description** | User describes workflow in natural language | "Create a 3-phase code review workflow" | | **Requirements doc** | Structured requirements file | `requirements.md` with phases/agents/outputs | | **Existing skill** | Refactor/redesign an existing skill | Restructure a flat skill into phases | ## Frontmatter Conversion Rules When converting from command format to skill format: | Command Field | Skill Field | Transformation | |---------------|-------------|----------------| | `name` | `name` | Prefix with group: `plan` โ†’ `workflow-plan` | | `description` | `description` | Append trigger phrase: `Triggers on "xxx"` | | `argument-hint` | _(removed)_ | Arguments handled in Input Processing section | | `examples` | _(removed)_ | Examples moved to inline documentation | | `allowed-tools` | `allowed-tools` | Expand wildcards: `Skill(*)` โ†’ `Skill`, add commonly needed tools | | `group` | _(removed)_ | Embedded in `name` prefix | ## Orchestrator Content Mapping What goes into SKILL.md vs what goes into phase files: ### SKILL.md (Coordinator) | Section | Content | Source | |---------|---------|--------| | Frontmatter | name, description, allowed-tools | Command frontmatter (converted) | | Architecture Overview | ASCII diagram of phase flow | Derived from execution structure | | Key Design Principles | Coordination rules | Extracted from command coordinator role | | Execution Flow | Phase sequence with `Ref:` markers + Phase Reference table | Command execution process | | Core Rules | Orchestration constraints | Command core rules | | Input Processing | Structured format conversion | Command input processing | | Data Flow | Inter-phase data passing | Command data flow | | TodoWrite Pattern | Attachment/collapse lifecycle | Command TodoWrite sections | | Post-Phase Updates | Planning notes / state updates between phases | Command inter-phase update code | | Error Handling | Failure recovery | Command error handling | | Coordinator Checklist | Pre/post phase actions | Command coordinator checklist | | Related Commands | Prerequisites and follow-ups | Command related commands | ### Phase Files (Execution Detail) | Content | Rule | |---------|------| | Full agent prompts | Preserve verbatim from source command | | Bash command blocks | Preserve verbatim | | Code implementations | Preserve verbatim | | Validation checklists | Preserve verbatim | | Error handling details | Preserve verbatim | | Input/Output spec | Add if not present in source | | Phase header | Add `# Phase N: {Name}` | | Objective section | Add `## Objective` with bullet points | | Next Phase link | Add `## Next Phase` with link to next | **Critical Rule**: Phase files must be **content-faithful** to their source. Do NOT summarize, abbreviate, or simplify. The phase file IS the execution instruction - every bash command, every agent prompt, every validation step must be preserved. ## SKILL.md Template ```markdown --- name: {skill-name} description: {description}. Triggers on "{trigger1}", "{trigger2}". allowed-tools: {tools} --- # {Title}
View on GitHub
This SKILL.md is very large, so SkillsMP previews the first section here. View on GitHub