К основному содержанию
скилл CX Codex

environments — скилл для Claude Code: окружения и установка

Скилл environments для Claude Code разделяет настройки разработки и production, а также описывает работу с секретами и миграциями. Агент подключает его при настройке окружения, добавлении переменной или разборе утечки ключа.

MIT ★ 741 обновлён 2026-11-14

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add phuryn/product-engineering
/plugin install app-stack@product-engineering
Открыть на GitHub

Что делает environments

Скилл задаёт правила разделения development и production: отдельные ресурсы и наборы ключей, запись проверенных подключений с датой и проверка переменных при сборке и запуске. Новая переменная должна попасть в .env.example, документацию переменных и схему конфигурации. Секреты нельзя хранить в репозитории, логах или клиентском коде.

Для миграции production сначала применяют изменения схемы вручную и только после разрешения владельца; миграция должна выдержать период, когда старый код ещё обслуживает запросы. Скилл также описывает ротацию утёкших ключей, проверку резервных копий восстановлением и план пересборки окружений. Примеры механизмов даны для Next.js, Supabase, Clerk и Netlify, а сам принцип предлагается переносить на другие стеки.

Какие задачи решает

  • разделить ресурсы и секреты development и production
  • проверить, где используется каждая копия ключа
  • добавить переменную в пример, документацию и схему
  • подготовить миграцию без конфликта со старым кодом
  • проверить резервную копию восстановлением

Примеры запросов агенту

  • Настрой окружения development и production для этого приложения.
  • Добавь переменную окружения и внеси её в схему конфигурации.
  • Разбери утечку ключа и опиши порядок его ротации.

Как установить environments

1Через маркетплейс плагинов

/plugin marketplace add phuryn/product-engineering
/plugin install app-stack@product-engineering

Команда ставит плагин app-stack целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add phuryn/product-engineering --skill environments -a claude-code

3Вручную: положить файлы

~/.claude/skills/environments/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/environments/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об environments

Как установить environments в Claude Code?

В Claude Code выполни /plugin marketplace add phuryn/product-engineering и затем /plugin install app-stack@product-engineering.

Что делает environments?

Скилл описывает разделение development и production, учёт переменных и секретов, миграции, ротацию ключей и проверку восстановления из резервной копии.

Какие технологии упоминает environments?

В качестве примеров механизмов названы Next.js, Supabase, Clerk и Netlify. Правила предлагается адаптировать и к другим стекам.

Исходный текст

SKILL.md · MIT
---
name: environments
description: "Adding a variable or secret, 'set up production', a domain or a provider token, 'which database is this', a leaked key: dev and production for an AI-built app, backups, incidents."
---

# Environments — development, production, and what moves between them

**Keep two of everything, never mixed.** Record every claim about which is which with the date checked. This skill covers separating environments, moving configuration and secrets, and changing schema while code still serves. It also covers leaks, failures and rebuilding.

**Keep the principle and swap the mechanism on another stack.** These rules use Next.js (App Router), Supabase, Clerk and Netlify mechanisms after stating the principle.

**The product's own instructions come first.** Follow its names for the environments doc, variables doc and branches.

**Write to the product's records, whatever it calls them.** They hold:

- The environments doc: which resource each environment uses, verified and dated, ending in the environment log, one row per environment event;
- The variables doc: one row per variable, and where every copy of each secret lives;
- The env schema: the one module that validates configuration, at build and at boot;
- `.env`, the local configuration, never committed, and `.env.example`, its committed list of placeholders;
- The backlog: deferred work, each item with its reason and the trigger that reopens it.

## What binds

