flags

Manage Next.js feature flags from type declarations to runtime bundle injection.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/sigitpoerwo/repoworkspace_zahra --skill flags-sigitpoerwo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flags
Source: https://github.com/sigitpoerwo/repoworkspace_zahra/tree/main/skills/03-BELUM-DICOBA/dari-clawhub/flags
Command: npx skills add https://github.com/sigitpoerwo/repoworkspace_zahra --skill flags-sigitpoerwo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing Next.js framework feature flags across the codebase to ensure correct build, runtime behavior, and bundle variants, without breaking deployments.

Core Features & Use Cases

  • Wiring and validation of flags from config-shared.ts to config-schema.ts, with build-time and runtime considerations.
  • Consumption and propagation of flags through define-env.ts, next-server.ts, and export/worker.ts across client and server bundles.
  • Quick scenario: Imagine enabling an experimental feature behind a runtime toggle to test in production with safe rollbacks.

Quick Start

Update config-shared.ts and config-schema.ts, propagate the flag through define-env.ts, and adjust next-runtime and related server files to activate it end-to-end.

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 client and server bundles?

Next.js feature flag management is achieved by wiring type declarations from config-shared.ts to config-schema.ts, then propagating them through define-env.ts and next-server.ts to ensure correct build-time and runtime injection across client and server bundles.

How does build-time injection work for Next.js runtime environments?

Build-time injection for Next.js runtime environments uses DefinePlugin variants and define-env.ts to wire flags, ensuring environment propagation across app and server routes without breaking deployments during pre-compiled runtime bundle generation.

Can I enable an experimental Next.js feature behind a runtime toggle for production testing?

Yes, you can enable an experimental Next.js feature behind a runtime toggle to test in production by adjusting config-shared.ts and next-runtime.webpack-config.js, allowing safe rollbacks if deployment issues arise.

Do I need to update config-shared.ts and config-schema.ts to add a new Next.js feature flag?

Yes, adding a new Next.js feature flag requires updating config-shared.ts and config-schema.ts for wiring and validation, followed by adjustments to define-env.ts and related server files to activate the flag end-to-end.

Why does my Next.js feature flag break deployments when propagated to export worker bundles?

Next.js feature flags can break deployments if environment propagation is incomplete, requiring updates to export/worker.ts and next-server.ts to ensure correct runtime behavior and bundle variants across app and server routes.