agentharness-router

A generated set of routing rules for an AI coding agent, based on a repository's CLAUDE.md instructions. It tells the agent where to find the full rules and how the generated file must be maintained.

In plain words
What is it for?
Use it to route coding sessions to the right repository instructions, keep Cursor rule files synchronized, and follow the required verification and staging steps before stopping.
Why use it?
It keeps repository-wide agent guidance consistent with its source file and lets the CI check detect manual or outdated changes. It also defines the repository's completion workflow.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/andr-ca/agentharness/agentharness-router
Clone the repo
git clone --depth 1 https://github.com/andr-ca/agentharness

Made for: Cursor.

Per session 5,154 This file is loaded in full into every session.
When invoked 5,154 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.05154 $0.05154
Opus 5 $0.02577 $0.02577
Sonnet 5 $0.01031 $0.01031
Haiku 4.5 $0.00515 $0.00515

Measured yesterday against content hash 4712b4ce44b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentharness-router scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/agentharness-router.mdc · 394 lines

How it starts

The opening of the file, as written. The whole thing — 394 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generated from this repo's own CLAUDE.md by tools/generate-cursor-rules.sh (https://github.com/andr-ca/agentharness) — do not hand-edit; regenerate instead (tools/generate-cursor-rules.sh --output-dir .). A CI check keeps this file in sync with its source (see .github/workflows/ci.yml's content-quality job).

This file covers repo-wide routing rules only. Cursor has no confirmed support for the Agent Skills open standard (SKILL.md) — each skill under .claude/skills/ is instead mirrored here as its own .cursor/rules/<skill-name>.mdc, with that skill's own description copied into the rule's frontmatter and no globs set. That makes each rule Agent-Requested: Cursor's agent reads the description and decides whether to pull the full rule body in, the closest native analog to SKILL.md's own progressive disclosure.


agentharness – Agent Router

This file is loaded into every session that touches this repo. Keep it short — everything else is one link away. Full index: MANIFEST.md. Planned-but-not-built: ROADMAP.md.

🤖 Agent Workflow Completion

Default (no publish authority): verify and stage, then stop.

  1. Run the completion gate — before declaring any work done, run bash tools/check-completion.sh. This script verifies lint, types, tests, coverage, and content quality in one shot and exits non-zero if anything fails. The Stop hook in .github/hooks/completion-gate.json and .claude/settings.json enforces this automatically for Claude Code and GitHub Copilot — the agent cannot stop until all gates pass.
  2. Create atomic commits locally — one logical unit per commit, clear message explaining WHY
  3. 🛑 Stop before pushing, opening a PR, or auto-implementing recommendations. Present a summary of what's staged and ask the user to confirm before publishing anything.

A local commit is not a durable safe-point in an ephemeral-container execution environment. If you have verified, committed-but-unpushed work and are about to block on AskUserQuestion or other unbounded human input, consider pushing to a remote branch (a scratch/WIP branch is fine) first — committed-but-unpushed work can be lost if the container is reclaimed during the wait, with no error at commit time and no warning until a later git log looks unfamiliar. This is disclosure of an existing risk, not a grant of publish authority: it does not authorize opening a PR or merging, and the default tier above still governs those.

Read the full file on GitHub · 394 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 394 lines · 5,154 tokens per session scan A 4712b4ce44b0

Subscribe to this mod's changes

agentharness-router is a cursor rule published in the GitHub repository andr-ca/agentharness (1 stars, last pushed 2d ago), licensed MIT. It adds 5,154 tokens to every session, about $0.0258 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.