- **The target is stated, never inferred.** Every command that reads or writes an environment names it (a project ref, a URL, an instance) rather than inheriting it from whatever a config file was last left pointing at. A per-machine, gitignored config (an MCP server's, a CLI's link) may name production today and development tomorrow, and a CLI given both a link and a typed ref may follow either. So the database CLI is never linked: each environment's database is reached by its own connection string, and no command depends on which flag wins. **Operator tooling has no production default.** A command that writes to something both environments share (one DNS zone, one account) refuses to run until its target is named. `references/environments-and-branches.md § Operator commands`; the database mechanics are `supabase-production`.
- **Separate development and production resources and key sets.** Include operator credentials. Share none: a provider token or SSH key in both environments' files lets a development-checkout leak reach production. The app refuses to build and boot on a partial configuration. Production's generated secrets are generated afresh, never copied from development.
- **Record each environment's verified resources, check date and proving command.** Re-read it, never remember it: mappings move. A line in the environments doc still holding a placeholder is a thing that has not happened yet.
- **Secrets are never in the repository, a URL, a log line, a command line or a client bundle.** Every module that imports one is marked server-only (on Next.js, `import "server-only"`), so a client import fails the build. Only `NEXT_PUBLIC_*` values reach the browser.
- **Every new environment variable gets three things in the same change.** Add a placeholder in `.env.example`, a row in the variables doc, and a line in the env schema that fails when it is missing. **The schema runs at build and dev start, not only at boot.** `NEXT_PUBLIC_*` values enter the client bundle during build, before a boot check could catch a leak. It checks each key's shape where the vendor gives one and never echoes a value. `references/variables.md`.
- **A value you generate rather than fetch is generated now.** Generate cookie-signing secrets, token peppers and similar values, write them where that environment's values live, and name them in your summary. Put development's in the development checkout's `.env`. Generate production's afresh in the production operator file outside the development checkout until go-live step 3 puts it on the host. Never use a `.env*` file there: `next build` reads `.env.production`. Nobody can look up a generated value; an empty placeholder causes boot failure without an instruction. **One that seals or tags stored data can never be replaced without breaking that data.** Keep an off-machine copy (`references/variables.md § The kinds of variable`).
- **Know whether a push applies migrations, and apply them by hand before the push.** Apply production's only after the owner's go. Applying before the push opens a window where every build still serving, the app's and each separately deployed runtime's, meets the new schema. Every pending migration is written to survive that window, a contracting one waits outside the migrations directory until every runtime has moved past it, or the outage is named in the go/no-go. `references/migrations-window.md`.
- **A tunnel's address is public.** Development only, the link to the owner and nowhere else (never a deployed runtime's configuration), closed when the owner is done. `references/environments-and-branches.md § Showing development to the owner`.
- **Every holder keeps its own copy of a secret.** This includes the host, each Worker, each box, and the operator's `.env` that a deploy uploads again. Keep a map of every copy. **A planned rotation revokes last.** Make the new value beside the old, put it into every holder and deploy each, check it works, then revoke the old one. Revoking first breaks whatever still holds the old value, and a deploy from an operator file not yet updated puts the old value back. A push redeploys only the app; the rest is `release-gate`. `references/variables.md § Where every copy lives`, `§ Rotating`.
- **A leaked key is the same order, done at once.** Write it in the environment log. If it is being used against you, revoke first and accept that every holder fails until it has the new value. If a build or a dev server ever ran with a secret in a public variable, that secret was served: rotate it.
- **A backup is *not verified* until a restore drill has run.** Record the drill's date and result. A provider's schedule is not evidence, and **a database backup is not the system**: list what no backup holds and how each comes back. Once the product runs more than its host builds, keep a runbook for rebuilding both environments from nothing. `references/data-and-incidents.md § Backups and restore`, `references/rebuild-from-nothing.md`.
- **No screen and no legal page promises automatic deletion until the job that deletes exists.**

## When you are…

| When you are… | Read |
|---|---|
| setting up an environment, recording which database or instance is which, naming branches, writing an operator command | `references/environments-and-branches.md` |
| showing a change to the owner before it is deployed | `references/environments-and-branches.md § Showing development to the owner` |
| adding, renaming or reading an environment variable; adding a secret; before go-live | `references/variables.md` |
| pointing a domain at the product; giving the agent a provider's token; which host goes behind a proxy; before the first users | `references/domain-and-provider-access.md` |
| rotating a key; finding every place a secret is held | `references/variables.md § Where every copy lives`, `§ Rotating` |
| writing a migration the deployed code will meet; renaming or dropping a column; revoking a grant; promoting a release with pending migrations | `references/migrations-window.md` |
| promising retention, deleting a workspace, listing what is held about people, backups, an incident, a leaked key, writing the environment log | `references/data-and-incidents.md` |
| rebuilding an environment from empty accounts, or writing the runbook for it | `references/rebuild-from-nothing.md` |

Each rule's origin, the case that taught it, is in `receipts.md` beside this file; read it when a rule's edge is unclear.

## How you can tell it worked

Every variable the code reads is recorded with where it lives in each environment. Development never reaches production's data, and one rotation would retire a leaked key.

## Files

| File | Holds |
|---|---|
| `references/environments-and-branches.md` | the environments table; recording the verified mapping and the inventory; branches and sites; operator commands; showing development to the owner through a Cloudflare quick tunnel |
| `references/variables.md` | the variables doc's columns; the kinds of variable and how each is handled; the env schema's contract; setting values on the host; where every copy lives; rotating; the pre-go-live checklist |
| `references/domain-and-provider-access.md` | who creates and scopes each provider credential and what stays the owner's; the domain's order, from the nameservers to a certificate; proxy or DNS-only per host; what to tighten before the first users |
| `references/migrations-window.md` | whether a push applies migrations; the window between applying a migration and every runtime's new build going live; compatible changes; expand and contract, for columns and for grants; what to name in the go/no-go |
| `references/data-and-incidents.md` | data that expires; what we hold about people; backups, and what no backup holds; incident basics, the symptom table and panic buttons; a leaked key; the environment log |
| `references/rebuild-from-nothing.md` | the runbook for recreating both environments from empty accounts: what the repository cannot reproduce, the order, and what each step needs |

