Next.js Config Sanity Skill
Purpose
Reduce security and deployment risks caused by unsafe next.config.ts changes.
When to Use
- •
next.config.tschanges - •Unexpected build or deploy regressions
- •Security review
Inputs
- •
next.config.ts - •Hosting environment constraints (if known)
Outputs
- •Review notes under
.agent/artifacts/{conversation-id}/nextjs_config_sanity.md - •Minimal config fixes (if needed)
Prerequisites
- •Ability to run a local build
Tools & Availability
- •Local shell +
npm run build - •If build unavailable, document why
Methodology
- •Review headers, redirects, rewrites, and images config.
- •Check for unsafe headers (overly permissive
Access-Control-Allow-*). - •Validate caching headers for sensitive pages.
- •Confirm experimental flags are intentional and documented.
Verification
- • Config changes documented with rationale
- •
npm run buildcompletes (or failure documented) - • Headers/caching settings reviewed for security impact
Pass/Fail: Pass only if all checks above are satisfied.
Risks & Mitigations
- •Misconfigured headers → review against expected security posture
- •Hidden regressions → keep minimal diffs and rebuild locally