my-router
Context-aware router that detects work type and dispatches to the right skill. Ships with a minimal default routing table; extend it in a fork, or register project-local skills in a consuming repo via routing-table.local.md or an AGENTS.local.md Routing section.
Install
npx skills add https://github.com/yzhao062/anywhere-agents/tree/main/skills/my-router
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install yzhao062-anywhere-agents@llmmart
git clone https://github.com/yzhao062/anywhere-agents.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole yzhao062/anywhere-agents collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
My Router
Overview
A routing layer that sits between the outer workflow (e.g., superpowers brainstorm/plan/execute/verify) and domain skills. The router reads the working directory, file types, and user prompt to decide which skill to invoke, so the user does not need to remember skill names.
In this repo's shipped form, the routing table has concrete entries for the six shipped skills (implement-review, ci-mockup-figure, readme-polish, editable-figure, my-router itself, and prun for explicit parallel fan-out intent). It is also designed as a pattern you extend. A fork of this repo edits references/routing-table.md directly. A consuming project, where that file is overwritten on every bootstrap, instead registers its own skills in a bootstrap-proof local file (routing-table.local.md at the repo root, or a ## Routing section in AGENTS.local.md); the router reads those rows and dispatches to them. See Extending the Router.
When to Use Superpowers vs. Direct Dispatch
The router decides this. Not all tasks need superpowers' full ceremony.
| Task shape | Route | Why |
|---|---|---|
| Clear, scoped task with an obvious skill match (e.g., "review staged changes") | Direct dispatch — router picks the domain skill and runs it immediately | Brainstorming and planning add no value when the task is already well-defined |
| Open-ended, multi-step, or ambiguous task (e.g., "build a new feature", "restructure the paper") | Superpowers first — brainstorm → plan → execute (router dispatches during execute) → verify | These benefit from thinking before doing |
| Quick edit or fix (e.g., "fix the typo on line 42", "rename this variable") | Neither — just do it directly | No routing or workflow needed |
| Effort signal words in prompt (e.g., "extensively", "deep", "thorough", "in-depth", "carefully", "comprehensive") | Superpowers + extended thinking — enable extended thinking (Alt+T) and route through superpowers regardless of task shape |
The user is explicitly asking for more deliberation |
The rule: if the domain skill is obvious and the scope is clear, skip superpowers and dispatch directly. If the task needs exploration or planning, let superpowers run the outer loop and the router dispatches during execution. If the user signals they want deep effort, always use superpowers with extended thinking enabled.
Integration with Superpowers
When superpowers is active, it handles workflow phases: brainstorm → plan → execute → verify. The router activates during the execute phase and dispatches to the right domain skill.
When superpowers is not active (direct dispatch or quick task), the router works standalone.
How Routing Works
At dispatch time, the router checks three signals in order (keywords, file types, project structure). In a consuming project, before applying the shipped table below, it first merges any consumer-local routing extensions: a routing-table.local.md at the repo root, or a ## Routing section in AGENTS.local.md. These two files survive bootstrap (the shipped table does not), so they are where a consuming repo registers its own skills; on a keyword or file-type conflict, the local row wins. See Extending the Router.
1. Prompt keywords (highest priority)
The user's prompt often contains the clearest signal. The shipped routing table includes keyword entries for implement-review, ci-mockup-figure, readme-polish, and editable-figure. Add entries for your own skills in your fork's references/routing-table.md, or, in a consuming project, in a bootstrap-proof local file (see Extending the Router).
When a figure request explicitly asks for PowerPoint or native editability, take the editable-figure route ahead of the generic figure, README-polish, or slide routes. A request to simplify an existing editable figure stays on that route. An explicit HTML mockup, TikZ, screenshot, or prompt-only request keeps its requested format. Before taking that route, check that the session can perform the desktop PowerPoint validation editable-figure requires. If it cannot, explain the limitation and offer ci-mockup-figure only when its output fits the request. Do not silently substitute HTML for an explicitly requested PPTX.
See references/routing-table.md for the current table and the extension template.
2. File types in working directory
If prompt keywords are ambiguous, inspect the files being worked on. The shipped router recognizes staged git changes → implement-review, HTML mockup files for dashboards/timelines → ci-mockup-figure, a top-level README.md flagged for polish → readme-polish, and .pptx figure sources beside a paper, proposal, or README → editable-figure. Add your own file-type rules when you add new skills.
3. Project structure hints
Some projects declare their type in AGENTS.local.md or via directory naming conventions (e.g., a proposals/ or papers/ directory, or a submodule pointing at a shared editorial repo). Use these hints to pick content-aware behavior when relevant to your skills.
Dispatch Rules
- Local-first override: before dispatching, scan
skills/(project-local) for any skill that is a more specific variant of the matched skill. If a local variant exists, use it instead of any pack-deployed or bootstrapped copy. - If a prompt keyword matches → invoke that skill.
- If file context matches but prompt is vague (e.g., "help me with this") → state the detected context and proposed skill, ask the user to confirm before proceeding.
- If multiple skills could apply → state the candidates and ask the user to choose.
- If nothing matches → fall through to superpowers or general agent behavior. Do not force a skill where none fits.
Skill Lookup Order
In consuming project repos, skills can be project-local, pack-deployed, or bootstrapped from shared config. When dispatching, look for each skill in this order:
skills/<name>/SKILL.md: project-local (highest priority). Projects can add their own skills here..claude/skills/<name>/SKILL.md: pack-deployed byanywhere-agents pack install. The.claude/prefix is a historical Claude Code convention; the SKILL.md contents are agent-agnostic..agent-config/repo/skills/<name>/SKILL.md: bootstrapped from the shared config repo.- Installed plugins: agent-specific plugin skills (e.g., Claude Code plugins), check
/skillsoutput.
If a project-local skill matches the task better than a pack-deployed or bootstrapped skill, prefer the project-local one. The router itself follows this same lookup order.
Extending the Router
Where you register a new skill depends on whether you own this repo or only consume it. The mechanism is the same: a routing row keyed on prompt keywords, file types, and directory hints. Only the location differs, and it must survive your config-refresh path.
In a fork of this repo (you own the shipped table):
- Add the skill directory under
skills/<your-skill>/. - Add a row to
references/routing-table.md. - Add a matching
.claude/commands/<your-skill>.mdpointer so Claude Code can invoke it directly.
In a consuming project (this skill arrives via bootstrap or anywhere-agents pack install):
Do not edit references/routing-table.md here. Every on-disk copy (.agent-config/repo/skills/my-router/, .claude/skills/my-router/) is overwritten on the next bootstrap or pack verify --fix. Register your skill where bootstrap never reaches:
- Add the skill directory under
skills/<your-skill>/(project-local, bootstrap-proof by construction). - Register its routing in either of these bootstrap-proof files:
routing-table.local.mdat the repo root, using the same table format asreferences/routing-table.md; or- a
## Routingsection inAGENTS.local.md, convenient when you already keep project overrides there.
- Optionally add a project-local
.claude/commands/<your-skill>.mdpointer. The bootstrap copy step is non-destructive and never deletes command files absent from upstream, so a consumer-only pointer survives.
At dispatch time the router merges these local rows on top of the shipped table; on a keyword or file-type conflict, the local entry wins. Both routing-table.local.md and AGENTS.local.md sit outside the set of files bootstrap rewrites, so the registration persists across refreshes.
Combining with Implement-Review
When review is needed after a domain skill finishes:
- Domain skill runs (e.g., code changes, paper edits)
- Changes are staged
- Router dispatches to
implement-reviewwith the appropriate lens (code, paper, proposal, general) - Reviewer applies the lens-specific criteria
See implement-review/SKILL.md for the review loop protocol.
Examples
User says: "Review this"
→ Router detects: staged changes exist → dispatches to implement-review; content-type lens (code, paper, proposal, general) selected based on staged files.
User says: "Build the feature and review it"
→ Router detects: code context → superpowers handles the build, then router dispatches to implement-review with code lens.
User says: "Make an HTML mockup for the method figure"
→ Router detects: keyword "mockup" → dispatches to ci-mockup-figure.
User says: "Polish the README with modern patterns"
→ Router detects: keyword "polish README" → dispatches to readme-polish.
User says: (anything else, shipped router has no rule)
→ Router falls through to superpowers or general agent behavior. Add more rules in references/routing-table.md (in a fork) or in routing-table.local.md / an AGENTS.local.md ## Routing section (in a consuming project).
Files (anywhere-agents)
-
agents
-
openai.yaml 439 B
interface: display_name: "My Router" short_description: "Auto-detect context and dispatch to the right skill" default_prompt: "Use $my-router to detect the current context and dispatch to the right domain skill. Look for the skill at skills/my-router/SKILL.md first, then .claude/skills/my-router/SKILL.md, then .agent-config/repo/skills/my-router/SKILL.md. Read the routing table from references/routing-table.md at the same path."
-
-
references
-
routing-table.md 5.1 KB
# Routing Table — Quick Reference ## Shipped Skills | Skill | Triggers on | What it does | |---|---|---| | `implement-review` | staged changes + review request | Structured review loop with a reviewer agent (e.g., Codex); content-aware lenses for code, paper, proposal, or general | | `my-router` | any task (this skill) | Detects context and dispatches to the right skill | | `ci-mockup-figure` | "mockup", "HTML figure", "dashboard mockup", "timeline figure", "Gantt", "TikZ figure", "arrow routing" | Build HTML mockups of systems, dashboards, and timelines, then capture as space-efficient PNG/PDF figures; use TikZ or skia-canvas for abstract diagrams needing arrow routing | | `readme-polish` | "polish README", "modernize README", "README audit", "README rewrite", "README badges", "README hero image" | Audit a GitHub README and rewrite using modern 2025-2026 patterns (centered header, badges, hero image, GitHub alert callouts, emoji feature bullets, collapsibles, Mermaid diagrams) | | `prun` | explicit parallel delegation / fan-out intent; not auto-routed by file type | Fan out independent task units to Agy workers while the session coordinates; no Claude subagents, and Codex is reserved for `/vet`; workers spend the Google AI pool and never commit or push | | `editable-figure` | "editable figure", "PowerPoint figure", "PPTX figure", "editable diagram". Completing a build needs desktop PowerPoint validation; without it, explain the limitation and offer `ci-mockup-figure` rather than substituting it | Analyze the source, study references for the document type, and design a paper, proposal, or README figure delivered as native editable PowerPoint objects with publication or web exports | The shipped routing table covers the six skills above. To add your own: in a **fork of this repo**, add rows to this file. In a **consuming project**, this file is overwritten on every bootstrap, so register project-local skills in a bootstrap-proof location instead: a `routing-table.local.md` at the repo root, or a `## Routing` section in `AGENTS.local.md`. The router merges those rows on top of this table at dispatch time (local rows win on conflict). See the `my-router` SKILL.md section "Extending the Router" for the full recipe. ## Extension Template Copy this section and extend it with your own skills. In a fork, edit the tables below in place; in a consuming project, copy the rows into your bootstrap-proof `routing-table.local.md` (or an `AGENTS.local.md` `## Routing` section) instead, since this file is restored on every bootstrap. When a user's prompt matches keywords or files, the router dispatches to the corresponding skill. ### Keyword-based routing | Keywords in prompt | Skill | Source | |---|---|---| | "review staged", "review changes", "review the diff" | `implement-review` | shipped | | "editable figure", "editable diagram", "PowerPoint figure", "PPTX figure" | `editable-figure` | shipped | | "mockup", "HTML figure", "HTML mockup", "interactive figure", "dashboard mockup", "Gantt", "screenshotable figure", "capture mode", "skia-canvas", "TikZ figure", "arrow routing" | `ci-mockup-figure` | shipped | | "polish README", "modernize README", "README audit", "README rewrite", "README badges", "README hero image", "GitHub README patterns" | `readme-polish` | shipped | | `<your-keywords>` | `<your-skill-name>` | `skills/` (local) or shared | ### File-type routing If prompt keywords are ambiguous, inspect the files being worked on: | Files present | Likely context | Default skill | |---|---|---| | Staged git changes | Review needed | `implement-review` | | HTML mockup files for systems, dashboards, or timelines | Figure source | `ci-mockup-figure` | | `.pptx` figure sources beside a paper, proposal, or README | Editable figure source | `editable-figure` | | Top-level `README.md` flagged for audit or rewrite | Public-facing README | `readme-polish` | | `<your-file-type>` | `<your-context>` | `<your-skill>` | ### Directory-hint routing Some projects declare their type via directory naming: | Directory pattern | Likely context | Default skill | |---|---|---| | `<your-directory-pattern>` (e.g., `proposals/`, `papers/`) | `<your-context>` | `<your-skill>` | ## Lens Selection for implement-review When the router dispatches to `implement-review`, it also selects a review lens. The lens is content-type-aware: | Context | Lens | Criteria source | |---|---|---| | `.py`, `.js`, `.ts`, `.go`, `.rs`, code files | Code | Google eng-practices, Microsoft Engineering Fundamentals | | `.tex`/`.bib` in paper directory | Paper | NeurIPS, ICLR, ICML, ACL review guidelines | | `.tex`/`.bib`/`.md` in proposal directory | Proposal | NSF Merit Review or NIH Simplified Peer Review (ask user which agency) | | Mixed or unclear | General | Completeness, correctness, consistency, clarity | See `implement-review/references/review-lenses.md` for full lens definitions. ## Local-first Rule If a project has a more specific local skill (e.g., a project-local variant under `skills/` that overrides a shared skill), prefer the local version. Local skills are customized for the project context and should win over generic shared copies.
-
-
SKILL.md 10 KB
--- name: my-router description: Context-aware router that detects work type and dispatches to the right skill. Ships with a minimal default routing table; extend it in a fork, or register project-local skills in a consuming repo via routing-table.local.md or an AGENTS.local.md Routing section. --- # My Router ## Overview A routing layer that sits between the outer workflow (e.g., `superpowers` brainstorm/plan/execute/verify) and domain skills. The router reads the working directory, file types, and user prompt to decide which skill to invoke, so the user does not need to remember skill names. In this repo's shipped form, the routing table has concrete entries for the six shipped skills (`implement-review`, `ci-mockup-figure`, `readme-polish`, `editable-figure`, `my-router` itself, and `prun` for explicit parallel fan-out intent). It is also designed as a **pattern you extend**. A fork of this repo edits `references/routing-table.md` directly. A consuming project, where that file is overwritten on every bootstrap, instead registers its own skills in a bootstrap-proof local file (`routing-table.local.md` at the repo root, or a `## Routing` section in `AGENTS.local.md`); the router reads those rows and dispatches to them. See [Extending the Router](#extending-the-router). ## When to Use Superpowers vs. Direct Dispatch The router decides this. Not all tasks need superpowers' full ceremony. | Task shape | Route | Why | |---|---|---| | Clear, scoped task with an obvious skill match (e.g., "review staged changes") | **Direct dispatch** — router picks the domain skill and runs it immediately | Brainstorming and planning add no value when the task is already well-defined | | Open-ended, multi-step, or ambiguous task (e.g., "build a new feature", "restructure the paper") | **Superpowers first** — brainstorm → plan → execute (router dispatches during execute) → verify | These benefit from thinking before doing | | Quick edit or fix (e.g., "fix the typo on line 42", "rename this variable") | **Neither** — just do it directly | No routing or workflow needed | | Effort signal words in prompt (e.g., "extensively", "deep", "thorough", "in-depth", "carefully", "comprehensive") | **Superpowers + extended thinking** — enable extended thinking (`Alt+T`) and route through superpowers regardless of task shape | The user is explicitly asking for more deliberation | The rule: **if the domain skill is obvious and the scope is clear, skip superpowers and dispatch directly. If the task needs exploration or planning, let superpowers run the outer loop and the router dispatches during execution. If the user signals they want deep effort, always use superpowers with extended thinking enabled.** ## Integration with Superpowers When superpowers is active, it handles workflow phases: brainstorm → plan → execute → verify. The router activates during the **execute** phase and dispatches to the right domain skill. When superpowers is not active (direct dispatch or quick task), the router works standalone. ## How Routing Works At dispatch time, the router checks three signals in order (keywords, file types, project structure). In a consuming project, before applying the shipped table below, it first merges any **consumer-local routing extensions**: a `routing-table.local.md` at the repo root, or a `## Routing` section in `AGENTS.local.md`. These two files survive bootstrap (the shipped table does not), so they are where a consuming repo registers its own skills; on a keyword or file-type conflict, the local row wins. See [Extending the Router](#extending-the-router). ### 1. Prompt keywords (highest priority) The user's prompt often contains the clearest signal. The shipped routing table includes keyword entries for `implement-review`, `ci-mockup-figure`, `readme-polish`, and `editable-figure`. Add entries for your own skills in your fork's `references/routing-table.md`, or, in a consuming project, in a bootstrap-proof local file (see [Extending the Router](#extending-the-router)). When a figure request explicitly asks for PowerPoint or native editability, take the `editable-figure` route ahead of the generic figure, README-polish, or slide routes. A request to simplify an existing editable figure stays on that route. An explicit HTML mockup, TikZ, screenshot, or prompt-only request keeps its requested format. Before taking that route, check that the session can perform the desktop PowerPoint validation `editable-figure` requires. If it cannot, explain the limitation and offer `ci-mockup-figure` only when its output fits the request. Do not silently substitute HTML for an explicitly requested PPTX. See [`references/routing-table.md`](references/routing-table.md) for the current table and the extension template. ### 2. File types in working directory If prompt keywords are ambiguous, inspect the files being worked on. The shipped router recognizes staged git changes → `implement-review`, HTML mockup files for dashboards/timelines → `ci-mockup-figure`, a top-level `README.md` flagged for polish → `readme-polish`, and `.pptx` figure sources beside a paper, proposal, or README → `editable-figure`. Add your own file-type rules when you add new skills. ### 3. Project structure hints Some projects declare their type in `AGENTS.local.md` or via directory naming conventions (e.g., a `proposals/` or `papers/` directory, or a submodule pointing at a shared editorial repo). Use these hints to pick content-aware behavior when relevant to your skills. ## Dispatch Rules 1. **Local-first override**: before dispatching, scan `skills/` (project-local) for any skill that is a more specific variant of the matched skill. If a local variant exists, use it instead of any pack-deployed or bootstrapped copy. 2. **If a prompt keyword matches** → invoke that skill. 3. **If file context matches but prompt is vague** (e.g., "help me with this") → state the detected context and proposed skill, ask the user to confirm before proceeding. 4. **If multiple skills could apply** → state the candidates and ask the user to choose. 5. **If nothing matches** → fall through to superpowers or general agent behavior. Do not force a skill where none fits. ## Skill Lookup Order In consuming project repos, skills can be project-local, pack-deployed, or bootstrapped from shared config. When dispatching, look for each skill in this order: 1. `skills/<name>/SKILL.md`: project-local (highest priority). Projects can add their own skills here. 2. `.claude/skills/<name>/SKILL.md`: pack-deployed by `anywhere-agents pack install`. The `.claude/` prefix is a historical Claude Code convention; the SKILL.md contents are agent-agnostic. 3. `.agent-config/repo/skills/<name>/SKILL.md`: bootstrapped from the shared config repo. 4. **Installed plugins**: agent-specific plugin skills (e.g., Claude Code plugins), check `/skills` output. If a project-local skill matches the task better than a pack-deployed or bootstrapped skill, prefer the project-local one. The router itself follows this same lookup order. ## Extending the Router Where you register a new skill depends on whether you own this repo or only consume it. The mechanism is the same: a routing row keyed on prompt keywords, file types, and directory hints. Only the location differs, and it must survive your config-refresh path. **In a fork of this repo** (you own the shipped table): 1. Add the skill directory under `skills/<your-skill>/`. 2. Add a row to `references/routing-table.md`. 3. Add a matching `.claude/commands/<your-skill>.md` pointer so Claude Code can invoke it directly. **In a consuming project** (this skill arrives via bootstrap or `anywhere-agents pack install`): Do **not** edit `references/routing-table.md` here. Every on-disk copy (`.agent-config/repo/skills/my-router/`, `.claude/skills/my-router/`) is overwritten on the next bootstrap or `pack verify --fix`. Register your skill where bootstrap never reaches: 1. Add the skill directory under `skills/<your-skill>/` (project-local, bootstrap-proof by construction). 2. Register its routing in **either** of these bootstrap-proof files: - `routing-table.local.md` at the repo root, using the same table format as `references/routing-table.md`; or - a `## Routing` section in `AGENTS.local.md`, convenient when you already keep project overrides there. 3. Optionally add a project-local `.claude/commands/<your-skill>.md` pointer. The bootstrap copy step is non-destructive and never deletes command files absent from upstream, so a consumer-only pointer survives. At dispatch time the router merges these local rows on top of the shipped table; on a keyword or file-type conflict, the local entry wins. Both `routing-table.local.md` and `AGENTS.local.md` sit outside the set of files bootstrap rewrites, so the registration persists across refreshes. ## Combining with Implement-Review When review is needed after a domain skill finishes: 1. Domain skill runs (e.g., code changes, paper edits) 2. Changes are staged 3. Router dispatches to `implement-review` with the appropriate lens (code, paper, proposal, general) 4. Reviewer applies the lens-specific criteria See `implement-review/SKILL.md` for the review loop protocol. ## Examples **User says:** "Review this" → Router detects: staged changes exist → dispatches to `implement-review`; content-type lens (code, paper, proposal, general) selected based on staged files. **User says:** "Build the feature and review it" → Router detects: code context → superpowers handles the build, then router dispatches to `implement-review` with code lens. **User says:** "Make an HTML mockup for the method figure" → Router detects: keyword "mockup" → dispatches to `ci-mockup-figure`. **User says:** "Polish the README with modern patterns" → Router detects: keyword "polish README" → dispatches to `readme-polish`. **User says:** (anything else, shipped router has no rule) → Router falls through to superpowers or general agent behavior. Add more rules in `references/routing-table.md` (in a fork) or in `routing-table.local.md` / an `AGENTS.local.md` `## Routing` section (in a consuming project).
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.