devcontainer-creator
Devcontainer Creator
This skill acts as an implementation manual to assist you in creating, editing, and updating .devcontainer/devcontainer.json environments. It leverages the official Dev Container Specification, using images from mcr.microsoft.com and features from ghcr.io/devcontainers/features/.
Core Principle
Mandatory Planning: Before creating or modifying any .devcontainer configuration files, you MUST draft a design plan and obtain user approval. The plan should outline the orchestration method (image, Dockerfile, or Compose), the base image, requested features, and any required lifecycle scripts or environment variables.
Workflow
Follow these steps to construct or update the Devcontainer configuration:
1. Analyze the Workspace
Examine the project root to determine the primary languages and tools in use:
- Check for dependency files (e.g.,
package.json,requirements.txt,go.mod,Cargo.toml). - Look for existing
Dockerfileordocker-compose.yml(orcompose.yaml) files. If the project already has custom container setups, prefer using the existing orchestration method (Dockerfile or Compose) over a pure image-based configuration. - Check if a
.devcontainerdirectory already exists. If it does, your goal is to update or repair it, not overwrite it blindly.