DevContainer Validator for Openclaw

A Python-powered CLI validator for devcontainer.json files that checks for structural errors, security risks, and configuration best practices.

charlie-morrison
v1.0.1
May 1, 2026
0
891
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install devcontainer-validator

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install devcontainer-validator using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is DevContainer Validator?

The DevContainer Validator is a robust technical tool designed to streamline the creation and maintenance of development environments. It specifically targets VS Code Dev Containers, GitHub Codespaces, and DevPod configurations by parsing JSONC files to identify common pitfalls. As a valuable component within the Openclaw Skills ecosystem, it helps developers maintain high-quality infrastructure-as-code by enforcing 24+ validation rules across various configuration domains.

By providing granular feedback on everything from OCI feature formats to dangerous privileged mode settings, this skill ensures that development containers are both functional and secure. Its zero-dependency Python architecture makes it exceptionally portable for any local or cloud-based environment.

DevContainer Validator Use Cases

  • Verifying devcontainer.json syntax and structural integrity for new projects.
  • Auditing security settings to prevent container breakouts or shell injection risks.
  • Automating configuration checks in CI/CD pipelines to prevent broken Codespaces.
  • Debugging port forwarding and networking inconsistencies in complex container setups.
  • Ensuring compliance with container best practices like non-root user execution.

How DevContainer Validator Works

  1. The validator loads a devcontainer.json file, supporting JSONC to handle comments and trailing commas.
  2. It executes a comprehensive suite of checks categorized into structure, features, networking, lifecycle scripts, customizations, and security.
  3. The tool analyzes potential conflicts between source types, such as simultaneous image and dockerFile declarations.
  4. It evaluates OCI feature references and lifecycle command patterns for syntax and security issues.
  5. It generates a report based on the selected output format, identifying issues by severity (Error, Warning, Info).
  6. The tool returns a specific exit code to signal success or failure, allowing for automated gatekeeping in development workflows.

DevContainer Validator Setup

To start using this tool with Openclaw Skills, ensure you have Python 3.8+ installed. The script uses the Python standard library, so no additional pip installs are required.

# Basic validation of a local file
python3 scripts/devcontainer_validator.py validate .devcontainer/devcontainer.json

# Run a security-focused audit in strict mode
python3 scripts/devcontainer_validator.py security --strict devcontainer.json

DevContainer Validator Data Schema & Taxonomy

The skill analyzes standard devcontainer.json schemas and outputs structured data. Below is the mapping of the validation categories and their focus areas:

Validation Area Logic Scope Example Checks
Structure File Integrity Missing image source, unknown top-level keys, JSONC syntax
Features Extension Logic Invalid feature formats, OCI reference validation, duplicates
Ports & Net Connectivity Port range validation (0-65535), forwardPorts array format
Lifecycle Hook Safety Shell injection patterns, empty commands, script type checks
Security Hardening remoteUser presence, privileged mode detection, capAdd entries
Customization Editor Logic VS Code extension ID format, settings object structure

DevContainer Validator Advanced Features

  • Multi-format output support including raw text, structured JSON, and one-line summaries.
  • Strict mode implementation to treat warnings and info messages as fatal errors for high-compliance environments.
  • Severity filtering via the --min-severity flag to focus on critical errors during initial development.
  • Specialized sub-commands like security or features to perform targeted audits without running the full suite.
  • Compatibility with the Openclaw Skills philosophy of lightweight, portable, and highly integrable CLI utilities.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*