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.
git clone --depth 1 https://github.com/samqin123/Claude_skill_poolWrote 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.
[](https://agentmods.dev/rules/samqin123/claude_skill_pool/api-first-development)<a href="https://agentmods.dev/rules/samqin123/claude_skill_pool/api-first-development"><img src="https://agentmods.dev/badge/rules/samqin123/claude_skill_pool/api-first-development/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.
<a href="https://agentmods.dev/rules/samqin123/claude_skill_pool/api-first-development"><img src="https://agentmods.dev/badge/rules/samqin123/claude_skill_pool/api-first-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00024 | $0.01318 |
| Opus 5.5 | $0.00010 | $0.00527 |
| Sonnet 5.5 | $0.00005 | $0.00264 |
| Haiku 4.5 | $0.00002 | $0.00132 |
Grade B, and why
api-first-development scanned grade B with 2 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 3mo 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.
Sends data to an external URLmediumData exfiltration
A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.
curl -X POST .../api/v1/xxx -H "Content-Type: application/json" -d '{...}' Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -X POST .../api/v1/xxx -H "Content-Type: application/json" -d '{...}' How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API-First 模块化开发框架
当项目涉及前后端分离、全栈开发、或任何需要多层协作的场景时,本规则自动生效。
核心架构:三层分离
前端层(Frontend) 中间层(Glue/BFF) 后端API包(Backend)
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ 页面 & 组件 │ ←API→ │ 跨API编排 │ ←API→ │ 独立业务模块 │
│ 只调API+渲染 │ │ 数据聚合适配 │ │ 内聚逻辑封装 │
│ 不含业务逻辑 │ │ 耦合逻辑处理 │ │ 对外只暴露API │
└──────────────┘ └──────────────┘ └──────────────┘
后端 API 包标准开发流程
每个后端功能必须走完以下闭环:
开发(Implement) → Checkfix(Lint/Build) → 封装(Module/Class) → API暴露(Endpoint) → API文档(Doc)
- 一个 API 包只做一件事,对外只暴露 API 端点
- 完成开发后必须执行 Checkfix 闭环(参考 code-debugger 技术栈检查表)
- 封装为独立模块后暴露 REST/GraphQL/RPC 端点
- 必须生成 API 文档(见下方模板),前端开发者仅依据此文档调用
API 文档标准模板
每个 API 包完成后,在 docs/api/ 或模块目录下生成:
# [模块名] API 文档
## 端点概览
| 方法 | 路径 | 功能 | 认证 |
|------|------|------|------|
| POST | /api/v1/xxx | 描述 | Bearer Token |
## 详细接口
### [接口名称]
- **路径**: `POST /api/v1/xxx`
- **描述**: 功能说明
**请求参数**:
| 参数 | 位置 | 类型 | 必填 | 说明 |
|------|------|------|------|------|
| field | body | string | 是 | 描述 |
**响应格式**:
成功 (200):
```json
{ "code": 0, "data": { ... }, "message": "success" }
失败 (4xx/5xx):
{ "code": 错误码, "data": null, "message": "错误描述" }
错误码:
| 错误码 | 含义 | 处理建议 |
|---|
调用示例:
curl -X POST .../api/v1/xxx -H "Content-Type: application/json" -d '{...}'
## 前端开发规范
- 前端只负责:页面渲染 + 调用后端 API + 用户交互
- 业务逻辑全部在后端 API 包内,前端不重复实现
- 依据 API 文档开发,可与后端并行
## 中间层/全栈规范
- 只处理多个 API 包之间的编排和聚合
- 只处理前端特殊需求的数据适配(BFF 模式)
- 不重复实现后端已有的业务逻辑
## 跨层任务自动分解协议
当收到涉及多个层级的开发/debug 需求时(如"增加 SSE 流式输出"),必须按以下协议分解:
### Step 1: 层级识别
判断任务涉及哪些层:后端?前端?中间层?
### Step 2: 按 API 边界拆分子任务
子任务 1 [后端]: 开发 API 包(开发→Checkfix→封装→API端点→API文档) 子任务 2 [API文档]: 确保 API 契约清晰(请求/响应/错误码/示例) 子任务 3 [前端]: 依据 API 文档实现页面功能 子任务 4 [集成]: 验证前后端契约一致性
### Step 3: 严格按序执行
后端 API 包先行 → API 文档产出 → 前端/中间层消费 → 集成验证
## Debug 边界规则
| Bug 表现 | 归属层 | Debug 范围 | 禁止行为 |
|----------|--------|-----------|----------|
| API 返回错误数据 | 后端 | 只查 API 包内部逻辑 | 不改前端来"绕过" |
| 页面不显示/显示异常 | 前端 | 只查页面逻辑+API调用参数 | 不改后端API契约来迁就 |
| 多API协作异常 | 中间层 | 查编排逻辑+各API契约一致性 | 不进入单个API包内部改逻辑 |
| 前后端数据不匹配 | 集成 | 对照API文档检查契约一致性 | 先确定谁违反了契约再改 |
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.
- 3mo ago First seen · 124 lines · 24 tokens per session scan B 449638f5e067
api-first-development is a cursor rule published in the GitHub repository samqin123/Claude_skill_pool (2 stars, last pushed 22d ago), licensed Apache-2.0. It adds 24 tokens to every session and 1,318 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
api-first-development compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| api-first-developmentsamqin123/Claude_skill_pool | Cursor rule | 2 | 22d ago | Apache-2.0 | B | 24 | Cursor |
| djangosanjeed5/awesome-cursor-rules-mdc | Cursor rule | 3.6k | 11d ago | CC0-1.0 | A | 2,043 | Cursor |
| api-property-optionality-hygienenovuhq/novu | Cursor rule | 40k | today | none | A | 0 | Cursor |
| cursormrwogu/promptscript | Cursor rule | 326 | 4d ago | MIT | A | 53 | Cursor |
| pythonPatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 734 | Cursor |
| gosupertokens/create-supertokens-app | Cursor rule | 24 | 8d ago | Apache-2.0 | A | 0 | Cursor |
| ehs-ims-conventionsSafetyMP/Autonomous-EHS-Management | Cursor rule | 9 | 5d ago | Apache-2.0 | A | 722 | Cursor |