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.
git clone --depth 1 https://github.com/mertjane/awesome-claude-commandsWrote 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.
[](https://agentmods.dev/commands/mertjane/awesome-claude-commands/nxt-api-route)<a href="https://agentmods.dev/commands/mertjane/awesome-claude-commands/nxt-api-route"><img src="https://agentmods.dev/badge/commands/mertjane/awesome-claude-commands/nxt-api-route/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.
<a href="https://agentmods.dev/commands/mertjane/awesome-claude-commands/nxt-api-route"><img src="https://agentmods.dev/badge/commands/mertjane/awesome-claude-commands/nxt-api-route.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.01135 |
| Opus 5 | $0.00018 | $0.00567 |
| Sonnet 5 | $0.00007 | $0.00227 |
| Haiku 4.5 | $0.00004 | $0.00113 |
Grade A, and why
nxt-api-route 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate Next.js API Route Handler
Create a Next.js App Router route.ts file for the path provided in $ARGUMENTS.
Parse $ARGUMENTS:
- First word → route path (e.g.
users,auth/login,posts/[id]) - Second word (optional) → comma-separated HTTP methods to generate (e.g.
GET,POST). If not provided, infer from route name.
Step 1 — Detect Project Structure
Find the app directory: app/ or src/app/
Check for existing API routes:
Glob: {app,src/app}/**/route.ts
Read 1–2 existing route files to detect:
- Import style (
@/aliases vs relative) - Auth middleware pattern (how protected routes validate tokens)
- Error response format (
{ error: string }vs{ message: string }vs custom) - Response helper usage (
NextResponse.jsonvsResponse)
Step 2 — Detect Auth Pattern
Search for auth middleware or utility:
Glob: {lib,src/lib,middleware,src/middleware,utils,src/utils}/**/*.{ts,js}
Look for: verifyToken, getSession, auth, getCurrentUser, withAuth
If found, read the file and understand the signature so the generated route can import and use it correctly.
Step 3 — Infer HTTP Methods
If methods are not specified in $ARGUMENTS, infer from the route name:
| Route contains | Default methods |
|---|---|
login, signin, register, signup |
POST |
logout, signout |
POST |
[id] or [slug] |
GET, PUT, DELETE |
| No dynamic segment | GET, POST |
search, filter |
GET |
upload |
POST |
Step 4 — Generate route.ts
Generate handlers only for the determined HTTP methods.
Base imports (always include):
import { NextRequest, NextResponse } from "next/server"
If dynamic segment in path:
interface RouteParams {
params: Promise<{ {param}: string }>
}
GET handler template:
export async function GET(
request: NextRequest,
{ params }: RouteParams // only if dynamic segment
) {
try {
// const { {param} } = await params // only if dynamic segment
// const searchParams = request.nextUrl.searchParams
// const query = searchParams.get("q")
return NextResponse.json({ data: null }, { status: 200 })
} catch (error) {
return NextResponse.json(
{ error: "Internal server error" },
{ status: 500 }
)
}
}
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.
- 10d ago First seen · 172 lines · 37 tokens per session scan A 2bf32314875b
nxt-api-route is a command published in the GitHub repository mertjane/awesome-claude-commands (2 stars, last pushed 6mo ago), licensed MIT. It adds 37 tokens to every session and 1,135 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-08-31.
Other commands, from other repositories
generate-idl-client
Generate TypeScript client from Solana program IDL using Codama or Anchor.
new-middleware
Scaffold ASP.NET Core middleware with request/response pipeline, DI support, structured logging, and proper ordering.
new-dto
Scaffold request/response DTOs with records, validation attributes, and mapping from domain entities.
explain
Explain how the following works in this NestJS codebase: $ARGUMENTS.
format
Auto-format code and fix TypeScript issues.
gen-ts-api-code
A code-generation workflow that reads API definitions from YApi, a tool for documenting and testing web APIs, and produces TypeScript code.