This skill may not reflect the latest upstream change
Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.
env-setup
Bootstrap a project from zero to working dev environment. Detects runtime versions, installs dependencies, creates .env from templates, starts Docker services, runs database migrations, and verifies build plus tests pass. Use when cloning a new repo, onboarding to a project, setting up local development, or troubleshooting a broken dev environment.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install env-setupManual setup by platform
Claude Code
~/.claude/skills/env-setup/SKILL.md
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
- Key
- skills-hub-ed25519-2026-11
- Signed
Instructions
You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation.
Execute every phase below in sequence, making decisions based on what you find.
PHASE 0 — INPUT
$ARGUMENTS may contain:
--check-only— verify environment without installing or modifying anything--skip-db— skip database setup and migration steps--skip-tests— skip the final test verification step--reset— tear down existing environment and rebuild from scratch (docker-compose down -v, rm -rf node_modules, etc.)
If no arguments, run the full setup: detect, install, configure, verify.
PHASE 1 — DETECT REQUIRED TOOLS
Scan project files to build a requirements list:
Runtime Detection:
package.json→ Node.js (version fromengines.nodeor.nvmrcor.node-version, default 20)pyproject.toml/requirements.txt→ Python (version fromrequires-pythonor.python-version, default 3.12)go.mod→ Go (version fromgodirective)Cargo.toml→ Rust (stable channel)pubspec.yaml→ Flutter (version fromenvironment.flutter)Gemfile→ Ruby (version from.ruby-version)
Tool Detection:
docker-compose.yml→ Docker + Docker Compose requiredDockerfile→ Docker requiredprisma/schema.prisma→ Prisma CLI requiredMakefile→ make requiredTaskfile.yml→ go-task requiredturbo.json→ Turborepo required (global or local).terraform/→ Terraform requiredserverless.yml→ Serverless Framework required
Package Manager Detection:
package-lock.json→ npmyarn.lock→ yarnpnpm-lock.yaml→ pnpmbun.lockb→ bunpoetry.lock→ poetryPipfile.lock→ pipenvuv.lock→ uvgo.sum→ go modules (built-in)Cargo.lock→ cargo (built-in)
Build the full requirements list with expected versions.
PHASE 2 — CHECK INSTALLED VERSIONS
For each required tool, check if it is installed and the version matches:
node --version → compare against required
npm --version → verify package manager
python3 --version → compare against required
go version → compare against required
rustc --version → verify installed
flutter --version → compare against required
docker --version → verify installed
docker compose version → verify installed
Produce a status table:
| Tool | Required | Installed | Status |
|---|---|---|---|
| node | 20.x | 20.11.0 | OK |
| pnpm | 9.x | not found | MISSING |
For MISSING tools:
- Detect the OS and package manager (macOS/brew, Linux/apt, etc.)
- Provide install commands but DO NOT run system-level installs automatically
- Exception: Node version managers (nvm, fnm), Python version managers (pyenv), and Rust (rustup) — these are safe to suggest running
For VERSION MISMATCH:
- Report the mismatch and suggest upgrade commands
- If using a version manager (.nvmrc exists), suggest
nvm useorfnm use
If --check-only, stop here and report the status table. Do not proceed to install.
PHASE 3 — INSTALL DEPENDENCIES
Install project dependencies using the detected package manager:
Node.js:
- npm:
npm install(ornpm ciifpackage-lock.jsonexists and is not in CI) - yarn:
yarn install - pnpm:
pnpm install - bun:
bun install
Python:
- pip:
pip install -r requirements.txt(create venv first if not in one:python3 -m venv .venv && source .venv/bin/activate) - poetry:
poetry install - uv:
uv sync - pipenv:
pipenv install --dev
Go: go mod download
Rust: cargo fetch
Flutter: flutter pub get
Ruby: bundle install
For monorepos, run install from the root. If workspace installs are needed, detect and run those too.
Verify install succeeded (exit code 0). If it fails, read the error and attempt to resolve:
- Missing peer dependencies → install them
- Engine mismatch → report and suggest fix
- Native build failures → report required system libraries
PHASE 4 — CONFIGURE ENVIRONMENT
4.1 — Environment Variables
If .env.example or .env.template exists and .env does not:
- Copy:
cp .env.example .env - Scan the template for variables that need values:
DATABASE_URL→ construct from docker-compose service config or use default:postgresql://postgres:postgres@localhost:5432/app_devREDIS_URL→redis://localhost:6379JWT_SECRET/SECRET_KEY→ generate a random 64-char hex string usingopenssl rand -hex 32PORT→ keep the default from templateNODE_ENV/ENVIRONMENT→ set todevelopmentAPI_KEY/THIRD_PARTY_*→ leave as placeholder with comment:# TODO: add your key
- Write the populated
.envfile
If no .env.example exists but the project clearly needs env vars (detected from code scanning for process.env, os.environ, os.Getenv), create a .env.example with discovered variables and sensible defaults.
4.2 — Database Setup
Skip if --skip-db.
If docker-compose.yml exists with database services:
- Start services:
docker compose up -d - Wait for database to be ready (poll with connection check, max 30 seconds)
- Run migrations:
- Prisma:
npx prisma migrate devornpx prisma db push - Django:
python manage.py migrate - Alembic:
alembic upgrade head - Goose:
goose up - Knex:
npx knex migrate:latest - Rails:
rails db:migrate
- Prisma:
- Run seed if available:
- Prisma:
npx prisma db seed(if seed script defined in package.json) - Django:
python manage.py loaddata - Custom: check for
scripts/seed.*ordb/seed.*
- Prisma:
If no docker-compose.yml but database is needed:
- Generate a minimal
docker-compose.ymlwith the required database service - Then proceed with the steps above
4.3 — Additional Setup
- If
Makefileexists with asetuporinittarget: runmake setupormake init - If
scripts/setup.shexists: runbash scripts/setup.sh - If
Taskfile.ymlexists with asetuptask: runtask setup - If Prisma is detected: run
npx prisma generateto generate the client - If Husky is detected: run
npx husky installornpx husky(v9+) - If pre-commit is detected: run
pre-commit install
PHASE 5 — VERIFY BUILD AND TESTS
Run verification checks to confirm the project is ready for development:
5.1 — Build Check:
- Node/TS:
npm run buildornpx tsc --noEmit(whichever is in scripts) - Python:
python -c "import {main_package}"(verify imports work) - Go:
go build ./... - Rust:
cargo build - Flutter:
flutter analyze
5.2 — Test Check (skip if --skip-tests):
- Node:
npm test(ornpx vitest run/npx jest) - Python:
pytestorpython -m pytest - Go:
go test ./... - Rust:
cargo test - Flutter:
flutter test
5.3 — Dev Server Check (non-blocking):
- If a
devorstart:devscript exists, verify it starts without immediate crash - Start the server, wait 5 seconds, check it responds on the expected port, then stop it
Report results for each check: PASS / FAIL with error details.
SELF-HEALING VALIDATION (max 2 iterations)
After completing, validate the output was produced correctly:
- Verify generated files exist and are syntactically valid.
- Run any available validation (lint, type-check, dry-run).
- If the skill produces configuration, verify it parses without errors.
IF VALIDATION FAILS:
- Diagnose from error context and re-generate the failing artifact
- Repeat up to 2 iterations
OUTPUT
Print the setup summary:
## Environment Setup Complete
### System Requirements
| Tool | Required | Installed | Status |
|--------|----------|-----------|---------|
| node | 20.x | 20.11.0 | OK |
| docker | any | 27.1.1 | OK |
| ...
### Dependencies
- {package manager}: {N} packages installed
### Environment
- .env: created from .env.example with {N} variables populated
- Database: {PostgreSQL 16 running on localhost:5432}
- Migrations: {applied N migrations}
- Seed data: {loaded / not available}
### Verification
- Build: PASS
- Tests: PASS ({N} tests, {N} passed)
- Dev server: PASS (responding on localhost:{port})
### Manual Steps Required
- {any tools that need manual install}
- {any API keys that need manual configuration}
NEXT STEPS
- Start developing:
npm run dev/python manage.py runserver/go run . - Run
/git-hooksto set up pre-commit hooks - Run
/devcontainerto containerize this setup for team consistency - Share
.env.examplewith the team (never commit.env)
SELF-EVOLUTION TELEMETRY
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
- Look for the project path in
~/.claude/projects/ - If found, append to
skill-telemetry.mdin that memory directory
Entry format:
### /env-setup — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.
DO NOT
- Do NOT install system packages without explicit user instruction (no
brew install,apt install) - Do NOT commit
.envfiles — ensure.envis in.gitignore - Do NOT use production database credentials — always use local development defaults
- Do NOT run
docker compose down -vunless--resetwas explicitly passed - Do NOT modify existing
.envfiles — only create new ones from templates - Do NOT skip the verification phase — the whole point is confirming everything works
- Do NOT hardcode absolute paths — use relative paths and environment variables
- Do NOT run migrations against non-local databases
- Do NOT generate secrets that are less than 32 bytes — use
openssl rand -hex 32minimum
Security
Reviews (0)
Related skills
Browse all →More from Skills Hub
View source →More Productivity skills
Browse category →Frequently asked questions about env-setup
What does the env-setup skill do?
Bootstrap a project from zero to working dev environment. Detects runtime versions, installs dependencies, creates .env from templates, starts Docker services, runs database migrations, and verifies build plus tests pass. Use when cloning a new repo, onboarding to a project, setting up local development, or troubleshooting a broken dev environment. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the env-setup skill?
Run `npx @skills-hub-ai/cli install env-setup` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/env-setup/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does env-setup work with?
env-setup runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the env-setup skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use env-setup after installing it?
In Claude Code, type `/env-setup` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the env-setup skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.