devcontainer

Create reproducible devcontainer.json configurations with pinned Features and lifecycle scripts.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill devcontainer-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: devcontainer
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/devcontainer
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill devcontainer-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes inconsistent, fragile, and hard-to-reproduce development environments by guiding you to define secure, version-pinned devcontainer.json setups with dependable lifecycle behavior.

Core Features & Use Cases

  • Reproducible Environment Setup: Pin base image tags and Dev Container Feature versions to avoid “it works on my machine” drift.
  • Correct Lifecycle Hook Usage: Separate onCreateCommand, updateContentCommand, and postCreateCommand so OS-level work happens at the right time and project dependencies run only when the workspace is ready.
  • Secure, Practical Customization: Configure remoteUser, VS Code extensions, and settings, and prefer Features over monolithic Dockerfiles.
  • Use Case: When onboarding contributors to a Python/Node repo, create a consistent devcontainer that installs OS tools and then installs project dependencies reliably for every developer and Codespaces session.

Quick Start

Use the devcontainer skill to generate a robust .devcontainer/devcontainer.json for a project by specifying your base image, required Features, remoteUser, and the commands that should run in onCreateCommand, updateContentCommand, and postCreateCommand.

Frequently Asked Questions about devcontainer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a reproducible devcontainer.json configuration for VS Code and Codespaces?

Lifecycle scripts in devcontainers separate container creation, workspace mounting, and dependency installation. Use onCreateCommand for OS-level setup, updateContentCommand for workspace updates, and postCreateCommand for project dependencies.

What's the best way to separate onCreateCommand, updateContentCommand, and postCreateCommand in devcontainers?

Separate lifecycle scripts by running OS-level work in onCreateCommand, workspace updates in updateContentCommand, and project dependencies in postCreateCommand to ensure dependencies install only when the workspace is fully ready.

Why should I use Dev Container Features instead of a monolithic Dockerfile?

Using Features instead of a monolithic Dockerfile allows version-pinned, modular toolchain additions. This prevents environment drift and ensures secure, consistent setups across VS Code and Codespaces environments.

How do I configure remoteUser securely when setting up a devcontainer?

Configure remoteUser to securely separate root execution for OS-level container creation from remoteUser execution for post-creation dependency installation, ensuring safe and consistent development environments.

Does this devcontainer setup work for onboarding contributors to a Python or Node repository?

Yes, this devcontainer setup onboards contributors to Python or Node repos by creating consistent environments that reliably install OS tools and project dependencies for every developer and Codespaces session.