Skip to main content

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.

ProductivityOfficialCertifiedAI reviewed Jul 21, 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.

v2.0.0New

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-setup
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/env-setup/SKILL.md

Setup guide →

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
0Save

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 from engines.node or .nvmrc or .node-version, default 20)
  • pyproject.toml / requirements.txt → Python (version from requires-python or .python-version, default 3.12)
  • go.mod → Go (version from go directive)
  • Cargo.toml → Rust (stable channel)
  • pubspec.yaml → Flutter (version from environment.flutter)
  • Gemfile → Ruby (version from .ruby-version)

Tool Detection:

  • docker-compose.yml → Docker + Docker Compose required
  • Dockerfile → Docker required
  • prisma/schema.prisma → Prisma CLI required
  • Makefile → make required
  • Taskfile.yml → go-task required
  • turbo.json → Turborepo required (global or local)
  • .terraform/ → Terraform required
  • serverless.yml → Serverless Framework required

Package Manager Detection:

  • package-lock.json → npm
  • yarn.lock → yarn
  • pnpm-lock.yaml → pnpm
  • bun.lockb → bun
  • poetry.lock → poetry
  • Pipfile.lock → pipenv
  • uv.lock → uv
  • go.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:

ToolRequiredInstalledStatus
node20.x20.11.0OK
pnpm9.xnot foundMISSING

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 use or fnm 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 (or npm ci if package-lock.json exists 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:

  1. Copy: cp .env.example .env
  2. 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_dev
    • REDIS_URL → redis://localhost:6379
    • JWT_SECRET / SECRET_KEY → generate a random 64-char hex string using openssl rand -hex 32
    • PORT → keep the default from template
    • NODE_ENV / ENVIRONMENT → set to development
    • API_KEY / THIRD_PARTY_* → leave as placeholder with comment: # TODO: add your key
  3. Write the populated .env file

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:

  1. Start services: docker compose up -d
  2. Wait for database to be ready (poll with connection check, max 30 seconds)
  3. Run migrations:
    • Prisma: npx prisma migrate dev or npx prisma db push
    • Django: python manage.py migrate
    • Alembic: alembic upgrade head
    • Goose: goose up
    • Knex: npx knex migrate:latest
    • Rails: rails db:migrate
  4. 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.* or db/seed.*

If no docker-compose.yml but database is needed:

  • Generate a minimal docker-compose.yml with the required database service
  • Then proceed with the steps above

4.3 — Additional Setup

  • If Makefile exists with a setup or init target: run make setup or make init
  • If scripts/setup.sh exists: run bash scripts/setup.sh
  • If Taskfile.yml exists with a setup task: run task setup
  • If Prisma is detected: run npx prisma generate to generate the client
  • If Husky is detected: run npx husky install or npx 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 build or npx 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 (or npx vitest run / npx jest)
  • Python: pytest or python -m pytest
  • Go: go test ./...
  • Rust: cargo test
  • Flutter: flutter test

5.3 — Dev Server Check (non-blocking):

  • If a dev or start:dev script 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:

  1. Verify generated files exist and are syntactically valid.
  2. Run any available validation (lint, type-check, dry-run).
  3. 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


  1. Start developing: npm run dev / python manage.py runserver / go run .
  2. Run /git-hooks to set up pre-commit hooks
  3. Run /devcontainer to containerize this setup for team consistency
  4. Share .env.example with 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.md in 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 .env files — ensure .env is in .gitignore
  • Do NOT use production database credentials — always use local development defaults
  • Do NOT run docker compose down -v unless --reset was explicitly passed
  • Do NOT modify existing .env files — 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 32 minimum
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion to interfaces using modern CSS — scroll-driven animations, view transitions, @starting-style, and GPU-accelerated transforms. Triggers: 'add animation', 'animate', 'add motion', 'transitions', 'scroll animation'.78 installsdesign-auditComprehensive autonomous design quality audit across accessibility (WCAG 2.2), performance, theming, responsive/adaptive design, and anti-pattern detection. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.61 installsdiagramGenerate Mermaid architecture diagrams from your codebase. Produces C4 context and container diagrams, sequence diagrams for key flows, ER diagrams from database schemas, and module dependency graphs. Use when you need architecture diagrams, system diagrams, database ERD, sequence diagrams, dependency visualization, or C4 model diagrams.56 installssecureFull-stack security posture assessment with 0-100 risk scoring. Scans dependency vulnerabilities (npm audit, pip-audit, cargo audit, govulncheck), dangerous code patterns (SQL injection, eval, command injection, ReDoS, innerHTML, XSS vectors), authentication gaps (missing auth middleware.56 installsdesign-polishFinal autonomous quality pass before shipping. Fixes alignment, spacing, consistency, typography hierarchy, color harmony, motion timing, and every micro-detail that separates good from great..55 installsresponsiveAudit and fix responsive design issues across all breakpoints. Scans for fixed widths that cause mobile overflow, missing media query variants, non-responsive images, undersized touch targets below 48px, unreadable typography, and horizontal scroll violations..49 installs

More from Skills Hub

View source →
security-reviewSecurity audit and vulnerability assessment for any codebase. Scans for authentication bypasses, missing auth middleware, broken JWT validation (algorithm confusion, weak secrets, missing expiry), OAuth state and PKCE flaws, IDOR and horizontal privilege escalation.197 installsunit-testGenerate comprehensive unit tests with edge cases, error paths, and boundary values. Triggers: you need to add unit tests, increase code coverage, test edge cases, or verify error handling paths.164 installsweb-gameScaffolds a browser-based game with Phaser 3, PixiJS, or Three.js including game loop, asset pipeline, responsive canvas, input handling, audio, save/load, and deployment to itch.io or web. Triggers: on: "web game", "browser game", "html5 game", "phaser game", "pixi game".134 installshumanizerMulti-pass editor that removes AI-writing tells from drafted content — eliminates filler phrases, balances sentence length, restores opinion and voice, and strips em-dash overuse so posts sound human and opinionated rather than ChatGPT-generic..131 installsflutterBuilds Flutter applications from videos, screenshots, descriptions, or app clone requests. Triggers on: flutter app, build a mobile app, replicate this app in Flutter, build from video, build from screenshots, clone this app, build an app, make an app like, recreate this UI.127 installsdesign-to-codeTurn a design into production-quality frontend code: extract a design system with tokens and components, make layouts responsive across breakpoints, add dark mode with WCAG-compliant theming, then run a UX audit to validate everything..124 installs

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.