跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 devcontainer-setup

Devcontainer Setup

脚手架一个完整的 VS代码 Dev Container配置与多克,多克编组,以及可选的克洛德代码CLI支持. 当被要求"设置devcontainer","添加多克开发环境","配置dev容器"时激活,或者将开发工作流程容器化.

176 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

脚手架一个完整的 VS代码 Dev Container配置与多克,多克编组,以及可选的克洛德代码CLI支持. 当被要求"设置devcontainer","添加多克开发环境","配置dev容器"时激活,或者将开发工作流程容器化.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Devcontainer Setup Skill、Authorized Scope、Contract、Information Gathering、Required Information、File Structure to Create。 其中含规范建议的小节:分步指令、输入输出示例。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/templates.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Scaffolds a complete VS Code Dev Container configuration with Docker, docker-compose, and optional Claude Code CLI support. Activates when asked to "set up devcontainer", "add docker development environment", "configure dev container", or containerize a development workflow.

Devcontainer Setup SkillAuthorized ScopeContractInformation GatheringRequired InformationFile Structure to CreateTemplatesPackage Manager ReferenceImplementation StepsExample Usage

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
devcontainer-setup
description
Scaffolds a complete VS Code Dev Container configuration with Docker, docker-compose, and optional Claude Code CLI support. Activates when asked to "set up devcontainer", "add docker development environment", "configure dev container", or containerize a development workflow.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • references/templates.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「devcontainer-setup」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-e39d3f75c1a6ebcd-%E5%87%8F%E5%8E%8B%E5%99%A8%E8%AE%BE%E7%BD%AE.html
请存为 .cursor/skills/devcontainer-setup/SKILL.md 或 .claude/skills/devcontainer-setup/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/shipshitdev/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/shipshitdev/skills' --list

npx skills add 'https://github.com/shipshitdev/skills' --skill 'devcontainer-setup'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: devcontainer-setup description: Scaffolds a complete VS Code Dev Container configuration with Docker, docker-compose, and optional Claude Code CLI support. Activates when asked to "set up devcontainer", "add docker development environment", "configure dev container", or containerize a development workflow. metadata: version: "1.1.0" tags: "devcontainer, docker, setup"

Devcontainer Setup Skill

Authorized Scope

Apply this engine only within the user's requested task and existing explicit authorization. Loading or delegating to it grants no additional authority. Preserve report-only restrictions and the caller's target, host, provider, and cost limits. Existing approval satisfies a gate only for the same actions and scope; obtain approval before expanding them. Forward these limits to delegates.

Contract

Inputs:

  • Project runtime, existing container configuration, and requested development setup
  • Approved directory mounts and optional tooling

Outputs:

  • Dev Container configuration and startup instructions

Creates/Modifies:

  • .devcontainer/ files within the authorized setup scope

External Side Effects:

  • Image pulls, package installs, or container startup only when requested

Confirmation Required:

  • Before overwriting existing configuration or mounting directories outside the selected project
  • Before adding tooling or starting containers outside the approved setup

Delegates To:

  • docker-expert for container configuration details

Information Gathering

Before creating the devcontainer, gather the following information from the user:

Required Information

  1. Project Name: What is the project/container name? (e.g., my-project, shipshitdev-api)

  2. Base Image: What runtime does this project use?

    • oven/bun:1.3.5 - Bun projects (recommended for speed)
    • node:20-slim - Node.js projects
    • node:20 - Node.js with more tools
    • Custom image path
  3. Package Manager: Which package manager?

    • bun - Bun (default for Bun projects)
    • npm - npm
    • pnpm - pnpm
    • yarn - Yarn
  4. Ports: What ports need to be forwarded? (comma-separated, e.g., 3000, 3001, 5432)

  5. Port Labels (optional): Labels for each port (e.g., 3000=Web, 5432=Postgres)

  6. Parent Directory Mount: Should the parent directory be mounted for cross-repo access?

    • Yes - Mount parent as /workspace (good for monorepos, shared libraries)
    • No - Only mount this project
  7. Claude Code Support: Include Claude Code CLI setup?

    • Yes - Install Claude Code and fix symlinks for container use
    • No - Skip Claude Code setup
  8. VS Code Extensions (optional): Additional extensions to install (comma-separated extension IDs)

  9. Monorepo Structure (if applicable):

    • Is this a monorepo with nested package.json files?
    • What are the app/package directories? (e.g., apps/*, packages/*)

File Structure to Create

.devcontainer/
├── devcontainer.json      # VS Code dev container config
├── Dockerfile             # Container image definition
├── docker-compose.yml     # Docker compose config
├── setup.sh               # Post-create setup script
└── README.md              # Documentation

Templates

Generate all five files from the gathered information:

  • devcontainer.json — build config, mounts, features, VS Code extensions/settings, forwarded ports, postCreateCommand
  • Dockerfile — base image, workdir, dependency install (monorepo-aware), dev tools, exposed ports
  • docker-compose.yml — service definition, volumes (parent mount + node_modules caching), ports, dev command
  • setup.sh — installs dependencies; if Claude Code support is requested, also fixes host-to-container Claude config symlinks and prints API key setup instructions
  • README.md — quick start, mount/port tables, directory structure, troubleshooting

See references/templates.md for the full fill-in-the-blank text of each file ({{PLACEHOLDER}} values come from the gathered information above).

Package Manager Reference

| Package Manager | Lock File | Install Command | Dev Command | |-----------------|-----------|-----------------|-------------| | bun | bun.lock* | bun install --frozen-lockfile | bun run dev | | npm | package-lock.json | npm ci | npm run dev | | pnpm | pnpm-lock.yaml | pnpm install --frozen-lockfile | pnpm run dev | | yarn | yarn.lock | yarn install --frozen-lockfile | yarn dev |

Implementation Steps

  1. Ask the user the required questions above using AskUserQuestion
  2. Create the .devcontainer directory
  3. Generate each file with the gathered configuration
  4. Make setup.sh executable
  5. Provide summary of what was created and how to use it

Example Usage

User: "Set up devcontainer for my Next.js project"

  1. Gather info: Project uses Bun, ports 3000, needs Claude Code support
  2. Create all 5 files in .devcontainer/
  3. Output: "Created devcontainer configuration. Open in VS Code and click 'Reopen in Container'."

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…