--- name: ck-orchestration description: Orchestrate multi-agent workflows with sequential chaining and parallel execution. Use for feature delivery pipelines, research-then-implement flows, parallel independent tasks, subagent coordination, and passing context between agents. --- # ck-orchestration Protocols for coordinating multiple ck-* skills as agents in complex workflows. Covers sequential chaining, parallel execution, delegation patterns, and documentation management. ## When to Use - Coordinating a multi-phase feature delivery (plan → implement → test → review) - Running independent tasks simultaneously (code + tests + docs in parallel) - Passing outputs from one agent to the next in a pipeline - Managing subagent context and report paths - Deciding when to chain vs. parallelize work ## Don't Use When - Single-skill tasks that don't need coordination - Quick fixes or one-off queries — invoke the skill directly ## Reference Documents | Topic | Reference | |-------|-----------| | Sequential chaining patterns | `references/sequential-chaining.md` | | Parallel execution patterns | `references/parallel-execution.md` | | Delegation context rules | `references/delegation-context.md` | | Documentation management | `references/documentation-management.md` | --- ## Sequential Chaining Chain agents when tasks have dependencies or require outputs from previous steps. **Standard feature pipeline:** ``` ck-planning → ck-cook → ck-web-testing → ck-code-review ``` **Research-first pipeline:** ``` ck-research → ck-planning → ck-cook → ck-code-review ``` **Debug pipeline:** ``` ck-debug → ck-fix → ck-web-testing → ck-code-review ``` **Rules:** - Each agent completes fully before the next begins - Pass the output file path (plan path, report path) as context to the next agent - Never assume an agent's output — read it explicitly before proceeding See `references/sequential-chaining.md` for detailed patterns. --- ## Parallel Execution Dispatch multiple agents simultaneously for independent tasks. **When to parallelize:** - Code + Tests + Docs: implementing separate, non-conflicting components - Multiple feature branches: different agents on isolated features - Research fan-out: multiple `ck-research` agents on different topics reporting back to `ck-planning` - Scout coverage: multiple `ck-scout` agents covering different directories **When NOT to parallelize:** - Tasks that write to the same files - Tasks where one depends on output of another - More than the available system resources can handle **Coordination rule:** Define integration points before starting parallel execution. Plan how results will be merged. See `references/parallel-execution.md` for patterns. --- ## Delegation Context (MANDATORY) When dispatching any subagent via the Manager Surface, always include: 1. **Work Context Path**: The git root or CWD of the PRIMARY files being worked on 2. **Reports Path**: `{work_context}/plans/reports/` for that project 3. **Plans Path**: `{work_context}/plans/` for that project **Example prompt to subagent:** ``` Fix the parser bug in the auth module. Work context: /path/to/project Reports: /path/to/project/plans/reports/ Plans: /path/to/project/plans/ ``` **Rule:** If your CWD differs from the work context (e.g., editing files in a different project), use the **work context paths**, not CWD paths. See `references/delegation-context.md` for full rules. --- ## Skill Activation in Workflows Each ck-* skill maps to a workflow role: | Workflow Role | Use Skill | |---------------|-----------| | Research | `ck-research` (dispatch multiple in parallel) | | Codebase scouting | `ck-scout` | | Planning | `ck-planning` | | Implementation | `ck-cook` | | UI/design | `ck-frontend-design` | | Testing | `ck-web-testing` | | Code review | `ck-code-review` | | Debugging | `ck-debug` | | Bug fixing | `ck-fix` | | Git operations | `ck-git` | | Docs update | handled inline per `references/documentation-management.md` | --- ## Documentation Management Update project docs in `./docs` after: - Feature implementation - Bug fixes - Architecture changes - Security updates **Docs to maintain:** - `./docs/codebase-summary.md` — project structure overview - `./docs/system-architecture.md` — architecture decisions - `./docs/code-standards.md` — coding conventions - `./docs/development-roadmap.md` — phases and milestones - `./docs/project-changelog.md` — significant changes See `references/documentation-management.md` for update protocol. --- ## Report Naming Convention All agents write reports using the pattern from the `## Naming` section injected by `ck-session-guard`: ``` Report: {reports-path}/{agent-type}-{name-pattern}.md Plan dir: {plans-path}/{name-pattern}/ ``` Where `{name-pattern}` is the computed date + optional issue ID + `{slug}` placeholder. **IMPORTANT:** Sacrifice grammar for concision in reports. List unresolved questions at end if any.