api-first-modular

api-first-modular is a skill for Claude Code, Codex from samqin123/Claude_skill_pool. It costs 127 tokens per session (2,550 once invoked), scanned A, original, Apache-2.0.

An API-first development framework that separates a project into frontend pages, coordinating code, and independent backend API packages. An API is a defined way for one part of a program to request data or actions from another.

In plain words
What is it for?
Use it to build backend features, frontend pages, cross-layer changes, and bug fixes with documented boundaries between the parts.
Why use it?
It prevents frontend code from containing backend business rules or accessing the database directly. It also gives developers a way to decide which layer owns a task or bug.

Skill for Claude CodeCodex

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 skills/samqin123/claude_skill_pool/api-first-modular
Any agent
npx skills add samqin123/Claude_skill_pool --skill api-first-modular
Clone the repo
git clone --depth 1 https://github.com/samqin123/Claude_skill_pool

Made for: Claude Code, Codex.

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 api-first-modular

README.md
[![agentmods](https://agentmods.dev/badge/skills/samqin123/claude_skill_pool/api-first-modular.svg)](https://agentmods.dev/skills/samqin123/claude_skill_pool/api-first-modular)
Your own site
<a href="https://agentmods.dev/skills/samqin123/claude_skill_pool/api-first-modular"><img src="https://agentmods.dev/badge/skills/samqin123/claude_skill_pool/api-first-modular.svg" alt="Measured on agentmods" height="20"></a>
Per session 127 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,550 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00127 $0.02550
Opus 5 $0.00063 $0.01275
Sonnet 5 $0.00025 $0.00510
Haiku 4.5 $0.00013 $0.00255

Measured 3d ago against content hash 3024dce81188, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-first-modular scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

[curl 示例]
package/full-dev-脚手架/.codex/skills/api-first-modular/SKILL.md · 240 lines

How it starts

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

API-First 模块化开发框架

后端每个功能 = 一个独立 API 包。前端只调 API + 渲染页面。全栈只做多个 API 包之间的编排。

这是强制约束,所有涉及前后端的开发和调试任务都必须遵循。


三层架构模型

┌─────────────────────────────────────────────────────────────────┐
│  ┌──────────────┐   ┌──────────────┐   ┌──────────────┐       │
│  │  前端层       │   │  中间层/BFF  │   │  后端API包    │       │
│  │  Frontend    │◄─►│  Glue / BFF  │◄─►│  Backend     │       │
│  │              │   │              │   │              │       │
│  │ 职责:        │   │ 职责:        │   │ 职责:        │       │
│  │ • 页面渲染   │   │ • 跨API编排  │   │ • 业务逻辑   │       │
│  │ • 用户交互   │   │ • 数据聚合   │   │ • 数据处理   │       │
│  │ • API调用    │   │ • 适配转换   │   │ • API暴露    │       │
│  │ • 状态管理   │   │ • 鉴权中继   │   │ • API文档    │       │
│  │              │   │              │   │              │       │
│  │ 禁止:        │   │ 禁止:        │   │ 禁止:        │       │
│  │ • 业务逻辑   │   │ • 重复后端   │   │ • 关心前端   │       │
│  │ • 直连数据库 │   │   已有逻辑   │   │   如何渲染   │       │
│  └──────────────┘   └──────────────┘   └──────────────┘       │
└─────────────────────────────────────────────────────────────────┘

层级判断规则

如果任务涉及… 归属层 处理方式
页面布局、组件、样式、用户交互 前端 前端开发
数据库操作、算法、业务规则 后端API包 后端开发
多个API的组合调用、数据聚合 中间层 全栈开发
前后端数据格式不匹配 集成问题 先查API文档契约

后端 API 包标准开发流程(5 步闭环)

每个后端功能必须走完以下 5 步

开发 ──► Checkfix ──► 封装 ──► API端点 ──► API文档
  1. 开发 (Implement) — 实现核心业务逻辑,编写单元测试,遵循单一职责
  2. Checkfix 闭环 — 执行技术栈对应的 lint/build 检查,失败则修复并复跑直至通过
  3. 封装 (Encapsulate) — 封装为独立模块/类/包,明确输入输出接口,隐藏内部实现
  4. API 暴露 (Expose) — 创建 API 端点(REST/GraphQL/RPC/WebSocket/SSE),统一响应格式,添加输入验证、错误处理、鉴权
  5. API 文档 (Document) — 按标准模板生成文档,文档是前端开发的唯一依据,必须与代码同步

API 文档标准模板

每个 API 包完成后,在 docs/api/ 或模块目录下生成:

# [模块名] API 文档

> 最后更新: [YYYY-MM-DD] | 版本: v1.0

## 概览
[模块的业务功能简介,1-2 句话]

## Base URL
`/api/v1/[module-name]`

## 认证方式
[Bearer Token / API Key / Session / 无认证]

## 端点列表
| 方法 | 路径 | 功能 | 认证 |
|------|------|------|------|

## 详细接口

### [接口名称]
- **路径**: `[METHOD] /api/v1/xxx`
- **功能**: [功能描述]
- **认证**: [是/否]

#### 请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|

#### 响应格式
**成功 (200)**:
{ "code": 0, "data": {...}, "message": "success" }

**失败 (4xx/5xx)**:
{ "code": 40001, "data": null, "message": "参数错误:field1 不能为空" }

#### 错误码
| 错误码 | HTTP状态码 | 含义 | 处理建议 |
|--------|-----------|------|----------|

#### 调用示例
[curl 示例]

## 特殊协议
[WebSocket / SSE / 长轮询等非标准协议的连接方式、事件格式、重连策略]

Read the full file on GitHub · 240 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 240 lines · 127 tokens per session scan A 3024dce81188

Subscribe to this mod's changes

api-first-modular is a skill published in the GitHub repository samqin123/Claude_skill_pool (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 127 tokens to every session and 2,550 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens