| name | check-environment |
| description | Detect OS/shell, validate vcpkg setup, and emit a combined environment report. Use when asked to check the environment, verify setup, or troubleshoot vcpkg configuration. |
Check Environment
Run a unified check that detects the host OS and shell, verifies key developer tools, validates vcpkg installation and registry structure. Produces a single consolidated markdown report.
Goals
- PASS: Environment is suitable for building ports with vcpkg-registry; all critical tools and paths validated.
- FAIL: Missing critical tools or misconfigured environment; actionable fixes provided.
Capabilities
- Identify operating system and shell (Windows/PowerShell prioritized)
- Verify minimum tool availability (curl, tar, zip, unzip, git, cmake, ninja)
- Locate and validate vcpkg (
VCPKG_ROOT or PATH)
- Check vcpkg-tool version and critical directories
- Verify registry folders in current workspace (
ports/, versions/, triplets/)
- Enumerate
VCPKG_* environment variables and explain VCPKG_FEATURE_FLAGS
- Emit one structured report for reproducibility
User Input
No input required. Automatically detects environment and vcpkg configuration.
Process
Use short shell commands. Do NOT use complicated scripts.
Phase 1: Detect Operating System & Shell
- OS detection:
- Windows:
$PSVersionTable.PSVersion
- Linux/macOS:
uname -s
- System details:
- Windows:
Get-ComputerInfo | Select-Object CsName, WindowsVersion, OsArchitecture
- Linux:
uname -a; lsb_release -a 2>/dev/null || cat /etc/os-release
- macOS:
sw_vers; uname -m
- Shell info:
- Windows:
$PSVersionTable.PSEdition; $PSVersionTable.PSVersion
- Linux/macOS:
echo $SHELL; $SHELL --version
- Tool availability: check
curl, tar, zip, unzip, git, cmake, ninja
Phase 2: Locate and Validate vcpkg
- Check
VCPKG_ROOT environment variable
- Check
vcpkg in PATH
- Infer
VCPKG_ROOT from executable path if unset
- Fallback search: common paths (
C:\vcpkg, /usr/local/vcpkg, $HOME/vcpkg)
- Get vcpkg version:
vcpkg --version (minimum recommended: 2025-06-20)
- Verify critical directories:
scripts/, triplets/, ports/
- Check toolchain file:
${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
Phase 3: Check Registry Structure
- Locate
vcpkg-configuration.json
- Verify folders:
ports/, versions/, triplets/
- Check
versions/baseline.json
- List vcpkg-related environment variables:
- Windows:
Get-ChildItem Env: | Where-Object Name -like 'VCPKG*'
- Linux/macOS:
env | grep -i '^VCPKG' | sort
Reporting
Output a single markdown report with these headings (in order). Emit all headings even if empty (use None).
# Combined Environment Report
## Summary — Timestamp, OS family, architecture, shell, outcome (READY/WARN/ERROR)
## System — OS detailed, hostname, kernel, distribution
## Shell — Shell name, version, edition
## Tools — Each of curl/tar/zip/unzip/git/cmake/ninja with version or missing
## vcpkg Installation — VCPKG_ROOT, root exists, executable found, toolchain file, critical dirs
## Version Status — Detected version, parsed date tag, minimum recommended, status
## Registry Structure — Registry root, ports/versions/triplets folder presence and counts
## Configuration File — vcpkg-configuration.json path, registries, default registry
## Environment Variables — List each VCPKG_* variable
## Feature Flags — Raw value, parsed flags, unknown flags
## Diagnostics — PATH contains vcpkg, inferred root, missing components, cross-platform translations
## Recommendations — Install missing tools, set VCPKG_ROOT, upgrade vcpkg-tool
## Next Steps — Based on READY/WARN/ERROR status
Conventions
- Use ✅ ⚠️ ❌ where applicable
- Keep results concise; no full dumps
- Prefer PowerShell commands on Windows; provide POSIX translations only when needed
Next Steps Guidance
- READY: suggest
search-port or create-port skill
- WARN: perform upgrades then re-run check
- ERROR: install/fix missing items first