memstack-security-api-audit

memstack-security-api-audit is a skill for Claude Code from cwinvestments/memstack. It costs 69 tokens per session (3,784 once invoked), scanned A, original, MIT.

An API security auditor reviews web API endpoints for authentication, authorization, input validation, and common security gaps. An API is a set of routes that other software uses to communicate with an application.

In plain words
What is it for?
Use it to inspect Next.js API routes, middleware, and endpoint protection, with adaptations for detected Express or Fastify projects.
Why use it?
It helps find routes that may accept unauthorized requests, expose data, or process unsafe input.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the memstack plugin — 87 skills, 2 commands, 6 hooks shipped together

Good fit Use it to inspect Next.js API routes, middleware, and endpoint protection, with adaptations for detected Express or Fastify projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cwinvestments/memstack/api-audit
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.

Any agent
npx skills add cwinvestments/memstack --skill api-audit
Clone the repo
git clone --depth 1 https://github.com/cwinvestments/memstack

Made for: Claude Code.

Or install memstack, the plugin that ships this one along with the rest of its 87 skills, 2 commands, 6 hooks.

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 memstack-security-api-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/cwinvestments/memstack/api-audit.svg)](https://agentmods.dev/skills/cwinvestments/memstack/api-audit)
Your own site
<a href="https://agentmods.dev/skills/cwinvestments/memstack/api-audit"><img src="https://agentmods.dev/badge/skills/cwinvestments/memstack/api-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,784 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 304
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.00069 $0.03784
Opus 5 $0.00034 $0.01892
Sonnet 5 $0.00014 $0.00757
Haiku 4.5 $0.00007 $0.00378

Measured 4d ago against content hash 1f97f4e48141, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

memstack-security-api-audit 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 4d 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/security/api-audit/SKILL.md · 371 lines

How it starts

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

🛡️ API Audit: Checking API Route Security...

Audit Next.js API routes for authentication, authorization, validation, and common vulnerabilities.

Activation

When this skill activates, output:

🛡️ API Audit: Checking API Route Security...

Then execute the protocol below.

Context Guard

Context Status
User asks to audit/check API routes ACTIVE: full audit
User mentions API security ACTIVE: full audit
User asks about endpoint protection ACTIVE: full audit
User is writing a new API route DORMANT: let them finish first
Non-Next.js project DORMANT, not applicable (adapt if Express/Fastify detected)

Protocol

Step 1: Discover API Routes

Find all API route files in the project:

  1. App Router (Next.js 13+):

    find . -path "*/app/api/*/route.ts" -o -path "*/app/api/*/route.js"
    

    Each file exports named functions: GET, POST, PUT, PATCH, DELETE.

  2. Pages Router (legacy):

    find . -path "*/pages/api/*.ts" -o -path "*/pages/api/*.js"
    

    Each file exports a default handler.

  3. Middleware:

    find . -name "middleware.ts" -o -name "middleware.js" | head -5
    

    Check if global auth middleware exists (reduces per-route auth requirements).

  4. Server Actions (Next.js 14+):

    grep -r "'use server'" --include="*.ts" --include="*.tsx" -l
    

    Server actions are also attack surface: treat as API routes. For each server action function, verify it performs authentication before accessing data. Server actions are callable from any client component and receive no automatic auth: they are functionally identical to unauthenticated POST endpoints unless the function explicitly calls getSession(), getAuthContext(), or equivalent.

Compile a list of all routes with their HTTP methods and file paths.

Step 2: Check Authentication (Check 1)

For each route, determine if it verifies the caller is authenticated:

Read the full file on GitHub · 371 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. 4d ago Changed 1f97f4e48141
  2. 5d ago First seen · 371 lines · 69 tokens per session scan A 0426e2753370

Subscribe to this mod's changes

memstack-security-api-audit is a skill published in the GitHub repository cwinvestments/memstack (419 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 3,784 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-09-03.

Related

Other skills, from other repositories

api-error-handler

Add consistent error handling to API routes. Creates standardized error responses, logging, and error classes. Triggers on "add error handling", "error handling", "standardize errors".

luqiang-code/claude-code-skills · 40 tokens

ring:migrating-to-lib-observability

Migrating a Lerian Go app off lib-commons observability imports (deprecated shims or removed APIs) to lib-observability via a fixed mapping table, then bumps go.mod and validates the build; ring:backend-go applies the edits. Covers log/zap/runtime/assert, opentelemetry/tracing, HTTP middleware, context helpers, and…

LerianStudio/ring · 104 tokens

ring:using-lib-systemplane

Using lib-systemplane, the hot-reload runtime-config plane (Postgres LISTEN/NOTIFY or MongoDB change streams), in two modes. Sweep Mode detects DIY config reload (SIGHUP, fsnotify, viper, pgx LISTEN), manual tenant-scoping, hand-built admin CRUD, and v4 residue. Reference Mode catalogs client lifecycle and…

LerianStudio/ring · 106 tokens

ring:using-tracing

Using lib-observability/tracing for OTEL provider lifecycle, trace-context propagation across HTTP/gRPC/queues, span error/event recording, and PII redaction, in two modes. Sweep Mode detects raw OTEL setup, hand-rolled header propagation, manual span-attribute assembly, and DIY redaction. Reference Mode catalogs…

LerianStudio/ring · 94 tokens

ring:mapping-streaming-events

Mapping the eventable points in a Lerian Go service where lib-streaming should emit past-tense, durable, tenant-scoped business events, producing a PM-validated event catalog and instrumentation-map.json for ring:instrumenting-streaming-events. Three-pass discovery (Survey, Slice, Mark) with a scope fence and delivery…

LerianStudio/ring · 95 tokens

ring:instrumenting-streaming-events

Instrumenting streaming events: wires lib-streaming event emission end-to-end into a Lerian Go service via a 13-gate cycle (catalog, Builder bootstrap, Emit sites, outbox, HTTP manifest, NoopEmitter fallback, integration and chaos tests), dispatching ring:backend-go under TDD. Consumes the validated…

LerianStudio/ring · 102 tokens