agent-routing.keepalive-wake

agent-routing.keepalive-wake is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (2,913 once invoked), scanned A, original, MIT.

A set of rules for keeping background agent tasks alive, checking their status, and handing them off when they finish or reach a deadline.

In plain words
What is it for?
It governs status checks, scheduled wake-ups, task stopping, deadline interventions, and lifecycle handoffs for asynchronous work.
Why use it?
It prevents an agent from guessing about unfinished work, releasing shared resources too early, or starting duplicate tasks.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions subagents; mentions Codex.

Good fit It governs status checks, scheduled wake-ups, task stopping, deadline interventions, and lifecycle handoffs for asynchronous work.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/agent-routing.keepalive-wake
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.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: 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.keepalive-wake

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.keepalive-wake.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.keepalive-wake)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/agent-routing.keepalive-wake"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/agent-routing.keepalive-wake.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,913 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.00000 $0.02913
Opus 5 $0.00000 $0.01456
Sonnet 5 $0.00000 $0.00583
Haiku 4.5 $0.00000 $0.00291

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

Security

Grade A, and why

agent-routing.keepalive-wake 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 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.

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.

template/.cursor/rules/agent-routing.keepalive-wake.mdc · 90 lines

How it starts

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

Reference 檔。要不要排 keepalive(Iron Law、適用範圍窮舉、派出當下的自查表、Red Flags)留在 agent-routing.md § 主線靜默上限;怎麼填(canonical inert 模板逐字、deadline 取值)與醒來之後做什麼都在本檔。兩個時刻各有 [[agent-routing]] 的具名時機指針叫醒本檔。

Generic keepalive 醒來只做控制面動作

可觀察 predicate 動作
native non-blocking task-status query = running,且未到 deadline 完全相同的 inert prompt 重排既有 interval,本 turn 結束
task = terminal 停對應 wakeup,排一次不含原任務、結果或授權的 ASYNC_LIFECYCLE_HANDOFF task=<id> owner=<owner> cause=terminal
task = running,且到 deadline 停 control wakeup、保留 owner 與 in-flight claim,排 ASYNC_DEADLINE_INTERVENTION;owner 必須先取消 task(native cancellation control)或取得具名延長,確認 terminal 前 NEVER 收割、釋放 lock 或重派
狀態不可判定(含 runtime 沒有 native task-status query 可用) 不 claim、不收割、不釋放 lock;以同一 inert prompt 進行有限次重查。次數用盡時走 ASYNC_DEADLINE_INTERVENTION,確認 terminal 前同樣不得重派。NEVER 因為查不到狀態就改讀 BashOutput tail 或 log 補判——那是 allowlist 外的動作,per 下一段

control turn 的 allowlist 只有「native non-blocking task-status query、重排同一 inert wakeup、停止 wakeup、排 lifecycle handoff / deadline intervention」。NEVER 讀 repo / log 猜狀態、執行原任務、Edit / Write、commit、publish、propagate、push、開新工作或做任何 shared-resource mutation。

每一個 native completion notification 與 terminal lifecycle handoff MUST 先共用 claim(pending → harvesting → harvested)再收尾。claim key:有 harness task id 的路徑用 task-id;notification-only 路徑(taskId: null)用 owner ref,狀態機相同:已是 harvesting / harvested 則 no-op(這擋掉 delayed notification 重複收割),deadline / unknown 不得 claim。只有 claim 成功的正常 turn 可讀 result 並走 owner 既有收尾,且同一 turn MUST 停掉對應 wakeup(native wakeup scheduler({stop: true}))並一併 native cancellation control owner 的 persistent Monitor(若有)。

Read the full file on GitHub · 90 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 · +2 lines 19aac517a5d8
  2. 8d ago First seen · 88 lines · 0 tokens per session scan A 8d90e96b89b3

Subscribe to this mod's changes

agent-routing.keepalive-wake 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 2,913 tokens. 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-30.