ops-orchestrate
Autonomous multi-project orchestration engine. Audits all registered projects, structures work into dependency-wired tasks, dispatches parallel agents (subagents or Agent Teams), audits completions, and ships PRs. Registry-driven — works for any user with a configured project registry.
What this skill does
## Runtime Context
Before orchestrating, load:
1. **Preferences**: `cat ${CLAUDE_PLUGIN_DATA_DIR:-$HOME/.claude/plugins/data/ops-ops-marketplace}/preferences.json` — read `owner`, `timezone`, `yolo_enabled`, registry path
2. **Daemon health**: `cat ${CLAUDE_PLUGIN_DATA_DIR}/daemon-health.json` — ensure all services healthy before dispatching
3. **Secrets**: Resolve via env → Doppler → password manager: `GITHUB_TOKEN`, `SENTRY_AUTH_TOKEN`, `LINEAR_API_KEY`, `ANTHROPIC_API_KEY`
4. **Ops memories**: Check `${CLAUDE_PLUGIN_DATA_DIR}/memories/topics_active.md` for priority context
# OPS ► ORCHESTRATE — Autonomous Work Engine
## CLI/API Reference
### gh CLI (GitHub)
| Command | Usage | Output |
|---------|-------|--------|
| `gh pr list --state open --json number,title,statusCheckRollup,reviewDecision,mergeable,isDraft` | Open PRs with status | JSON array |
| `gh pr view <n> --repo <repo> --json files,additions,deletions` | PR file diff summary | JSON |
| `gh pr checks <n>` | CI check status | Check list |
| `gh pr merge <n> --squash --admin` | Squash merge PR | Merge result |
| `gh run list --repo <repo> --workflow "<workflow>" --limit 5 --json conclusion,headBranch` | CI runs for workflow | JSON array |
| `gh run view <id> --repo <repo> --log-failed` | Failed CI logs | Log output |
| `gh issue list --state open` | Open issues | JSON array |
### sentry-cli / Sentry API
| Command | Usage | Output |
|---------|-------|--------|
| `sentry-cli issues list --project <slug> --status unresolved` | Unresolved issues | Issue list |
| `curl -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" "https://sentry.io/api/0/projects/<org>/<proj>/issues/?query=is:unresolved"` | API fallback | JSON array |
### Linear GraphQL (fallback when MCP unavailable)
| Command | Usage | Output |
|---------|-------|--------|
| `curl -X POST https://api.linear.app/graphql -H "Authorization: $LINEAR_API_KEY" -H "Content-Type: application/json" -d '{"query":"{ issues(filter: {state: {type: {in: [\"started\",\"unstarted\"]}}}) { nodes { id title state { name } priority assignee { name } } } }"}'` | Active issues | JSON |
---
You are the **master orchestrator**. Your job: audit every registered project, structure all discovered work into a dependency graph, dispatch maximum-parallel agents, audit their output, and ship PRs — until the task board is empty or the user interrupts.
**No preamble. No "would you like me to". Execute immediately.**
---
## Context Detection
Detect where this skill was invoked:
```bash
# If invoked from a specific project directory (not ~), scope to that project
CWD="$(pwd)"
if [ "$CWD" != "$HOME" ] && [ -d "$CWD/.git" ]; then
echo "SCOPED:$CWD"
else
echo "GLOBAL"
fi
```
- **SCOPED mode** (invoked inside a project dir): Limit work to that project only. Include all todos/tasks from the current conversation context. Skip the global registry scan.
- **GLOBAL mode** (invoked from ~ or with no git repo): Scan all registered projects.
If `$ARGUMENTS` contains `--project <alias>`, use SCOPED mode for that alias regardless of CWD.
---
## Orchestration Mode — How to Choose
### Decision matrix (shown to user if no flag passed)
```
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ORCHESTRATION MODE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
--subagents (default) Fire-and-forget. Cheapest. Best for:
- Independent single-repo fixes
- Tasks that don't need mid-flight changes
- Cost: ~1.5-2x base token usage
--teams Agent Teams with mid-flight steering. Best for:
- Cross-repo contract changes (API + consumer)
- Security/auth work touching 2+ repos
- When you need to redirect agents based on findings
- Cost: ~3-7x base token usage
--hybrid (recommended) Auto-selects per task. Teams for cross-repo
and security work, subagents for everything else.
Best balance of speed, cost, and coordination.
Cost: ~2-4x base token usage
--dry-run Audit + plan only. Shows what would be dispatched
without executing. Good for reviewing before committing.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
If no flag is passed, use `AskUserQuestion`:
```
[Subagents — fast & cheap] [Agent Teams — steerable] [Hybrid — auto-select] [Dry run — plan only]
```
### Auto-detection heuristic (for `--hybrid` mode)
Tag each task during Phase 2:
| Condition | Mode | Why |
|-----------|------|-----|
| Task touches 1 repo, no auth/payments/PII | `subagent` | Isolated, no coordination needed |
| Task touches 2+ repos (API schema + consumer) | `team` | Teammates coordinate schema handoff |
| Task touches auth, payments, PII, secrets | `team` | Security-reviewer teammate audits in real-time |
| Task is read-only (audit, report, analysis) | `subagent` | No risk, no coordination |
| Task depends on another in-flight task's output | `team` | SendMessage delivers output without re-dispatch |
### Feature flag requirement for Agent Teams
Agent Teams requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. Check before using:
```bash
[ "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-0}" = "1" ] && echo "teams_available" || echo "teams_unavailable"
```
If `--teams` or `--hybrid` is requested but the flag is off, warn and fall back to `--subagents`.
---
## Phase 1 — Audit (parallel, read-only)
### 1a. Discover projects
**SCOPED mode**: Use only the current directory. Read `.planning/STATE.md` if it exists.
**GLOBAL mode**: Scan the project registry:
```bash
REGISTRY="${CLAUDE_PLUGIN_ROOT}/scripts/registry.json"
jq -r '.projects[] | "\(.alias)|\(.paths[0])|\(.repos[0] // "none")|\(.gsd // false)"' "$REGISTRY" 2>/dev/null
```
For each project path, verify it exists on disk. Skip missing paths.
### 1b. Parallel audit dispatch
Group projects into batches of ~8. Dispatch one audit subagent per batch (always subagents — audit is read-only, no steering needed):
Each audit agent checks:
- `git status --porcelain` — uncommitted changes
- `git log origin/dev..HEAD --oneline` — unpushed commits
- `gh pr list --state open --json number,title,statusCheckRollup,reviewDecision,mergeable,isDraft` — open PRs + CI
- `gh run list --limit 5 --json status,conclusion,name,headBranch,createdAt` — recent CI runs
- `.planning/STATE.md` — current GSD phase + progress
- `.planning/ROADMAP.md` — upcoming phases
- Unresolved review comments on open PRs
### 1c. Filter already-fixed failures
Before creating tasks for CI failures:
```bash
# If latest run on dev/main is success → skip (intermittent or already fixed)
gh run list --repo <repo> --workflow "<workflow>" --limit 5 --json conclusion,headBranch \
--jq '[.[] | select(.headBranch == "dev" or .headBranch == "main")] | .[0].conclusion'
```
- Latest = `success` → **skip**
- Latest = `failure` AND 2+ prior also `failure` → **create task** (persistent)
- Latest = `failure` but prior = `success` → **create P2 task** (new regression)
### 1d. External issue sources (parallel with 1b)
Run these in parallel with the audit agents:
- **Sentry**: `mcp__sentry__search_issues` or `sentry-cli issues list` — P0/P1 unresolved errors
- **Linear**: `mcp__linear__list_issues` for current sprint — in-progress and unstarted
- **GitHub Issues**: `gh issue list --state open` per repo
- **Conversation context**: Scan current conversation for todos, requests, and incomplete work the user mentioned
### 1e. Cross-reference against existing tasks
`TaskList` — check current task board. Flag:
- Tasks already done → mark `completed`
- Tasks stale (root cause changed) → update description
- New work not yet in TaskList → queue for Phase 2
---
## Phase 2 — Structure (TaskCreate + dependency wiring)
### 2a. Decompose into atomic 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.