A focused Next.js security auditor that catches the stuff that's easy to miss in App Router projects. It hunts for the classic NEXT_PUBLIC_ footgun where secrets end up in client bundles, checks Server Actions for missing auth and input validation, and verifies middleware matchers actually cover your protected routes. The pattern library is solid on the specifics: IDOR vulnerabilities in dynamic routes, the next.config.js env trap, inconsistent auth between API route methods. Use it when reviewing Next.js codebases or before deployment to catch high severity auth gaps. The grep commands alone make it worth having loaded if you work in Next.js regularly.

skills.sh installs
370
GitHub stars
122
last updated
Jun 3, 2026

Install

$ npx -y skills add igorwarzocha/opencode-workflows --skill security-nextjs --agent claude-code

Installs into .claude/skills of the current project.

Files

Security audit patterns for Next.js applications covering environment variable exposure, Server Actions, middleware auth, API routes, and App Router security.

Environment Variable Exposure

The NEXT_PUBLIC_ Footgun

NEXT_PUBLIC_* → Bundled into client JavaScript → Visible to everyone
No prefix     → Server-only → Safe for secrets

Audit steps:

  1. grep -r "NEXT_PUBLIC_" . -g "*.env*"
  2. For each var, ask: "Would I be OK if this was in view-source?"
  3. Common mistakes:
    • NEXT_PUBLIC_API_KEY (SHOULD be server-only)
    • NEXT_PUBLIC_DATABASE_URL (MUST NOT use)
    • NEXT_PUBLIC_STRIPE_SECRET_KEY (use STRIPE_SECRET_KEY)

Safe pattern:

// Server-only (API route, Server Component, Server Action)
const apiKey = process.env.API_KEY; // ✓ No NEXT_PUBLIC_

// Client-safe (truly public)
const publishableKey = process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY; // ✓ Publishable

next.config.js env Is Always Bundled

Values set in next.config.js under env are inlined into the client bundle, even without NEXT_PUBLIC_. Treat them as public.

Sponsors

Details

Repository
github.com/igorwarzocha/opencode-workflows
Categories
Frontend Development, Security
First seen
Jun 3, 2026

More from igorwarzocha/opencode-workflows

All 7
1ihlamury avatarfigma-ui-skillsihlamury/design-skillsFigma's UI design system. Use when building interfaces inspired by Figma's aesthetic - light mode, Inter font, 4px grid.363skills.sh installs
2majiayu000 avatarapp-ui-designmajiayu000/claude-arsenalapp ui design353skills.sh installs
3ihlamury avatarframer-ui-skillsihlamury/design-skillsFramer's UI design system. Use when building interfaces inspired by Framer's aesthetic - dark mode, Inter font, 4px grid.337skills.sh installs
4develite98 avatarangular-best-practices-v20develite98/angular-best-practicesAngular 20+ performance optimization guidelines with Signals, httpResource, signal inputs/outputs, @defer, and native control flow (@if, @for). Use when writing335skills.sh installs
5getsentry avatarsentry-svelte-sdkgetsentry/sentry-agent-skillsFull Sentry SDK setup for Svelte and SvelteKit. Use when asked to "add Sentry to Svelte", "add Sentry to SvelteKit", "install @sentry/sveltekit", or configure e319skills.sh installs
6sickn33 avatarvercel-react-best-practicessickn33/antigravity-awesome-skillsvercel react best practices287skills.sh installs