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 devjourney/unifi-mcp. It costs 219 tokens per session (2,158 once invoked), scanned A, a copy of myco:api-endpoint-serializer-authoring, MIT.

Repository instructions for adding REST API endpoints and serializers in the unifi-mcp project. They define how to classify endpoints, paginate results, connect managers, and satisfy routing and validation checks.

In plain words
What is it for?
Use them when adding resource or action endpoints under apps/api, creating mutation responses, wiring ManagerFactory, or diagnosing the named CI checks.
Why use it?
They reduce errors such as returning the wrong status for unavailable capabilities, using unstable page-number pagination, or importing from the wrong package.

Skill for Claude Code

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

This is devjourney/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 devjourney/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/devjourney/unifi-mcp/main/.agents/skills/api-endpoint-serializer-authoring/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/devjourney/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/devjourney/unifi-mcp/api-endpoint-serializer-authoring/github.svg)](https://agentmods.dev/skills/devjourney/unifi-mcp/api-endpoint-serializer-authoring)
Your own site
<a href="https://agentmods.dev/skills/devjourney/unifi-mcp/api-endpoint-serializer-authoring"><img src="https://agentmods.dev/badge/skills/devjourney/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/devjourney/unifi-mcp/api-endpoint-serializer-authoring"><img src="https://agentmods.dev/badge/skills/devjourney/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.
Origin 100% copy Near-identical to another mod 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 8d ago against content hash 49a54b91ab72, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 8d 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

This is a copy

100% identical to myco:api-endpoint-serializer-authoring — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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

How it starts

The opening of the file, as written. The whole thing — 243 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 · 243 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. 8d ago First seen · 243 lines · 219 tokens per session scan A 49a54b91ab72

Subscribe to this mod's changes

myco:api-endpoint-serializer-authoring is a skill published in the GitHub repository devjourney/unifi-mcp (0 stars, last pushed 1mo ago), 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. It is 100% identical to myco:api-endpoint-serializer-authoring, differing in 3 lines, and is treated as a copy.

Related

Other skills, from other repositories

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

api-rate-limit-handler

Implement bounded, idempotency-aware API throttling, backoff, and retry handling for 429 and transient 5xx responses.

sickn33/agentic-awesome-skills · 32 tokens