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.
npx skills add doancan/mags --skill api-lifecyclegit clone --depth 1 https://github.com/doancan/magsWrote 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/skills/doancan/mags/api-lifecycle)<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.
<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>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.00058 | $0.03015 |
| Opus 5.5 | $0.00023 | $0.01206 |
| Sonnet 5.5 | $0.00012 | $0.00603 |
| Haiku 4.5 | $0.00006 | $0.00301 |
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.
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/123notGET /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-Keyheader) 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_cursorin 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),nextlink, and the current page size in the response.
- 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
- Consistent naming: Use snake_case for JSON fields (
created_at, notcreatedAt). 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 |
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.
- 1mo ago First seen · 203 lines · 58 tokens per session scan A 52d0939dbb5a
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.
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-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-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…
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…
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…
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…