pn-audit-api

pn-audit-api is a command for Claude Code, Cursor from perniemann/pnCore. It costs 44 tokens per session (1,026 once invoked), scanned A, original, MIT.

An API design review command for checking how software communicates with other software, especially through REST web endpoints. It reviews conventions, HTTP meanings, response formats, validation, and accidental exposure of internal data structures.

In plain words
What is it for?
Use it to review or fix routes and modules in REST or GraphQL APIs, including status codes, request validation, response shapes, and versioning decisions.
Why use it?
It helps remove inconsistent endpoints, unclear errors, weak input checks, and responses that make clients depend on internal implementation details.

Command for Claude CodeCursor

Written for Cursor and Claude Code: shipped in a Cursor plugin, but also a Claude Code command (commands/*.md).

Part of the pn-core plugin — 150 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to review or fix routes and modules in REST or GraphQL APIs, including status codes, request validation, response shapes, and versioning decisions.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/perniemann/pncore/pn-audit-api
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.

Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Claude Code, Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 150 skills, 19 commands, 9 agents, 1 MCP server.

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 pn-audit-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-api/github.svg)](https://agentmods.dev/commands/perniemann/pncore/pn-audit-api)
Your own site
<a href="https://agentmods.dev/commands/perniemann/pncore/pn-audit-api"><img src="https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-api/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 pn-audit-api

Your own site · 80×15
<a href="https://agentmods.dev/commands/perniemann/pncore/pn-audit-api"><img src="https://agentmods.dev/badge/commands/perniemann/pncore/pn-audit-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,026 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 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.00044 $0.01026
Opus 5.5 $0.00018 $0.00410
Sonnet 5.5 $0.00009 $0.00205
Haiku 4.5 $0.00004 $0.00103

Measured 13d ago against content hash 35ea825ee24c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pn-audit-api 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 13d 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.

packages/pn-core-mcp/content/commands/pn-audit-api.md · 102 lines

How it starts

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

pn-audit-api

Start every response with: [pn-command] 🔺

Advanced (palette-hidden). Not in the / slash palette. Invoked by the /pn-backend-audit umbrella, or directly via get_command("pn-audit-api").

Progress: Before each numbered section in Flow, state one line:

  • "pn-audit-api: Step 1 of 5 — Context."
  • "pn-audit-api: Step 2 of 5 — Scope."
  • "pn-audit-api: Step 3 of 5 — Audit."
  • "pn-audit-api: Step 4 of 5 — Fix."
  • "pn-audit-api: Step 5 of 5 — Summary."

Focused API design pass: audit and fix REST conventions, HTTP semantics, response consistency, input validation, and schema leaks. No security posture changes (use pn-audit-security), no performance changes (use pn-audit-performance) — API design only.

Flow

1. Context

Check .pncore-stack.md for known stack, API style, and auth mechanism. If not found, ask:

  • "What API framework? (Express/Fastify/Hono/FastAPI/other)"
  • "REST or GraphQL? Versioned (/v1/) or unversioned?"

2. Scope

If not specified: "Which routes or modules should I audit? Or reply 'all' for full API."

3. Audit

Load get_skill("pn-openapi-design") and consult pn-core://skills/backend/reference/api-design.md. For a GraphQL API, also load get_skill("pn-graphql") and audit schema design, resolvers, N+1 and depth/complexity limits against it.

For each route or endpoint group, audit:

Resource naming:

  • Are URLs noun-based? No verbs in paths (/createUser → /users)?
  • Collections plural? (/user → /users)
  • Sub-resources correctly nested? No nesting > 2 levels?

HTTP method usage:

  • GET is safe and idempotent? No state changes in GET handlers?
  • POST used for creation only? Not for generic "do something"?
  • PUT vs. PATCH: PUT for full replace, PATCH for partial update?
  • DELETE idempotent? Returns 204 or appropriate on success?

Status codes:

  • 200 for errors? → Fix to correct 4xx/5xx
  • 201 on creation? 204 when no body to return?
  • 401 vs. 403 confused? (401 = unauthenticated, 403 = forbidden)
  • 400 vs. 422 confused? (400 = malformed, 422 = valid but failed validation)

Read the full file on GitHub · 102 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. 13d ago Changed 35ea825ee24c
  2. 3mo ago First seen · 102 lines · 44 tokens per session scan A 211d1e6bffb2

Subscribe to this mod's changes

pn-audit-api is a command published in the GitHub repository perniemann/pnCore (0 stars, last pushed 5d ago), licensed MIT. It adds 44 tokens to every session and 1,026 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

pn-audit-api compared with commands from other repositories

pn-audit-api next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pn-audit-apiperniemann/pnCoreCommand05d agoMITA44Claude Code, Cursor
review-pryonatangross/orchestkitCommand317todayMITA47Claude Code, Cursor
audit-fullyonatangross/orchestkitCommand317todayMITA45Claude Code, Cursor
gh-triagemastra-ai/mastraCommand30ktodaynoneA19Claude Code
t800-startKhar-AG/t-800-agentCommand83mo agoMITA0Claude Code
t800-doctorKhar-AG/t-800-agentCommand83mo agoMITA0Claude Code
t-800-factory-validateKhar-AG/t-800-agentCommand83mo agoMITA0Claude Code