Related skills:

- `release-gate` (the release checklist, rollback, the runtimes a push does not redeploy, Netlify's edge)
- `supabase-production` (the migration ledger, `--db-url` and why the CLI is never linked, a second runtime's database login, database gotchas)
- `clerk-production` (the production instance, its keys and DNS)
- `transactional-email` (one provider server per environment, the development redirect)
- `test-harness` (the harness's own variables and the pinned `.env`)
- `saas-authorization` (the threat model the secrets rules come from)
- `shipping-artifacts` (the variables doc as a reviewer reads it).

© Paweł Huryn · MIT · phuryn/product-engineering

Похожие скиллы

Каталог скиллов SKILL.md →
pixijs-environments pixijs Скилл pixijs-environments для Claude Code помогает запускать PixiJS v8 вне обычного браузера: в Web Worker, Node.js, SSR и при строгой CSP. Подсказывает, как выбрать адаптер и настроить загрузку модулей. CX Codex +1 6 800установок upgrading-mwaa-environments aws Скилл upgrading-mwaa-environments проведёт окружение MWAA на новую версию Airflow: подберёт путь обновления и один из трёх сценариев по тому, нужно ли сохранить историю запусков. CX Codex +1 1 700установок mcloud-environments medusajs Скилл mcloud-environments для Claude Code создаёт и удаляет среды mcloud, повторно развёртывает сборки или запускает новые. Управляет жизненным циклом окружений и деплоями. CX Codex +1 1 600установок test-environments kindlmann Скилл test-environments для Claude Code. Помогает спроектировать уровни тестовых окружений: от локального контура и CI до preview-стендов и staging с паритетом продакшена. CX Codex +1 1 600установок layer-environments layerai Скилл layer-environments для Claude Code создаёт игровые фоны, параллаксные слои, панорамы 360° и игровые миры через Layer. Он подключается при создании окружения, настройке зацикливания слоёв или экспорте в Godot и Unity. CX Codex +1 1 100установок preview-environments-builder patricio0312rev Скилл preview-environments-builder генерирует пайплайны временных окружений для каждого пулл-реквеста с автоматическим развёртыванием, уникальным адресом и удалением ресурсов после закрытия PR. CX Codex +1 250установок

Из того же набора51

Весь набор →
uptime-monitoring Скилл uptime-monitoring для Claude Code настраивает внешние проверки доступности приложения и оповещения. Запускается при публикации приложения, добавлении /health или cron-задачи и запросе о мониторинге. CX Codex +1 ★ 741звёзд репо performance-audit-static Скилл performance-audit-static для Claude Code проверяет производительность кода статически: ищет N+1-запросы, лишнюю загрузку данных, проблемы с индексами и кешированием. Запускается по запросу на аудит производительности. CX Codex +1 ★ 741звёзд репо legal-pages Скилл legal-pages для Claude Code помогает подготовить юридические страницы по фактическому поведению приложения. Запускается при создании продукта и изменениях в обработке данных, cookies или провайдерах. CX Codex +1 ★ 741звёзд репо flight-deck Скилл flight-deck для Claude Code, который сохраняет ход долгой работы в файлах и на странице статуса. Запускается по просьбе показать прогресс или восстановить, на чём остановилась сессия. CX Codex +1 ★ 741звёзд репо embedded-agents-agent-sdk Скилл embedded-agents-agent-sdk для Claude Code и Codex встраивает агентов Claude в приложение на Next.js через Claude Agent SDK. Запускается при запросе на интеграцию Agent SDK или когда агенту нужен движок Claude Code. CX Codex +1 ★ 741звёзд репо mcp-server Скилл mcp-server для Claude Code помогает собрать удалённый MCP-сервер, подключить OAuth и подготовить его к публикации в каталоге. Описывает этапы разработки, проверки инструментов и подтверждения работы клиента. CX Codex +1 ★ 741звёзд репо transactional-email Скилл transactional-email для Claude Code помогает добавить транзакционные письма и оповещения в приложение. Разбирает выбор почтового провайдера, повторы отправки и отписку в один клик. CX Codex +1 ★ 741звёзд репо grok-agents Скилл grok-agents для Claude Code запускает Grok CLI из другого агента как партнёра, исполнителя или независимого ревьюера. Он подключается к просьбам привлечь Grok к обсуждению решения, этапу разработки или проверке изменений. CX Codex +1 ★ 741звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой