{"slug":"local-env-setup","title":"local-env-setup","summary":"Configure the local wisp-science runtime — uv/Python bootstrap, Node+scimaster-cli for bear-* literature skills, pixi for bioinformatics multi-env analysis. Detect mainland-China network and apply mirrors. Use when Capabilities shows missing Python/uv/Node/sci/pixi, bootstrap err","platform":"Claude","tags":["linux"],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-08-23T08:58:31.091905Z","repo":{"url":"https://github.com/xuzhougeng/wisp-science","stars":1170,"forks":122,"license":"AGPL-3.0","updatedAt":"2026-09-25T06:13:53Z"},"bodyHtml":"<hr>\n<h2>name: local-env-setup\ndescription: Configure the local wisp-science runtime — uv/Python bootstrap, Node+scimaster-cli for bear-* literature skills, pixi for bioinformatics multi-env analysis. Detect mainland-China network and apply mirrors. Use when Capabilities shows missing Python/uv/Node/sci/pixi, bootstrap errors, or the user asks to 配置环境 / install Python / uv / Node / pixi / set up the local environment. Not for remote GPU/SSH compute (use compute-env-setup).\nlicense: Apache-2.0\ntags: bootstrap, uv, python, node, npm, pixi, scimaster, mirror, china, install, macos, windows, linux</h2>\n<h1>Local runtime setup</h1>\n<p>wisp-science needs three <strong>independent</strong> local toolchains:</p>\n<table>\n<thead>\n<tr>\n<th>Layer</th>\n<th>Tools</th>\n<th>Purpose</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Core</strong></td>\n<td><code>uv</code> + managed Python venv</td>\n<td>App bootstrap, <code>python</code> tool, bundled MCP servers</td>\n</tr>\n<tr>\n<td><strong>Literature</strong></td>\n<td>Node &gt;= 20, <code>npm</code>, <code>sci</code> (scimaster-cli)</td>\n<td>Bundled <code>bear-*</code> skills (real paper search)</td>\n</tr>\n<tr>\n<td><strong>Bioinformatics</strong></td>\n<td><code>pixi</code></td>\n<td>Per-project conda/pip multi-env analysis (scanpy, workflow engines like snakemake/nextflow/oxo-flow)</td>\n</tr>\n</tbody>\n</table>\n<p>Core is <strong>required</strong> for the app. Literature and bioinformatics layers are optional until the user runs those skills — but Capabilities shows all of them; install what's missing for the user's goal.</p>\n<p>Restart wisp-science after changing PATH or global config so bootstrap re-runs.</p>\n<h2>Step 0 — Detect platform, region, and current state</h2>\n<p>Read the <strong>Environment</strong> section in the system prompt (<code>Operating system</code>, <code>Working directory</code>).</p>\n<h3>0a — Region / network (mirror or not)</h3>\n<p><strong>Before any install or <code>pip</code>/<code>npm</code>/<code>pixi add</code>, decide whether the user is on mainland China and needs mirrors.</strong></p>\n<p>Signals (use several; do not rely on one):</p>\n<table>\n<thead>\n<tr>\n<th>Signal</th>\n<th>Mainland likely</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>User writes in Chinese and mentions 国内 / 镜像 / 翻墙 / 清华 / 阿里</td>\n<td>yes</td>\n</tr>\n<tr>\n<td><code>TZ</code> / system timezone <code>Asia/Shanghai</code>, <code>Asia/Chongqing</code>, <code>Asia/Urumqi</code></td>\n<td>hint</td>\n</tr>\n<tr>\n<td>Locale <code>zh_CN</code>, <code>zh-Hans-CN</code></td>\n<td>hint</td>\n</tr>\n<tr>\n<td><code>curl -s --connect-timeout 3 https://pypi.org/simple/</code> fails or &gt;5s; tuna mirror responds in &lt;2s</td>\n<td>yes</td>\n</tr>\n<tr>\n<td>User explicitly says they are <strong>not</strong> in China / have full international access</td>\n<td>no</td>\n</tr>\n</tbody>\n</table>\n<p>If <strong>ambiguous</strong>, ask once: \"Are you on mainland China? I'll use domestic mirrors for pip/npm/conda if yes.\"</p>\n<p>When <strong>mainland mirrors apply</strong>, set these <strong>before</strong> installs (user shell profile or session env):</p>\n<pre><code># PyPI / uv (core bootstrap + pixi pip deps)\nexport UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple\nexport PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple\n\n# npm (scimaster-cli)\nnpm config set registry https://registry.npmmirror.com\n</code></pre>\n<p>Windows (PowerShell, persist for user):</p>\n<pre><code>[Environment]::SetEnvironmentVariable(\"UV_INDEX_URL\", \"https://pypi.tuna.tsinghua.edu.cn/simple\", \"User\")\n[Environment]::SetEnvironmentVariable(\"PIP_INDEX_URL\", \"https://pypi.tuna.tsinghua.edu.cn/simple\", \"User\")\nnpm config set registry https://registry.npmmirror.com\n</code></pre>\n<p><strong>Pixi conda channels</strong> (global or per-project <code>pixi.toml</code>):</p>\n<pre><code>[project]\nchannels = [\"https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/\"]\n\n[pypi-config]\nindex-url = \"https://pypi.tuna.tsinghua.edu.cn/simple\"\n</code></pre>\n<p>Or global:</p>\n<pre><code>pixi config set --global pypi-config.index-url https://pypi.tuna.tsinghua.edu.cn/simple\n</code></pre>\n<p>Alternatives if tuna is slow: Aliyun PyPI <code>https://mirrors.aliyun.com/pypi/simple/</code>, USTC conda mirrors.</p>\n<p>If international access works, <strong>do not</strong> set mirrors — use defaults.</p>\n<h3>0b — Tool presence</h3>\n<p>Run with <strong><code>shell</code></strong> (PowerShell on Windows, <code>sh -c</code> elsewhere):</p>\n<p><strong>Windows:</strong></p>\n<pre><code>Get-Command uv,node,npm,sci,pixi -ErrorAction SilentlyContinue | Select-Object Name,Source\nuv --version 2&gt;$null; node --version 2&gt;$null; npm --version 2&gt;$null; sci --version 2&gt;$null; pixi --version 2&gt;$null\n</code></pre>\n<p><strong>macOS / Linux:</strong></p>\n<pre><code>for c in uv node npm sci pixi; do command -v $c &amp;&amp; $c --version 2&gt;/dev/null; done\n</code></pre>\n<p><strong>Capabilities</strong> (能力) shows: <code>Python · uv · Node · sci · pixi · skills · MCP</code>.</p>\n<h2>Layer 1 — Core: uv + Python</h2>\n<p>wisp-science does <strong>not</strong> ship Python. It needs <strong><code>uv</code></strong> on PATH (or <code>UV_PATH</code>) to create the managed venv.</p>\n<h3>What gets created automatically</h3>\n<ol>\n<li><code>uv venv</code> → virtualenv under app data</li>\n<li><code>uv pip install -r …/python/requirements-mcp.txt</code></li>\n<li>Marker <code>.wisp_deps_ok</code> when deps succeed</li>\n</ol>\n<table>\n<thead>\n<tr>\n<th>OS</th>\n<th>Desktop venv path</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Windows</td>\n<td><code>%APPDATA%\\science.wisp-science\\wisp-science\\python\\.venv</code></td>\n</tr>\n<tr>\n<td>macOS</td>\n<td><code>~/Library/Application Support/science.wisp-science/wisp-science/python/.venv</code></td>\n</tr>\n<tr>\n<td>Linux</td>\n<td><code>~/.local/share/science.wisp-science/wisp-science/python/.venv</code></td>\n</tr>\n</tbody>\n</table>\n<p>Dev checkout: <code>&lt;workspace&gt;/.wisp/python/.venv</code></p>\n<h3>Install uv</h3>\n<p><strong>International:</strong></p>\n<pre><code># Windows\npowershell -ExecutionPolicy Bypass -c \"irm https://astral.sh/uv/install.ps1 | iex\"\n</code></pre>\n<pre><code># macOS / Linux\ncurl -LsSf https://astral.sh/uv/install.sh | sh\n</code></pre>\n<p><strong>Mainland China:</strong> prefer <strong>winget</strong> / <strong>Homebrew</strong> / distro package if the astral installer is slow or blocked; set <code>UV_INDEX_URL</code> (above) before <code>uv pip install</code>.</p>\n<pre><code>winget install --id astral-sh.uv -e          # Windows\n</code></pre>\n<pre><code>brew install uv                               # macOS\n</code></pre>\n<p>Default binary: <code>~/.local/bin/uv</code> (Unix) or <code>%USERPROFILE%\\.local\\bin\\uv.exe</code> (Windows). Ensure that dir is on PATH.</p>\n<h3>Python via uv</h3>\n<pre><code>uv python install 3.11\nuv python list\n</code></pre>\n<p>Target: <strong>Python 3.11+</strong>. With mainland mirrors, export <code>UV_INDEX_URL</code> first.</p>\n<h3>Manual bootstrap (auto-setup failed)</h3>\n<p>Set <code>REQ</code> to <code>&lt;repo&gt;/python/requirements-mcp.txt</code> or bundled copy. With mirrors:</p>\n<pre><code>export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple   # if mainland\nuv venv \"$APP_DATA/python/.venv\"\nuv pip install -r \"$REQ\" --python \"$APP_DATA/python/.venv/bin/python\"\n</code></pre>\n<p>Windows: same with <code>$env:UV_INDEX_URL</code> and <code>Scripts\\python.exe</code>.</p>\n<h3>Verify core</h3>\n<pre><code>uv --version\n# managed venv:\npython -c \"import mcp, pandas; print('ok')\"\n</code></pre>\n<h2>Layer 2 — Literature: Node + scimaster-cli</h2>\n<p>Required for bundled <strong><code>bear-support</code></strong>, <strong><code>bear-counter</code></strong>, <strong><code>bear-map</code></strong>, <strong><code>bear-scoop</code></strong>, <strong><code>bear-trace</code></strong>, <strong><code>bear-review</code></strong>, <strong><code>bear-onboard</code></strong>, <strong><code>bear-propose</code></strong>.</p>\n<h3>Install Node &gt;= 20</h3>\n<p><strong>International:</strong> <a href=\"https://nodejs.org/\">https://nodejs.org/</a> LTS, or <code>winget install OpenJS.NodeJS.LTS</code>, or <code>brew install node</code>.</p>\n<p><strong>Mainland China:</strong></p>\n<pre><code># Windows — winget often works; or npmmirror-hosted installer\nwinget install OpenJS.NodeJS.LTS\n</code></pre>\n<pre><code># macOS — brew or fnm with npmmirror\nbrew install node\n# fnm alternative:\n# export FNM_NODE_DIST_MIRROR=https://npmmirror.com/mirrors/node\n# fnm install 20 &amp;&amp; fnm use 20\n</code></pre>\n<p>After install, open a <strong>new</strong> terminal; verify <code>node --version</code> (v20+).</p>\n<h3>scimaster-cli</h3>\n<p>Set npm registry first if mainland (see 0a), then:</p>\n<pre><code>npm install -g scimaster-cli\nsci init        # paste SciMaster API Key\nsci --version\nsci usage\n</code></pre>\n<p>API Key: SciMaster settings → API Key. Do <strong>not</strong> proceed with bear-* skills if <code>sci --version</code> fails.</p>\n<p>In the wisp-science desktop app, you can also save the SciMaster key in\nSettings -&gt; Credentials -&gt; SCIMaster. Wisp will sync that key into\n<code>~/.scimaster/config.json</code> for <code>scimaster-cli</code>.</p>\n<h2>Layer 3 — Bioinformatics: pixi</h2>\n<p><strong>pixi</strong> manages isolated per-project environments (conda + pip) — use for scanpy/single-cell, variant calling stacks, etc. The wisp <strong><code>python</code> tool</strong> uses the core uv venv; run bioinfo code via <strong><code>shell</code></strong>: <code>pixi run python …</code> or <code>pixi run …</code> in the project directory.</p>\n<h3>Workflow engines</h3>\n<p>For <strong>multi-step analysis pipelines</strong> (many rules, parallel execution, resume after failure), pair pixi with a dedicated workflow engine — pixi manages the environments, the engine schedules the steps. Run engines from <strong><code>shell</code></strong> in the project directory.</p>\n<table>\n<thead>\n<tr>\n<th>Engine</th>\n<th>What it is</th>\n<th>When to choose</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"https://snakemake.github.io\">snakemake</a></td>\n<td>Python-defined rules, mature conda/mamba integration</td>\n<td>Established rules; Python-centric teams</td>\n</tr>\n<tr>\n<td><a href=\"https://www.nextflow.io\">nextflow</a></td>\n<td>Groovy DSL, container-first</td>\n<td>nf-core ecosystem; HPC/cloud portability</td>\n</tr>\n<tr>\n<td><a href=\"https://github.com/Traitome/oxo-flow\">oxo-flow</a></td>\n<td>Rust-native, TOML-defined DAG engine; CLI + web UI</td>\n<td>Lightweight single-binary install; rule-level conda/mamba/pixi/docker/singularity backends; checkpoint/resume</td>\n</tr>\n</tbody>\n</table>\n<h3>Install pixi</h3>\n<p><strong>International:</strong></p>\n<pre><code>curl -fsSL https://pixi.sh/install.sh | bash\n</code></pre>\n<pre><code>powershell -ExecutionPolicy ByPass -c \"irm -useb https://pixi.sh/install.ps1 | iex\"\n</code></pre>\n<p><strong>Mainland China:</strong> if install script is slow, try <code>brew install pixi</code> (macOS) or download release from GitHub mirror; then configure mirrors (0a).</p>\n<h3>Typical project workflow</h3>\n<p>In the user's analysis directory:</p>\n<pre><code>pixi init\npixi add scanpy anndata          # example; adjust to task\npixi run python analysis.py\n</code></pre>\n<p>Multiple envs: use <code>[environments]</code> / features in <code>pixi.toml</code>, or separate project dirs — see <a href=\"https://pixi.sh\">pixi docs</a>.</p>\n<p>With mainland mirrors, set <code>[pypi-config]</code> and <code>channels</code> in <code>pixi.toml</code> (0a) <strong>before</strong> large <code>pixi add</code>.</p>\n<h3>Verify pixi</h3>\n<pre><code>pixi --version\npixi info    # shows config paths and channels\n</code></pre>\n<h2>Workarounds</h2>\n<table>\n<thead>\n<tr>\n<th>Issue</th>\n<th>Fix</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>uv/node installed but app still says missing</td>\n<td>Restart wisp-science; confirm tools on PATH for the <strong>GUI user</strong> (macOS: relaunch from Dock after shell profile update).</td>\n</tr>\n<tr>\n<td>Cannot modify PATH</td>\n<td>Set <code>UV_PATH</code> / <code>PIXI_PATH</code> to full binary paths before launching wisp-science.</td>\n</tr>\n<tr>\n<td>Mainland: timeouts on pypi.org / registry.npmjs.org</td>\n<td>Apply Step 0a mirrors; retry.</td>\n</tr>\n<tr>\n<td>Corporate proxy / TLS</td>\n<td><code>HTTPS_PROXY</code>, trust store; still use mirrors if direct egress to US is blocked.</td>\n</tr>\n<tr>\n<td>Corrupt core venv</td>\n<td>Delete <code>python/.venv</code> under app data; restart (bootstrap recreates).</td>\n</tr>\n<tr>\n<td>bear-* skill stops at CLI check</td>\n<td>Install Node + <code>scimaster-cli</code> + <code>sci init</code>; do not fake citations.</td>\n</tr>\n</tbody>\n</table>\n<h2>Agent workflow</h2>\n<ol>\n<li><code>use_skill</code> this file when Capabilities or bootstrap reports missing tools.</li>\n<li><strong>Step 0a first</strong> — detect mainland vs international; configure mirrors before any download.</li>\n<li>Detect OS — PowerShell on Windows, <code>sh</code> elsewhere.</li>\n<li>Install missing layers in order: <strong>core (uv)</strong> → <strong>literature (Node+sci)</strong> → <strong>bioinfo (pixi)</strong> as needed.</li>\n<li>Verify each layer; tell user to <strong>restart wisp-science</strong> after PATH/config changes.</li>\n<li>Finish with <strong>attempt_completion</strong>: region/mirror choice, what was installed, paths checked, Capabilities expectations.</li>\n</ol>\n<h2>Not in scope</h2>\n<ul>\n<li>Remote GPU or direct SSH → <code>compute-env-setup</code>; managed cloud backends are\nunavailable until Wisp implements a matching execution-context backend</li>\n<li>Replacing pixi with conda/micromamba when pixi suffices locally</li>\n<li>SciMaster API billing / key provisioning beyond pointing to <code>sci init</code></li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":13360,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-08T11:59:44.271845Z","sha256":"EFC5D6693274CABF432AC249E68A427FC040216BB94D2E77D6343A4A5BF2F037","sizeBytes":5758},"review":null,"source":{"repositoryUrl":"https://github.com/xuzhougeng/wisp-science","path":"skills/local-env-setup","license":"AGPL-3.0","commit":"79e64163262196611dd390d06713c465b906b299","subtreeSha":"A2748BB13E260D839204DFA82888E7251AF35FF11DF4687EB83A712112F384D5","lastSyncedAt":"2026-09-25T07:37:55.552497Z"},"reviewedAt":"2026-09-08T12:03:02.892933Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/xuzhougeng/wisp-science/tree/main/skills/local-env-setup"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install xuzhougeng-wisp-science@llmmart"},{"target":"git","command":"git clone https://github.com/xuzhougeng/wisp-science.git"}]}