Generate complete devenv 2.x (2.2+) development environments from project requirement inputs. Use when a user asks to set up a dev environment, scaffold project tooling, configure local services, or generate devenv.nix / devenv.yaml files. Triggers include: 'set up devenv', 'create dev environment', 'configure local services', 'generate devenv config', 'scaffold environment for [language/framework]', or any request for reproducible development tooling with Nix. Always use this skill — not ad-hoc nix config — when the target toolchain is devenv 2.x.
Generate production-quality devenv 2.x environments from structured project
requirements. Detailed configuration lives in references/ — load only the files
the request actually needs (see Reference Routing).
Requirement Intake
Extract or confirm the following before generating any files. Ask for missing
required fields — do not infer or default silently.
Field
Required
Description
Example
languages
Yes
Primary language(s) + version
python 3.12, rust stable
services
No
Backing services
postgres 16, redis, kafka
processes
No
Long-running app processes
api server, worker
secrets
No
Secret env vars the app needs
DATABASE_URL, STRIPE_KEY
extra_packages
No
CLI tools / utilities
jq, awscli2
git_hooks
No
Pre-commit checks
ruff, rustfmt
lsp
No
LSP support needed
yes / no per language
polyrepo
No
Deps on other devenv repos
github:myorg/my-service
shell
No
Preferred shell
bash, zsh, fish, nu
profiles
No
Env variants per machine / user / CI
ci, hostname.laptop, user.alice
ai_tooling
No
Claude Code hooks / agents / MCP servers in the env
git-hooks-run hook, mcpServers.devenv
Reference Routing
Load reference files at intake time, keyed on which intake fields were filled.
Never load all of them — each is a standalone 130–300 line document and only the
routed ones are relevant to a given request.
Request characteristic
Load
Any request (language toolchains are always involved)
devenv.nix # MANDATORY — every project gets one, even a near-empty one.
# Since 2.2 auto-activation (shell hook + `devenv allow`) keys on
# devenv.nix; a devenv.yaml-only project silently stops activating.
devenv.yaml # When inputs, imports, secretspec config, require_version,
# shell, or nixpkgs config are needed
secretspec.toml # When any secrets are declared
.gitignore # Must contain .devenv/ and .direnv/
.envrc is opt-in only: devenv init --include-envrc (or DEVENV_INCLUDE_ENVRC=1).
Do not hand-write one unless the user asks for direnv.
devenv shell # Enter environment (bash, zsh, fish, nu)
devenv up # Start all services and processes in the foreground
devenv up -d # Start them in the background; a later `devenv up`
# attaches to that manager instead of starting a second one
devenv processes attach # Stream status and logs, leaving processes running on Ctrl-C
devenv down # Stop background processes
devenv test # Run the test suite
devenv processes list # List processes and their running state
devenv processes logs <name> # View process logs
devenv tasks list # Show the task dependency tree
For auto-activation without direnv:
# bash and zsh need this in the shell rc file; fish and nushell auto-load it
# when devenv is installed via Nix:
eval "$(devenv hook bash)" # bash
eval "$(devenv hook zsh)" # zsh
# Then trust the project (from the directory containing devenv.nix):
devenv allow
AI Agent Integration
devenv detects coding agents and drops the TUI so output stays token-cheap; opt out
with DEVENV_NO_AI_AGENT=1, or force interactive output with --tui true.
Environment-level Claude Code config (claude.code.hooks, .agents, .commands,
.mcpServers) is covered in references/ai-integration.md.
MCP Integration
devenv mcp serves package and option search over stdio, or devenv mcp --http 8080
over HTTP; a public instance runs at mcp.devenv.sh.
See references/ai-integration.md for wiring it into an agent.
1---2name: devenv2-environment-generator3description: Generate complete devenv 2.x (2.2+) development environments from project requirement inputs. Use when a user asks to set up a dev environment, scaffold project tooling, configure local services, or generate devenv.nix / devenv.yaml files. Triggers include: 'set up devenv', 'create dev environment', 'configure local services', 'generate devenv config', 'scaffold environment for [language/framework]', or any request for reproducible development tooling with Nix. Always use this skill — not ad-hoc nix config — when the target toolchain is devenv 2.x.4license: MIT5---67# devenv Environment Generator (2.x)89Generate production-quality devenv 2.x environments from structured project10requirements. Detailed configuration lives in `references/` — load only the files11the request actually needs (see [Reference Routing](#reference-routing)).1213---1415## Requirement Intake1617Extract or confirm the following before generating any files. Ask for missing18required fields — do not infer or default silently.1920| Field | Required | Description | Example |21|---|---|---|---|22| `languages` | Yes | Primary language(s) + version | `python 3.12`, `rust stable` |23| `services` | No | Backing services | `postgres 16`, `redis`, `kafka` |24| `processes` | No | Long-running app processes | `api server`, `worker` |25| `secrets` | No | Secret env vars the app needs | `DATABASE_URL`, `STRIPE_KEY` |26| `extra_packages` | No | CLI tools / utilities | `jq`, `awscli2` |27| `git_hooks` | No | Pre-commit checks | `ruff`, `rustfmt` |28| `lsp` | No | LSP support needed | yes / no per language |29| `polyrepo` | No | Deps on other devenv repos | `github:myorg/my-service` |30| `shell` | No | Preferred shell | `bash`, `zsh`, `fish`, `nu` |31| `profiles` | No | Env variants per machine / user / CI | `ci`, `hostname.laptop`, `user.alice` |32| `ai_tooling` | No | Claude Code hooks / agents / MCP servers in the env | `git-hooks-run` hook, `mcpServers.devenv` |3334---3536## Reference Routing3738Load reference files **at intake time**, keyed on which intake fields were filled.39Never load all of them — each is a standalone 130–300 line document and only the40routed ones are relevant to a given request.4142| Request characteristic | Load |43|---|---|44| Any request (language toolchains are always involved) | `references/languages.md` |45| Backing services: postgres, redis, kafka, minio, elasticsearch, … | `references/services.md` |46| Long-running processes, readiness probes, restart policy, file watching, attach | `references/processes.md` |47| Build steps, codegen, DB migrations, seed data, cached/conditional work | `references/tasks.md` |48| Helper commands, generated or checked-in files, env vars, `/etc/hosts`, local TLS certs | `references/scripts-and-files.md` |49| Secrets, API keys, DSNs, credential providers | `references/secrets.md` |50| Pre-commit checks, linters, formatters | `references/git-hooks.md` |51| `devenv.yaml`: inputs, nixpkgs config, `shell`, `backend`, `clean`, `strict_ports`, `require_version` | `references/yaml.md` |52| Monorepo, polyrepo, `imports`, cross-project references, `--from` | `references/composing.md` |53| Per-machine, per-user, or CI variants of one environment | `references/profiles.md` |54| Claude Code integration, AI agent behavior, MCP servers | `references/ai-integration.md` |55| Container images, buildable `outputs`, `enterTest` / `devenv test` | `references/outputs-containers-testing.md` |56| CLI invocation, activation, debugging a broken environment | `references/cli.md` |57| Cachix binary caches, overlays, macOS/Apple SDK, Android, AWS | `references/misc-integrations.md` |5859---6061## Output Files6263```64devenv.nix # MANDATORY — every project gets one, even a near-empty one.65 # Since 2.2 auto-activation (shell hook + `devenv allow`) keys on66 # devenv.nix; a devenv.yaml-only project silently stops activating.67devenv.yaml # When inputs, imports, secretspec config, require_version,68 # shell, or nixpkgs config are needed69secretspec.toml # When any secrets are declared70.gitignore # Must contain .devenv/ and .direnv/71```7273`.envrc` is opt-in only: `devenv init --include-envrc` (or `DEVENV_INCLUDE_ENVRC=1`).74Do not hand-write one unless the user asks for direnv.7576---7778## devenv.nix — Canonical Skeleton7980```nix81{ pkgs, config, lib, inputs, ... }:8283{84 packages = with pkgs; [ ];8586 languages.<lang>.enable = true;8788 services.<name>.enable = true;8990 processes.<name> = {91 exec = "...";92 ports.<port-name>.allocate = 8080;93 after = [ "devenv:processes:<name>" ];94 ready.http.get = { port = config.processes.<name>.ports.<port-name>.value; path = "/healthz"; };95 restart.on = "on_failure"; # "never" | "always" | "on_failure"96 restart.max = 5; # null for unlimited97 watch.paths = [ ./src ];98 watch.extensions = [ "rs" ];99 };100101 tasks."<namespace>:<name>" = {102 exec = "...";103 before = [ "devenv:enterShell" ];104 after = [ "devenv:processes:<name>" ];105 status = "check-if-needed"; # exit 0 = skip106 execIfModified = [ "src/**" ];107 };108109 scripts.<name> = {110 exec = ''...'';111 packages = [ pkgs.curl ];112 description = "Help text";113 };114115 env = { KEY = "value"; }; # non-secret values only116117 git-hooks.hooks.<name>.enable = true; # requires git-hooks input in devenv.yaml118119 enterShell = ''echo "ready"'';120}121```122123---124125## Breaking Changes from devenv 0.x / 1.x / 2.0126127| Change | Version | Required action |128|---|---|---|129| Native process manager is default | 2.0 | Set `process.manager.implementation = "process-compose"` to revert |130| `git-hooks` not bundled by default | 2.0 | Add the input to `devenv.yaml` before using `git-hooks.hooks` |131| `devenv build` outputs JSON | 2.0 | Parse with `jq -r '.["attribute.path"]'` |132| `devenv container --copy <name>` removed | 2.0 | Use `devenv container copy <name>` |133| `pre-commit` command renamed to `prek` | 2.0 | Use the `prek` CLI instead of `pre-commit` |134| `restart` is a submodule | 2.0 | Use `restart.on` / `restart.max` / `restart.window`, not a plain string |135| `watch` is a submodule | 2.0 | Use `watch.paths` / `watch.extensions` / `watch.ignore`, not a plain list |136| `devenv tasks run` default mode changed | 2.1 | Dependency tasks now run by default; `--mode single` for old behavior |137| `devenv` without a command shows help | 2.1 | Use `devenv version` or `devenv --version` |138| `devenv.yaml` keys documented as snake_case | 2.1.1 | Write `strict_ports`, `allow_unfree`, `clean.enabled`; camelCase is legacy-only |139| Auto-activation keys on `devenv.nix`, not `devenv.yaml` | 2.2 | Always emit a `devenv.nix`, even for yaml-driven projects |140| `devenv init` no longer writes `.envrc` | 2.2 | Pass `--include-envrc` or set `DEVENV_INCLUDE_ENVRC` if direnv is wanted |141| `x86_64-darwin` dropped | 2.2 | Intel Macs must pin an older CLI; Apple Silicon can run it under Rosetta 2 |142143Migration guide: https://devenv.sh/guides/migrating-to-2.0/1442.2 release notes: https://devenv.sh/blog/2026/07/28/devenv-22-attach-to-running-processes-and-persistent-out-of-tree-environments/145146---147148## Validation Checklist149150Run before finalizing output:151152- [ ] Every example and generated project includes a `devenv.nix`153- [ ] Every process that binds a port uses `ports.<port-name>.allocate` — no hardcoded strings154- [ ] Service and process ports are wired through `config.processes.<name>.ports.<port-name>.value`, never a literal port in a URL or flag155- [ ] Secrets are in `secretspec.toml`, not in `env = {}`156- [ ] `secretspec.enable: true` is set in `devenv.yaml` wherever a `secretspec.toml` ships157- [ ] Every `devenv.yaml` key is snake_case158- [ ] `devenv.yaml` declares the `git-hooks` input if `git-hooks.hooks` is used159- [ ] Process dependencies use `devenv:processes:<name>` with optional `@started`, `@ready`, `@completed` suffix160- [ ] One-shot migration/seed processes use `@completed` dependency ordering161- [ ] Language versions are pinned where reproducibility matters162- [ ] `devenv.yaml` present if inputs, imports, secretspec config, `shell`, nixpkgs config, or `require_version` are needed163- [ ] `.gitignore` includes `.devenv/` and `.direnv/`164- [ ] `languages.<lang>.lsp.enable` is only touched to opt **out** — it defaults to `true`165- [ ] `restart` uses submodule syntax: `restart.on`, not a plain string166- [ ] `watch` uses submodule syntax: `watch.paths`, not a plain list167- [ ] Tasks that should run before shell entry use `before = [ "devenv:enterShell" ]`168169---170171## Agent Workflow1721731. **Intake** — Extract requirement fields. Ask for missing required fields.1742. **Load references** — Route the filled intake fields through the table above; read only those files.1753. **Map** — Translate requirements to devenv 2.x constructs.1764. **Draft** — Generate `devenv.nix`, plus `devenv.yaml`, `secretspec.toml`, `.gitignore` as applicable.1775. **Validate** — Run the checklist above. Fix violations before output.1786. **Annotate** — Add inline comments explaining non-obvious choices.1797. **Summarize** — Provide activation commands:180181```bash182devenv shell # Enter environment (bash, zsh, fish, nu)183devenv up # Start all services and processes in the foreground184devenv up -d # Start them in the background; a later `devenv up`185 # attaches to that manager instead of starting a second one186devenv processes attach # Stream status and logs, leaving processes running on Ctrl-C187devenv down # Stop background processes188devenv test # Run the test suite189devenv processes list # List processes and their running state190devenv processes logs <name> # View process logs191devenv tasks list # Show the task dependency tree192```193194For auto-activation without direnv:195196```bash197# bash and zsh need this in the shell rc file; fish and nushell auto-load it198# when devenv is installed via Nix:199eval "$(devenv hook bash)" # bash200eval "$(devenv hook zsh)" # zsh201202# Then trust the project (from the directory containing devenv.nix):203devenv allow204```205206---207208## AI Agent Integration209210devenv detects coding agents and drops the TUI so output stays token-cheap; opt out211with `DEVENV_NO_AI_AGENT=1`, or force interactive output with `--tui true`.212Environment-level Claude Code config (`claude.code.hooks`, `.agents`, `.commands`,213`.mcpServers`) is covered in `references/ai-integration.md`.214215## MCP Integration216217`devenv mcp` serves package and option search over stdio, or `devenv mcp --http 8080`218over HTTP; a public instance runs at `mcp.devenv.sh`.219See `references/ai-integration.md` for wiring it into an agent.
Run npx skillmds@latest add mister2d/devenv2-environment-generator in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Generate complete devenv 2.x (2.2+) development environments from project requirement inputs. Use when a user asks to set up a dev environment, scaffold project tooling, configure local services, or generate devenv.nix / devenv.yaml files. Triggers include: 'set up devenv', 'create dev environment', 'configure local services', 'generate devenv config', 'scaffold environment for [language/framework]', or any request for reproducible development tooling with Nix. Always use this skill — not ad-hoc nix config — when the target toolchain is devenv 2.x. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: makes network calls, reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
mister2d (@mister2d) published this skill. Their other Agent Skills are listed on their SkillMD profile.