extract-routing

A command that scans selected source-code paths for business anchors such as message topics, status values, identity constants, interface names, and table names. It saves these findings as candidates for human review.

In plain words
What is it for?
Use it to draft an anchor table showing each value, its possible application, evidence file, suggested knowledge page, and confidence.
Why use it?
It helps update project knowledge without treating uncertain code findings as established facts or modifying approved knowledge automatically.

Command

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 commands/alisunstar/opensunstar/extract-routing
Clone the repo
git clone --depth 1 https://github.com/alisunstar/OpenSunstar
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 608 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00608
Opus 5 $0.00000 $0.00304
Sonnet 5 $0.00000 $0.00122
Haiku 4.5 $0.00000 $0.00061

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

Security

Grade A, and why

extract-routing 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.

rd-protocol/commands/extract-routing.md · 46 lines

What it actually says

/rd:extract-routing — 源码锚点提取适配器(外置)

知识资产层适配器:从源码提取业务锚点(Topic/状态枚举/业务身份常量/接口名/表名),产出锚点补表草稿入 knowledge/candidate/,经 owner review 后才并入正式页 frontmatter。核心不内建提取逻辑(K1),本命令由外部 Agent 执行。

先读规则

  1. 读 knowledge/ROUTING.md 与 knowledge/applications/INDEX.md(现状路由)
  2. 读 knowledge/KNOWLEDGE-RULES.md(candidate 治理规则)
  3. 扫描范围仅限当前需求涉及的仓库路径(最小读取边界)

执行

  1. 在扫描范围内识别锚点候选:MQ Topic 常量、状态枚举、业务身份常量、对外接口名、核心表名;
  2. 为每个锚点给出:锚点类型(TOPIC/STATE/BIZ_IDENTITY/INTERFACE/MODEL)、字面值、候选应用、证据文件路径、建议挂载的正式页(applications//…);
  3. 只产出候选,不修改任何正式 knowledge/ 页与 ROUTING.md;
  4. 证据不足者标 confidence: low,禁止推断成事实。

产物

  • knowledge/candidate/anchors-<YYYY-MM-DD>.md,frontmatter 含:
    type: candidate
    sourceType: ai-assisted
    engine: rd-extract-routing
    status: CANDIDATE
    confidence: medium
    evidence:
      - code: <证据文件路径>
    
    正文为锚点表:| 类型 | 字面值 | 候选应用 | 建议挂载页 | 证据 | confidence |

何时停止

  • 扫描范围无法从需求/ROUTE 推断 → 停止,等人工划定范围。
  • 敏感路径(密钥/客户数据/线上配置)一律不读不写。

人工确认

— 草稿需 owner review:确认的锚点由人(或后续命令)写入正式页 frontmatter anchors;未确认者留在 candidate,不得被 os wiki routing 合并(合并器只读正式区)。

与索引合并器的关系

  • 本适配器产“候选锚点”(外部智能);
  • os wiki routing 只合并正式区已声明 anchors(确定性核心);
  • 二者以 owner review 为界,错误知识不入 ROUTING。
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 · 46 lines · 0 tokens per session scan A f607c0e79a4d

Subscribe to this mod's changes

extract-routing is a command published in the GitHub repository alisunstar/OpenSunstar (40 stars, last pushed 18d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 608 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.