Config-driven operating environment skill for shell commands, tool path resolution, and platform-specific syntax across all platforms
Config-driven operating environment skill for shell commands, tool path resolution, and platform-specific syntax across all platforms
Scope: always -- auto-loaded for every agent session. Do not skip.
This skill defines how to discover tool paths, detect the platform, and apply shell syntax rules. All paths come from configuration files; nothing is hardcoded in this skill.
| File | Purpose | Committed |
|||--|
| {directories.cache}/session-paths.json | Verified tool paths for this machine | No (gitignored) |
| {directories.config}/tools.json | Resolution order, fallbacks, env vars per tool | Yes |
| {directories.config}/settings.json | Platform rules, directories, credentials refs | Yes |
Rule: Paths live ONLY in these config files. Skills and .cursorrules must never contain hardcoded tool paths.
Read {directories.cache}/session-paths.json:
{
"paths": { "python": "...", "pip": "...", "conda": "...", "git": "...", "pytest": "..." },
"workspace": { "root": "...", "shell": "powershell" },
"verified": "2026-02-10"
}
If the file exists and verified is recent, use these paths directly. This is
the fastest resolution -- one read, zero lookups.
If the file is missing, empty, or stale, proceed to Step 4 (Tool Path Resolution).
Read user_info.Shell from the IDE context (provided automatically in every
message). Cross-reference with the platforms section in {directories.config}/settings.json:
{
"platforms": {
"windows": { "shell": "powershell", "path_separator": "\\", "env_syntax": "%VAR%" },
"linux": { "shell": "bash", "path_separator": "/", "env_syntax": "$VAR" },
"darwin": { "shell": "zsh", "path_separator": "/", "env_syntax": "$VAR" }
}
}
Use the detected shell to select the correct syntax rules below.
powershell)&& chaining -- use ; to chain commands sequentially.# WRONG -- parse error in PowerShell 5.x
cd "path" && git pull
# CORRECT
cd "path"; git pull
<<EOF) -- use simple strings or multiple -m flags.# WRONG
git commit -m "$(cat <<'EOF'
message
EOF
)"
# CORRECT
git commit -m "feat: Add new feature"
# CORRECT -- multi-line
git commit -m "feat: Add new feature" -m "Detailed description here"
# CORRECT -- PowerShell here-string
$message = @"
Title line
Body paragraph
"@
git commit -m $message
Always use full tool paths -- bare python or git may not resolve.
Use the verified path from session cache.
Set working_directory on Shell tool calls instead of cd.
Verify paths with Glob or LS before referencing in commands.
bash) / Zsh (zsh)&& chaining works normally.<<EOF) works normally.working_directory on Shell tool calls instead of cd.| Bash / Zsh | PowerShell 5.x | Purpose |
||-||
| && | ; | Sequential execution |
| \|\| | ; if ($LASTEXITCODE -ne 0) { ... } | Run on failure |
| \| | \| | Pipe (same on all platforms) |
When a path is not in session cache or fails, resolve using the order defined
in {directories.config}/tools.json under resolution_order:
{directories.cache}/session-paths.json (already tried in Step 1)env_var field for the tool (e.g., $env:PYTHON_PATH on Windows, $PYTHON_PATH on Unix)tools section of {directories.config}/tools.json for fallbacks array; try each path in orderwhere.exe <tool> (Windows) or which <tool> (Unix)defaults.<platform> in {directories.config}/tools.jsonFor each tool, tools.json defines:
{
"python": {
"env_var": "PYTHON_PATH",
"conda_env": "cursor-factory",
"auto_detect": ["python", "python3", "python.exe"],
"fallbacks": ["<paths from tools.json>"],
"min_version": "3.10"
}
}
Do not repeat these paths here. Read them from tools.json at resolution time.
After resolving a tool path:
<path> --version) to confirm the tool works.{directories.cache}/session-paths.json so future calls skip resolution.When Python operations require a specific conda environment:
conda_env field from {directories.config}/tools.json for the python tool.<conda_path> activate <env_name>.& <conda_path> activate <env_name> or the activate.bat script.<conda_path> install -n <env_name> <package> over bare conda install..cursorrules -- always read from config.working_directory on Shell tool calls instead of using cd.Glob or LS before referencing them in commands.user_info.Shell to determine which syntax rules to apply.This skill should be used when strict adherence to the defined process is required.
npx skills add gitwalter/operating-environments下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer