Agent skill

New API

by Rain-kl in Rain-kl/OpenFlare

Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。

Apache-2.0Auto-check passedBackend & APIs

Install New API

skills CLI
$ npx skills add Rain-kl/OpenFlare --skill new-api -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Rain-kl/OpenFlare new-api --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/new-api .claude/skills/new-api && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
new-api
GitHub stars
288
Token cost
~1.4k tokens
SKILL.md length
266 words
Files
4 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。

  • Works in 2 steps: 根路径自定义包:root/custom.go → V1 API 自定义包:v1/custom.go
  • Tasks that involve OpenAPI specifications
  • SKILL.md covers 核心路由准则与防线 (Routing Governance…, 路由归属判定表 (Where should I…, 两个自定义路由包的用法与区别 (Root Custom vs… and 建议创建/修改的文件结构 (Recommended…, plus 2 more sections
  • Runs Go scripts from its folder; calls make and go

What it does

New API is an agent skill from Rain-kl/OpenFlare. Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files.

It sits in Backend & APIs, covering OpenAPI specifications. It works with OpenAPI and Cloudflare. The repository describes itself as: OpenFlare is an open-source CDN orchestration and edge security platform. It supports reverse proxy, centralized configuration synchronization, in-network tunneling (Tunnels)… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve OpenAPI specifications

Example prompts

  • “/new-api”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. 根路径自定义包:root/custom.go
  2. V1 API 自定义包:v1/custom.go

What it can do on your machine

Read from SKILL.md and the folder at commit 7483897. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Go), which the agent can run.

    Shell commands in SKILL.md call:

    • make
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

New API loads about 1.4k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 27 tokens; SKILL.md has 266 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~27
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Rain-kl/OpenFlare at commit 7483897, republished under its Apache-2.0 licence (© Rain-kl). 266 words, ~1,380 tokens.

Download SKILL.mdSave it as .claude/skills/new-api/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
new-api
description
Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。

新增业务 API 开发与路由注册规范

本技能是 Wavelet 项目接口开发与路由注册的唯一指导规范。在开发任何新接口前,请严格按照本指南进行架构决策与路由注册。


核心路由准则与防线 (Routing Governance & Guardrails)

Wavelet 后端路由采用了严格的框架层与业务层隔离机制。请牢记以下开发原则:

  1. 禁止修改框架级路由文件:
    • 以下文件属于系统框架/平台级接口,禁止为了添加自定义业务接口而进行任何修改:
      • internal/router/router.go(核心入口委派)
      • internal/router/root/default.go(公开文件服务、robots.txt、Swagger 及 /api/health 路由)
      • internal/router/root/frontend.go(前端静态服务)
      • internal/router/v1/v1.go(V1 分发层协调器)
      • internal/router/v1/admin.go(框架管理员端管理接口)
      • internal/router/v1/user.go(框架普通用户端基础接口、OAuth及公开接口)
  2. 仅允许在 custom.go 中注册业务接口:
    • 所有的自定义/业务相关接口注册,有且仅有以下两个合法的承载点:
      • internal/router/root/custom.go(用于挂载到根路径的特殊业务接口)
      • internal/router/v1/custom.go(用于挂载在 API V1 下的标准自定义业务接口)

路由归属判定表 (Where should I register my new API?)

根据接口的访问路径特征和访问身份/限制条件,决定将新开发的 API 挂载至何处:

目标 API 路径特征访问身份/条件限制对应的路由注册入口是否允许修改
/my-custom-path (挂载在根路径下的特殊业务接口)自定义控制root/custom.go 中的 RegisterCustomRootRoutes允许修改 (业务自定义入口)
/api/v1/custom/... (API v1 下的定制业务接口)自定义控制v1/custom.go 中的 RegisterCustomRoutes允许修改 (业务自定义入口)
/api/v1/admin/... (系统管理员管理端接口)需要管理员登录 (admin.LoginAdminRequired())v1/admin.go禁止修改 (仅限系统框架路由)
/api/v1/user/... (框架普通用户基础接口)需要普通用户登录 (oauth.LoginRequired())v1/user.go禁止修改 (仅限系统框架路由)
/api/v1/public/... (Captcha、Config 等系统公开接口)所有人 (无条件 / 公开)v1/user.go禁止修改 (仅限系统框架路由)
GET /f/:id, GET /robots.txt, GET /api/health (系统级默认及公开接口)所有人 (无条件 / 公开)root/default.go禁止修改 (仅限系统框架路由)

两个自定义路由包的用法与区别 (Root Custom vs V1 Custom)

1. 根路径自定义包:root/custom.go
  • 适用场景:适用于需要直接挂载在主域名根路径下的特殊自定义业务接口(如第三方 Webhook 回调、特定的短链接重定向、外部数据接口等,不需要 /api/v1 前缀)。
  • 用法示例: 在 root/custom.go 中实现:
    go
    package root
    
    import (
        "github.com/Rain-kl/Wavelet/internal/apps/custom"
        "github.com/gin-gonic/gin"
    )
    
    // RegisterCustomRootRoutes registers custom business routes that belong to the root path.
    func RegisterCustomRootRoutes(r *gin.Engine) {
        // 挂载到根路径下,如 GET /my-custom-webhook
        r.GET("/my-custom-webhook", custom.HandleRootWebhook)
    }
    (注:该函数已由 root.go 自动加载,你无需修改任何其他核心文件。)
2. V1 API 自定义包:v1/custom.go
  • 适用场景:适用于普通的自定义业务 API,需要规范挂载在标准 API V1 路径下(即自动带有 /api/v1/custom/... 前缀,可选择性配置用户/管理员登录中间件)。
  • 用法示例: 在 v1/custom.go 中实现:
    go
    package v1
    
    import (
        "github.com/Rain-kl/Wavelet/internal/apps/custom"
        "github.com/gin-gonic/gin"
    )
    
    // RegisterCustomRoutes registers standard custom API routes under /api/v1.
    func RegisterCustomRoutes(apiV1Router *gin.RouterGroup) {
        customRouter := apiV1Router.Group("/custom")
        {
            // 挂载到 /api/v1/custom 下,例如:POST /api/v1/custom/action
            customRouter.POST("/action", custom.DoActionHandler)
        }
    }
    (注:该函数已由 v1/v1.go 自动加载,你无需修改任何其他核心文件。)

当新增一套定制的业务接口(例如名为 custom 的业务模块)时,建议采用以下标准文件结构:

text
internal/
├── router/
│   ├── root/
│   │   └── custom.go           # [修改] 若为根路径 API,在此处注册,将路由委派给 apps/custom
│   └── v1/
│       └── custom.go           # [修改] 若为 v1 API,在此处注册,将路由委派给 apps/custom
└── apps/
    └── custom/
        ├── routers.go          # [新建] HTTP Handlers (Gin),负责参数绑定、校验与响应
        ├── logics.go           # [新建] 业务逻辑层:承载模块内闭环的纯 Go 业务逻辑,不依赖 gin.Context
        └── errs.go             # [新建] 存放模块特有的业务错误常量定义(可选)

核心开发步骤 (Step-by-Step Flow)

步骤 1:数据库定义与迁移

如果自定义功能涉及新表或字段,请参考 database-migration 技能,在 internal/infra/persistence/migrator/goose/ 目录下编写迁移文件,在 internal/model/ 中定义 GORM 实体(无 CRUD / 无 DB 访问),并在 internal/repository/ 中实现数据访问(repository 为唯一持久化入口)。

步骤 2:在模块内实现业务逻辑 (logics.go / service.go)

业务逻辑逻辑应当实现于 internal/apps/custom/ 目录下:

  • 优先使用纯函数(logics.go):定义接收 context.Context 且不依赖 *gin.Context 的函数,易于单元测试与 Worker 复用。参考 internal/apps/user/logics.go。
  • 有状态服务(service.go):若需注入依赖(如 DB 连接、外部客户端等),可定义 Service 结构体和构造函数。
  • 跨模块副作用(推送、任务监听等):核心业务代码通过 internal/listener 发射域事件,禁止直接 import push 模块;装配在 internal/platform/bootstrap 完成(参见 push-notification skill)。
步骤 3:编写 HTTP Handler (routers.go)

在 internal/apps/custom/routers.go 中编写 Handler:

  • 负责请求参数绑定与校验(使用 ShouldBindJSON/ShouldBindQuery)。
  • 负责提取 Session / 用户身份。
  • 调用业务逻辑层,并使用 github.com/Rain-kl/Wavelet/internal/shared/response 统一返回响应:
    • 成功时返回:response.OK(data) 或 response.OKNil()
    • 失败时返回:response.Err(msg)
  • 编写规范的 Swagger 注释。
步骤 4:在自定义包中注册路由并委派

根据 路由归属判定表,在 root/custom.go 或 v1/custom.go 中编写注册代码,将路由路径绑定到步骤 3 中编写的 Handler。


质量验证门禁 (Quality Gates)

每次新增或修改接口后,必须运行并验证以下各项:

  1. 自动授权许可:make license(新增 Go 文件时自动添加许可头)
  2. 重新生成 Swagger 文档:make swagger(若有 Swagger 注释修改)
  3. 静态代码及风格检查:make code-check(确保通过 golangci-lint 和前端 TS 检查)
  4. 自动化单元测试:go test ./...(确保所有测试 100% 通过)

© Rain-kl, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in .agents/skills/new-api of Rain-kl/OpenFlare.

  • SKILL.md
  • references/handler_example.go
  • references/logics_example.go
  • references/service_example.go

Open the folder on GitHubat commit 7483897

Compare with similar skills

New API next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

New API compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New API this skillRain-kl/OpenFlare288—~1.4kAutomated safety check: PassApache-2.0
Distilled SDKalchemy-run/distilled431—~6kAutomated safety check: PassApache-2.0
ToolJet Marketplace Plugin BuilderToolJet/ToolJet41k—~2.1kAutomated safety check: PassAGPL-3.0
Step Partsearthtojake/text-to-cad18k1 repos~1.5kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0

Similar skills

  • Distilled SDK

    alchemy-run/distilled

    Build or update a distilled SDK for an API provider — sourcing its OpenAPI/Smithy/GraphQL/discovery description, adding the spec mirror that feeds it, generating packages/<provider, listing it on…

    431 GitHub stars~6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Turns an API description, such as an OpenAPI file or a Postman collection, into a connector plugin for ToolJet's marketplace and checks it with the repo's validator.

    41k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Step Parts

    earthtojake/text-to-cad

    Find, evaluate, and download common purchasable CAD parts from step.parts, including named off-the-shelf actuators, servos, motors, electronics boards, connectors, screws, bolts, nuts, washers…

    18k GitHub starsUsed in 1 repo~1.5k tokens
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated today
    Backend & APIsAuto-check passed

More from Rain-kl/OpenFlare

All 12 skills in this repo
  • Code Review Skill

    Rain-kl/OpenFlare

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, PHP, Python, Django, Go, C/.NET, Kotlin, Swift, NestJS, C/C++, and more.

    288 GitHub stars~2.3k tokensUpdated today
    Auto-check: notes
  • Go Logging

    Rain-kl/OpenFlare

    在选择日志方案、配置 slog、编写结构化日志语句或决定日志级别时使用。也适用于设置生产日志、为日志添加请求作用域上下文或从 log 迁移到 slog 的场景,即使用户未明确提及日志。不涵盖错误处理策略(参见 go-error-handling)。

    288 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Cache Framework

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改业务缓存(RAM/Redis/DB 三层读路径)、缓存失效、多节点 pub/sub 同步、或评估高频读是否应接入缓存时必须使用。本技能说明系统标准缓存框架、参考实现、禁止写法与分布式一致性要求。

    288 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Clickhouse Batchwriter

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API…

    288 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Database Migration

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…

    288 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • File Upload

    Rain-kl/OpenFlare

    Wavelet 项目专用:当业务需要上传文件、读取已上传文件、在 Worker/任务中程序化摄取字节流、选择存储引擎能力、或排查 wuploads / 文件统计异常时必须使用。本技能指导 storage 与 upload 分层、upload.Ingest 策略选型、前后端接入与禁止旁路写表。

    288 GitHub stars~1.7k tokensUpdated today
    Auto-check passed

Categories

Questions about New API

What does New API do?

Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。. New API is an agent skill from Rain-kl/OpenFlare.

When should I use New API?

New API fits situations like: tasks that involve OpenAPI specifications.

How do I install New API in Claude Code?

Run `npx skills add Rain-kl/OpenFlare --skill new-api -a claude-code`. Or copy the skill folder (.agents/skills/new-api in Rain-kl/OpenFlare) into .claude/skills/new-api in your project. Claude Code loads it when a task matches its description.

How do I install New API in Codex?

Run `npx skills add Rain-kl/OpenFlare --skill new-api -a codex`. Or copy the skill folder (.agents/skills/new-api in Rain-kl/OpenFlare) into .agents/skills/new-api in your project. Codex loads it when a task matches its description.

Can I use New API in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Rain-kl/OpenFlare --skill new-api -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-api, .gemini/skills/new-api, .github/skills/new-api and .opencode/skills/new-api in your project.

What does New API need to run?

Going by SKILL.md and its folder, New API needs Go for the scripts in its folder and the command-line tools its instructions call (make and go).

Does New API access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is New API safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does New API use?

New API is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does New API use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to New API?

Skills that share tags, products or a category with New API: Distilled SDK (alchemy-run/distilled, 431 stars), ToolJet Marketplace Plugin Builder (ToolJet/ToolJet, 41k stars), Step Parts (earthtojake/text-to-cad, 18k stars) and API Designer (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New API?

Rain-kl (a GitHub user) maintains it in Rain-kl/OpenFlare, which has 288 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 7, 2026.

Source: Rain-kl/OpenFlare on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.