dev-environment

Local development environment patterns: runtime version pinning with mise/asdf, environment variables with direnv, Dev Containers for consistent team environments, Docker Compose for local services, and pre-commit hooks.

8 stars

Best use case

dev-environment is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Local development environment patterns: runtime version pinning with mise/asdf, environment variables with direnv, Dev Containers for consistent team environments, Docker Compose for local services, and pre-commit hooks.

Teams using dev-environment should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/dev-environment/SKILL.md --create-dirs "https://raw.githubusercontent.com/marvinrichter/clarc/main/skills/dev-environment/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/dev-environment/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How dev-environment Compares

Feature / Agentdev-environmentStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Local development environment patterns: runtime version pinning with mise/asdf, environment variables with direnv, Dev Containers for consistent team environments, Docker Compose for local services, and pre-commit hooks.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Dev Environment Skill

"Works on my machine" is a solved problem. Consistent environments across the team eliminate entire classes of bugs and onboarding friction.

## When to Activate

- Setting up a new project's development environment (`/setup-dev`)
- Onboarding a new developer
- Debugging "it works on CI but not locally" problems
- Standardizing the team's Node/Python/Go version
- Setting up pre-commit hooks for automatic quality checks
- Configuring a Dev Container so the project opens identically in VS Code and GitHub Codespaces
- Running local email testing with Mailpit so email flows can be verified without a real SMTP server

---

## Runtime Version Pinning (mise)

