dynamic-routing
Skill4 starsChanged 3 months agoMITView on GitHub
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.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- saitarrun/Devforge-aitheir own version, first seen Jun 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- saitarrun/Devforge-ai★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository125 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/agent-loom-routing.mdcCursor rule
- .cursor/rules/agent-loom-skills-index.mdcCursor rule
- adversarial-hatSkill
- agent-builderSkill
- agent-launcherSkill
- agent-loom-syncSkill
- agent-observabilitySkill
- agent-run-retroSkill
- agent-system-architectureSkill
- api-and-interface-designSkill
- api-deprecation-and-migrationSkill
- apply-paper-to-projectSkill
- app-security-hardeningSkill
- architectural-decision-logSkill
- assumption-mappingSkill
- brainstormingSkill
- browser-testing-with-devtoolsSkill
- business-modelingSkill
- ci-cd-and-automationSkill
- codebase-understandingSkill
- code-review-crspSkill
- code-simplificationSkill
- compress-skillSkill
- context-engineeringSkill
- create-agent-promptSkill
- cross-link-skillsSkill
- customer-discoverySkill
- debug-and-fixSkill
- deep-thinkingSkill
- dependency-mappingSkill
- deploy-anywhereSkill
- deprecate-skillSkill
- design-directionSkill
- design-reviewSkill
- design-systemSkill
- eval-judgeSkill
- eval-outputSkill
- eval-pipelineSkill
- eval-rubric-designSkill
- experimentationSkill
- experiment-backlogSkill
- experiment-readoutSkill
- experiment-runbookSkill
- experiment-specSkill
- fault-localizeSkill
- feature-specSkill
- fermiSkill
- first-principlesSkill
- frontend-designSkill
- generate-changelogSkill
- git-workflow-and-versioningSkill
- gsap-animationSkill
- harness-engineeringSkill
- harness-evolutionSkill
- harness-generationSkill
- idea-evaluationSkill
- idea-generationSkill
- implementation-planSkill
- improve-skillsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
When a step fails or observation ≠ expected, you reflect, branch, and revise the plan — never blind-retry the same action.
- Very specific: line 31
Every route decision appends to the plan's Plan delta log in .agent-loom/plans/<task-id>.md.
- Very specific: line 32
Prefer path recombination (insert/replace remaining steps) over full replan when <50% of steps remain.
- Very specific: line 33
If failure is a bug in existing code, route to debug-and-fix before resuming the plan.
- Very specific: line 53
Read references/ROUTE-PATTERNS.md.
- Very specific: line 69
Run structured-planning lint via plan_lint.py.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dynamic Routing
When a step fails or observation ≠ expected, you reflect, branch, and revise the plan — never blind-retry the same action. Output is an updated plan delta + chosen alternate path.
Hard Rules
Ground reflection in step evidence — cite tool output, error message, or test failure.
Blind retry of the identical action is forbidden unless the reflection identifies a transient cause (network, rate limit) with a documented backoff.
Every route decision appends to the plan's Plan delta log in .agent-loom/plans/<task-id>.md.
Prefer path recombination (insert/replace remaining steps) over full replan when <50% of steps remain.
If failure is a bug in existing code, route to debug-and-fix before resuming the plan.
Workflow
Step 1 — Capture failure context
From the failed step: step_id, expected vs actual, error text, layer (tool/env/code/plan).
Step 2 — Structured reflection (3 lines max)
Hypothesis: [cause grounded in evidence]
Layer: [plan | tooling | code | environment]
Actionability: [plan revision | debug-and-fix | escalate user]Step 3 — Select route
Read references/ROUTE-PATTERNS.md. Pick one:
| Route | When |
| Alternate tool | Same goal, different tool/path |
| Decompose | Step too large — split into Sx.1, Sx.2 |
| Rollback + revise | Prior step assumption wrong — mark prior revised, insert fix step |
| Escalate model tier | Executing model tripped a model-selection tripwire (same test failed 2x, 3 attempts at one fix, unscoped design question) — announce the tier switch; the HUMAN changes models (advisory, per model-selection) |
| Abort | Goal infeasible with current constraints — mark aborted, stop |
| Debug handoff | Root cause unclear — debug-and-fix, resume plan after fix |
Step 4 — Update plan
- Mark failed step
failedorrevised. - Insert/replace pending steps.
- Append delta log row.
- Run
structured-planninglint viaplan_lint.py.
Step 5 — Resume
Return control to structured-planning at the new first pending step.
Gotchas
- Retrying without changing inputs is not routing — it's a loop.
- Full replan discards useful done steps — patch the remainder.
- Environment flakes need explicit transient tag + max 1 retry with backoff.
- Tier escalation is advisory: announce
switch to [tier/model]and WAIT — never assume the harness can switch models itself. Tier escalation (who executes) and path revision (what to do) are separate decisions; they can combine.
Output Format
## Dynamic route — [task_id] / [step_id]
Reflection:
- Hypothesis: [...]
- Layer: [...]
Route chosen: [alternate tool | decompose | rollback+revise | abort | debug handoff]
Plan delta:
| at | step_id | from | to | reason |
|----|---------|------|-----|--------|
| [...] |
Resume at: **Sx** | Handoff: debug-and-fix | AbortedExamples
Teaser: S2 migration fails (table exists) → route decompose → S2.1 check schema, S2.2 apply delta only.
Full pairs: references/examples.md
Common Rationalizations
| Excuse | Reality |
| "Retry might work" | Same inputs → same failure. Change the path. |
| "Replan from scratch is faster" | Loses done-step evidence and trace links. |
| "Error is obvious" | Write the hypothesis anyway — audit trail. |
| "Skip delta log" | Next agent won't know why the plan changed. |
| "Debug later" | If layer=code, debug now before continuing plan. |
Verification
- Reflection cites step evidence
- Plan delta log updated
- No identical blind retry
- plan_lint.py passes after revision
Red Flags
- Same action repeated after failure
- Plan revised without delta log entry
- Code bug worked around in plan without debug-and-fix
Prune Log
Last pruned: 2026-07-08
- Added Escalate-model-tier route wired to model-selection tripwires (agent-loom upgrade Phase 2)
Impact Report
Route: [task_id]/[step_id] | Decision: [route type] | Resume: [step or handoff]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

