harness-router

harness-router is a skill for Claude Code, Codex from Tirefly/agent-harness-template. It costs 70 tokens per session (1,104 once invoked), scanned A, original, MIT.

A user-level routing process that prepares context before a substantial task begins. It classifies the task, reads applicable rules and memories, and selects relevant skills and reusable building blocks.

In plain words
What is it for?
Use it at the start of a new task or when the task changes type. It helps route coding, analysis, design, debugging, and other work to the appropriate instructions and prior knowledge.
Why use it?
It reduces missed project conventions and irrelevant context by assembling the information needed for the specific kind of work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions AGENTS.md.

Good fit Use it at the start of a new task or when the task changes type. It helps route coding, analysis, design, debugging, and other work to the appropriate instructions and prior knowledge.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tirefly/agent-harness-template/harness-router
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.

Any agent
npx skills add Tirefly/agent-harness-template --skill harness-router
Clone the repo
git clone --depth 1 https://github.com/Tirefly/agent-harness-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for harness-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/tirefly/agent-harness-template/harness-router/github.svg)](https://agentmods.dev/skills/tirefly/agent-harness-template/harness-router)
Your own site
<a href="https://agentmods.dev/skills/tirefly/agent-harness-template/harness-router"><img src="https://agentmods.dev/badge/skills/tirefly/agent-harness-template/harness-router/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for harness-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/tirefly/agent-harness-template/harness-router"><img src="https://agentmods.dev/badge/skills/tirefly/agent-harness-template/harness-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00070 $0.01104
Opus 5 $0.00035 $0.00552
Sonnet 5 $0.00014 $0.00221
Haiku 4.5 $0.00007 $0.00110

Measured 9d ago against content hash eb4143c2ca36, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

harness-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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/retrieve.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/harness-router/SKILL.md · 51 lines

What it actually says

Harness Router:任务开始的上下文组装

按以下七步执行,不得跳步。依据与本流程冲突时,先向用户呈现冲突再继续。

1. 任务分型

从用户消息判定任务类型(模板示例:game-design / domain-dev / domain-analysis / general;按 references/routing-table.yaml 实际定义调整)。 分不清 → general 兜底,并向用户说明分型依据(一句话)。用户纠正分型时,记下纠正信号(retro 素材)。

2. 查路由表

references/routing-table.yaml,取该类型的 memory-domains、skills、exclusions、execution-blueprint。

3. 常驻注入

无条件读取并纳入上下文(先读规范,再读记忆):

  • ~/.agents/AGENTS.md(用户级唯一规范来源,最高优先级;必须先读再行动,任何流程/技能指令与之冲突时以此为准)
  • ~/.agents/memory/constitution.md(设计宪法,裁决标准)
  • ~/.agents/memory/profile.md(用户画像)

4. 记忆检索

优先运行:python ~/.agents/skills/harness-router/scripts/retrieve.py --query "<任务关键词>" --domains <路由表 domains> --top 5(跨平台可移植写法;PowerShell 参数位 ~ 不展开时,先把 ~ 替换为 $env:USERPROFILE 得到本机绝对路径再运行)

  • 成功 → 读取返回卡片的原文(路径在输出的 path 字段)
  • 退出码 2(索引缺失)→ 先执行 --rebuild 重建索引再查;重建也失败或无 Python 环境 → 降级两级 grep:① grep ~/.agents/memory/INDEX.md 表行(domains / 标题)② 再 grep 各卡片 frontmatter 的 keywords 行(grep -l "keywords:.*<关键词>" ~/.agents/memory/*/*.md,INDEX 表不含 keywords 列),读 top 3-5 张卡原文
  • 检索无结果 → 正常冷启动,不硬凑 【裁决 1 追加】score 是相对排序不是绝对相关度:未命中时也可能输出 top-N 条 score 0.0 的卡。必须结合标题与 keywords 自行判断相关性,明显不相关的直接丢弃,不注入上下文。 【裁决 2 追加】Python 探测顺序:pythonuv run python → 本机已知绝对路径。本机兜底路径在对应技能文件的本机裁决注释中维护(跨机部署时替换为新机器的实际路径);均不可用才走 grep 降级。

5. 未关闭检查点检查

检索 INDEX.md 中 task-open 状态的卡(用表行锚定模式 \| task-open \|,避免误命中第 5 行图例文字):若与本任务相关,先向用户呈现断点(定了什么/搁置什么/下一步),确认从断点恢复还是重新开始。

6. 组装上下文包并透明呈现

向用户简要呈现(白盒):

  • 任务分型结论与依据
  • 注入的记忆(id + 标题);宪法与画像视为默认注入,不必逐条复述
  • 计划使用的技能与执行蓝图(设计任务展示阶段→原子序列)
  • 明确排除项(exclusions) 用户当场纠正(如"这条记忆过时了")→ 记为 retro 素材。

7. 执行选项(仅正式设计任务)

向用户提供选择: a) 本会话直接执行(沿用当前上下文) b) 派发干净 subagent 执行(无对话历史,只带上下文包 + 执行蓝图,产出收回主会话) 建议:复杂/正式设计任务选 b,快速迭代选 a。

检查点纪律(执行期)

execution-blueprint 中 checkpoint: true 的阶段完成时,立即产出 checkpoint 卡(按 harness-retro 的模板),走用户确认门后入库。 长任务自由讨论中每约 5 轮实质交流检查一次 checkpoint 需求;每次回答结束时的自动自检见 AGENTS.md「回答后 TAH 判定」。

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 51 lines · 70 tokens per session scan A eb4143c2ca36

Subscribe to this mod's changes

harness-router is a skill published in the GitHub repository Tirefly/agent-harness-template (2 stars, last pushed 14d ago), licensed MIT. It adds 70 tokens to every session and 1,104 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens