Official agent skill

Cross Platform Paths

by microsoft in microsoft/vscode-python-environments

Critical patterns for cross-platform path handling in this VS Code extension.

OfficialMITAuto-check passedTesting & QA

Install Cross Platform Paths

skills CLI
$ npx skills add microsoft/vscode-python-environments --skill cross-platform-paths -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/vscode-python-environments cross-platform-paths --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/vscode-python-environments.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/cross-platform-paths .claude/skills/cross-platform-paths && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cross-platform-paths
GitHub stars
141
Token cost
~1.5k tokens
SKILL.md length
226 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Critical patterns for cross-platform path handling in this VS Code extension.

  • Works in 3 steps: Test on Windows (cmd, PowerShell, Git… → Test on macOS (zsh, bash) → Test on Linux (bash, fish)
  • Writing path-related code
  • SKILL.md covers Core Rules, Platform-Specific Gotchas, Common Patterns and File Existence Checks, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Cross Platform Paths is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. Critical patterns for cross-platform path handling in this VS Code extension. Windows vs POSIX path bugs are the 1 source of issues. Use this skill when reviewing or writing path-related code.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA. It works with Visual Studio Code, Linux, macOS and Bash. The repository describes itself as: VS Code extension for Python environment and package management. The licence is MIT.

When your agent uses it

  • Writing path-related code

Example prompts

  • “/cross-platform-paths”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Test on Windows (cmd, PowerShell, Git Bash)
  2. Test on macOS (zsh, bash)
  3. Test on Linux (bash, fish)

What it can do on your machine

Read from SKILL.md and the folder at commit 4faeedf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cross Platform Paths loads about 1.5k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 226 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/vscode-python-environments at commit 4faeedf, republished under its MIT licence (© microsoft). 226 words, ~1,495 tokens.

Download SKILL.mdSave it as .claude/skills/cross-platform-paths/SKILL.md (or your agent's skills folder).
name
cross-platform-paths
description
Critical patterns for cross-platform path handling in this VS Code extension. Windows vs POSIX path bugs are the #1 source of issues. Use this skill when reviewing or writing path-related code.
argument-hint
Review path handling in [file or component]
user-invocable
false

Cross-Platform Path Handling

CRITICAL: This extension runs on Windows, macOS, and Linux. Path bugs are the #1 source of issues.

Core Rules

Rule 1: Never Concatenate Paths with /
typescript
// ❌ WRONG: POSIX-style path concatenation
const envPath = homeDir + '/.venv/bin/python';

// ✅ RIGHT: Use path.join()
const envPath = path.join(homeDir, '.venv', 'bin', 'python');
Rule 2: Use path.resolve() for Comparisons, Not path.normalize()
typescript
// ❌ WRONG: path.normalize keeps relative paths relative on Windows
const normalized = path.normalize(fsPath);
// path.normalize('\test') → '\test' (still relative!)

// ✅ RIGHT: path.resolve adds drive letter on Windows
const normalized = path.resolve(fsPath);
// path.resolve('\test') → 'C:\test' (absolute!)

// When comparing paths, use resolve() on BOTH sides:
const pathA = path.resolve(fsPath);
const pathB = path.resolve(e.environmentPath.fsPath);
return pathA === pathB;
Rule 3: Use Uri.file().fsPath for VS Code Paths
typescript
// ❌ WRONG: Raw string comparison
if (filePath === otherPath) {
}

// ✅ RIGHT: Compare fsPath to fsPath
import { Uri } from 'vscode';
const fsPathA = Uri.file(pathA).fsPath;
const fsPathB = Uri.file(pathB).fsPath;
if (fsPathA === fsPathB) {
}

Platform-Specific Gotchas

Windows
IssueDetails
Drive lettersPaths start with C:\, D:\, etc.
BackslashesSeparator is \, not /
Case insensitivityC:\Test equals c:\test
Long pathsPaths >260 chars may fail
Mapped drivesZ:\ may not be accessible
pyenv-winUses pyenv.bat, not pyenv or pyenv.exe
Poetry cache%LOCALAPPDATA%\pypoetry\Cache\virtualenvs
UNC paths\\server\share\ format
macOS
IssueDetails
Case sensitivityDepends on filesystem (usually insensitive)
Homebrew symlinksComplex symlink chains in /opt/homebrew/
Poetry cache~/Library/Caches/pypoetry/virtualenvs
XCode PythonDifferent from Command Line Tools Python
Linux
IssueDetails
Case sensitivityPaths ARE case-sensitive
/bin symlinks/bin may be symlink to /usr/bin
XDG directories~/.local/share/virtualenvs for pipenv
Poetry cache~/.cache/pypoetry/virtualenvs
Hidden filesDot-prefixed files are hidden

Common Patterns

Getting Platform-Specific Paths
typescript
import * as os from 'os';
import * as path from 'path';

// Home directory
const home = os.homedir(); // Works cross-platform

// Construct paths correctly
const venvPath = path.join(home, '.venv', 'bin', 'python');
// Windows: C:\Users\name\.venv\bin\python
// macOS:   /Users/name/.venv/bin/python
// Linux:   /home/name/.venv/bin/python
Environment-Specific Executable Names
typescript
const isWindows = process.platform === 'win32';

// Python executable
const pythonExe = isWindows ? 'python.exe' : 'python';

// Activate script
const activateScript = isWindows
    ? path.join(venvPath, 'Scripts', 'activate.bat')
    : path.join(venvPath, 'bin', 'activate');

// pyenv command
const pyenvCmd = isWindows ? 'pyenv.bat' : 'pyenv';
Normalizing Paths for Comparison
typescript
import { normalizePath } from './common/utils/pathUtils';

// Use normalizePath() for map keys and comparisons
const key = normalizePath(filePath);
cache.set(key, value);

// But preserve original for user display
traceLog(`Discovered: ${filePath}`); // Keep original
Handling Uri | string Union Types
typescript
// ❌ WRONG: Assuming Uri
function process(locator: Uri | string) {
    const fsPath = locator.fsPath; // Crashes if string!
}

// ✅ RIGHT: Handle both types
function process(locator: Uri | string) {
    const fsPath = locator instanceof Uri ? locator.fsPath : locator;

    // Now normalize for comparisons
    const normalized = path.resolve(fsPath);
}

File Existence Checks

typescript
import * as fs from 'fs';
import * as path from 'path';

// Check file exists (cross-platform)
const configPath = path.join(projectRoot, 'pyproject.toml');
if (fs.existsSync(configPath)) {
    // File exists
}

// Use async version when possible
import { promises as fsPromises } from 'fs';
try {
    await fsPromises.access(configPath);
    // File exists
} catch {
    // File does not exist
}

Shell Path Escaping

typescript
// ❌ WRONG: Unescaped paths in shell commands
terminal.sendText(`python ${filePath}`);
// D:\path\file.py becomes "D:pathfile.py" in some shells!

// ✅ RIGHT: Quote paths
terminal.sendText(`python "${filePath}"`);

// For Git Bash on Windows, escape backslashes
const shellPath = isGitBash ? filePath.replace(/\\/g, '/') : filePath;

Testing Cross-Platform Code

When testing path-related code:

  1. Test on Windows (cmd, PowerShell, Git Bash)
  2. Test on macOS (zsh, bash)
  3. Test on Linux (bash, fish)

Pay special attention to:

  • Paths with spaces: C:\Program Files\Python
  • Paths with Unicode: ~/проекты/
  • Very long paths (>260 chars on Windows)
  • Paths with special characters: $, &, (, )

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/cross-platform-paths of microsoft/vscode-python-environments.

Open the folder on GitHubat commit 4faeedf

Compare with similar skills

Cross Platform Paths next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cross Platform Paths compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cross Platform Paths this skillmicrosoft/vscode-python-environments141—~1.5kAutomated safety check: PassMIT
Apple Container Test RunnerRustPython/RustPython22k—~467Automated safety check: PassMIT
Adu Motion Videoadunext/adu-motion-video166—~2.3kAutomated safety check: PassMIT
UvBiFangKNT/mtga1.2k—~541Automated safety check: PassAGPL-3.0
Cross Platform Guardianwcygan/dotfiles196—~514Automated safety check: PassNone
Code Change Verificationopenai/openai-agents-python30k—~1.4kAutomated safety check: PassMIT

Similar skills

  • Apple Container Test Runner

    RustPython/RustPython

    Runs RustPython tests inside a Linux container built with Apple's container CLI, so macOS users can compare Linux results with their local ones.

    22k GitHub stars~467 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Adu Motion Video

    adunext/adu-motion-video

    使用完整动画工程包,把新口播、文案与自有素材制作成可编辑动效视频和 60fps MP4;也支持轻量 TPL、手绘续接、字幕与改旧片。支持 Windows、macOS、Linux,以及 Codex、Claude Code、豆包、DeepSeek、WorkBuddy 等可读写文件并运行命令的助手。

    166 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Uv

    BiFangKNT/mtga

    在 Windows/macOS/Linux 上使用 uv 执行 Python 运行、依赖同步、锁文件管理、Python 版本管理与工具命令(uv run、uv sync、uv lock、uv python、uv tool)。当任务涉及“用 uv 运行脚本/命令”“临时依赖(--with)”“锁文件一致性(--locked/--frozen)”“跨平台…

    1.2k GitHub stars~541 tokensUpdated 3 mo ago
    Auto-check passed
  • Protect macOS, Ubuntu, Fedora, and Linux/WSL compatibility in this dotfiles repository.

    196 GitHub stars~514 tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Code Change Verification

    openai/openai-agents-python

    Official

    Run the required final formatting, lint, type, and test checks after eligible SDK changes pass review.

    30k GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • K8e Sandbox

    xiaods/k8e

    Run a goal end to end inside an isolated K8E sandbox pod (gVisor / Kata / Firecracker) instead of on the host: exec bash / Python / Node / TypeScript, install packages, move files in and out, reuse…

    499 GitHub stars~6k tokensUpdated 9 days ago
    Backend & APIsAuto-check passed

More from microsoft/vscode-python-environments

All 9 skills in this repo
  • Python Manager Discovery

    microsoft/vscode-python-environments

    Official

    Environment manager-specific discovery patterns and known issues.

    141 GitHub stars~2.7k tokensUpdated yesterday
    Auto-check passed
  • Run E2E Tests

    microsoft/vscode-python-environments

    Official

    Run E2E tests to verify complete user workflows like environment discovery, creation, and selection.

    141 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Run Integration Tests

    microsoft/vscode-python-environments

    Official

    Run integration tests to verify that extension components work together correctly.

    141 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Run Smoke Tests

    microsoft/vscode-python-environments

    Official

    Run smoke tests to verify extension functionality in a real VS Code environment.

    141 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Debug Failing Test

    microsoft/vscode-python-environments

    Official

    Debug a failing test using an iterative logging approach, then clean up and document the learning.

    141 GitHub stars~780 tokensUpdated yesterday
    Auto-check passed
  • Generate Snapshot

    microsoft/vscode-python-environments

    Official

    Generate a codebase health snapshot for technical debt tracking and planning.

    141 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Cross Platform Paths

What does Cross Platform Paths do?

Critical patterns for cross-platform path handling in this VS Code extension. Cross Platform Paths is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. Critical patterns for cross-platform path handling in this VS Code extension.

When should I use Cross Platform Paths?

Cross Platform Paths fits situations like: writing path-related code.

How do I install Cross Platform Paths in Claude Code?

Run `npx skills add microsoft/vscode-python-environments --skill cross-platform-paths -a claude-code`. Or copy the skill folder (.github/skills/cross-platform-paths in microsoft/vscode-python-environments) into .claude/skills/cross-platform-paths in your project. Claude Code loads it when a task matches its description.

How do I install Cross Platform Paths in Codex?

Run `npx skills add microsoft/vscode-python-environments --skill cross-platform-paths -a codex`. Or copy the skill folder (.github/skills/cross-platform-paths in microsoft/vscode-python-environments) into .agents/skills/cross-platform-paths in your project. Codex loads it when a task matches its description.

Can I use Cross Platform Paths in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/vscode-python-environments --skill cross-platform-paths -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cross-platform-paths, .gemini/skills/cross-platform-paths, .github/skills/cross-platform-paths and .opencode/skills/cross-platform-paths in your project.

What does Cross Platform Paths need to run?

SKILL.md names no scripts, command-line tools or credentials: Cross Platform Paths is instructions for the agent only. Our summary lists: Python 3.

Does Cross Platform Paths access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cross Platform Paths safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cross Platform Paths use?

Cross Platform Paths is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cross Platform Paths use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cross Platform Paths?

Skills that share tags, products or a category with Cross Platform Paths: Apple Container Test Runner (RustPython/RustPython, 22k stars), Adu Motion Video (adunext/adu-motion-video, 166 stars), Uv (BiFangKNT/mtga, 1.2k stars) and Cross Platform Guardian (wcygan/dotfiles, 196 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cross Platform Paths?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/vscode-python-environments, which has 141 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 7, 2026.

Source: microsoft/vscode-python-environments on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.