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 agentmods add skills/membrane/api-gateway/optimize-interceptor-docsnpx skills add membrane/api-gateway --skill optimize-interceptor-docsgit clone --depth 1 https://github.com/membrane/api-gatewayWhat 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 | $0.00173 | $0.02244 |
| Opus 5 | $0.00086 | $0.01122 |
| Sonnet 5 | $0.00035 | $0.00449 |
| Haiku 4.5 | $0.00017 | $0.00224 |
Grade A, and why
optimize-interceptor-docs 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 yesterday.
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 — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Optimize Interceptor Documentation
Membrane's reference pages (https://www.membrane-api.io/docs/) are generated from the Java source, not hand-written. The element name, attribute table, child cardinalities and "required" flags are derived from the @MCElement / @MCAttribute / @MCChildElement annotations and the JSON schema. The prose and the example come from Javadoc tags. So "writing docs" here means rewriting Javadoc — and getting it right depends on knowing exactly what the renderer consumes and what it rejects.
Goal: a page that reads like a precise reference entry — a one-glance summary, exact behaviour, one runnable YAML example, and a compact syntax sketch. Short but complete. No XML examples.
Workflow
- Read the class and pull facts from code — never invent. Identify:
@MCElement(name=...)→ the element name used in YAML.- every
@MCAttributesetter → an attribute (default from the field initializer or@default; type from the setter param; enum values from the enum type). - every
@MCChildElementsetter → a child element / list (cardinality fromList<…>vs single, order fromorder=). handleRequest/init→ real behaviour worth documenting: status codes, side effects (what it adds to theExchange), what happens on the failure path, defaults applied when config is omitted.- which flows it actually acts in — check
getAppliedFlow()and which ofhandleRequest/handleResponse/handleAbortare really overridden (and anyflow.isRequest()guards inside them). An element can be wired for a flow but no-op there; document what runs, not what's declared. Only mention flow in the prose when it's special — i.e. the element acts in only the request flow or only the response flow. Acting in both request and response is the normal case; don't state it. - Don't trust the existing Javadoc — it's often copy-pasted from a sibling element and wrong. Verify every
@defaultagainst the field initializer and every@descriptionagainst the code (e.g.<for>shipped@default groovyfor a field initialized toSpEL, and anindescription that talked about a "test condition" lifted from<if>). Fix what the code contradicts.
- Rewrite the class-level Javadoc:
@topic,@description,@yaml. Keep the existing@topicunless it's clearly wrong.@topicbelongs on top-level elements — those that can appear directly in aflow:or at theapi:level. Elements that are only ever used inside another interceptor or api as a child/sub-config (e.g. an extractor, a key store entry, a sub-element withcomponent = false) do not get@topic.
- Rewrite each attribute and child setter's Javadoc:
@description, plus@default/@examplefor attributes. - Replace every XML sample with YAML, and add a
[] |syntax sketch where the shape is non-trivial. - Validate — every tag value is parsed as XML by the build (see below). Confirm well-formedness; optionally compile to let the annotation processor check it.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- yesterday First seen · 95 lines · 173 tokens per session scan A 7cb7284fc626
optimize-interceptor-docs is a skill published in the GitHub repository membrane/api-gateway (638 stars, last pushed yesterday), licensed Apache-2.0. It adds 173 tokens to every session and 2,244 once invoked, about $0.0009 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.
Other skills, from other repositories
api-design-patterns
Design robust APIs with RESTful patterns, GraphQL schemas, versioning strategies, and error handling conventions. Supports OpenAPI/Swagger documentation and SDK generation patterns. Triggers on API design, schema definition, endpoint architecture, or developer experience requests.
api-designer
Designs production-grade APIs — REST, GraphQL, gRPC, and AsyncAPI patterns including pagination, versioning, error handling, rate limiting, and API governance. Use when the user asks to design APIs, create endpoints, build an API layer, write OpenAPI specs, or needs help with REST/GraphQL/gRPC service design.
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.
api-design-first
Design-first API development skill. Generates OpenAPI 3.1 specifications, enforces REST design best practices, validates endpoints, handles versioning, pagination, error formatting, authentication patterns, rate limiting, and idempotency. Activates when users say "design an API", "create OpenAPI spec", "API endpoint"…
lap
LAP CLI -- compile, search, and manage API specs for AI agents. Use when working with API specifications (OpenAPI, GraphQL, AsyncAPI, Protobuf, Postman), compiling specs to LAP format, searching the LAP registry, generating skills from API specs, or publishing APIs. Commands: init, compile, search, get, skill…
lap
LAP CLI -- compile, search, and manage API specs for AI agents. Use when working with API specifications (OpenAPI, GraphQL, AsyncAPI, Protobuf, Postman), compiling specs to LAP format, searching the LAP registry, generating skills from API specs, or publishing APIs. Commands: init, compile, search, get, skill…