flags

Wire Next.js feature flags across config-shared.ts, config-schema.ts, and build/runtime paths.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/JuanDiego30/cermont_aplicativo --skill flags-juandiego30
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flags
Source: https://github.com/JuanDiego30/cermont_aplicativo/tree/main/.agents/skills/flags
Command: npx skills add https://github.com/JuanDiego30/cermont_aplicativo --skill flags-juandiego30

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Feature flags are essential for controlling experimental Next.js behavior without code changes. This skill provides a structured approach to add, modify, and wire flags across build and runtime configurations.

Core Features & Use Cases

  • Wiring between config-shared.ts and config-schema.ts for type and schema validation.
  • Client-side and runtime considerations with define-env.ts, next-server.ts, and export/worker.ts integration.
  • Clear guidance on consumption paths and maintenance of feature flag consistency.

Quick Start

Add or modify a feature flag by updating config-shared.ts and config-schema.ts, and wire it into define-env.ts for client code or runtime bundles as needed.

Frequently Asked Questions about flags

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

FAQPage Schema
How do I manage Next.js feature flags across build-time and runtime paths?

Managing Next.js feature flags requires wiring between config-shared.ts and config-schema.ts, then applying flags at build-time via define-env.ts or at runtime through next-server.ts and export/worker.ts for stable behavior.

What is the best way to add a new feature flag in a Next.js config schema?

The best way to add a Next.js feature flag is updating config-shared.ts and config-schema.ts for type and schema validation, then wiring it into define-env.ts for client code or runtime bundles as needed.

When should I use build-time define-env versus runtime next-server for Next.js feature flags?

Use build-time define-env.ts when client-side code needs static flag values, and runtime next-server.ts with export/worker.ts when flags must be dynamically evaluated during server execution or export processes.

Can I use this feature flag approach without additional dependencies in my Next.js project?

Yes, this approach works without external dependencies by leveraging internal Next.js configuration files like config-shared.ts, config-schema.ts, define-env.ts, and next-server.ts to wire and consume feature flags end-to-end.

Why are my Next.js feature flags inconsistent between client and server rendering?

Inconsistent Next.js feature flags occur when config-shared.ts and config-schema.ts are not properly wired into both define-env.ts for client consumption and next-server.ts or export/worker.ts for runtime evaluation.