add-api-endpoint

add-api-endpoint is a skill for Claude Code, Codex from willdady/platypus. It costs 35 tokens per session (796 once invoked), scanned A, original, MIT.

A guide for adding authenticated, tenant-scoped API endpoints with Hono.js, a JavaScript and TypeScript web framework.

In plain words
What is it for?
Use it when adding Platypus backend routes, mounting them in the server, defining request schemas, and applying the correct organization and workspace permissions.
Why use it?
It helps prevent logged-in users from accessing another organization or workspace's data by requiring authentication, access checks, validation, and database handling.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/willdady/platypus/add-api-endpoint
Any agent
npx skills add willdady/platypus --skill add-api-endpoint
Clone the repo
git clone --depth 1 https://github.com/willdady/platypus

Made for: Claude Code, Codex.

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 add-api-endpoint

README.md
[![agentmods](https://agentmods.dev/badge/skills/willdady/platypus/add-api-endpoint.svg)](https://agentmods.dev/skills/willdady/platypus/add-api-endpoint)
Your own site
<a href="https://agentmods.dev/skills/willdady/platypus/add-api-endpoint"><img src="https://agentmods.dev/badge/skills/willdady/platypus/add-api-endpoint.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 796 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00035 $0.00796
Opus 5 $0.00017 $0.00398
Sonnet 5 $0.00007 $0.00159
Haiku 4.5 $0.00003 $0.00080

Measured 3d ago against content hash f50c85996cdb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-api-endpoint 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 3d 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.

.agents/skills/add-api-endpoint/SKILL.md · 89 lines

How it starts

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

Adding New API Endpoints

Authenticated is not scoped. requireAuth proves who the caller is and nothing about what they may reach. Platypus is multi-tenant — Organization → Workspace → resource — so an endpoint carrying only requireAuth is reachable by any logged-in user against any tenant's data. Scope is a separate, mandatory decision, taken per route.

Steps

  1. Create the route module in the backend's routes area — a Hono instance exported for mounting.

  2. Mount it on the app in the backend's server module. The mount path carries the tenancy, so the hierarchy lives in the URL and the middleware reads the ids from it:

    app.route("/organizations/:orgId/workspaces/:workspaceId/agents", agent);
    
  3. Define the request schemas in the shared schemas package, following the full / create / update variants each domain model already has.

  4. Compose each route: authenticate, scope, validate, handle — in that order, as arguments to the route, not as a blanket .use("*"). Scope is per route because two routes in one file rarely deserve the same access.

    agent.post(
      "/",
      requireAuth,
      requireOrgAccess(),
      requireWorkspaceAccess,
      sValidator("json", agentCreateSchema),
      async (c) => {
        const data = c.req.valid("json");
        const scope = workspaceScopeOf(c);
        // ...
      },
    );
    

Done when every route in the module names its scoping middleware explicitly, and you can say which tenant each one is confined to.

Choosing the scope

Pick the narrowest that admits the callers you intend:

Middleware Admits
requireOrgAccess() any member of the Organization in the path
requireOrgAccess(["admin"]) members holding one of the named Organization roles
requireWorkspaceAccess callers permitted in the Workspace in the path
requireWorkspaceOwner the Workspace's Owner
requireWorkspaceConfigAccess() credential- or reach-bearing Workspace config, admin-only
requireWorkspaceConfigAccess(flag) the same, plus the Owner when that Workspace flag is set
requireSuperAdmin platform operators only

Read the full file on GitHub · 89 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. 3d ago First seen · 89 lines · 35 tokens per session scan A f50c85996cdb

Subscribe to this mod's changes

add-api-endpoint is a skill published in the GitHub repository willdady/platypus (71 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 796 once invoked, about $0.0002 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-09-01.

Related

Other skills, from other repositories

p5js

Production pipeline for interactive and generative visual art using p5.js. Creates browser-based sketches, generative art, data visualizations, interactive experiences, 3D scenes, audio-reactive visuals, and motion graphics — exported as HTML, PNG, GIF, MP4, or SVG. Covers: 2D/3D rendering, noise and particle systems…

moltis-org/moltis · 152 tokens

opencode

Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions. Requires the opencode CLI installed and authenticated.

moltis-org/moltis · 36 tokens

architecture-diagram

Generate dark-themed SVG diagrams of software systems and cloud infrastructure as standalone HTML files with inline SVG graphics. Semantic component colors (cyan=frontend, emerald=backend, violet=database, amber=cloud/AWS, rose=security, orange=message bus), JetBrains Mono font, grid background. Best suited for…

moltis-org/moltis · 163 tokens

ideation

Generate project ideas through creative constraints. Use when the user says 'I want to build something', 'give me a project idea', 'I'm bored', 'what should I make', 'inspire me', or any variant of 'I have tools but no direction'. Works for code, art, hardware, writing, tools, and anything that can be made.

moltis-org/moltis · 75 tokens

mcp-servers

Add, remove, configure, and troubleshoot MCP (Model Context Protocol) servers. Use when the user wants to connect external tools, manage MCP server lifecycle, or debug MCP connectivity issues.

moltis-org/moltis · 42 tokens

slacrawl

Archive and search Slack workspace messages, threads, and channels via the slacrawl CLI. Supports API sync, Slack export ZIP import, local desktop cache import, and full-text search.

moltis-org/moltis · 41 tokens