mcpField
N
nextjs-secure-bff

nextjs-secure-bff

github.com/xirothedevSecurity259 installsUpdated 23w ago
Repository

About nextjs-secure-bff

A skill for security reviews when Next.js forms a backend boundary, including Route Handlers, Server Actions, proxies, and webhooks. Prioritized rules and examples focus on authorization, input validation, and output filtering.

Key features

  1. 01Review public entry points and backend boundaries
  2. 02Check authentication and authorization
  3. 03Validate webhook inputs
  4. 04Control proxy headers and outputs
  5. 05Load rules and examples as needed

Use cases

  1. 01Review security of Next.js Route Handlers
  2. 02Check authorization in data-mutating Server Actions
  3. 03Secure proxy endpoints and webhooks
  4. 04Reduce leaks in client data and serialized results

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/xirothedev/skills --skill nextjs-secure-bff

After installing, type/nextjs-secure-bffin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
test-cases.json
dataset/api/proxy-headers/
correct.ts
incorrect.ts
notes.md
dataset/api/route-boundaries/
correct.ts
incorrect.ts
notes.md
dataset/api/webhook-validation/
correct.ts
incorrect.ts
notes.md
dataset/security/dal-dto/
correct.tsx
incorrect.tsx
notes.md
dataset/security/env-server-only/
correct.ts
incorrect.ts
notes.md
dataset/security/server-action-authz/
correct.ts
incorrect.tsx
notes.md
references/
_sections.md
api-proxy-headers.md
api-route-boundaries.md
api-webhook-validation.md
security-dal-dto.md
security-env-server-only.md
security-server-action-authz.md
sources/
inventory.json

Details

From the project README

Next.js Secure BFF

Use this skill when Next.js acts as a public backend boundary, not just a rendering layer. Treat Route Handlers, Proxy, and Server Actions as externally reachable entry points that need normal backend security review.

When to Apply

Use this skill when:

  • Writing or reviewing app/**/route.ts, proxy.ts, webhook handlers, callback URLs, or BFF proxy endpoints
  • Designing Server Actions that mutate data or depend on authenticated users
  • Moving database, secrets, or internal API access into a Next.js app
  • Auditing whether data passed to Client Components is minimized and safe
  • Debugging leaks through headers, serialized action results, logs, or broad DTOs

Load On Demand

Start with this file. Load detailed files only when the task needs them:

references/_sections.md
references/api-route-boundaries.md
references/security-server-action-authz.md
references/security-dal-dto.md
references/security-env-server-only.md
references/api-webhook-validation.md
references/api-proxy-headers.md
dataset/security/server-action-authz/correct.ts
sources/inventory.json

Each rule file includes:

  • Why the pattern matters
  • Incorrect and correct examples
  • Dataset path with larger TypeScript/TSX examples
  • Official source references

Rule Categories by Priority

Resolve conflicts by lower priority number first. At the same priority, prefer Security, API, then Operations.

PriorityCategoryImpactPrefix
1Security & AuthorizationCRITICALsecurity-
2Public API BoundariesCRITICALapi-
3Operations & Runtime ControlsHIGHops-

Source Policy

Prefer official Next.js docs for framework semantics. For auth libraries, follow the library's official adapter docs after this skill establishes the Next.js security boundary. Do not copy community webhook, proxy, or Server Action snippets unless they validate inputs, re-authorize the caller, and filter outputs.

Comments

Markdown supported