microsoft/hve-core
Publicmirrored fromhttps://github.com/microsoft/hve-coreAvailable
docs/customization/environment.md
334lines · modecode
| 1 | --- |
| 2 | title: Environment Customization |
| 3 | description: Configure DevContainers, VS Code settings, MCP servers, and coding agent environments for your team |
| 4 | author: Microsoft |
| 5 | ms.date: 2026-02-24 |
| 6 | ms.topic: how-to |
| 7 | keywords: |
| 8 | - devcontainer |
| 9 | - vs code settings |
| 10 | - mcp servers |
| 11 | - environment |
| 12 | estimated_reading_time: 6 |
| 13 | --- |
| 14 | |
| 15 | ## DevContainer Configuration |
| 16 | |
| 17 | HVE Core uses an Ubuntu 22.04 (Jammy) base image with Node.js 20, Python 3.11, |
| 18 | and PowerShell 7 pre-installed. The configuration lives in |
| 19 | `.devcontainer/devcontainer.json` and includes extensions for Markdown editing, |
| 20 | spell checking, and GitHub integration. |
| 21 | |
| 22 | ### Default Tool Stack |
| 23 | |
| 24 | The DevContainer ships with these tools: |
| 25 | |
| 26 | * Node.js 20 with npm |
| 27 | * Python 3.11 |
| 28 | * PowerShell 7 with PSScriptAnalyzer, PowerShell-Yaml, and Pester 5.7.1 |
| 29 | * Git and GitHub CLI |
| 30 | * Azure CLI |
| 31 | * shellcheck for bash validation |
| 32 | * actionlint for GitHub Actions workflow validation |
| 33 | * gitleaks for secret scanning |
| 34 | |
| 35 | ### Customizing for Your Team |
| 36 | |
| 37 | To add tools or adjust versions, modify `.devcontainer/devcontainer.json`. The |
| 38 | `features` section controls language runtimes and CLIs: |
| 39 | |
| 40 | ```json |
| 41 | { |
| 42 | "features": { |
| 43 | "ghcr.io/devcontainers/features/node:1": { |
| 44 | "version": "20" |
| 45 | }, |
| 46 | "ghcr.io/devcontainers/features/python:1": { |
| 47 | "version": "3.11" |
| 48 | }, |
| 49 | "ghcr.io/devcontainers/features/powershell:1": {} |
| 50 | } |
| 51 | } |
| 52 | ``` |
| 53 | |
| 54 | Add new features by referencing published DevContainer features from the |
| 55 | [DevContainers feature registry](https://containers.dev/features). For example, |
| 56 | to add Terraform: |
| 57 | |
| 58 | ```json |
| 59 | { |
| 60 | "features": { |
| 61 | "ghcr.io/devcontainers/features/terraform:1": { |
| 62 | "version": "1.6" |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | ``` |
| 67 | |
| 68 | ### Adding VS Code Extensions |
| 69 | |
| 70 | Include team-specific extensions in the `customizations.vscode.extensions` |
| 71 | array. Each entry uses the `publisher.extensionId` format: |
| 72 | |
| 73 | ```json |
| 74 | { |
| 75 | "customizations": { |
| 76 | "vscode": { |
| 77 | "extensions": [ |
| 78 | "streetsidesoftware.code-spell-checker", |
| 79 | "davidanson.vscode-markdownlint", |
| 80 | "ms-python.python" |
| 81 | ] |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | ``` |
| 86 | |
| 87 | ### Lifecycle Scripts |
| 88 | |
| 89 | Three lifecycle hooks execute during container setup: |
| 90 | |
| 91 | * `onCreateCommand` runs `.devcontainer/scripts/on-create.sh` to install system |
| 92 | dependencies (shellcheck, actionlint, PowerShell modules, gitleaks) |
| 93 | * `updateContentCommand` runs `npm ci` to install JavaScript dependencies |
| 94 | * `postCreateCommand` runs `.devcontainer/scripts/post-create.sh` for final |
| 95 | configuration |
| 96 | |
| 97 | Add custom setup steps to these scripts or create new scripts referenced from |
| 98 | `devcontainer.json`. |
| 99 | |
| 100 | ## VS Code Settings |
| 101 | |
| 102 | Workspace-level settings in `.vscode/settings.json` configure editor behavior, |
| 103 | Copilot customization discovery, and validation tools. These settings apply to |
| 104 | everyone who opens the workspace. |
| 105 | |
| 106 | ### Key Settings |
| 107 | |
| 108 | The workspace configures several critical behaviors: |
| 109 | |
| 110 | ```json |
| 111 | { |
| 112 | "editor.formatOnSave": true, |
| 113 | "[markdown]": { |
| 114 | "editor.defaultFormatter": "davidanson.vscode-markdownlint" |
| 115 | }, |
| 116 | "search.followSymlinks": false |
| 117 | } |
| 118 | ``` |
| 119 | |
| 120 | ### Copilot Discovery Paths |
| 121 | |
| 122 | VS Code discovers customization files through `chat.*FilesLocations` settings. |
| 123 | Each entry maps a directory path to `true` to enable scanning: |
| 124 | |
| 125 | ```json |
| 126 | { |
| 127 | "chat.instructionsFilesLocations": { |
| 128 | ".github/instructions/hve-core": true, |
| 129 | ".github/instructions/coding-standards": true |
| 130 | }, |
| 131 | "chat.agentFilesLocations": { |
| 132 | ".github/agents/hve-core": true, |
| 133 | ".github/agents/hve-core/subagents": true |
| 134 | }, |
| 135 | "chat.promptFilesLocations": { |
| 136 | ".github/prompts/hve-core": true |
| 137 | }, |
| 138 | "chat.agentSkillsLocations": { |
| 139 | ".github/skills": true, |
| 140 | ".github/skills/shared": true, |
| 141 | ".github/skills/coding-standards": true |
| 142 | } |
| 143 | } |
| 144 | ``` |
| 145 | |
| 146 | When you add a new collection directory, register it in these settings so Copilot |
| 147 | discovers your customizations. |
| 148 | |
| 149 | ### YAML Schema Validation |
| 150 | |
| 151 | The workspace maps YAML schemas to frontmatter validation: |
| 152 | |
| 153 | ```json |
| 154 | { |
| 155 | "yaml.schemas": { |
| 156 | "./scripts/linting/schemas/docs-frontmatter.schema.json": [ |
| 157 | "docs/**/*.md" |
| 158 | ] |
| 159 | } |
| 160 | } |
| 161 | ``` |
| 162 | |
| 163 | This setup provides in-editor validation for frontmatter fields when the Red Hat |
| 164 | YAML extension (`redhat.vscode-yaml`) is installed. |
| 165 | |
| 166 | ### Commit Message Instructions |
| 167 | |
| 168 | Copilot uses a dedicated instructions file for generating commit messages: |
| 169 | |
| 170 | ```json |
| 171 | { |
| 172 | "github.copilot.chat.commitMessageGeneration.instructions": [ |
| 173 | { |
| 174 | "file": ".github/instructions/hve-core/commit-message.instructions.md" |
| 175 | } |
| 176 | ] |
| 177 | } |
| 178 | ``` |
| 179 | |
| 180 | You can add your own commit message instructions file or replace this reference |
| 181 | to match your team's commit conventions. |
| 182 | |
| 183 | ## MCP Server Integration |
| 184 | |
| 185 | Model Context Protocol (MCP) servers extend Copilot's capabilities by connecting |
| 186 | it to external tools and data sources. MCP servers run alongside VS Code and |
| 187 | provide additional context, actions, or integrations that Copilot can invoke |
| 188 | during conversations. |
| 189 | |
| 190 | ### Configuration |
| 191 | |
| 192 | MCP servers are configured in `.vscode/mcp.json` at the workspace level: |
| 193 | |
| 194 | ```json |
| 195 | { |
| 196 | "servers": { |
| 197 | "github": { |
| 198 | "type": "http", |
| 199 | "url": "https://api.githubcopilot.com/mcp/" |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | ``` |
| 204 | |
| 205 | ### Adding Team-Specific MCP Servers |
| 206 | |
| 207 | To integrate your team's tools, add server entries to the `servers` object. |
| 208 | Each server needs a unique key, a type, and connection details: |
| 209 | |
| 210 | ```json |
| 211 | { |
| 212 | "servers": { |
| 213 | "github": { |
| 214 | "type": "http", |
| 215 | "url": "https://api.githubcopilot.com/mcp/" |
| 216 | }, |
| 217 | "contoso-api": { |
| 218 | "type": "http", |
| 219 | "url": "https://mcp.contoso.com/v1/" |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | ``` |
| 224 | |
| 225 | MCP servers enable agents to interact with issue trackers, CI/CD pipelines, |
| 226 | databases, and other systems your team relies on. |
| 227 | |
| 228 | ## Coding Agent Environment |
| 229 | |
| 230 | The GitHub Copilot coding agent runs in a cloud-based GitHub Actions environment, |
| 231 | separate from the local DevContainer. The |
| 232 | `.github/workflows/copilot-setup-steps.yml` workflow pre-installs tools before |
| 233 | the agent begins work. |
| 234 | |
| 235 | ### Pre-Installed Tools |
| 236 | |
| 237 | The coding agent environment includes: |
| 238 | |
| 239 | * Node.js 20 with npm dependencies from `package.json` |
| 240 | * Python 3.11 |
| 241 | * PowerShell 7 with PSScriptAnalyzer, PowerShell-Yaml, and Pester 5.7.1 |
| 242 | * shellcheck (pre-installed on ubuntu-latest) |
| 243 | * actionlint for GitHub Actions workflow validation |
| 244 | |
| 245 | ### Adding Tools for the Coding Agent |
| 246 | |
| 247 | Add installation steps to `copilot-setup-steps.yml`. Each tool should include |
| 248 | SHA-verified downloads for security: |
| 249 | |
| 250 | ```yaml |
| 251 | - name: Install custom tool |
| 252 | env: |
| 253 | TOOL_VERSION: '1.0.0' |
| 254 | TOOL_SHA256: 'abc123...' |
| 255 | run: | |
| 256 | curl -sLO "https://example.com/tool_${TOOL_VERSION}.tar.gz" |
| 257 | echo "${TOOL_SHA256} tool_${TOOL_VERSION}.tar.gz" | sha256sum -c - |
| 258 | tar -xzf "tool_${TOOL_VERSION}.tar.gz" tool |
| 259 | sudo install tool /usr/local/bin/tool |
| 260 | ``` |
| 261 | |
| 262 | ### Validation |
| 263 | |
| 264 | The workflow supports manual execution through `workflow_dispatch`, allowing you |
| 265 | to test setup changes before the coding agent encounters them. |
| 266 | |
| 267 | ## Environment Synchronization |
| 268 | |
| 269 | The DevContainer (`on-create.sh`) and coding agent (`copilot-setup-steps.yml`) |
| 270 | share most tools but differ intentionally in a few areas. |
| 271 | |
| 272 | ### Shared Tools |
| 273 | |
| 274 | | Tool | DevContainer | Coding Agent | |
| 275 | |------------------|--------------|--------------| |
| 276 | | Node.js 20 | Yes | Yes | |
| 277 | | Python 3.11 | Yes | Yes | |
| 278 | | PowerShell 7 | Yes | Yes | |
| 279 | | PSScriptAnalyzer | Yes | Yes | |
| 280 | | Pester 5.7.1 | Yes | Yes | |
| 281 | | shellcheck | Yes | Yes | |
| 282 | | actionlint | Yes | Yes | |
| 283 | |
| 284 | ### Intentional Differences |
| 285 | |
| 286 | | Tool | DevContainer | Coding Agent | Reason | |
| 287 | |----------|--------------|--------------|------------------------------------------------| |
| 288 | | gitleaks | Yes | No | Secret scanning is relevant for local dev only | |
| 289 | |
| 290 | ### Keeping Environments Aligned |
| 291 | |
| 292 | When adding or removing tools in either environment, evaluate whether both need |
| 293 | the change and update accordingly. Follow this checklist: |
| 294 | |
| 295 | 1. Determine if the tool is needed for local development, coding agent work, |
| 296 | or both. |
| 297 | 2. Update `.devcontainer/scripts/on-create.sh` for DevContainer changes. |
| 298 | 3. Update `.github/workflows/copilot-setup-steps.yml` for coding agent changes. |
| 299 | 4. Pin dependency versions and verify checksums in both locations. |
| 300 | 5. Test the DevContainer rebuild and run the setup workflow via |
| 301 | `workflow_dispatch`. |
| 302 | |
| 303 | ## Role Scenarios |
| 304 | |
| 305 | ### SRE/Operations |
| 306 | |
| 307 | An SRE team at Fabrikam needs Terraform and kubectl available in both |
| 308 | environments for infrastructure-as-code workflows. |
| 309 | |
| 310 | Steps to customize: |
| 311 | |
| 312 | 1. Add the Terraform DevContainer feature to `devcontainer.json` |
| 313 | 2. Add a kubectl installation step to `on-create.sh` |
| 314 | 3. Mirror both installations in `copilot-setup-steps.yml` |
| 315 | 4. Add the Terraform VS Code extension to the DevContainer extensions list |
| 316 | 5. Register any IaC-specific instruction paths in `.vscode/settings.json` |
| 317 | |
| 318 | ### Engineer |
| 319 | |
| 320 | A development team at Northwind Traders uses a custom API testing tool and wants |
| 321 | Copilot to reference their internal MCP server during code reviews. |
| 322 | |
| 323 | Steps to customize: |
| 324 | |
| 325 | 1. Add the API testing tool to `on-create.sh` and `copilot-setup-steps.yml` |
| 326 | 2. Configure the internal MCP server in `.vscode/mcp.json` |
| 327 | 3. Add workspace settings for any new extensions the team requires |
| 328 | 4. Create an instructions file that teaches Copilot about the team's API |
| 329 | conventions |
| 330 | |
| 331 | <!-- markdownlint-disable MD036 --> |
| 332 | *🤖 Crafted with precision by ✨Copilot following brilliant human instruction, |
| 333 | then carefully refined by our team of discerning human reviewers.* |
| 334 | <!-- markdownlint-enable MD036 --> |
| 335 | |