agent-routing.pi-watch-protocol

agent-routing.pi-watch-protocol is a cursor rule for Claude Code, Codex, Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (21,854 once invoked), scanned B, original, MIT.

A set of rules for assigning coding tasks to helper agents and monitoring their progress. It defines which dispatch tools and models to use, how to record the starting Git state, and how to handle quota limits.

In plain words
What is it for?
Use it to route implementation, screenshot review, and proposal/apply work through a defined process. It helps preserve evidence, Git baselines, and completion checks.
Why use it?
It prevents inconsistent task handoffs, unsafe shortcuts, and unclear status reporting when several agents are working. It also provides a fallback when an agent or quota is unavailable.

Cursor rule for Claude CodeCodexCursor

Written for Claude Code and Codex and Cursor: PreToolUse hook event, but also runs codex exec. Also seen: reads .claude/ paths; mentions subagents; names the NotebookEdit tool.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node vendor/scripts/pi-dispatch.ts \.

Good fit Use it to route implementation, screenshot review, and proposal/apply work through a defined process. It helps preserve evidence, Git baselines, and completion checks.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter
agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol

Made for: Claude Code, Codex, Cursor.

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 agent-routing.pi-watch-protocol

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol/github.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol/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 agent-routing.pi-watch-protocol

Your own site · 80×15
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.pi-watch-protocol.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 21,854 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00000 $0.21854
Opus 5 $0.00000 $0.10927
Sonnet 5 $0.00000 $0.04371
Haiku 4.5 $0.00000 $0.02185

Measured today against content hash 74ca5a3e3e37, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

agent-routing.pi-watch-protocol scanned grade B with 1 finding 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 today.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .claude/.hub-state.json | grep syncedAt # 若新近時間戳 → 自動 hook 型 dirty
template/.cursor/rules/agent-routing.pi-watch-protocol.mdc · 745 lines

How it starts

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

Agent Routing — Pi / screenshot-review Dispatch & Watch Protocol

Reference 檔。核心 routing 規則見 agent-routing.md。本檔聚焦實際派 Pi / screenshot-review agent 出去時的標準流程模板、watch protocol、Plan-first / Git baseline declaration 硬指令與 bounded phase 執行契約。

Pi 派工的標準流程(所有 routing 共用)

任何 Pi 席位出去工作一律走 vendor/scripts/pi-dispatch.ts——gemini(provider google-gemini-cli)、astra / sol / luna(provider openai-codexterra 可解析但 2026-08-11 起 NEVER 派)、luna-cursor / grok-cursor(provider cursor)、grok-xai(provider xai每一格都走這個入口,沒有例外。

要指 openai-codex 那組席位時寫 codex-pool,那個區分只在配額鏈與計價成立;派工管道一律稱 pi。

已 route 給 Pi 的工作,NEVER 以直接執行 codex execcodex review 代替 dispatcher,也不走任何 codex:rescue / codex:setup / codex:codex-rescue plugin 路線。

持有 dispatch 的主線自己派、自己等通知、自己讀 dispatcher JSON 回報,禁止叫使用者切 CLI、禁止「Stop here」純文字 handoff。

模板:

  1. Write 把指示寫到 /tmp/pi-<topic>-<slug>-prompt.md(prompt 太長不要 inline)
  2. Bash tool(background process launcher (enabled)):

<model-slug> 選檔:先查 [[agent-routing.routing-table]] 的具名列。一般非 UI 實作用 luna medium,複雜實作與修復升級用 sol high;已列明 Gemini/Grok 的工作沿用該列。Astra 只承接 planning/decision/review,未知工作先分類,不用 Astra 當預設。本節的 Pi 派工不改走 cx 或 AI Agent+GPT;Codex 主線 → 任一 GPT 可用原生 agent 的獨立分支見 [[agent-routing]] § Session transport boundary。

node ~/offline/clade/vendor/scripts/pi-dispatch.ts \
  --brief /tmp/pi-<topic>-<slug>-prompt.md \
  --cwd <cwd> \
  --label <topic>-<slug> \
  --model <astra|sol|gemini|luna|luna-cursor|grok-xai|grok-cursor> --effort <low|medium|high|xhigh|max> \
  --route <routing-table|claude-delegate-sub|fallback-chain|manual> \
  --tier-basis <table-row|five-conjunct|adjudication|delegate-sub|quota-fallback|manual> \
  [--table-row <routing-row>] [--retry-of <prior-label>] [--chain-origin <astra|sol|luna|grok-xai>] [--task-role <planning|decision|review>]

Read the full file on GitHub · 745 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. today Changed · -106 lines 74ca5a3e3e37
  2. yesterday Changed · +60 lines b929f72ba210
  3. 3d ago Changed · -20 lines b9f4b690690d
  4. 4d ago Changed · +2 lines aceea426001b
  5. 5d ago Changed · +27 lines 49af89de9511
  6. 9d ago First seen · 782 lines · 0 tokens per session scan B b08bb55be5f5

Subscribe to this mod's changes

agent-routing.pi-watch-protocol is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 21,854 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.