api-lifecycle

api-lifecycle is a skill for Claude Code from doancan/mags. It costs 58 tokens per session (3,015 once invoked), scanned A, original, MIT.

A set of rules for designing and maintaining application programming interfaces, the defined ways that software communicates. It covers resource-based routes, repeated-request safety, pagination, versioning, deprecation, rate limits, and documentation.

In plain words
What is it for?
Use it when designing REST or GraphQL APIs, planning breaking changes, adding rate limits, documenting endpoints, or retiring old versions.
Why use it?
It gives teams consistent decisions for changing an API without unexpectedly breaking clients or creating unsafe, hard-to-use endpoints.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the mags plugin — 17 skills, 2 agents shipped together

Good fit Use it when designing REST or GraphQL APIs, planning breaking changes, adding rate limits, documenting endpoints, or retiring old versions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/doancan/mags/api-lifecycle
View source ↗ doancan/mags
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.

Any agent
npx skills add doancan/mags --skill api-lifecycle
Clone the repo
git clone --depth 1 https://github.com/doancan/mags

Made for: Claude Code.

Or install mags, the plugin that ships this one along with the rest of its 17 skills, 2 agents.

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-lifecycle

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/doancan/mags/api-lifecycle"><img src="https://agentmods.dev/badge/skills/doancan/mags/api-lifecycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,015 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.00058 $0.03015
Opus 5.5 $0.00023 $0.01206
Sonnet 5.5 $0.00012 $0.00603
Haiku 4.5 $0.00006 $0.00301

Measured 1mo ago against content hash 52d0939dbb5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-lifecycle 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.

skills/api-lifecycle/SKILL.md · 203 lines

How it starts

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

API Lifecycle

API Design Principles

  • Resource-oriented design: Model APIs around resources (nouns), not actions (verbs). Use GET /orders/123 not GET /getOrder?id=123. Nest sub-resources logically: GET /users/123/orders. Keep nesting to a maximum of two levels.
  • Idempotency: GET, PUT, and DELETE must be idempotent. Repeated calls produce the same result. For POST (create) operations, support client-provided idempotency keys (Idempotency-Key header) to prevent duplicate resource creation on retries.
  • Stateless requests: Every request must contain all information needed to process it. Do not store client session state on the server between requests. Use tokens (JWT, opaque) for authentication context.
  • Pagination: Always paginate list endpoints. Choose the appropriate strategy:
    • Cursor-based (recommended): Use an opaque cursor token. Best for real-time data, large datasets, and when items can be inserted/deleted between pages. Return next_cursor in the response.
    • Offset-based: Use ?offset=20&limit=10. Simpler to implement but has consistency issues with changing datasets. Acceptable for admin UIs and static data.
    • Always include total_count (or indicate if more pages exist), next link, and the current page size in the response.
  • Consistent naming: Use snake_case for JSON fields (created_at, not createdAt). Use plural nouns for collection endpoints (/users, not /user). Use kebab-case for URL paths (/order-items, not /orderItems). Be consistent across the entire API.
  • HTTP methods and status codes: Use methods correctly: GET (read), POST (create), PUT (full replace), PATCH (partial update), DELETE (remove). Return appropriate status codes: 200 (success), 201 (created), 204 (no content), 400 (bad request), 401 (unauthorized), 403 (forbidden), 404 (not found), 409 (conflict), 422 (unprocessable entity), 429 (rate limited), 500 (server error).

Versioning Strategies

Strategy Format Pros Cons Best For
URL path /v1/users, /v2/users Explicit, easy to route, easy to document, cacheable URL pollution, clients must update all URLs Public APIs, APIs with infrequent breaking changes
Header Accept: application/vnd.api+json;version=2 Clean URLs, version is metadata not resource identity Harder to test in browser, less discoverable Internal APIs, APIs with frequent version changes
Query parameter /users?version=2 Easy to add, backward-compatible Breaks caching, pollutes query string, easy to forget Quick prototyping, transitional use only

Read the full file on GitHub · 203 lines

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 · 203 lines · 58 tokens per session scan A 52d0939dbb5a

Subscribe to this mod's changes

api-lifecycle is a skill published in the GitHub repository doancan/mags (3 stars, last pushed 8mo ago), licensed MIT. It adds 58 tokens to every session and 3,015 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

sanity-singletons

Configure singleton documents in a Sanity Studio using the document.singletons registry. Use when a developer wants a fixed-id document (settings, navigation, footer) edited in place, hidden from the default content list, with no "create new" or "duplicate" affordances — or when migrating a userland singleton…

sanity-io/agent-toolkit · 90 tokens

sanity-best-practices

Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints, and framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, the App SDK, and Studios…

sanity-io/agent-toolkit · 177 tokens

sanity-migration

Plans, implements, and reviews migrations from other CMSes and content systems into Sanity. Use when migrating or replatforming to Sanity from AEM, Adobe Experience Manager, Contentful, Strapi, Webflow, WordPress, Payload, Drupal, Markdown/MDX/frontmatter files, WXR/XML exports, CMS APIs, database dumps, static HTML…

sanity-io/agent-toolkit · 102 tokens

content-modeling-best-practices

Structured content modeling guidance for schema design, content architecture, content reuse, references versus embedded objects, separation of concerns, and taxonomies across Sanity and other headless CMSes. Use this skill when designing or refactoring content types, deciding field shapes, debating reusable versus…

sanity-io/agent-toolkit · 84 tokens

webhooks

Webhook subscriptions for the Ayrshare MCP server: register, unregister, and list HTTPS push notifications so an agent or app is notified on events instead of polling. Use whenever someone wants event push: "notify me when a post publishes", "let me know when a scheduled post goes out", "set up a webhook for new…

ayrshare/ayrshare-social-media-api-claude-plugin · 205 tokens

n8n-subworkflows

Build reusable, composable n8n sub-workflows. Use when extracting shared logic, building anything multi-step or reused across workflows, or any workflow over 10 nodes — and whenever the user mentions sub-workflows, Execute Workflow, reuse, shared/common logic, modular workflows, "Define Below" inputs…

czlonkowski/n8n-mcp · 121 tokens