memstack-development-api-designer

A design guide for REST APIs, which let software communicate through organized web addresses called endpoints. It defines routes, input checks, response shapes, authentication checks, and error handling for Next.js server code.

In plain words
What is it for?
Use it to design API endpoints, route structures, request and response formats, webhook handlers, and Next.js App Router API routes.
Why use it?
It helps keep an API consistent and prevents common problems such as accepting invalid input, skipping authorization, or using unclear status codes.

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/cwinvestments/memstack/api-designer
Any agent
npx skills add cwinvestments/memstack --skill api-designer
Clone the repo
git clone --depth 1 https://github.com/cwinvestments/memstack

Made for: Claude Code, Codex.

Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,184 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.00066 $0.04184
Opus 5 $0.00033 $0.02092
Sonnet 5 $0.00013 $0.00837
Haiku 4.5 $0.00007 $0.00418

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

Security

Grade A, and why

memstack-development-api-designer 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 2d 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.

skills/development/api-designer/SKILL.md · 548 lines

How it starts

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

🔌 API Designer — Designing routes, validation, and handler patterns...

Produces production-ready Next.js App Router API routes with auth guards, Zod validation, typed responses, and consistent error handling.

Activation

When this skill activates, output:

🔌 API Designer — Designing API routes and handlers...

Then execute the protocol below.

Context Status
User says "design API" or "create API route" or "add endpoint" ACTIVE
User says "REST API" or "route handler" ACTIVE
Building a new feature that needs API routes ACTIVE
Designing webhook endpoints ACTIVE
Discussing API concepts or REST theory DORMANT
Working on frontend components (not API layer) DORMANT

Anti-patterns

Trap Reality Check
"Auth is handled by middleware" Middleware can be bypassed. Every route handler must verify auth independently.
"I'll validate input later" Unvalidated input is the root of injection, type errors, and 500s. Zod first, logic second.
"Return 200 for everything" Status codes are the API contract. 401 vs 403 vs 404 vs 422 mean different things to clients.
"Error details help debugging" Stack traces and internal errors help attackers. Return safe messages, log details server-side.
"Rate limiting is a nice-to-have" Public endpoints without rate limits get abused within hours of deployment.
"TypeScript types are documentation enough" Types exist at build time. Zod schemas validate at runtime. You need both.

Protocol

Step 1: Design Route Structure

Map features to Next.js App Router file paths:

app/
  api/
    auth/
      login/route.ts          POST   - authenticate user
      logout/route.ts         POST   - clear session
      callback/route.ts       GET    - OAuth callback
    organizations/
      route.ts                GET    - list user's orgs
                              POST   - create org
      [orgId]/
        route.ts              GET    - get org details
                              PATCH  - update org
                              DELETE - delete org
        members/
          route.ts            GET    - list members
                              POST   - invite member
          [memberId]/
            route.ts          PATCH  - update role
                              DELETE - remove member
        projects/
          route.ts            GET    - list projects
                              POST   - create project
    webhooks/
      stripe/route.ts         POST   - Stripe webhook
      github/route.ts         POST   - GitHub webhook

Read the full file on GitHub · 548 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. 2d ago First seen · 548 lines · 66 tokens per session scan A 457b5f33c2da

Subscribe to this mod's changes

memstack-development-api-designer is a skill published in the GitHub repository cwinvestments/memstack (417 stars, last pushed 5d ago), licensed MIT. It adds 66 tokens to every session and 4,184 once invoked, about $0.0003 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

plan-ceo-review

CEO/founder-mode plan review. Rethink the problem, find the 10-star product, challenge premises, expand scope when it creates a better product. Four modes: SCOPE EXPANSION (dream big), SELECTIVE EXPANSION (hold scope + cherry-pick expansions), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials). Use when…

GCWing/BitFun · 143 tokens

ship

Ship workflow: detect + merge base branch, run tests, review diff, bump VERSION, update CHANGELOG, commit, push, and create a PR. Use for an explicit /ship invocation or when the user requests the full ship, release, or deploy workflow. For an ordinary commit, push, or pull-request publishing request, use the built-in…

GCWing/BitFun · 88 tokens

design-review

Designer's eye QA: finds visual inconsistency, spacing issues, hierarchy problems, AI slop patterns, and slow interactions — then fixes them. Iteratively fixes issues in source code, committing each fix atomically and re-verifying with before/after screenshots. For plan-mode design review (before implementation), use…

GCWing/BitFun · 125 tokens

plan-eng-review

Eng manager-mode plan review. Lock in the execution plan — architecture, data flow, diagrams, edge cases, test coverage, performance. Walks through issues interactively with opinionated recommendations. Use when asked to "review the architecture", "engineering review", or "lock in the plan". Proactively suggest when…

GCWing/BitFun · 116 tokens

pre-landing-review

Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust boundary violations, conditional side effects, and other structural issues. Use when explicitly asked for the specialized pre-landing workflow. Product /review requests are handled by BitFun's unified Review mechanism instead.…

GCWing/BitFun · 74 tokens

autoplan

Auto-review pipeline — reads the full CEO, design, eng, and DX review skills from disk and runs them sequentially with auto-decisions using 6 decision principles. Surfaces taste decisions (close approaches, borderline scope, codex disagreements) at a final approval gate. One command, fully reviewed plan out. Use when…

GCWing/BitFun · 152 tokens