unifi-mcp: Skill for Claude Code

.agents/skills/api-endpoint-serializer-authoring/SKILL.md

myco:api-endpoint-serializer-authoring is a skill for Claude Code from sirkirby/unifi-mcp. It costs 219 tokens per session (2,158 once invoked), scanned A, original, MIT.

A project-specific guide for adding API endpoints and serializers in the apps/api/ application. It explains how to classify endpoints, paginate results, connect managers, and satisfy routing and validation checks.

In plain words
What is it for?
Use it when adding resource or action endpoints, implementing cursor-based pagination, creating mutation acknowledgements, wiring ManagerFactory, or fixing the named CI checks.
Why use it?
It helps developers follow this project's API rules, including the different responses expected for resource and action endpoints. It also prevents unwanted dependencies on unrelated protocol code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is sirkirby/unifi-mcp's own configuration. It tells Claude Code how to work on unifi-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything unifi-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sirkirby/unifi-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sirkirby/unifi-mcp/main/.agents/skills/api-endpoint-serializer-authoring/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sirkirby/unifi-mcp

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 myco:api-endpoint-serializer-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/sirkirby/unifi-mcp/api-endpoint-serializer-authoring/github.svg)](https://agentmods.dev/skills/sirkirby/unifi-mcp/api-endpoint-serializer-authoring)
Your own site
<a href="https://agentmods.dev/skills/sirkirby/unifi-mcp/api-endpoint-serializer-authoring"><img src="https://agentmods.dev/badge/skills/sirkirby/unifi-mcp/api-endpoint-serializer-authoring/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 myco:api-endpoint-serializer-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/sirkirby/unifi-mcp/api-endpoint-serializer-authoring"><img src="https://agentmods.dev/badge/skills/sirkirby/unifi-mcp/api-endpoint-serializer-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 219 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,158 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00219 $0.02158
Opus 5 $0.00110 $0.01079
Sonnet 5 $0.00044 $0.00432
Haiku 4.5 $0.00022 $0.00216

Measured 12d ago against content hash 842d44e7d0f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

myco:api-endpoint-serializer-authoring 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 12d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/api-endpoint-serializer-authoring/SKILL.md · 246 lines

How it starts

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

API Endpoint and Serializer Authoring (apps/api)

A. Adding a Resource or Action Endpoint

1. Classify the endpoint type

  • Resource endpoint (GET /v1/sites/{id}/cameras): implies the resource exists; return HTTP 409 when the required product is absent.
  • Action endpoint: advisory; always return HTTP 200 with a capability_not_available envelope when the capability is missing — never 404 or 409 for action endpoints.

2. Wire cursor-based pagination

Use Cursor and paginate() from apps/api/src/unifi_api/services/pagination.py:

from unifi_api.services.pagination import Cursor, InvalidCursor, paginate

cursor = Cursor.decode(cursor_str) if cursor_str else None
page, next_cursor = paginate(items, cursor=cursor, limit=limit, key_fn=key_fn)
  • Cursor encodes {last_id, last_ts} as Base64 — survives new inserts; offset/page-number pagination does not.
  • Default limit 50, max 200. Expose cursor as an opaque query-string param.

3. Apply the dependency rule

apps/api/ MUST only import from unifi-core. Never import unifi-mcp-shared inside apps/api/ — it couples the REST server to MCP protocol concerns.

4. Wire ManagerFactory

ManagerFactory lives in apps/api/src/unifi_api/services/managers.py. It caches one manager per (controller_id, product) pair behind asyncio locks:

manager = await factory.get_connection_manager(session, controller_id, product)
  • product_kinds in the DB row is a comma-separated string. The factory splits it and raises UnknownProduct if the product isn't listed — so set product_kinds accurately when registering a controller.
  • Each concurrency scope (request) shares the cached manager instance; no per-request teardown.

B. Phase 5A Advanced Routing Patterns

Capability-aware dispatch

When two products expose identically-named endpoint families (e.g., both Network and Protect expose /events), dispatch at request time by consulting controller.product_kinds. Route to the correct manager based on which products are active — avoids collisions without duplicate routes.

Read the full file on GitHub · 246 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. 12d ago First seen · 246 lines · 219 tokens per session scan A 842d44e7d0f3

Subscribe to this mod's changes

myco:api-endpoint-serializer-authoring is a skill published in the GitHub repository sirkirby/unifi-mcp (809 stars, last pushed yesterday), licensed MIT. It adds 219 tokens to every session and 2,158 once invoked, about $0.0011 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-30.

Related

Other skills, from other repositories

pipefy-api-fallback

Use this skill when an MCP tool fails AND the introspection skill could not resolve the problem. This is the last-resort fallback (Tier 3): call the Pipefy GraphQL API directly using curl or httpx, authenticating with the Service Account (OAuth2) or a Personal Access Token (PAT) available as env var. Follow the 3-tier…

pipefy/ai-toolkit · 86 tokens

express-docs

Comprehensive Express.js reference covering getting started, routing, middleware, error handling, the Application/Request/Response/Router API objects, template engines, debugging, database integration, security, performance, production patterns, and migration guides. Use whenever the user mentions Express, Express.js…

pledgeandgrow/pledge-skills · 80 tokens

api

FastAPI + async/sync HTTP client patterns, JWT auth, multi-provider routing, Pydantic request/response models, CORS, background tasks, and typed frontend API clients — synthesized from lead-gen-engine and seo-geo-aeo-engine.

LuuOW/meridian-mcp · 51 tokens

api-design-principles

Master REST API design principles to build intuitive, scalable, and maintainable APIs. Use when designing new APIs, reviewing API specifications, or establishing API design standards.

thapaliyabikendra/ai-artifacts · 38 tokens

api-design

Design and implement RESTful APIs with proper routing, validation, error handling, and documentation. Use when building new API endpoints, designing API architecture, or improving existing APIs.

asgarovf/locusai · 37 tokens

api-docs-generator

Generate API documentation from code - produce OpenAPI/Swagger specs, Markdown API references, request/response examples, and interactive documentation from source code analysis.

chainlesschain/chainlesschain · 34 tokens