Official agent skill

Python Manager Discovery

by microsoft in microsoft/vscode-python-environments

Environment manager-specific discovery patterns and known issues.

OfficialMITAuto-check passedWriting & Content

Install Python Manager Discovery

skills CLI
$ npx skills add microsoft/vscode-python-environments --skill python-manager-discovery -a claude-code

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

GitHub CLI
$ gh skill install microsoft/vscode-python-environments python-manager-discovery --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/python-manager-discovery .claude/skills/python-manager-discovery && 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
python-manager-discovery
GitHub stars
141
Token cost
~2.7k tokens
SKILL.md length
468 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Environment manager-specific discovery patterns and known issues.

  • Works in 3 steps: Local config: poetry.toml in project root → Environment variables:… → Global config:…
  • Reviewing environment discovery code for conda
  • SKILL.md covers Manager Quick Reference, Poetry, Pipenv and PyEnv, plus 3 more sections
  • Calls conda

What it does

Python Manager Discovery is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. Environment manager-specific discovery patterns and known issues. Use when working on or reviewing environment discovery code for conda, poetry, pipenv, pyenv, or venv.

Its SKILL.md is about 2.7k 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 Writing & Content, covering Creative writing and fiction. It works with Python. The repository describes itself as: VS Code extension for Python environment and package management. The licence is MIT.

When your agent uses it

  • Reviewing environment discovery code for conda
  • Tasks that involve Creative writing and fiction

Example prompts

  • “/python-manager-discovery”

Requirements

  • Python 3

Workflow steps

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

  1. Local config: poetry.toml in project root
  2. Environment variables: POETRY_VIRTUALENVS_*
  3. Global config: ~/.config/pypoetry/config.toml

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

    Shell commands in SKILL.md call:

    • conda

    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

Python Manager Discovery loads about 2.7k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 468 words of instructions outside code blocks.

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

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). 468 words, ~2,672 tokens.

Download SKILL.mdSave it as .claude/skills/python-manager-discovery/SKILL.md (or your agent's skills folder).
name
python-manager-discovery
description
Environment manager-specific discovery patterns and known issues. Use when working on or reviewing environment discovery code for conda, poetry, pipenv, pyenv, or venv.
argument-hint
manager name (e.g., poetry, conda, pyenv)
user-invocable
false

Environment Manager Discovery Patterns

This skill documents manager-specific discovery patterns, environment variable precedence, and known issues.

Manager Quick Reference

ManagerConfig FilesCache LocationKey Env Vars
Poetrypoetry.toml, pyproject.toml, config.tomlPlatform-specificPOETRY_VIRTUALENVS_IN_PROJECT, POETRY_CACHE_DIR
PipenvPipfile, Pipfile.lockXDG or WORKON_HOMEWORKON_HOME, XDG_DATA_HOME
Pyenv.python-version, versions/~/.pyenv/ or pyenv-winPYENV_ROOT, PYENV_VERSION
Condaenvironment.yml, conda-meta/Registries + pathsCONDA_PREFIX, CONDA_DEFAULT_ENV
venvpyvenv.cfgIn-projectNone

Poetry

Discovery Locations

Virtualenvs cache (default):

  • Windows: %LOCALAPPDATA%\pypoetry\Cache\virtualenvs
  • macOS: ~/Library/Caches/pypoetry/virtualenvs
  • Linux: ~/.cache/pypoetry/virtualenvs

In-project (when enabled):

  • .venv/ in project root
Config Precedence (highest to lowest)
  1. Local config: poetry.toml in project root
  2. Environment variables: POETRY_VIRTUALENVS_*
  3. Global config: ~/.config/pypoetry/config.toml
Known Issues
IssueDescriptionFix
{cache-dir} placeholderNot resolved in paths from configResolve placeholder before use
Wrong default pathWindows/macOS differ from LinuxUse platform-specific defaults
In-project detectionPOETRY_VIRTUALENVS_IN_PROJECT must be checkedCheck env var first, then config
Code Pattern
typescript
async function getPoetryVirtualenvsPath(): Promise<string> {
    // 1. Check environment variable first
    const envVar = process.env.POETRY_VIRTUALENVS_PATH;
    if (envVar) return envVar;

    // 2. Check local poetry.toml
    const localConfig = await readPoetryToml(projectRoot);
    if (localConfig?.virtualenvs?.path) {
        return resolvePoetryPath(localConfig.virtualenvs.path);
    }

    // 3. Use platform-specific default
    return getDefaultPoetryCache();
}

function resolvePoetryPath(configPath: string): string {
    // Handle {cache-dir} placeholder
    if (configPath.includes('{cache-dir}')) {
        const cacheDir = getDefaultPoetryCache();
        return configPath.replace('{cache-dir}', cacheDir);
    }
    return configPath;
}

Pipenv

Discovery Locations

Default:

  • Linux: ~/.local/share/virtualenvs/ (XDG_DATA_HOME)
  • macOS: ~/.local/share/virtualenvs/
  • Windows: ~\.virtualenvs\

When WORKON_HOME is set:

  • Use $WORKON_HOME/ directly
Environment Variables
VarPurpose
WORKON_HOMEOverride virtualenv location
XDG_DATA_HOMEBase for Linux default
PIPENV_VENV_IN_PROJECTCreate .venv/ in project
Known Issues
IssueDescriptionFix
Missing WORKON_HOME supportEnv var not checkedRead env var before defaults
Missing XDG_DATA_HOME supportNot used on LinuxCheck XDG spec
Code Pattern
typescript
function getPipenvVirtualenvsPath(): string {
    // Check WORKON_HOME first
    if (process.env.WORKON_HOME) {
        return process.env.WORKON_HOME;
    }

    // Check XDG_DATA_HOME on Linux
    if (process.platform === 'linux') {
        const xdgData = process.env.XDG_DATA_HOME || path.join(os.homedir(), '.local', 'share');
        return path.join(xdgData, 'virtualenvs');
    }

    // Windows/macOS defaults
    return path.join(os.homedir(), '.virtualenvs');
}

PyEnv

Discovery Locations

Unix:

  • ~/.pyenv/versions/ (default)
  • $PYENV_ROOT/versions/ (if PYENV_ROOT set)

Windows (pyenv-win):

  • %USERPROFILE%\.pyenv\pyenv-win\versions\
  • Different directory structure than Unix!
Key Differences: Unix vs Windows
AspectUnixWindows (pyenv-win)
Commandpyenvpyenv.bat
Root~/.pyenv/%USERPROFILE%\.pyenv\pyenv-win\
Shims~/.pyenv/shims/%USERPROFILE%\.pyenv\pyenv-win\shims\
Known Issues
IssueDescriptionFix
path.normalize() vs path.resolve()Windows drive letter missingUse path.resolve() on both sides
Wrong command on WindowsLooking for pyenv instead of pyenv.batCheck for .bat extension
Code Pattern
typescript
function getPyenvRoot(): string {
    if (process.env.PYENV_ROOT) {
        return process.env.PYENV_ROOT;
    }

    if (process.platform === 'win32') {
        // pyenv-win uses different structure
        return path.join(os.homedir(), '.pyenv', 'pyenv-win');
    }

    return path.join(os.homedir(), '.pyenv');
}

function getPyenvVersionsPath(): string {
    const root = getPyenvRoot();
    return path.join(root, 'versions');
}

// Use path.resolve() for comparisons!
function comparePyenvPaths(pathA: string, pathB: string): boolean {
    return path.resolve(pathA) === path.resolve(pathB);
}

Conda

Show full SKILL.md (192 more words)Show less
Discovery Locations

Environment locations:

  • Base install envs/ directory
  • ~/.conda/envs/
  • Paths in ~/.condarc envs_dirs

Windows Registry:

  • HKCU\Software\Python\ContinuumAnalytics\
  • HKLM\SOFTWARE\Python\ContinuumAnalytics\
Shell Activation
ShellActivation Command
bash, zshsource activate envname
fishconda activate envname (NOT source!)
PowerShellconda activate envname
cmdactivate.bat envname
Known Issues
IssueDescriptionFix
Fish shell activationUses bash-style commandUse fish-compatible syntax
Registry pathsMay be stale/invalidVerify paths exist
Base vs named envsDifferent activationCheck if activating base
Code Pattern
typescript
function getCondaActivationCommand(shell: ShellType, envName: string): string {
    switch (shell) {
        case 'fish':
            // Fish uses different syntax!
            return `conda activate ${envName}`;
        case 'cmd':
            return `activate.bat ${envName}`;
        case 'powershell':
            return `conda activate ${envName}`;
        default:
            // bash, zsh
            return `source activate ${envName}`;
    }
}

venv

Discovery

Identification:

  • Look for pyvenv.cfg file in directory
  • Contains home and optionally version keys
Version Extraction Priority
  1. version field in pyvenv.cfg
  2. Parse from home path (e.g., Python311)
  3. Spawn Python executable (last resort)
Code Pattern
typescript
async function getVenvVersion(venvPath: string): Promise<string | undefined> {
    const cfgPath = path.join(venvPath, 'pyvenv.cfg');

    try {
        const content = await fs.readFile(cfgPath, 'utf-8');
        const lines = content.split('\n');

        for (const line of lines) {
            const [key, value] = line.split('=').map((s) => s.trim());
            if (key === 'version') {
                return value;
            }
        }

        // Fall back to parsing home path
        const homeLine = lines.find((l) => l.startsWith('home'));
        if (homeLine) {
            const home = homeLine.split('=')[1].trim();
            const match = home.match(/(\d+)\.(\d+)/);
            if (match) {
                return `${match[1]}.${match[2]}`;
            }
        }
    } catch {
        // Config file not found or unreadable
    }

    return undefined;
}

PET Server (Native Finder)

JSON-RPC Communication

The PET server is a Rust-based locator that communicates via JSON-RPC over stdio.

Known Issues
IssueDescriptionFix
No timeoutJSON-RPC can hang foreverAdd Promise.race with timeout
Silent spawn errorsExtension continues without envsSurface spawn errors to user
Resource leaksWorker pool not cleaned upDispose on deactivation
Type guard missingResponse types not validatedAdd runtime type checks
Cache key collisionPaths normalize to same keyUse consistent normalization
Code Pattern
typescript
async function fetchFromPET<T>(method: string, params: unknown): Promise<T> {
    const timeout = 30000; // 30 seconds

    const result = await Promise.race([
        this.client.request(method, params),
        new Promise<never>((_, reject) => setTimeout(() => reject(new Error('PET server timeout')), timeout)),
    ]);

    // Validate response type
    if (!isValidResponse<T>(result)) {
        throw new Error(`Invalid response from PET: ${JSON.stringify(result)}`);
    }

    return result;
}

© 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/python-manager-discovery of microsoft/vscode-python-environments.

Open the folder on GitHubat commit 4faeedf

Compare with similar skills

Python Manager Discovery 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.

Python Manager Discovery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Manager Discovery this skillmicrosoft/vscode-python-environments141—~2.7kAutomated safety check: PassMIT
Inputs V2 New Modulesaezlab/pypath164—~728Automated safety check: PassGPL-3.0
Novel WriterZJU-REAL/Easel3.2k—~1kAutomated safety check: PassApache-2.0
Script Comparative Review Against HitsSupreme-Ultimate/novel-to-script-team174—~1.8kAutomated safety check: PassMIT
Story Multi-Perspective Reviewzenstory-ai/oh-story-claudecode7.3k3 repos~3kAutomated safety check: PassMIT
Short Web Fiction Trend Scanzenstory-ai/oh-story-claudecode7.3k3 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Inputs V2 New Module

    saezlab/pypath

    Create a new pypath inputsv2 module for an external database.

    164 GitHub stars~728 tokensUpdated today
    Writing & ContentAuto-check passed
  • Novel Writer

    ZJU-REAL/Easel

    长篇小说/网文连载创作:从世界观、人设和三级大纲写到逐章正文,并用文件化状态维护伏笔、前情和跨章一致性. An agent skill from ZJU-REAL/Easel.

    3.2k GitHub stars~1k tokensUpdated 2 days ago
    Writing & ContentAuto-check passed
  • Script Comparative Review Against Hits

    Supreme-Ultimate/novel-to-script-team

    Chinese-language skill that scores a generated short-drama script against a reference hit script on rhythm, dialogue style, emotional impact and structure, with PASS/FAIL thresholds.

    174 GitHub stars~1.8k tokensUpdated 5 mo ago
    Media & CreativeAuto-check passed
  • Story Multi-Perspective Review

    zenstory-ai/oh-story-claudecode

    Reviews Chinese web-novel text with several reviewer agents in parallel, falling back to a single-agent pass, and reports structure, character, prose and setting problems with fixes.

    7.3k GitHub starsUsed in 3 repos~3k tokens
    Writing & ContentAuto-check passed
  • Short Web Fiction Trend Scan

    zenstory-ai/oh-story-claudecode

    Scans popular short web-fiction rankings on Chinese platforms such as Dianzhong and Heiyan to surface trending emotional hooks, themes and topic candidates with an expiry warning.

    7.3k GitHub starsUsed in 3 repos~1.2k tokens
    Writing & ContentAuto-check passed
  • Drives long-form fiction, scripts, storyboards, interactive films and long-document translation through InkOS, with every change made by a typed action.

    10k GitHub starsUsed in 1 repo~1.1k tokens
    Writing & ContentAuto-check passed

More from microsoft/vscode-python-environments

All 9 skills in this repo
  • Cross Platform Paths

    microsoft/vscode-python-environments

    Official

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

    141 GitHub stars~1.5k tokensUpdated today
    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 today
    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 today
    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 today
    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 today
    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 today
    Auto-check passed

Works with

Questions about Python Manager Discovery

What does Python Manager Discovery do?

Environment manager-specific discovery patterns and known issues. Python Manager Discovery is an agent skill from microsoft/vscode-python-environments, published by the product's own GitHub organization. Environment manager-specific discovery patterns and known issues.

When should I use Python Manager Discovery?

Python Manager Discovery fits situations like: reviewing environment discovery code for conda; tasks that involve Creative writing and fiction.

How do I install Python Manager Discovery in Claude Code?

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

How do I install Python Manager Discovery in Codex?

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

Can I use Python Manager Discovery 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 python-manager-discovery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-manager-discovery, .gemini/skills/python-manager-discovery, .github/skills/python-manager-discovery and .opencode/skills/python-manager-discovery in your project.

What does Python Manager Discovery need to run?

Going by SKILL.md and its folder, Python Manager Discovery needs the command-line tools its instructions call (conda). Our summary lists: Python 3.

Does Python Manager Discovery 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 Python Manager Discovery 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 Python Manager Discovery use?

Python Manager Discovery 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 Python Manager Discovery use?

About 2.7k tokens (SKILL.md is roughly 11k 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 Python Manager Discovery?

Skills that share tags, products or a category with Python Manager Discovery: Inputs V2 New Module (saezlab/pypath, 164 stars), Novel Writer (ZJU-REAL/Easel, 3.2k stars), Script Comparative Review Against Hits (Supreme-Ultimate/novel-to-script-team, 174 stars) and Story Multi-Perspective Review (zenstory-ai/oh-story-claudecode, 7.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Manager Discovery?

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.