AGENT
Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing status codes, pagination,…
A complete, realistic audit of a small Express orders service, in the standard format. Use it as the shape your output should take. (Secret values shown are obviously fake illustrations.)
$ npx -y skills add vanara-agents/skills --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
A complete, realistic audit of a small Express orders service, in the standard format. Use it as the shape your output should take. (Secret values shown are obviously fake illustrations.)
A complete, realistic audit of a small Express orders service, in the standard format. Use it as the shape your output should take. (Secret values shown are obviously fake illustrations.)
---
Scope: 4 changed files — `orders/controller.js`, `orders/repo.js`, `reports/controller.js`, `config.js`. Surfaces: 3 HTTP routes (1 public, 2 authenticated), 1 SQL data layer, 1 file read, 1 config module.
(`ORDER BY ${sort}`). Exploit: `GET /orders?sort=id;DROP TABLE orders--`. **Fix:** allow-list sortable columns and bind values:
const COLS = { created_at: 'created_at', total: 'total' };
const col = COLS[req.query.sort] ?? 'created_at';
db.query(`SELECT * FROM orders WHERE owner = ? ORDER BY ${col} DESC LIMIT 50`, [req.session.userId]);path read and returned. Exploit: `GET /reports?name=../../../../etc/passwd`. **Fix:** confine to a base dir and strip components:
const base = path.resolve('/var/reports');
const target = path.resolve(base, path.basename(req.query.name));
if (!target.startsWith(base + path.sep)) return res.status(400).end();with no ownership check; any authenticated user reads any order. **Fix:** compare to the session principal and 404 on mismatch:
const order = await repo.findById(req.params.id); if (!order || order.ownerId !== req.session.userId) return res.status(404).end();
committed: `const STRIPE = 'sk_live_4eC39HqLyjEXAMPLEzdp7dc'` (fake illustration). **Fix:** load from env/secret manager and **rotate** the token — git history still contains it. Add a pre-commit secret scan (`scripts/scan-secrets.mjs`).
the client (`res.status(500).send(err.stack)`), leaking file paths and library versions. **Fix:** return a generic message; log the detail server-side.
X-Content-Type-Options). **Fix:** add a headers middleware (e.g. `helmet`).
---
**Verdict: No-go (block)** — 2 CRITICAL and 2 HIGH must be fixed before merge.
**Remediation notes:**
other controllers for the same pattern; it is usually copied.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing status codes, pagination,…
This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the contract-breakers first. Severity…
The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to…
Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting rules last. Every box is a…
APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add without breaking**, and version…
Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.