security-nextjs

Audit Next.js security patterns for environment exposure and auth gaps.

7|2|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/justinlevinedotme/jalco-opencode --skill security-nextjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-nextjs
Source: https://github.com/justinlevinedotme/jalco-opencode/tree/main/opencode/.config/opencode/skills/security-nextjs
Command: npx skills add https://github.com/justinlevinedotme/jalco-opencode --skill security-nextjs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rg, and includes scripts (resource) components.

What problem does it solve?

Next.js security can be fragile with App Router, Server Actions, and middleware; this skill provides a structured audit approach to identify exposure of NEXT_PUBLIC_ variables, missing auth, and misconfigurations to harden apps.

Core Features & Use Cases

  • NEXT_PUBLIC_ exposure checks and config review for secret leakage
  • Server Actions authentication and input-validation guidance
  • Middleware and API route coverage assessment with remediation steps
  • Configuration and header hardening recommendations for Next.js projects

Quick Start

Run the Next.js security audit on a project using the included scanner script to surface common misconfigurations.

Frequently Asked Questions about security-nextjs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Next.js App Router security for environment variable exposure?

To audit Next.js App Router security, scan your project to identify NEXT_PUBLIC_ environment variable exposure and surface misconfigurations that leak secrets. This structured audit reviews config files to prevent sensitive data leakage.

How do I check if my Next.js Server Actions have authentication and input validation?

Checking Next.js Server Actions authentication involves scanning your codebase to identify missing auth checks and input validation gaps. The audit provides targeted guidance to secure server-side execution endpoints.

What is the best way to harden Next.js middleware and API route security?

The best way to harden Next.js middleware and API route security is to run an audit assessing coverage and identifying weaknesses. This process generates remediation steps for middleware configurations and secure header implementation.

Does this Next.js security audit work for projects of all sizes?

Yes, this Next.js security audit applies to projects of all sizes. It evaluates App Router, Server Actions, and middleware configurations across any Next.js codebase to enforce secure headers and config hardening.

Why does rg need to be installed to run a Next.js security audit?

The ripgrep tool, or rg, must be installed because the scanner scripts rely on it to recursively search Next.js project files. This dependency enables rapid identification of NEXT_PUBLIC_ exposure and configuration weaknesses.

When do I need to check Next.js headers and config for security hardening?

You need to check Next.js headers and config for security hardening whenever you deploy App Router or Server Actions. The audit enforces checks for secure Next.js headers and config to prevent misconfigurations.