Repo-aware router skill for AI coding CLIs that maps tasks to the right repository, project skill/agent, and native CLI backend.
SaferSkills independently audited AgentRepoRouter (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
中文版 | English
<p align="center"> <img src="images/cover/cover-03-architecture-board.png" alt="AgentRepoRouter Cover" width="100%"> </p>
Repo-aware routing for AI coding CLIs as an installable skill for multiple agent hosts.
AgentRepoRouter installs into OpenClaw, Claude Code, OpenCode, Codex, and Hermes skill locations. It does not replace those tools. It routes tasks to the right repo, preserves each CLI's native agent and skill conventions, and uses structured repo metadata to improve navigation.
flowchart TD
start["Start scripts/install.sh"] --> env["Check Node.js 18+, Git, and TTY support"]
env --> hosts["Detect available agent hosts"]
hosts --> lang["Select skill language: Chinese / English"]
lang --> mode{"Select install mode"}
mode -->|Global| global["Write canonical skill directory: ~/.agents/skills/agent-repo-router"]
mode -->|Single host| single["Write selected host skill directory directly"]
mode -->|Custom hosts| custom["Write canonical directory and link selected hosts"]
global --> installHosts["Resolve installHosts"]
single --> installHosts
custom --> installHosts
installHosts --> clis["Select executionClis"]
clis --> discovery{"Choose project discovery mode"}
discovery -->|Auto scan| autoScan["Scan local projects and collect repo metadata"]
discovery -->|Manual| manual["Enter absolute project paths"]
autoScan --> assets["Detect project-level skills and agents"]
manual --> assets
assets --> mapping["Generate schema v2 repo_mappings.json"]
mapping --> deploy["Deploy SKILL.md and references/guide.*.md"]
deploy --> links{"Need host symlinks?"}
links -->|Global / Custom hosts| symlink["Symlink host skill directories to the canonical directory"]
links -->|Single host| direct["Keep direct host install directory"]
symlink --> validate["Validate repo_mappings.json"]
direct --> validate
validate --> done["Install complete: host can load agent-repo-router"]flowchart TD
user["User submits a coding task"] --> host["OpenClaw / Claude Code / OpenCode / Codex / Hermes"]
host --> skill["Load agent-repo-router Skill"]
skill --> config["Read references/repo_mappings.json"]
config --> repoDecision{"Can the target repo be resolved confidently?"}
repoDecision -->|User specified repo| targetRepo["Use the user-specified repo"]
repoDecision -->|repo name / alias / task intent match| targetRepo
repoDecision -->|No reliable match| askRepo["Ask the user for the target repo"]
askRepo --> targetRepo
targetRepo --> projectHints["Read aliases, skills, and agents for the repo"]
projectHints --> projectAssets{"Project-level skill / agent matched?"}
projectAssets -->|Yes| projectPlan["Compose skill / agent prompt using the native CLI convention"]
projectAssets -->|No| globalAssets{"Global skill / agent strictly matched?"}
globalAssets -->|Yes| globalPlan["Attach global capability conservatively"]
globalAssets -->|No| fallback["Fallback by executionClis order"]
projectPlan --> chooseCli{"Choose execution CLI"}
globalPlan --> chooseCli
fallback --> chooseCli
chooseCli --> claude["Claude Code: cd repo && claude -p task"]
chooseCli --> opencode["OpenCode: cd repo && opencode run task"]
chooseCli --> cursor["Cursor: cd repo && agent -p task"]
chooseCli --> codex["Codex: cd repo && codex exec task"]
chooseCli --> hermes["Hermes: cd repo && hermes --oneshot task"]
claude --> result["Native CLI runs in the target repo and returns the result"]
opencode --> result
cursor --> result
codex --> result
hermes --> resultMany developers now have more than one coding CLI, more than one repo, and more than one place where custom agents or skills live.
The real problem is often not "how do I run 20 agents in parallel?" It is:
AgentRepoRouter is built for that gap.
The best way to understand AgentRepoRouter is:
This means AgentRepoRouter is intentionally lighter than a full orchestration runtime. It focuses on entry, routing, repo selection, and native CLI invocation rather than boards, worktrees, PR lifecycle automation, or parallel swarms.
This round of repo research led to three practical conclusions:
aliases, detected project skills, and detected project agents now embedded in repo_mappings.json, AgentRepoRouter is no longer just a thin prompt wrapper. It becomes structured routing context that supported hosts can navigate reliably.# Install from GitHub
curl -fsSL https://raw.githubusercontent.com/wufei-png/AgentRepoRouter/main/scripts/install.sh | bash
# Or local install
bash scripts/install.sh
# Non-interactive install with explicit repositories
bash scripts/install.sh --yes --language zh --repo /absolute/path/to/repo --hosts codex --execution-clis codex
# Non-interactive install by scanning a repository prefix
bash scripts/install.sh --yes --auto-scan --scan-root /absolute/path/to/repos --scan-depth 5 --hosts all --execution-clis all
# Review repo aliases and detected project assets
vim ~/.agents/skills/agent-repo-router/references/repo_mappings.json
# Start your host, for example OpenClaw
openclawUser
-> OpenClaw / Claude Code / OpenCode / Codex / Hermes
-> Router Skill
-> repo match via repo name / alias / task intent
-> project-level skill / agent hints from repo_mappings.json
-> direct native CLI executionscripts/install.sh checks Node.js 18+ and Git, then detects supported agent hosts.~/.agents/skills/agent-repo-router and symlink detected hosts.--repo arguments, manual absolute paths, and configurable scan depth. Auto scan defaults to depth 5; scripts can use --scan-depth N or AGENT_REPO_ROUTER_SCAN_MAX_DEPTH=N.--yes, --language zh|en, --install-mode global|single|custom, --hosts, --execution-clis, --existing backup|skip|overwrite, --repo, --auto-scan, and --scan-root.--hosts all means all detected install hosts; if none are detected, the installer falls back to the Codex canonical target. Explicit host names are allowed even when the host CLI is not detected.--execution-clis all means all detected execution CLIs in the fixed order claude-code,opencode,cursor,codex,hermes; explicitly listed execution CLIs must be installed.--existing backup, which moves real old installtargets under ${TMPDIR:-/tmp}/agent-repo-router-skill-backups/install-* and creates a fresh repo_mappings.json instead of merging aliases. Existing symlink install targets are unlinked and recreated, not backed up.
aliases, detected project-level skills, and detected project-level agents.repo_mappings.json with installMode, installHosts, and executionClis.AgentRepoRouter is delivered as a skill, not as another daemon or control plane. It can be installed directly for one host or installed once globally and linked into multiple host skill directories.
Routing quality depends on repo context. repo_mappings.json is therefore not just a list of paths. It is a small routing catalog:
{
"schemaVersion": 2,
"installMode": "global",
"installHosts": ["global", "openclaw", "claude-code", "opencode", "codex", "hermes"],
"executionClis": ["claude-code", "opencode", "cursor", "codex", "hermes"],
"repos": [
{
"name": "example-backend",
"path": "/path/to/backend",
"aliases": ["backend", "api"],
"skills": {
"claude-code": [
{
"name": "build_and_test",
"description": "Run build and tests before finishing changes."
}
]
},
"agents": {
"claude-code": [
{
"name": "bugfix",
"description": "Fix bugs and regressions with targeted changes."
}
]
}
}
]
}Each CLI already has its own invocation model and project asset conventions. AgentRepoRouter keeps those differences visible and uses them rather than hiding them.
claude -p "task" or claude --agent <name> "task"opencode run "task" with prompt-based agent selectionagent -p "task" with prompt-based agent selectioncodex exec "task" with project-level .agents/skills/, .codex/agents/, and AGENTS.mdhermes --oneshot "task" with Hermes skill conventionsIf a repo already has a project-level skill or agent, that should be treated as a strong hint before any global helper is attached.
If nothing matches reliably, AgentRepoRouter falls back using the executionClis order in repo_mappings.json. The behavior stays inspectable and predictable.
The newer aliases and detected skills and agents fields directly improve routing in ways the earlier minimal schema could not:
aliases lets the host match user language to repo nicknames such as api, docs, or admin.skills gives the router project-level capability hints before the CLI even starts.agents gives the router project-level specialist hints without forcing weak global matches.references/ folder keeps the runtime skill short while moving longer CLI conventions into explicit reference docs.The projects below are good comparison points, but they optimize for different layers of the stack.
| Project | Primary role | Execution model | What it optimizes for | How it differs from AgentRepoRouter |
|---|---|---|---|---|
| AgentRepoRouter | Repo-aware routing skill for multiple agent hosts | One skill chooses repo, skill, agent, and CLI, then calls the native CLI directly | Unified entry and predictable routing across multiple coding CLIs | Focuses on routing and native convention preservation instead of full orchestration |
| OpenClaw | Local-first personal assistant and control plane | Sessions, channels, skills, tools, and agents under one assistant runtime | Communication surfaces, sessions, skills, local-first assistant behavior | AgentRepoRouter is a coding-focused skill on top of OpenClaw, not a replacement |
| MCO | Parallel multi-CLI orchestration | Dispatch the same prompt to multiple coding CLIs and synthesize the results | Fan-out review, consensus, multi-model comparison | AgentRepoRouter chooses one best-fit path first; MCO is better when you want parallel review or consensus |
| agtx | Multi-agent task board and lifecycle manager | Kanban board, tmux sessions, worktrees, and orchestration agent | Persistent task flow across many agent sessions | AgentRepoRouter is much lighter and does not own task boards or worktree lifecycles |
| Agent Orchestrator | Autonomous PR and CI workflow automation | Dashboard plus agents in isolated worktrees reacting to CI and review feedback | Ticket-to-PR automation at scale | AgentRepoRouter stays as a routing layer and avoids taking over the whole delivery lifecycle |
| metaswarm | Opinionated SDLC orchestration framework | Multi-phase workflow, many personas, review gates, recursive orchestration | Strong process control and self-improving delivery loops | AgentRepoRouter is less opinionated, simpler to adopt, and easier to layer onto an existing OpenClaw setup |
| burn-harness | Continuous developer task queue for coding agents | Background loop pulls tasks, executes work, creates draft PRs, retries failures | Non-stop task throughput | AgentRepoRouter is interactive and routing-oriented rather than a background worker queue |
SKILL.md stays readable while references/ holds the detailed conventions.| CLI | Non-interactive task command | Project or custom config |
|---|---|---|
| Claude Code | claude -p "task" | ~/.claude/agents/, <repo>/.claude/agents/, <repo>/.claude/skills/ |
| OpenCode | opencode run "task" | ~/.config/opencode/agents/, <repo>/.opencode/agents/, <repo>/.opencode/skills/ |
| Cursor | agent -p "task" | ~/.cursor/agents/, <repo>/.cursor/agents/ |
| Codex | codex exec "task" | ~/.codex/config.toml, .codex/config.toml, ~/.codex/agents/, .codex/agents/, .agents/skills/, AGENTS.md |
| Hermes | hermes --oneshot "task" | ~/.hermes/skills/software-development/, host-specific Hermes config |
| Host | Direct skill path |
|---|---|
| OpenClaw | ~/.openclaw/skills/agent-repo-router |
| Claude Code | ~/.claude/skills/agent-repo-router |
| OpenCode | ~/.config/opencode/skills/agent-repo-router |
| Codex | ~/.agents/skills/agent-repo-router |
| Hermes | ~/.hermes/skills/software-development/agent-repo-router |
Codex's current public Agent Skills manual lists user skills under $HOME/.agents/skills; ~/.codex/skills is not the user skill discovery path for this installer.
Codex also officially supports codex exec -C /path/to/repo "task". AgentRepoRouter documentation still uses cd /path && ... examples so the routing pattern stays uniform across CLIs.
User: "Fix the auth bug in the api project, use the repo's build_and_test skill."
Router:
1. Match repo alias `api` -> `example-backend`
2. Read detected project skills -> `build_and_test`
3. Read detected project agents -> `bugfix`
4. Choose the best native CLI path
5. Execute directly in the target repoUse AgentRepoRouter when you want:
Pair AgentRepoRouter with other tools when needed:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.