[mise](https://mise.jdx.dev) (formerly rtx) manages Node, Python, Go, Java, and 200+ other runtimes per-project:

```toml
# .mise.toml — commit this to git
[tools]
node = "22"
python = "3.12"
go = "1.24"

[env]
NODE_ENV = "development"
```

```bash
# Install mise
curl https://mise.run | sh

# Install all tools defined in .mise.toml
mise install

# Activate (add to shell profile)
mise activate zsh >> ~/.zshrc
```

Everyone on the team runs the same versions. CI should use the same `.mise.toml`:

```yaml
# .github/workflows/ci.yml
- uses: jdx/mise-action@v2  # Reads .mise.toml automatically
```

---

## Environment Variables (direnv)

[direnv](https://direnv.net) automatically loads `.env` when you `cd` into a project directory:

```bash
# Install
brew install direnv
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc

# Project setup
echo 'dotenv' > .envrc      # Load .env automatically
direnv allow                 # Approve this project
```

`.env` is gitignored. `.env.example` is committed with all variables documented.

```bash
# .env (local, gitignored)
DATABASE_URL=postgresql://app:app@localhost:5432/appdb
REDIS_URL=redis://localhost:6379

# .envrc (committed — just loads .env)
dotenv
```

---

## Dev Container (VS Code / GitHub Codespaces)

Dev Containers give every developer (and CI) the exact same environment in Docker:

```json
// .devcontainer/devcontainer.json
{
  "name": "myapp",
  "dockerComposeFile": ["../docker-compose.dev.yml", "docker-compose.devcontainer.yml"],
  "service": "app",
  "workspaceFolder": "/workspace",

  "features": {
    "ghcr.io/devcontainers/features/git:1": {},
    "ghcr.io/devcontainers/features/github-cli:1": {}
  },

  "postCreateCommand": "npm install && npm run db:migrate",
  "postStartCommand": "docker compose up -d postgres redis",

  "customizations": {
    "vscode": {
      "settings": {
        "editor.formatOnSave": true,
        "editor.defaultFormatter": "biomejs.biome"
      },
      "extensions": [
        "biomejs.biome",
        "prisma.prisma",
        "bradlc.vscode-tailwindcss"
      ]
    }
  }
}
```

```yaml
# .devcontainer/docker-compose.devcontainer.yml
services:
  app:
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    volumes:
      - ..:/workspace:cached
    command: sleep infinity
    environment:
      DATABASE_URL: postgresql://app:app@postgres:5432/appdb
      REDIS_URL: redis://redis:6379
```

---

## Docker Compose for Local Services

Run only infrastructure services locally — run the app code natively (better hot reload, debugger):

```yaml
# docker-compose.dev.yml
services:
  postgres:
    image: postgres:18-alpine
    environment: { POSTGRES_DB: appdb, POSTGRES_USER: app, POSTGRES_PASSWORD: app }
    ports: ['5432:5432']
    volumes: [postgres_data:/var/lib/postgresql/data]
    healthcheck:
      test: [CMD, pg_isready, -U, app]
      interval: 5s
      retries: 5

  redis:
    image: redis:8-alpine
    ports: ['6379:6379']

  mailpit:
    image: axllent/mailpit
    ports: ['1025:1025', '8025:8025']  # SMTP + Web UI for local email testing
    # Test emails visible at http://localhost:8025

volumes:
  postgres_data:
```

```bash
# Start services
docker compose -f docker-compose.dev.yml up -d

# Stop (keeps data)
docker compose -f docker-compose.dev.yml stop

# Reset data
docker compose -f docker-compose.dev.yml down -v && docker compose -f docker-compose.dev.yml up -d
```

---

## Pre-Commit Hooks (automatic quality gates)

These already exist via hooks.json — document the key ones:

| Hook | Trigger | What It Does |
|------|---------|-------------|
| Post-edit format | Edit any TS/JS file | Runs Biome/Prettier |
| Post-edit typecheck | Edit any .ts file | Runs `tsc --noEmit` |
| Console.log warning | Edit any file | Warns if console.log added |
| Pre-push reminder | git push | Prompts to review changes |

For teams without Claude Code, use [pre-commit](https://pre-commit.com):

```yaml
# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: lint
        name: Lint
        entry: npm run lint
        language: system
        pass_filenames: false

      - id: typecheck
        name: Type Check
        entry: npm run typecheck
        language: system
        pass_filenames: false
```

---

## Checklist

- [ ] `.mise.toml` committed with pinned runtime versions
- [ ] `.env.example` committed with all variables documented
- [ ] `.env` is in `.gitignore`
- [ ] `docker-compose.dev.yml` for local services
- [ ] README Getting Started section < 5 steps to running locally
- [ ] Local email testing (Mailpit) for features that send email
- [ ] Dev Container (optional but valuable for onboarding and Codespaces)

Related Skills

zero-trust-patterns

8
from marvinrichter/clarc

Zero-Trust security patterns — mTLS between microservices (Istio/SPIFFE), SPIRE workload identity, OPA/Envoy authorization, NetworkPolicy default-deny-all, short-lived credentials, service mesh security, and Kubernetes RBAC hardening.

wireframing

8
from marvinrichter/clarc

Wireframing and prototyping workflow: fidelity levels (lo-fi sketch → mid-fi wireframe → hi-fi prototype), tool selection (Figma, Excalidraw, Balsamiq), user flow diagrams, wireframe annotation standards, information architecture (IA) mapping, and the handoff from wireframe to visual design. For developers who need to communicate UI structure before writing code.

webrtc-patterns

8
from marvinrichter/clarc

WebRTC patterns — peer connection setup, ICE/STUN/TURN configuration, signaling server design, SFU vs mesh topology, screen sharing, media track management, and reconnect/ICE restart handling.

webhook-patterns

8
from marvinrichter/clarc

Webhook patterns for receiving, verifying (HMAC), and idempotently processing third-party events. Covers Stripe, GitHub, and generic webhook patterns, delivery guarantees, retry handling, and testing.

web-performance

8
from marvinrichter/clarc

Web performance optimization: Core Web Vitals (LCP, CLS, INP), Lighthouse CI with budget configuration, bundle analysis (webpack-bundle-analyzer, vite-bundle-visualizer), hydration performance, network waterfall reading, image optimization (WebP/AVIF, srcset), and font performance.

wasm-performance

8
from marvinrichter/clarc

WebAssembly performance: wasm-opt binary optimization, size reduction (panic=abort, LTO, strip), profiling WASM in Chrome DevTools, memory management (linear memory, avoiding GC pressure), SIMD, and multi-threading with SharedArrayBuffer.

wasm-patterns

8
from marvinrichter/clarc

WebAssembly patterns: wasm-pack, wasm-bindgen (JS↔Wasm interop), WASI, Component Model, wasm-opt, Rust-to-WASM compilation, JS integration (web workers, streaming instantiation), and production deployment (CDN, Content-Type headers).

visual-testing

8
from marvinrichter/clarc

Visual Regression Testing: tool comparison (Chromatic/Percy/Playwright screenshots/BackstopJS), pixel-diff vs AI-based comparison, baseline management, flakiness strategies (masks, tolerances, waitForLoadState), CI integration with GitHub Actions, and Storybook integration.

visual-identity

8
from marvinrichter/clarc

Brand identity development: color palette construction (primary/secondary/semantic/neutral), logo concept brief writing, typeface pairings, brand voice definition, mood board direction, and Brand Guidelines document structure. Use when establishing or evolving a visual brand — not for implementing existing tokens.

ux-micro-patterns

8
from marvinrichter/clarc

UX micro-patterns for every product state: Empty States, Loading States (skeleton screens, spinners, optimistic UI), Error States, Success States, Confirmation Dialogs, Onboarding Flows, and Progressive Disclosure. These patterns apply to every feature — done wrong, they're the biggest source of user confusion.

typography-design

8
from marvinrichter/clarc

Typography as a creative discipline: typeface selection criteria, type pairing (serif + sans, display + body), modular scale systems, line-height and tracking ratios, hierarchy construction, and web/mobile rendering considerations. The decisions behind design tokens, not the tokens themselves.

typescript-testing

8
from marvinrichter/clarc

TypeScript testing patterns: Vitest for unit/integration, Playwright for E2E, MSW for API mocking, Testing Library for React components. Core TDD methodology for TypeScript/JavaScript projects.