Agent launcher
Executes a tasks.yaml task graph (output of spec-plan) as a controlled implementation run: launches isolated sub-agents per task, enforces dependency ordering and file-scope boundaries, merges successful results into an integration branch, and emits a machine-readable run report. Use when you have a planned task graph and need to orchestrate parallel agent execution with safety guardrails. Do NOT use for planning tasks (use spec-plan) or decomposing PRDs (use prd-decompose).From its SKILL.md
npx -y skills add PSDN-AI/nexus-skills --skill agent-launcherAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
11.6 KB, as published. Nobody here has run it
Agent Launcher
Execute a task graph as a controlled implementation run with isolated sub-agents, dependency enforcement, file-scope guardrails, and a machine-readable run report.
Table of Contents
- When Should You Use This?
- How This Skill Can Be Used
- Pipeline Context
- Prerequisites
- Quick Start
- Execution Workflow
- Constitutional Constraints
- Output Format
- Validation
- Common Pitfalls
When Should You Use This?
- You have a
tasks.yamlfromspec-planand want to execute it automatically. - You need dependency-ordered, parallel-safe agent execution with isolation.
- You want file-scope enforcement to prevent merge conflicts.
- You need a structured run report for human review or downstream automation.
How This Skill Can Be Used
| Model | How it works | When to use |
|---|---|---|
| A -- Script Execution | Run launch.sh to orchestrate task execution and produce a run report | Primary mode -- deterministic orchestration with guardrails |
| B -- Knowledge-Driven | An LLM reads this SKILL.md and manually orchestrates task execution | No bash available, or the LLM needs to handle edge cases scripts don't cover |
| C -- Hybrid | An LLM uses launch.sh for scheduling and workspace setup, then invokes sub-agents manually per task | Best coverage -- script handles deterministic parts, LLM handles agent invocation |
This skill is Layer 2 primary: scripts handle queueing, workspace isolation, merge sequencing, and status tracking. The SKILL.md guides orchestration policy, escalation, and judgment calls.
Pipeline Context
+-------------------+ +-------------------+ +-------------------+
| prd-decompose | --> | spec-plan | --> | agent-launcher |
| Skill | | Skill | | Skill |
| | | | | |
| PRD -> Domains | | Domain -> Tasks | | Tasks -> Code/PR |
+-------------------+ +-------------------+ +-------------------+
Upstream: spec-plan produces tasks.yaml with dependency ordering and file-scope declarations.
Output: Validated code on an integration branch, plus a structured run-report.yaml.
Prerequisites
Required:
bash(4.0+),git(2.20+),grep,sed,awk,find,sort,comm,mktemp
Input files (from spec-plan):
tasks.yaml-- task graph with dependencies, file-scope, and execution planconfig.yaml-- target_repo, target_branch, agent_model, max_iterations
Runtime requirement:
- A git repository checkout for the target project (passed via
--repo) - A clean working tree on the target repository
- An execution backend:
- Set
AGENT_LAUNCHER_EXECUTORto a shell command that performs the task and commits changes - Or set
AGENT_LAUNCHER_SIMULATE=truefor fixture/tests only
- Set
Quick Start
# Preview execution plan without making changes
./skills/agent-launcher/scripts/launch.sh /path/to/prd-output/frontend/ \
--repo /path/to/target-repo/ --dry-run
# Execute all tasks
AGENT_LAUNCHER_EXECUTOR='codex exec --prompt-file "$AGENT_LAUNCHER_PROMPT_FILE"' \
./skills/agent-launcher/scripts/launch.sh /path/to/prd-output/frontend/ \
--repo /path/to/target-repo/
# Limit concurrency
AGENT_LAUNCHER_EXECUTOR='codex exec --prompt-file "$AGENT_LAUNCHER_PROMPT_FILE"' \
./skills/agent-launcher/scripts/launch.sh /path/to/prd-output/frontend/ \
--repo /path/to/target-repo/ --max-parallel 2
# Resume an interrupted run
AGENT_LAUNCHER_EXECUTOR='codex exec --prompt-file "$AGENT_LAUNCHER_PROMPT_FILE"' \
./skills/agent-launcher/scripts/launch.sh /path/to/prd-output/frontend/ \
--repo /path/to/target-repo/ --resume run-20260303-001
# Simulation mode for local fixture tests only
AGENT_LAUNCHER_SIMULATE=true \
./skills/agent-launcher/scripts/launch.sh /path/to/prd-output/frontend/ \
--repo /path/to/target-repo/
Exit codes: 0 success | 1 missing input | 2 invalid tasks.yaml or repo state | 3 workspace failure | 4 task execution failure | 5 merge failure
Execution Workflow
Follow these eight phases in order:
Progress:
- [ ] Phase 1: LOAD -- Read tasks.yaml, config.yaml, repo state
- [ ] Phase 2: VALIDATE -- Confirm DAG validity and repo cleanliness
- [ ] Phase 3: SCHEDULE -- Determine ready tasks from depends_on + execution_plan
- [ ] Phase 4: PREPARE -- Create integration branch and task workspaces
- [ ] Phase 5: EXECUTE -- Launch sub-agent per ready task
- [ ] Phase 6: VERIFY -- Confirm only declared files changed
- [ ] Phase 7: MERGE -- Merge successful tasks into integration branch
- [ ] Phase 8: REPORT -- Emit run-report.yaml and human summary
Phase 1: LOAD
- Read
tasks.yamland parse task graph, execution plan, and validation summary. - Read
config.yamlfor target_repo, target_branch, agent_model, max_iterations. - If
--resumeis set, load priorrun-report.yaml, verify theexecution_idmatches, and restore successful task statuses. - Count total tasks and phases for scheduling.
Phase 2: VALIDATE
- Verify
tasks.yamlhas required structure (tasks, execution_plan, validation). - Verify the target repository exists and is a valid git repo.
- Verify the base branch exists in the repository.
- Check for uncommitted changes in the working tree.
- Verify
AGENT_LAUNCHER_EXECUTORis set unless simulation mode is explicitly enabled.
Phase 3: SCHEDULE
- Build a ready queue from the execution plan phases.
- For each phase, identify tasks whose dependencies are all satisfied.
- Split parallel phases into conflict-free batches so no batch exceeds
--max-paralleland no two tasks in a batch overlap infiles_touched. - Mark tasks as
blockedif any dependency has failed or become blocked.
Phase 4: PREPARE
- Create or reuse the integration branch:
agent-launcher/{domain}/{execution-id}from the base branch. - Reset each per-task branch:
agent/{task-id-lower}to the integration branch tip before execution. - Create a dedicated git worktree per active task branch.
See references/execution-contract.md for workspace isolation rules.
Phase 5: EXECUTE
For each ready task:
- Check dependency gates (all
depends_onmust besucceeded). - Write
.agent-launcher/{task-id}.prompt.mdinside the task worktree. - Invoke the configured executor inside the task worktree with the task's
prompt_context. - The executor commits changes to the task branch.
See references/prompt-template.md for the standard launch prompt format.
Phase 6: VERIFY
After each task completes:
- Compare files actually changed on the task branch against declared
files_touched. - If the task modified undeclared files, mark it as
failed(scope violation). - If verification passes, mark the task as
succeeded.
Phase 7: MERGE
- Merge successful tasks into the integration branch in execution plan order.
- Use
--no-ffmerges to preserve task provenance. - If a merge conflict occurs, abort, mark the task as
failed, and continue processing later tasks.
See references/execution-contract.md for merge protocol details.
Phase 8: REPORT
- Write
run-report.yamlwith per-task status, commit SHAs, and summary stats. - Print a human-readable summary showing succeeded, failed, and blocked tasks.
- Indicate whether the integration branch is PR-ready (all tasks succeeded).
- Exit with
4if any task failed or was blocked, or5if any merge failed.
See references/example-run-report.yaml for a worked example.
Constitutional Constraints
These rules are non-negotiable:
- Never launch a task until all
depends_ontasks have statussucceeded. - Never run two tasks concurrently if their
files_touchedoverlap. - Never merge changes outside a task's declared
files_touchedwithout explicit human approval. - Never merge a task that failed validation, exceeded retry limits, or produced ambiguous state.
- Always execute from a dedicated integration branch, never directly on the target base branch.
- Always execute task work in isolated worktrees, not in the repository's primary checkout.
- Every task run must leave a structured status trail in
run-report.yaml. - Never run without an explicit executor contract unless simulation mode is intentionally enabled.
- Stop retrying when policy is exhausted; surface a precise handoff instead of looping.
- Respect
agent_modelandmax_iterationsfromconfig.yaml.
Output Format
run-report.yaml
See references/example-run-report.yaml for the complete schema.
Key sections:
- Header: execution_id, domain, target_repo, branches, timestamps
- Tasks: per-task status, branch, commit_sha, retries, failure reason
- Summary: counts by status, merge count, PR readiness
Integration Branch
All successfully merged task work lives on agent-launcher/{domain}/{execution-id}. This branch is suitable for opening a PR against the base branch.
Failure Handling
See references/failure-policy.md for retry, blocking, resume, and escalation rules.
Validation
After a run:
run-report.yamlcontains accurate per-task status and summary counts.- Succeeded tasks have commit SHAs that match the integration branch history.
- Failed tasks have a
reasonfield explaining the failure. - Blocked tasks trace back to a specific dependency constraint recorded in the report.
- The integration branch contains only changes from succeeded tasks.
Common Pitfalls
- Dirty working tree: The launcher requires a clean git state. Commit or stash changes before running.
- Missing executor: Production runs fail closed unless
AGENT_LAUNCHER_EXECUTORis set. Simulation mode is for tests only. - Base branch mismatch: If the target_branch in config.yaml doesn't match the repo's current state, the integration branch starts from the wrong point.
- File scope false negatives: If
files_touchedin tasks.yaml is incomplete, the guardrails will flag legitimate changes as scope violations. Fix the task plan first. - Merge order sensitivity: Tasks must merge in topological order. Merging a downstream task before its upstream dependency causes conflicts.
- Resume with modified tasks.yaml: If you change tasks.yaml between runs, resume may restore stale successes from the prior
execution_id. Start a fresh run instead of reusing the old ID. - Max iterations too low: Complex tasks may need more iterations. Check config.yaml if tasks consistently fail at the retry limit.