Skip to content

dvy1987/agent-loom / .agents/skills/dynamic-routing

dynamic-routing

Verified

Select alternative execution paths when a plan step fails — branch on outcomes instead of blind retry. Load when a structured plan step fails, an unexpected observation arrives, or the user asks what to try next after an error. Also triggers on "try another approach", "route around this failure", "replan on failure", "if X fails try Y", or outcome-based branching during multi-step work. Pairs with structured-planning and debug-and-fix. Does not replace root-cause debugging — adds plan-level path selection.

FileKindSize
SKILL.mdskill md4.9 KB
references/ROUTE-PATTERNS.mdmarkdown1.6 KB
references/examples.mdmarkdown2.5 KB

references/examples.md

View on GitHub
# Dynamic Routing — Examples

## Ex.1 — Decompose after failure

**Input:** Step S2 "apply migration" failed — relation already exists

**Output:**
```markdown
## Dynamic route — add-users-table / S2

Reflection:
- Hypothesis: migration partially applied in prior run [EXTRACTED: psql error duplicate table]
- Layer: environment
- Actionability: plan revision

Route chosen: decompose

Plan delta:
| at | step_id | from | to | reason |
|----|---------|------|-----|--------|
| 2026-07-05T12:00:00Z | S2 | pending | failed | duplicate table |
| 2026-07-05T12:01:00Z | S2 | failed | revised | split into check + apply |

New steps: S2.1 verify schema state, S2.2 apply missing columns only
Resume at: **S2.1**
```

## Ex.2 — Debug handoff

**Input:** S3 API test fails with 500 — stack trace in handler

**Output:**
```markdown
Route chosen: debug handoff
Handoff: debug-and-fix — reproduce 500 on POST /users
Plan paused at S3 (in-progress). Resume structured-planning after fix verified.
```

## Ex.3 — Escalate model tier (advisory — the human switches)

**Input:** Step S4 "implement date-filter" — same unit test failed twice on the
executing mid-tier model; second "fix" edited an unrelated helper.

**Output:**
```markdown
## Dynamic route — report-filters / S4

Reflection:
- Hypothesis: task exceeds executing model's reasoning band — repeated failed
  fixes + out-of-contract edit are model-selection tripwires, not a plan flaw
  [EXTRACTED: pytest failure x2, diff touched utils/format.py outside contract]
- Layer: code (executor capability), plan structure sound
- Actionability: tier escalation per model-selection

Route chosen: escalate model tier

ANNOUNCE: switch to high-mid (Sonnet-class) for S4 only — then WAIT.
Do NOT proceed on the current model; the harness cannot switch itself.
Revert the out-of-contract edit to utils/format.py before resuming (safe-change).

Plan delta:
| at | step_id | from | to | reason |
|----|---------|------|-----|--------|
| 2026-07-08T09:00:00Z | S4 | in-progress | paused | tier escalation announced |

Resume at: **S4** (after the human confirms the model switch)
```

**Why this works:** the tripwire is external and observable (failing test +
out-of-contract diff — never the model's self-report); the route pauses and
WAITS for the human switch instead of assuming the harness can change models;
the stray edit is reverted before resuming so the bad attempt leaves no
residue; tier escalation (who executes) is kept separate from path revision
(what to do) — the plan itself was fine, so no decompose/replan was needed.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall