new-controller

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

A generator for HTTP controller handlers based on API interface documents. A controller handler receives a web request, validates it, calls the service layer, and formats the response.

In plain words
What is it for?
Use it to generate a Go handler for an API route, with different response handling for internal, user-self, or administrator endpoints.
Why use it?
It removes repetitive controller wiring and keeps handlers aligned with the documented API and response rules. It also checks required prerequisites, such as the service method and shared response helpers.

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}/... -run Test{Action}.

Good fit Use it to generate a Go handler for an API route, with different response handling for internal, user-self, 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-controller

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-controller

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/zuoyebang/aiweave/new-controller"><img src="https://agentmods.dev/badge/skills/zuoyebang/aiweave/new-controller.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,061 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.00028 $0.01061
Opus 5.5 $0.00011 $0.00424
Sonnet 5.5 $0.00006 $0.00212
Haiku 4.5 $0.00003 $0.00106

Measured 1mo ago against content hash a23bbdeb40e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

new-controller 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 1mo 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-controller/SKILL.md · 119 lines

How it starts

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

根据 $ARGUMENTS 生成 Controller handler 文件。

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

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

  • ⛔ 拒绝(§A.1):路径命中 BUILD_STATUS.md §0 中 🚫 模块路径(如 admin/{disabled-module}/*)时立即拒绝
  • 状态检查(§A.2):读 BUILD_STATUS.md §5 路由组状态
  • 依赖(§A.3):
    • 对应 service 未实现 → 先调 /new-service 生成
    • Internal 路由组首次生成时,先检查共享文件:controllers/http/internal/render.go(renderInternalResponse)+ validator.go,缺失则按 docs/architecture/render_functions.md 生成

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

  • 主文档:docs/api/{audience}_interfaces.md
  • 额外必读:docs/architecture/routing.md §4、docs/service/service_design.md(确认 service 方法签名)

第 2 步:选择响应模板

Internal 控制器模板(与外部协议对齐的响应格式)

package {module}

import (
    "{project}/components"
    "{project}/pkg/gin"
    "{project}/service/{service_module}"
)

type {Action}Req struct {
    Field1 string `json:"field1" binding:"required,max=64"`
}

var {svcVar} = &{service_module}.{Service}Service{}

func {Action}(ctx *gin.Context) {
    var req {Action}Req
    if err := ctx.ShouldBindJSON(&req); err != nil {
        renderInternalResponse(ctx, components.NewServiceError({N}, "请求参数错误"), nil)
        return
    }
    resp, err := {svcVar}.{Method}(ctx, &req)
    renderInternalResponse(ctx, err, resp)
}

UserSelf / Admin 控制器模板(标准 errNo/errStr 响应格式)

package {module}

import (
    "{project}/components"
    "{project}/pkg/gin"
    "{project}/pkg/golib/v2/base"
    "{project}/service/{service_module}"
)

type {Action}Req struct {
    Field1 string `json:"field1" binding:"required,max=64"`
}

var {svcVar} = &{service_module}.{Service}Service{}

func {Action}(ctx *gin.Context) {
    var req {Action}Req
    if err := ctx.ShouldBindJSON(&req); err != nil {  // GET 用 ShouldBindQuery
        base.RenderJsonFail(ctx, components.ErrorParamInvalid)
        return
    }
    resp, err := {svcVar}.{Method}(ctx, &req)
    if err != nil {
        base.RenderJsonFail(ctx, err)
        return
    }
    base.RenderJsonSucc(ctx, resp)
}

Read the full file on GitHub · 119 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. 1mo ago First seen · 119 lines · 28 tokens per session scan A a23bbdeb40e4

Subscribe to this mod's changes

new-controller is a skill published in the GitHub repository zuoyebang/aiweave (20 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 28 tokens to every session and 1,061 once invoked, about $0.0001 per session on Opus 5.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

compact-error-handling

Reduce repeated exception-handling code with language-appropriate constructs while preserving error propagation and diagnostics.

alivirgo/Major-AI-Skills · 23 tokens

api-runtime-verify

Verify a built backend HTTP surface at runtime: per route, record the response, assert it against the slice's acceptance behavior, and decide PASS/FAIL/BLOCKED. Do not use to review a contract before implementation (use api-contract-review or graphql-contract-review), write code (use implement-approved-slice), triage…

Mozurok/fhorja.dev · 95 tokens

api-contract-review

Review an API contract (shapes, errors, auth model) BEFORE implementation for naming, versioning, pagination, idempotency, and fit with existing endpoints. Use when designing or changing endpoints. Do not use when the API is already implemented (use review-hard or repo-consistency-sweep).

Mozurok/fhorja.dev · 64 tokens

backend-system-design

Produce a staff-grade backend system-design RFC: a 12-section document for a new service, endpoint, or feature. Composes with slo-define, performance-budget, api-contract-review, release-plan. Use when a backend feature needs architecture-level design before planning. Do not use to slice a designed change (use…

Mozurok/fhorja.dev · 106 tokens

graphql-contract-review

Review a GraphQL schema and a Backend-for-Frontend (BFF) contract BEFORE implementation against a GraphQL checklist (nullability, N+1, cost limits, federation, BFF thinness). Use when designing or modifying a GraphQL schema, a federated subgraph, or a BFF contract. Do not use for a REST contract (use…

Mozurok/fhorja.dev · 106 tokens