flags
vercel/next.js · Agent Skill
Gestisce i flag delle funzionalità sperimentali di Next.js, inclusi aggiunta, modifica e integrazione nel codice.
Vai all'installazione ↓Panoramica
| Autore | |
|---|---|
| Repository | vercel/next.js ↗ |
| Cartella dello skill | flags |
| Stelle | 142.171 |
| File inclusi | 1 |
| Licenza | MIT |
| Aggiornato | 23 giugno 2026 |
| Link | Sorgente dello skill ↗ · Repository ↗ |
Verifica Mozgi
Cosa abbiamo trovato nei file dello skill. I dettagli con l’abbonamento.
Installazione
Uno skill è una cartella con un file SKILL.md. Scegli il tuo agente ed esegui i comandi in un terminale (macOS, Linux o Git Bash su Windows) dalla radice del progetto.
Incolla il prompt in Claude, Codex o un altro assistente: controllerà lo skill e lo installerà.
Install the “flags” skill from mozgi.io (https://mozgi.io/skills/flags/) for me. 1. Download the archive: https://mozgi.io/skills/flags/download If it fails, take the skill folder from the source: https://github.com/vercel/next.js/tree/canary/.agents/skills/flags 2. Read SKILL.md and the other files. Check the skill is safe: no hidden commands, no sending data elsewhere, no scripts doing something other than described. If anything looks suspicious, stop and tell me. 3. Put the “flags” folder into your agent's skills folder: .claude/skills/ for Claude Code, .agents/skills/ for Codex, .cursor/skills/ for Cursor, .gemini/skills/ for Gemini CLI. Inside the project if we are in one, otherwise in the home folder (~/.claude/skills/ etc.). 4. Make sure <skills folder>/flags/SKILL.md exists. 5. Briefly tell me what this skill does and offer to try it on my task. If you cannot do a step yourself, tell me what to click or type.
git clone --depth 1 --branch canary https://github.com/vercel/next.js.git /tmp/next.js mkdir -p .claude/skills cp -r /tmp/next.js/.agents/skills/flags .claude/skills/flags
Riavvia Claude Code: lo skill compare nell'elenco; per richiamarlo a mano usa /flags. Per tutti i progetti: ~/.claude/skills.
git clone --depth 1 --branch canary https://github.com/vercel/next.js.git /tmp/next.js mkdir -p .agents/skills cp -r /tmp/next.js/.agents/skills/flags .agents/skills/flags
Codex cerca gli skill in .agents/skills dalla cartella corrente fino alla radice del repo; richiamalo con /skills o $flags. Per tutti i progetti: ~/.agents/skills.
git clone --depth 1 --branch canary https://github.com/vercel/next.js.git /tmp/next.js mkdir -p .cursor/skills cp -r /tmp/next.js/.agents/skills/flags .cursor/skills/flags
Cursor carica lo skill all'avvio; richiamalo con “/” nella chat Agent. Cursor legge anche .claude/skills e .agents/skills. Per tutti i progetti: ~/.cursor/skills.
git clone --depth 1 --branch canary https://github.com/vercel/next.js.git /tmp/next.js mkdir -p .gemini/skills cp -r /tmp/next.js/.agents/skills/flags .gemini/skills/flags
Gemini CLI propone di attivare lo skill quando il compito corrisponde: tu confermi. Per tutti i progetti: ~/.gemini/skills.
Leggi SKILL.md e i file correlati prima di installare. Clicca un file per l'anteprima.
Contenuto di SKILL.md
Testo originale dell'autore · sola letturaFeature Flags
Use this skill when adding or changing framework feature flags in Next.js internals.
Required Wiring
All flags need: config-shared.ts (type) → config-schema.ts (zod). If the flag is consumed in user-bundled code (client components, edge routes, app-page.ts template), also add it to define-env.ts for build-time injection. Runtime-only flags consumed exclusively in pre-compiled bundles can skip define-env.ts.
Where the Flag Is Consumed
Client/bundled code only (e.g. __NEXT_PPR in client components): define-env.ts is sufficient. Webpack/Turbopack replaces process.env.X at the user's build time.
Pre-compiled runtime bundles (e.g. code in app-render.tsx): The flag must also be set as a real process.env var at runtime, because app-render.tsx runs from pre-compiled bundles where define-env.ts doesn't reach. Two approaches:
- Runtime env var: Set in
next-server.ts+export/worker.ts. Both code paths stay in one bundle. Simple but increases bundle size. - Separate bundle variant: Add DefinePlugin entry in
next-runtime.webpack-config.js(scoped tobundleType === 'app'), new taskfile tasks, updatemodule.compiled.jsselector, and still set env var innext-server.ts+export/worker.tsfor bundle selection. Eliminates dead code but adds build complexity.
For runtime flags, also add the field to the NextConfigRuntime Pick type in config-shared.ts.
Runtime-Bundle Model
- Runtime bundles are built by
next-runtime.webpack-config.js(rspack) viataskfile.jsbundle tasks. - Bundle selection occurs at runtime in
src/server/route-modules/app-page/module.compiled.jsbased onprocess.envvars. - Variants:
{turbo/webpack} × {experimental/stable/nodestreams/experimental-nodestreams} × {dev/prod}= up to 16 bundles per route type. define-env.tsaffects user bundling, not pre-compiled runtime internals.process.env.Xchecks inapp-render.tsxare either replaced by DefinePlugin at runtime-bundle-build time, or read as actual env vars at server startup. They are NOT affected by the user's defines fromdefine-env.ts.- Gotcha: DefinePlugin entries in
next-runtime.webpack-config.jsmust be scoped to the correctbundleType(e.g.apponly, notserver) to avoid replacing assignment targets innext-server.ts.
Related Skills
$dce-edge- DCE-safe require patterns and edge constraints$react-vendoring- entry-base boundaries and vendored React$runtime-debug- reproduction and verification workflow
Domande frequenti
Che cosa fa lo skill flags?
Gestisce i flag delle funzionalità sperimentali di Next.js, inclusi aggiunta, modifica e integrazione nel codice.
Come si installa flags?
Apri il blocco “Installazione” in questa pagina e scegli il tuo agente — Claude Code, Codex, Cursor o Gemini CLI — per i comandi pronti che copiano la cartella dello skill nel posto giusto. Oppure copia il prompt dalla scheda “Con l'assistente” e lascia che sia l'assistente a controllare e installare lo skill.
Con quali modelli AI funziona flags?
Gli skill sono semplici istruzioni in Markdown (formato Agent Skills), quindi flags funziona con qualsiasi agente che legge SKILL.md: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode e altri. Il modello carica le istruzioni solo quando il compito corrisponde alla descrizione dello skill.
flags è gratuito?
Lo skill è pubblicato apertamente da vercel con licenza MIT. Lo skill in sé non costa nulla: paghi solo il tuo fornitore AI per i token usati.
È sicuro installare gli skill?
Uno skill è un insieme di istruzioni che il tuo agente seguirà: leggi SKILL.md e i file correlati prima di installarlo. Gli script nella cartella dello skill vengono eseguiti solo se li esegue l'agente: controlla cosa fa e non concedere permessi superflui.
In cosa differisce uno skill da un server MCP o da un plugin?
Un server MCP o un plugin danno al modello nuovi strumenti: codice che viene eseguito e restituisce un risultato. Uno skill fornisce conoscenza e metodo: come affrontare il compito, quali passi seguire e com'è un buon risultato. Non servono server né chiavi API.