api-first

An API-first development workflow that treats the backend as a separate API package and has the frontend use documented API endpoints. API endpoints are agreed interfaces through which software exchanges data.

In plain words
What is it for?
Use it to build backend APIs, implement frontend features against API documentation, split cross-layer work, and debug whether a problem belongs to the backend, frontend, or their contract.
Why use it?
It keeps frontend and backend work separated and makes their boundary explicit, reducing fixes that bypass or blur that boundary.

Command for Claude Code

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 commands/samqin123/claude_skill_pool/api-first
Clone the repo
git clone --depth 1 https://github.com/samqin123/Claude_skill_pool

Made for: Claude Code.

Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 355 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00034 $0.00355
Opus 5 $0.00017 $0.00178
Sonnet 5 $0.00007 $0.00071
Haiku 4.5 $0.00003 $0.00036

Measured 2d ago against content hash a988302d2e0d, 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 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 2d 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.

package/full-dev-脚手架/.claude/commands/api-first.md · 34 lines

What it actually says

你现在激活了 API-First 模块化开发框架

请先阅读 .claude/skills/api-first-modular.md 获取完整的方法论和工作流程。

快速指引

根据用户的需求类型,按以下方式工作:

1. 纯后端开发

走后端 API 包 5 步闭环:开发 → Checkfix → 封装 → API端点 → API文档

2. 纯前端开发

确认 API 文档已就绪,然后依据文档实现页面和 API 调用。如果 API 文档缺失,先要求补全。

3. 跨层开发/调试(最常见)

执行「跨层任务自动分解协议」:

  1. 层级识别 — 判断涉及哪些层(后端/前端/中间层)
  2. API边界拆分 — 按 API 包粒度拆为有序子任务
  3. 严格按序执行 — 后端先行 → API文档 → 前端消费 → 集成验证

4. Debug 任务

执行「Debug 边界规则」:

  1. 先判断问题归属层 — 后端API包内部?前端?中间层?契约不一致?
  2. 只在对应层内定位和修复
  3. 禁止跨层"绕过"修复

用户需求

$ARGUMENTS

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. 2d ago First seen · 34 lines · 34 tokens per session scan A a988302d2e0d

Subscribe to this mod's changes

api-first is a command published in the GitHub repository samqin123/Claude_skill_pool (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 34 tokens to every session and 355 once invoked, about $0.0002 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-31.