Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
haowjy avatar

Run Agent

  • 1 installs
  • 19 repo stars
  • Updated March 1, 2026
  • haowjy/orchestrate

Launches subagent runs composed of model, agent, skills, and prompt, routing to the correct CLI and writing run artifacts.

About

A single execution engine that composes runs from a model, optional skills, and a prompt, auto-routing to claude, codex, or opencode and logging everything. A developer uses it to launch and inspect structured subagent runs.

  • Auto-routes to the correct CLI based on the model
  • Supports template variables, session grouping, and dry-run

Run Agent by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #14,102 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/haowjy/orchestrate --skill run-agent

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars19
Last updatedMarch 1, 2026
Repositoryhaowjy/orchestrate

What it does

Launches subagent runs composed of model, agent, skills, and prompt, routing to the correct CLI and writing run artifacts.

Files

SKILL.mdMarkdownGitHub ↗

Run-Agent — Execution Engine

Single entry point for agent execution. A run is model + agent (opt) + skills (opt) + prompt. Routes to the correct CLI (claude, codex, opencode) based on the model, logs everything, and writes structured index entries.

Skills source: sibling skills (../). Runtime artifacts: .orchestrate/.

Runner scripts (relative to this skill directory):

  • scripts/run-agent.sh — launch a subagent run
  • scripts/run-index.sh — inspect and manage runs

Run Composition

Compose runs dynamically by specifying model, skills, and prompt:

# Model + skills + prompt
scripts/run-agent.sh --model MODEL --skills SKILL1,SKILL2 -p "PROMPT"

# Model + prompt (no skills)
scripts/run-agent.sh --model MODEL -p "PROMPT"

# With labels and session grouping
scripts/run-agent.sh --model MODEL --skills SKILLS \
    --session SESSION_ID --label KEY=VALUE -p "PROMPT"

# With template variables
scripts/run-agent.sh --model MODEL \
    -v KEY1=path/to/file1 -v KEY2=path/to/file2 \
    -p "Task using {{KEY1}} and {{KEY2}}"

# Dry run — see composed prompt + CLI command without executing
scripts/run-agent.sh --model MODEL --skills SKILLS --dry-run -p "PROMPT"

Key Flags

FlagDescription
--model MODEL / -mModel to use (auto-routes to correct CLI)
--agent NAMEAgent profile for defaults + permissions
--skills a,b,cSkills to compose into the prompt
--strict-skillsFail fast when any listed skill is unknown
-p "prompt"Task prompt
-f path/to/fileReference file appended to prompt
-v KEY=VALUETemplate variable substitution (repeatable)
--session IDSession ID for grouping related runs
--label KEY=VALUERun metadata label (repeatable)
`-D brief\standard\
--continue-run REFContinue a previous run's harness session
--forkFork the session on continuation (default where supported)
--in-placeResume without forking (always for Codex)
--dry-runShow composed prompt without executing
-C DIRWorking directory for subprocess

Runtime Config (.orchestrate/config.toml)

On first run in a workspace, run-agent.sh auto-creates .orchestrate/config.toml with commented examples.

Use this file to pin skills that should be auto-added on every run:

[skills]
pinned = ["orchestrate", "run-agent", "mermaid"]

Notes:

  • Pinned skills are merged with agent-profile skills and CLI --skills (deduplicated by name).
  • Default template is fully commented; uncomment/edit to enable.

Output Artifacts

Each run writes to .orchestrate/runs/agent-runs/<run-id>/:

  • params.json — run parameters and metadata
  • input.md — composed prompt
  • prompt.raw.md — composed prompt before runtime-generated output/report sections
  • output.jsonl — raw CLI output (stream-json or JSONL)
  • stderr.log — CLI diagnostics (also streamed to terminal)
  • report.md — written by the subagent (or extracted as fallback)
  • files-touched.nul — NUL-delimited file paths (canonical machine format)
  • files-touched.txt — newline-delimited file paths (human-readable)

Run Index

Two-row append-only index at .orchestrate/index/runs.jsonl:

  • Start row (written before execution): status: "running" — provides crash visibility.
  • Finalize row (written after execution): status: "completed"|"failed" with exit code, duration, token usage, git metadata.

A start row with no matching finalize row means the run crashed or is still in progress.

Structured Exit Codes

CodeMeaning
0Success
1Agent/model error (bad output, task failure)
2Infrastructure error (CLI not found, harness crash)
3Timeout
130Interrupted (SIGINT / user cancel)
143Terminated (SIGTERM)

Model Routing

PatternCLI
claude-*, opus*, sonnet*, haiku*Claude (claude -p)
gpt-*, o1*, o3*, o4*, codex*Codex (codex exec)
opencode-*, provider/modelOpenCode (opencode run)

Routing is automatic from the selected model.

Run Explorer CLI

scripts/run-index.sh provides index-based run inspection:

scripts/run-index.sh list                          # List recent runs
scripts/run-index.sh list --failed --json          # Failed runs as JSON
scripts/run-index.sh show @latest                  # Show last run details
scripts/run-index.sh report @latest                # Read last run's report
scripts/run-index.sh logs @latest --tools          # Tool call summary
scripts/run-index.sh files @latest                 # Files touched
scripts/run-index.sh stats                         # Aggregate statistics
scripts/run-index.sh continue @latest -p "PROMPT"  # Continue a run's session
scripts/run-index.sh retry @last-failed            # Retry a failed run
scripts/run-index.sh maintain --compact            # Archive old index entries

Run references: full ID, unique prefix (8+ chars), @latest, @last-failed, @last-completed.

Helper Scripts

ScriptPurpose
run-index.shRun explorer CLI (list, show, report, logs, files, stats, continue, retry, maintain)
log-inspect.shInspect run logs (summary, tools, errors, files, search)
extract-files-touched.shExtract file paths from run output
extract-harness-session-id.shExtract harness session/thread ID from output
extract-report-fallback.shExtract last assistant message as report fallback
load-model-guidance.shLoad model guidance with override precedence

Related skills

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.