microsoft/hve-core

Public

mirrored fromhttps://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
hve-core-v3.3.27

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/customization/environment.md

333lines · modecode

1---
2title: Environment Customization
3description: Configure DevContainers, VS Code settings, MCP servers, and coding agent environments for your team
4author: Microsoft
5ms.date: 2026-02-24
6ms.topic: how-to
7keywords:
8 - devcontainer
9 - vs code settings
10 - mcp servers
11 - environment
12estimated_reading_time: 6
13---
14
15## DevContainer Configuration
16
17HVE Core uses an Ubuntu 22.04 (Jammy) base image with Node.js 20, Python 3.11,
18and PowerShell 7 pre-installed. The configuration lives in
19`.devcontainer/devcontainer.json` and includes extensions for Markdown editing,
20spell checking, and GitHub integration.
21
22### Default Tool Stack
23
24The 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
37To 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
54Add new features by referencing published DevContainer features from the
55[DevContainers feature registry](https://containers.dev/features). For example,
56to 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
70Include team-specific extensions in the `customizations.vscode.extensions`
71array. 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
89Three 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
97Add custom setup steps to these scripts or create new scripts referenced from
98`devcontainer.json`.
99
100## VS Code Settings
101
102Workspace-level settings in `.vscode/settings.json` configure editor behavior,
103Copilot customization discovery, and validation tools. These settings apply to
104everyone who opens the workspace.
105
106### Key Settings
107
108The 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
122VS Code discovers customization files through `chat.*FilesLocations` settings.
123Each 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 }
142}
143```
144
145When you add a new collection directory, register it in these settings so Copilot
146discovers your customizations.
147
148### YAML Schema Validation
149
150The workspace maps YAML schemas to frontmatter validation:
151
152```json
153{
154 "yaml.schemas": {
155 "./scripts/linting/schemas/docs-frontmatter.schema.json": [
156 "docs/**/*.md"
157 ]
158 }
159}
160```
161
162This setup provides in-editor validation for frontmatter fields when the Red Hat
163YAML extension (`redhat.vscode-yaml`) is installed.
164
165### Commit Message Instructions
166
167Copilot uses a dedicated instructions file for generating commit messages:
168
169```json
170{
171 "github.copilot.chat.commitMessageGeneration.instructions": [
172 {
173 "file": ".github/instructions/hve-core/commit-message.instructions.md"
174 }
175 ]
176}
177```
178
179You can add your own commit message instructions file or replace this reference
180to match your team's commit conventions.
181
182## MCP Server Integration
183
184Model Context Protocol (MCP) servers extend Copilot's capabilities by connecting
185it to external tools and data sources. MCP servers run alongside VS Code and
186provide additional context, actions, or integrations that Copilot can invoke
187during conversations.
188
189### Configuration
190
191MCP servers are configured in `.vscode/mcp.json` at the workspace level:
192
193```json
194{
195 "servers": {
196 "github": {
197 "type": "http",
198 "url": "https://api.githubcopilot.com/mcp/"
199 }
200 }
201}
202```
203
204### Adding Team-Specific MCP Servers
205
206To integrate your team's tools, add server entries to the `servers` object.
207Each server needs a unique key, a type, and connection details:
208
209```json
210{
211 "servers": {
212 "github": {
213 "type": "http",
214 "url": "https://api.githubcopilot.com/mcp/"
215 },
216 "contoso-api": {
217 "type": "http",
218 "url": "https://mcp.contoso.com/v1/"
219 }
220 }
221}
222```
223
224MCP servers enable agents to interact with issue trackers, CI/CD pipelines,
225databases, and other systems your team relies on.
226
227## Coding Agent Environment
228
229The GitHub Copilot coding agent runs in a cloud-based GitHub Actions environment,
230separate from the local DevContainer. The
231`.github/workflows/copilot-setup-steps.yml` workflow pre-installs tools before
232the agent begins work.
233
234### Pre-Installed Tools
235
236The coding agent environment includes:
237
238* Node.js 20 with npm dependencies from `package.json`
239* Python 3.11
240* PowerShell 7 with PSScriptAnalyzer, PowerShell-Yaml, and Pester 5.7.1
241* shellcheck (pre-installed on ubuntu-latest)
242* actionlint for GitHub Actions workflow validation
243
244### Adding Tools for the Coding Agent
245
246Add installation steps to `copilot-setup-steps.yml`. Each tool should include
247SHA-verified downloads for security:
248
249```yaml
250- name: Install custom tool
251 env:
252 TOOL_VERSION: '1.0.0'
253 TOOL_SHA256: 'abc123...'
254 run: |
255 curl -sLO "https://example.com/tool_${TOOL_VERSION}.tar.gz"
256 echo "${TOOL_SHA256} tool_${TOOL_VERSION}.tar.gz" | sha256sum -c -
257 tar -xzf "tool_${TOOL_VERSION}.tar.gz" tool
258 sudo install tool /usr/local/bin/tool
259```
260
261### Validation
262
263The workflow supports manual execution through `workflow_dispatch`, allowing you
264to test setup changes before the coding agent encounters them.
265
266## Environment Synchronization
267
268The DevContainer (`on-create.sh`) and coding agent (`copilot-setup-steps.yml`)
269share most tools but differ intentionally in a few areas.
270
271### Shared Tools
272
273| Tool | DevContainer | Coding Agent |
274|------------------|--------------|--------------|
275| Node.js 20 | Yes | Yes |
276| Python 3.11 | Yes | Yes |
277| PowerShell 7 | Yes | Yes |
278| PSScriptAnalyzer | Yes | Yes |
279| Pester 5.7.1 | Yes | Yes |
280| shellcheck | Yes | Yes |
281| actionlint | Yes | Yes |
282
283### Intentional Differences
284
285| Tool | DevContainer | Coding Agent | Reason |
286|----------|--------------|--------------|------------------------------------------------|
287| gitleaks | Yes | No | Secret scanning is relevant for local dev only |
288
289### Keeping Environments Aligned
290
291When adding or removing tools in either environment, evaluate whether both need
292the change and update accordingly. Follow this checklist:
293
2941. Determine if the tool is needed for local development, coding agent work,
295 or both.
2962. Update `.devcontainer/scripts/on-create.sh` for DevContainer changes.
2973. Update `.github/workflows/copilot-setup-steps.yml` for coding agent changes.
2984. Pin dependency versions and verify checksums in both locations.
2995. Test the DevContainer rebuild and run the setup workflow via
300 `workflow_dispatch`.
301
302## Role Scenarios
303
304### SRE/Operations
305
306An SRE team at Fabrikam needs Terraform and kubectl available in both
307environments for infrastructure-as-code workflows.
308
309Steps to customize:
310
3111. Add the Terraform DevContainer feature to `devcontainer.json`
3122. Add a kubectl installation step to `on-create.sh`
3133. Mirror both installations in `copilot-setup-steps.yml`
3144. Add the Terraform VS Code extension to the DevContainer extensions list
3155. Register any IaC-specific instruction paths in `.vscode/settings.json`
316
317### Engineer
318
319A development team at Northwind Traders uses a custom API testing tool and wants
320Copilot to reference their internal MCP server during code reviews.
321
322Steps to customize:
323
3241. Add the API testing tool to `on-create.sh` and `copilot-setup-steps.yml`
3252. Configure the internal MCP server in `.vscode/mcp.json`
3263. Add workspace settings for any new extensions the team requires
3274. Create an instructions file that teaches Copilot about the team's API
328 conventions
329
330<!-- markdownlint-disable MD036 -->
331*🤖 Crafted with precision by ✨Copilot following brilliant human instruction,
332then carefully refined by our team of discerning human reviewers.*
333<!-- markdownlint-enable MD036 -->
334