api-first

api-first is a command for Claude Code from samqin123/Claude_skill_pool. It costs 34 tokens per session (355 once invoked), scanned A, original, Apache-2.0.

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

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

Good fit 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.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/samqin123/claude_skill_pool/api-first
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.

Clone the repo
git clone --depth 1 https://github.com/samqin123/Claude_skill_pool

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/samqin123/claude_skill_pool/api-first/github.svg)](https://agentmods.dev/commands/samqin123/claude_skill_pool/api-first)
Your own site
<a href="https://agentmods.dev/commands/samqin123/claude_skill_pool/api-first"><img src="https://agentmods.dev/badge/commands/samqin123/claude_skill_pool/api-first/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 api-first

Your own site · 80×15
<a href="https://agentmods.dev/commands/samqin123/claude_skill_pool/api-first"><img src="https://agentmods.dev/badge/commands/samqin123/claude_skill_pool/api-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00034 $0.00355
Opus 5.5 $0.00014 $0.00142
Sonnet 5.5 $0.00007 $0.00071
Haiku 4.5 $0.00003 $0.00036

Measured 1mo ago against content hash a988302d2e0d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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. 1mo 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 8mo ago), licensed Apache-2.0. It adds 34 tokens to every session and 355 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-31.