new-router

new-router is a skill for Claude Code from zuoyebang/aiweave. It costs 27 tokens per session (781 once invoked), scanned A, original, Apache-2.0.

A code-generation guide for creating HTTP route registration files from a routing document. It registers routes by audience, HTTP method, path, controller, and validation middleware.

In plain words
What is it for?
Use it to generate the main HTTP router and separate route files for internal, operator, or administrator endpoints.
Why use it?
It reduces mistakes when connecting documented API routes to their controller functions.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is cd test && go test -v ./cases/{audience}/....

Good fit Use it to generate the main HTTP router and separate route files for internal, operator, or administrator endpoints.

Compare 6 skills 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/zuoyebang/aiweave
agentmods
npx agentmods add skills/zuoyebang/aiweave/new-router

Made for: Claude Code.

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 new-router

README.md
[![agentmods](https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-router/github.svg)](https://agentmods.dev/skills/zuoyebang/aiweave/new-router)
Your own site
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-router"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-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 new-router

Your own site · 80×15
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-router"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-router.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 781 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.00027 $0.00781
Opus 5 $0.00014 $0.00391
Sonnet 5 $0.00005 $0.00156
Haiku 4.5 $0.00003 $0.00078

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

Security

Grade A, and why

new-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.

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.

templates/skills/new-router/SKILL.md · 95 lines

What it actually says

根据 $ARGUMENTS 生成路由注册文件。

公共步骤模板见 skills-spec/01_skill_authoring_guide.md §A-§E。本 Skill 特定内容如下。

第 0 步:拒绝规则与依赖前置

  • ⛔ 拒绝(§A.1):生成 admin 路由组时必须跳过 BUILD_STATUS.md §0 中 🚫 模块对应路由(即使 routing.md §5 表中列出也不能注册,可以注释占位 + 标注 "🚫 ...")
  • 状态检查(§A.2):读 BUILD_STATUS.md §2 router 行
  • 依赖(§A.3):扫描 controllers/http/{audience}/ 下文件,缺失的 controller 先列清单提醒用户

第 1 步:读取设计文档(公共必读见 §B)

  • 主文档:docs/architecture/routing.md §3(注册代码)+ §5(完整路由表)
  • 确认每条路由的:HTTP 方法 / 路径 / 控制器函数 / 校验中间件
  • 确认包导入别名约定(§4)

第 2 步:生成路由文件

http.go 主入口

package router

import (
    "{project}/controllers/http/probe"
    "{project}/middleware"
    "{project}/pkg/gin"
)

func Http(engine *gin.Engine) {
    engine.Use(middleware.Cors)
    engine.Use(middleware.Metrics)

    engine.GET("/{prefix}/ready", probe.Ready)

    registerInternalRoutes(engine)
    registerOperatorRoutes(engine)
    registerAdminRoutes(engine)
}

http_{audience}.go 子文件

按 routing.md §3.2 代码结构生成,例:

func registerOperatorRoutes(engine *gin.Engine) {
    op := engine.Group("/{prefix}/operator")

    // 免校验
    op.POST("/{module}/{action}", {audience}_{module}.{Action})

    // 需校验
    protected := op.Group("")
    protected.Use(middleware.{UserMw}())
    {
        registerOperator{Module}Routes(protected)
    }
}

第 3 步:文档同步(公共项见 §C)

  • 确认 routing.md §5 路由表与代码完全一致(含 🚫 跳过项注释)
  • 更新 BUILD_STATUS §2 router 行

第 4 步:测试同步(4 类用例标准见 §D)

路由是连接层,测试通过下游接口用例间接覆盖:

cd test && go test -v ./cases/{audience}/...

如生成 admin 组:必须验证 cases/admin/{disabled-module}_blocked_test.go smoke 用例(验证 /admin/{disabled-module}/* 返回 404)。

第 5 步:验证(公共格式见 §E)

go build ./router/...
go vet ./router/...

🧩 AIWeave 骨架 · 作者 XuRuibo [email protected] · Apache-2.0 · 模板文件,复制到工程后按业务语义填充

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 · 95 lines · 27 tokens per session scan A 3581f230558b

Subscribe to this mod's changes

new-router is a skill published in the GitHub repository zuoyebang/aiweave (20 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 27 tokens to every session and 781 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens

add-rpc

Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality.

mits-pl/wove · 36 tokens

wps-events

Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.

mits-pl/wove · 41 tokens

electron-api

Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.

mits-pl/wove · 27 tokens

compact-error-handling

How to eliminate verbose, repetitive try-catch blocks in generated code by using multi-exception tuples, contextlib.suppress, and functional Result types, cutting error boilerplate by 60%.

alivirgo/Major-AI-Skills · 43 tokens

api-runtime-verify

Verify an implemented backend HTTP surface at runtime: per route, record the request actually made, the HTTP status, the response content-type, and the observed body shape, assert each response against the slice's acceptance behavior, classify the findings, and decide a PASS/FAIL/BLOCKED runtime gate. The probe's real…

Mozurok/fhorja.dev · 216 tokens