orchestrating-skills
Skill-aware orchestration with context routing. Decomposes complex tasks into skill-typed subtasks, extracts targeted context subsets, executes subagents in parallel, and synthesizes results. Self-answers trivial lookups inline. No SDK dependency — uses raw HTTP via httpx. Use when tasks require multiple analytical perspectives, when context is large and subtasks only need portions, or when orchestrating-agents spawns too many redundant subagents.
What this skill does
## SURFACE ROUTING — read first
This skill hand-rolls subagent orchestration via raw Anthropic API calls. A
managed runtime now does the same job. Which one to use depends on your surface:
- **In Claude Code (incl. CCotw): use the native runtime, NOT this skill.** If you
can invoke `/deep-research`, trigger a run with the `workflow` keyword, set
`/effort ultracode`, or spawn Task subagents — do that instead. The runtime gives
16-concurrent / 1000-agent ceilings, an approval gate, adversarial cross-review,
and in-session resume that this skill would otherwise reimplement badly. Dynamic
workflows shipped in research preview (Claude Code v2.1.154+, 2026).
- **In claude.ai chat or the bare API (no workflow runtime): use this skill.**
Parallel API instances over httpx is the only fan-out path here. Proceed below.
Discriminator: do you have a native subagent/Task tool or a workflow command? Yes
→ native. No → this skill. Never reimplement the runtime where it already exists.
# Skill-Aware Orchestration
Orchestrate complex multi-step tasks through a four-phase pipeline that eliminates
redundant context processing and reflexive subagent spawning.
## When to Use
- Task requires **multiple analytical perspectives** (e.g., compare + critique + synthesize)
- Context is large and **subtasks only need portions** of it
- Simple lookups should be **self-answered** without spawning subagents
## When NOT to Use
- Single-skill tasks (just use the skill directly)
- Tasks requiring tool use or code execution (this is text-analysis orchestration)
- Real-time streaming requirements (this is batch-oriented)
## Quick Start
```python
import sys
sys.path.insert(0, "/mnt/skills/user/orchestrating-skills/scripts")
from orchestrate import orchestrate
result = orchestrate(
context=open("report.md").read(),
task="Compare the two proposed architectures, extract cost figures, and recommend one",
verbose=True,
)
print(result["result"])
```
## Dependencies
- **httpx** (usually pre-installed; `pip install httpx` if not)
- **No Anthropic SDK required**
- API key: reads `ANTHROPIC_API_KEY` env var or `/mnt/project/claude.env`
## Four-Phase Pipeline
### Phase 1: Planning (LLM)
The orchestrator reads the full context **once** and produces a JSON plan:
```json
{
"subtasks": [
{
"task": "Compare architecture A vs B on scalability, cost, and complexity",
"skill": "analytical_comparison",
"context_pointers": {"sections": ["Architecture A", "Architecture B"]}
},
{
"task": "What is the project budget?",
"skill": "self",
"answer": "$2.4M"
}
]
}
```
Key behaviors:
- Assigns one skill per subtask from the built-in library
- Uses `"self"` for direct lookups (numbers, names, dates) — no subagent spawned
- Self-answering is an LLM judgment call, not a sentence-count heuristic
- Context pointers use **section headers** (structural, edit-resilient)
### Phase 2: Assembly (Deterministic Code)
No LLM calls. Extracts context subsets using section headers or line ranges,
pairs each with the assigned skill's system prompt, builds prompt dicts.
### Phase 3: Execution (Parallel LLM)
Delegated subtasks run in parallel via `concurrent.futures.ThreadPoolExecutor`.
Each subagent receives **only its context slice** and **skill-specific instructions**.
### Phase 4: Synthesis (LLM)
Collects all results (self-answered + subagent), synthesizes into a coherent
response that reads as if a single expert wrote it.
## Built-in Skill Library
Eight analytical skills plus one pipeline skill:
| Skill | Purpose |
|-------|---------|
| `analytical_comparison` | Compare items along dimensions with trade-offs |
| `fact_extraction` | Extract facts with source attribution |
| `structured_synthesis` | Combine multiple sources into narrative |
| `causal_reasoning` | Identify cause-effect chains |
| `critique` | Evaluate arguments for soundness |
| `classification` | Categorize items with rationale |
| `summarization` | Produce concise summaries |
| `gap_analysis` | Identify missing information |
| `remember` | Persist key findings to long-term memory via `remembering` skill (pipeline-only, runs post-synthesis) |
## API Reference
### `orchestrate(context, task, **kwargs) -> dict`
Returns:
```python
{
"result": "Final synthesized response",
"plan": {...},
"subtask_count": 4,
"self_answered": 1,
"delegated": 3,
"memory_ids": ["abc123"], # populated when remember subtasks ran
}
```
Parameters:
- `context` (str): Full context to process
- `task` (str): What to accomplish
- `model` (str): Claude model, default `claude-sonnet-4-6`
- `max_tokens` (int): Per-subagent token limit, default 2048
- `synthesis_max_tokens` (int): Synthesis token limit, default 4096
- `max_workers` (int): Parallel subagent limit, default 5
- `skills` (dict): Custom skill library (merged with built-in)
- `persist` (bool): Auto-append a `remember` subtask to store findings, default False
- `verbose` (bool): Print progress to stderr
### CLI
```bash
python orchestrate.py \
--context-file report.md \
--task "Analyze this report" \
--verbose --json
```
## Extending the Skill Library
```python
from skill_library import SKILLS
custom_skills = {
**SKILLS,
"code_review": {
"description": "Review code for bugs, style, and security",
"system_prompt": "You are a code review specialist...",
"output_hint": "issues_list with severity and fix suggestions",
}
}
result = orchestrate(context=code, task="Review this PR", skills=custom_skills)
```
## Persisting Findings with `remember`
`remember` is a **pipeline skill** — it executes in Phase 4 after synthesis, not as a
parallel subagent. It uses LLM distillation to extract the key insight from the synthesized
result, then writes it to long-term memory via the `remembering` skill.
### Two ways to activate persistence
**1. `persist=True` (automatic)**
```python
result = orchestrate(
context=open("report.md").read(),
task="Compare approaches A and B",
persist=True, # auto-injects a remember subtask
verbose=True,
)
print(result["memory_ids"]) # ['abc123']
```
**2. Planner-emitted (explicit)**
The orchestrator planner can emit `remember` as a subtask when the task description
implies storage:
```json
{
"task": "Store the key findings from this analysis",
"skill": "remember",
"context_pointers": {}
}
```
### Requirements
- `remembering` skill must be installed (`/mnt/skills/user/remembering` or
`/home/user/claude-skills/remembering`)
- Turso credentials must be available (auto-detected by the remembering skill)
- If unavailable, persistence is skipped silently and `memory_ids` returns `[]`
## Architecture Details
See [references/architecture.md](references/architecture.md) for design decisions,
token efficiency analysis, and comparison with SkillOrchestra (arXiv 2602.19672).
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.