devcontainer-helper

📁 gabeosx/agent-skills 📅 Jan 21, 2026
11
总安装量
11
周安装量
#28776
全站排名
安装命令
npx skills add https://github.com/gabeosx/agent-skills --skill devcontainer-helper

Agent 安装分布

gemini-cli 9
claude-code 8
codex 8
antigravity 7
opencode 7
windsurf 6

Skill 文档

DevContainer Helper

This skill assists in creating and managing devcontainer.json files for consistent development environments.

Workflow

1. specific Requirements

Before generating the file, determine the user’s needs:

  • Base Environment: Do they want a pre-built image (e.g., Ubuntu, Python, Node), a custom Dockerfile, or a docker-compose.yml setup?
  • Languages & Tools: What languages (Node.js, Python, Go, Rust, etc.) and tools (Git, CLI utilities) are needed?
  • Extensions: Are there specific VS Code extensions required?
  • Ports: What ports need to be forwarded?

2. Generate Configuration

Use the template in assets/devcontainer-template.json as a starting point.

For Image-based (Simplest): Use the image property. Add features for additional tools.

For Dockerfile: Use build.dockerfile property pointing to their Dockerfile.

For Docker Compose: Use dockerComposeFile and service properties.

3. Add Features

Encourage using “Features” over manual Dockerfile commands when possible for better maintainability. Common features:

  • Node.js: ghcr.io/devcontainers/features/node:1
  • Python: ghcr.io/devcontainers/features/python:1
  • Docker-in-Docker: ghcr.io/devcontainers/features/docker-in-docker:2
  • Git: ghcr.io/devcontainers/features/git:1

4. Lifecycle Scripts

If the user needs to run commands (like npm install or pip install) after the container builds:

  • Use postCreateCommand for one-time setup.
  • Use postStartCommand for commands that run every time the container starts.

References

See references/cheatsheet.md for a list of common devcontainer.json properties and valid values.