orchestration
Use when executing multi-task work from GitHub issues or epics with parallel agents, dependency management, and consensus reviews. Triggers on "orchestrate issues", "execute epic", "run the orchestration", or complex multi-feature development phases. REQUIRES contextd MCP server.
What this skill does
# Multi-Task Orchestration
Execute orchestration from GitHub issues or epics with parallel agents, dependency resolution, consensus reviews, and automatic remediation using contextd for memory, checkpoints, and context folding.
## Prerequisites: contextd REQUIRED
**This skill CANNOT function without contextd.**
Orchestration depends on:
- `branch_create` / `branch_return` for context isolation (CRITICAL)
- `checkpoint_save` / `checkpoint_resume` for state management
- `memory_record` for learning capture
**If contextd unavailable:**
1. STOP - inform user: "Orchestration requires contextd for context isolation"
2. Suggest: "Run `/contextd:init` to configure contextd"
3. NO FALLBACK - this skill is inoperable without contextd
## Shared Orchestration Patterns
This skill builds on shared orchestration patterns. See:
- `includes/orchestration/parallel-execution.md` - Agent dispatch and concurrency
- `includes/orchestration/result-synthesis.md` - Collecting and merging results
- `includes/orchestration/context-management.md` - Context folding and memory
- `includes/orchestration/checkpoint-patterns.md` - Save/resume workflows
The patterns below are **contextd-specific** extensions for issue-driven orchestration.
## Orchestration Flow
```dot
digraph orchestration {
"Issues provided?" -> "Prompt user" [label="no"];
"Issues provided?" -> "Fetch issues" [label="yes"];
"Prompt user" -> "Fetch issues";
"Fetch issues" -> "Create feature branch";
"Create feature branch" -> "Resolve dependencies";
"Resolve dependencies" -> "For each group";
"For each group" -> "Create context branch" [label="parallel"];
"Create context branch" -> "Launch task agents";
"Launch task agents" -> "Collect results";
"Collect results" -> "Run consensus review";
"Run consensus review" -> "Remediate findings?" [shape=diamond];
"Remediate findings?" -> "Apply fixes" [label="yes"];
"Remediate findings?" -> "Save checkpoint" [label="no"];
"Apply fixes" -> "Run consensus review" [label="re-review"];
"Save checkpoint" -> "More groups?" [shape=diamond];
"More groups?" -> "For each group" [label="yes"];
"More groups?" -> "RALPH reflection" [label="no"];
"RALPH reflection" -> "Create PR";
"Create PR" -> "Final summary";
}
```
## Agents
| Agent | Purpose |
|-------|---------|
| `contextd:orchestrator` | This agent - manages workflow |
| `contextd:task-agent` | Executes individual tasks |
## Contextd Tools Required
**Memory:** `memory_search`, `memory_record`, `memory_consolidate`
**Checkpoints:** `checkpoint_save`, `checkpoint_resume`, `checkpoint_list`
**Context Folding:** `branch_create`, `branch_return`, `branch_status`
**Remediation:** `remediation_record`, `remediation_search`
**Reflection:** `reflect_analyze`, `reflect_report`
## Phase 0: Input Resolution
**If no issues provided, prompt the user:**
```
AskUserQuestion(
questions: [{
question: "Which issues or epic would you like to orchestrate?",
header: "Issues",
options: [
{ label: "Enter issue numbers", description: "Comma-separated list (e.g., 42,43,44)" },
{ label: "Select an epic", description: "Epic issue that contains sub-issues" },
{ label: "Current milestone", description: "All open issues in current milestone" }
],
multiSelect: false
}]
)
```
**For "Current milestone":**
```
gh issue list --milestone "$(gh api repos/:owner/:repo/milestones --jq '.[0].title')" --json number,title
-> Present list for confirmation
```
## Phase 1: Issue Discovery
```
1. Fetch issue details:
gh issue view <number> --json number,title,body,labels,milestone
2. For epics (single issue with sub-issues):
gh api graphql -f query='{ repository(owner:"X", name:"Y") {
issue(number: N) { trackedIssues(first: 50) { nodes { number title } } }
}}'
3. Extract task information:
- number -> Task ID
- title -> Task name
- body -> Agent prompt (look for ## Agent Prompt or ## Description)
- labels -> Priority (P0, P1, P2), type (feature, bug, etc.)
- "Depends On: #XX" in body -> Dependencies
4. Record to memory:
memory_record(title: "Orchestration: Issues #{list}", ...)
```
## Phase 1.5: Branch Setup (MANDATORY)
**NEVER push directly to main. ALWAYS create a feature branch first.**
```
1. Generate branch name from epic/issue:
branch_name = "feature/issue-{epic_number}-{sanitized_title}"
Example: "feature/issue-123-locomo-benchmark"
2. Create and checkout feature branch:
git checkout -b {branch_name}
3. Verify branch:
git branch --show-current
→ Must NOT be "main" or "master"
4. If already on main with uncommitted changes:
git stash
git checkout -b {branch_name}
git stash pop
```
**Why this matters:**
- Enables code review before merge
- Provides rollback capability
- Maintains audit trail
- Allows CI/CD validation
## Phase 2: Initialization
```
1. Read engineering practices:
Read("CLAUDE.md"), Read("engineering-practices.md")
2. Search past orchestrations:
memory_search(project_id, "orchestration", limit: 5)
3. If resuming:
checkpoint_list(session_id: "orchestrate-{issue_ids}")
checkpoint_resume(checkpoint_id)
4. Create main context branch:
branch_create(description: "Orchestration: #{issue_ids}", budget: 16384)
5. Save initial checkpoint:
checkpoint_save(name: "orchestrate-start")
```
## Phase 3: Dependency Resolution
```
1. Build dependency graph from issue relationships
2. Generate parallel groups (topological sort)
3. Validate no circular dependencies
Example:
#42 depends on nothing -> Group 1
#43 depends on nothing -> Group 1
#44 depends on #42 -> Group 2
#45 depends on #43, #44 -> Group 3
```
## Phase 4: Group Execution
See `includes/orchestration/parallel-execution.md` for agent dispatch patterns.
For each dependency group:
```
1. Create context branch (budget: 8192)
branch_create(description: "Group {n}: #{issue_numbers}")
2. Launch parallel task agents for issues in group:
Task(
subagent_type: "contextd:task-agent",
prompt: |
# Issue #{number}: {title}
{issue_body}
## Contextd Integration
- Record decisions with memory_record
- Record fixes with remediation_record
- Update issue with progress comments via `gh issue comment`
description: "Issue #{number}: {title}",
run_in_background: true
)
3. Monitor and collect results:
TaskOutput(task_id, block=false)
branch_status(branch_id) -> check budget
4. Return from branch:
branch_return(message: "Group complete: {summary}")
```
## Phase 5: Consensus Review
See `includes/orchestration/result-synthesis.md` for result collection and conflict resolution.
See `includes/orchestration/consensus-review.md` for consensus patterns and thresholds.
### 100% Consensus Requirement
Task orchestration requires **100% consensus** from all reviewers:
| Requirement | Threshold |
|-------------|-----------|
| Consensus Score | 100% |
| Vetoes | 0 (any veto blocks) |
| Critical/High | 0 |
If any reviewer vetoes or finds critical/high issues:
1. Create remediation task
2. Fix the issues
3. Re-run full review
4. Continue until 100% consensus
After each group:
```
1. Launch review agents in parallel:
Task(subagent_type: "fs-dev:security-reviewer", ...)
Task(subagent_type: "fs-dev:vulnerability-reviewer", ...)
Task(subagent_type: "fs-dev:code-quality-reviewer", ...)
Task(subagent_type: "fs-dev:documentation-reviewer", ...)
Task(subagent_type: "fs-dev:go-reviewer", ...) # if Go code
2. Collect verdicts using result synthesis patterns
- Parse findings from each reviewer
- Detect conflicts between reviewers
- Record to memory_record
3. Calculate consensus:
consensus_score = (approvals / total_reviewers) * 100
4. Apply veto threshold:
- strict: ALL findings must be fixed (100% consensus required)
- standard: CRITICAL/HIGH must be fixed (security/vulnerability have veto power)
-Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.