wanghao9610/STAR/.claude/skills/star-env-builder/SKILL.md
star-env-builder
Build and verify the project's Python runtime so plan execution has a working interpreter. Reads .env: a valid CONDA_HOME creates conda env ENV_NAME (argument, default CODE_NAME); otherwise a .venv in the root. An existing environment is never deleted — after confirmation it is renamed to a dated backup first. Dependencies come from the first source that has them: existing CODE_NAME/requirements* → packaging metadata (pyproject / setup.py / environment.yml) → import scan of the code, written out
- Source repository stars
- 44
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-08-24
- Source checked
- 2026-08-25
Decision brief
What it does: where it fits
Match the user's language. .env's STARLANG replaces it wherever it is set (conventions §7.6, the rule that picks a language), and it picks the chat reply's language exactly as it picks the language of the files this run writes — a reply is not exempt for having been drafted in a…
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/wanghao9610/STAR --skill ".claude/skills/star-env-builder"Inspect the Agent Skill "star-env-builder" from https://github.com/wanghao9610/STAR/blob/cde9489162e78f6c85995899849bb4e12451a9cf/.claude/skills/star-env-builder/SKILL.md at commit cde9489162e78f6c85995899849bb4e12451a9cf. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Workflow
1. Read .env and resolve CODENAME, CONDAHOME, PYTHONHOME (conventions §3). 2. ENVNAME := the argument, else CODENAME. An add … argument instead selects add mode: skip to Step 8, targeting the environment .env already names — nothing created, renamed, or rebuilt. 3. Detect and re…
Read .env and resolve CODENAME, CONDAHOME, PYTHONHOME (conventions §3).ENVNAME := the argument, else CODENAME. An add … argument instead selects add mode: skip to Step 8, targeting the environment .env already names — nothing created, renamed, or rebuilt.Detect and record (feeds the install plan and the report): platform + arch; nvidia-smi (driver's CUDA ceiling); nvcc --version / CUDAHOME (local toolkit, often absent); $CONDAHOME/bin/conda --version; uv --version. - 02
Step 0: Preliminary check
1. Read .env and resolve CODENAME, CONDAHOME, PYTHONHOME (conventions §3). 2. ENVNAME := the argument, else CODENAME. An add … argument instead selects add mode: skip to Step 8, targeting the environment .env already names — nothing created, renamed, or rebuilt. 3. Detect and re…
Read .env and resolve CODENAME, CONDAHOME, PYTHONHOME (conventions §3).ENVNAME := the argument, else CODENAME. An add … argument instead selects add mode: skip to Step 8, targeting the environment .env already names — nothing created, renamed, or rebuilt.Detect and record (feeds the install plan and the report): platform + arch; nvidia-smi (driver's CUDA ceiling); nvcc --version / CUDAHOME (local toolkit, often absent); $CONDAHOME/bin/conda --version; uv --version. - 03
Step 1: Choose the backend (deterministic)
CONDAHOME non-empty and the path exists → conda backend: $CONDAHOME/bin/conda create -n python= -y.
CONDAHOME non-empty and the path exists → conda backend: $CONDAHOME/bin/conda create -n python= -y.Otherwise → venv backend at /.venv: prefer uv venv .venv --python ; else $PYTHONHOME/bin/python -m venv .venv; last resort python3 -m venv .venv. ENVNAME is meaningless here — say so if one was passed, then continue.Python version: requires-python (pyproject.toml) → pythonrequires (setup.py / setup.cfg) → the upstream README's stated version → default 3.10. Conflicting signals → ask. - 04
Step 2: When the environment already exists
conda: already in conda env list → ask one question, three options: backup & rebuild (rename to $(date +%Y%m%d) via conda rename; older conda lacking rename: create --clone + remove, warn that disk usage temporarily dou…
conda: already in conda env list → ask one question, three options: backup & rebuild (rename to $(date +%Y%m%d) via conda rename; older conda lacking rename: create --clone + remove, warn that disk usage temporarily dou…venv: .venv exists → same three-way ask → backup is mv .venv .venv$(date +%Y%m%d). Note in the report: a moved venv has old absolute paths baked into its scripts — a frozen backup to consult or restore from, not an acti…Backup name already taken → append - (also from date). - 05
Step 3: Resolve dependencies (first signal wins)
Recipe and mapping table: references/dependencyresolution.md.
${CODENAME}/requirements.txt or ${CODENAME}/requirements/ exists → adopt as-is; never rewrite, reorder, or "improve" it.Else packaging metadata — pyproject.toml [project.dependencies], setup.py / setup.cfg installrequires, environment.yml — transcribe into the generated requirements files, keeping every version constraint.Else import scan: AST top-level imports over ${CODENAME}/ → drop stdlib and local modules → map import names to PyPI distributions (verify unknowns on PyPI) → write the layout, versions unpinned except known-coupled pai…
Permission review
Static risk signals and limitations
Reads files
The documentation asks the agent to read local files, directories, or repositories.
*Shared conventions.** `docs/mds/star-workflow/research-workflow-conventions.md` (Chinese: `research-workflow-conventions.zh-CN.md`) is the baseline every STAR skill shares; this file states what is specific to this one, and wins wherever iReads files
The documentation asks the agent to read local files, directories, or repositories.
One message, five results. `STAR_LANG` sets the reply language, `INVOLVE` the question level, and folding both into the opening message keeps neither costing a round trip of its own. The calls stay separate because each tool result carries Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 92/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 44 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- wanghao9610/STAR
- Skill path
- .claude/skills/star-env-builder/SKILL.md
- Commit
- cde9489162e78f6c85995899849bb4e12451a9cf
- License
- MIT
- Collected
- 2026-08-25
- Default branch
- main
View the original SKILL.md
Research Env Builder — runtime environment setup
Match the user's language. .env's STAR_LANG replaces it wherever it is set (conventions §7.6, the rule that picks a language), and it picks the chat reply's language exactly as it picks the language of the files this run writes — a reply is not exempt for having been drafted in a forked context or handed back through a sub-agent. It rides in the opening load below because a run may have no user turn behind it at all — a forked context, or an invocation with no interactive user — where there is no dialogue to match and STAR_LANG is the only signal; where it too is unset, fall back to the language of the invocation's own words. For Chinese, reply in Chinese and switch every resource the opening load and the workflow name to its _zh / .zh-CN variant — the Chinese conventions carry the §0 vocabulary that pins the Chinese terms. The instructions stay this file: SKILL_zh.md is its Chinese edition, kept in step for human readers, and is not loaded at runtime. Any other language loads the unsuffixed resources. If SKILL_zh.md conflicts with this file, this SKILL.md is authoritative.
Invocation: star-env-builder [ENV_NAME | add <package>…] [DESCRIPTION] — the conda environment name to create, omitted to use CODE_NAME from .env; add installs packages into the environment .env already names and records them in the requirements layout. Anything left over is a description (conventions §7.12): in your own words, what this run is for — a lead the run may follow and record, never an instruction standing in for a confirmation point. Prose matching none of the above is description alone: run as if no argument was given, saying so first. A lone argument-like token that matches nothing is not a description — ask which was meant. add is the exception: every token after it is a package name. An optional involve=low|medium|high token may accompany any argument (e.g. … involve=low): it sets this run's involve level (conventions §7.7) and is stripped before the argument and description are read.
Shared conventions. docs/mds/star-workflow/research-workflow-conventions.md (Chinese: research-workflow-conventions.zh-CN.md) is the baseline every STAR skill shares; this file states what is specific to this one, and wins wherever it is stricter. What building a runtime acts on — §0 vocabulary, §1 git, §2 the STOP line, §3 .env runtime, §4 real dates, §5 plan-name resolution, §7 dialogue, §8 the output table, §10 the skill roster — arrives through the opening load below. Three sections stay out: §6 delegation (the main agent runs the three runnable-check layers itself — Principle 6 and Step 6 say so, and no step here dispatches), §9 project layout (State & File Rules enumerate every path it may write, and every tree it may not, more strictly than that section states them), and §11 execution branches, whose nine items this skill never performs — it creates, merges and discards no branch and no worktree — and whose one rule for every other skill, that a commit made while the checkout sits on another run's execution branch rides into that leaf's merge, is restated in State & File Rules beside the commit rule it qualifies. The document's preamble stays out too, its precedence rule being the one this paragraph opens with. Read the whole file if a run ever needs one of them.
Before acting, load it in one message — three Bash calls with the project root as the working directory, plus a Read each of the two references every run reaches, the installer policy (Steps 5 and 8) and the runnable-check spec (Steps 6 and 8): <this skill's directory>/references/installer_policy.md and <this skill's directory>/references/runnable_check_spec.md, all sent together.
grep -sE '^(STAR_LANG|INVOLVE)=' .env || echo 'STAR_LANG / INVOLVE: unset' # reply language, question level (§7.6, §7.7)
awk '/^## /{k=/^## (0|1|2|3|4|5)\./} k' docs/mds/star-workflow/research-workflow-conventions.md
awk '/^## /{k=/^## (7|8)\./} k' docs/mds/star-workflow/research-workflow-conventions.md
awk '/^## /{k=/^## (10)\./} k' docs/mds/star-workflow/research-workflow-conventions.md
One message, five results. STAR_LANG sets the reply language, INVOLVE the question level, and folding both into the opening message keeps neither costing a round trip of its own. The calls stay separate because each tool result carries its own size limit: a result past roughly 30 KB is written out to a file that costs a second round trip to read back — exactly the round trip the one message exists to avoid — and the conventions excerpt is about 36 KB in total, split 13, 18 and 5 across its three calls. Each awk prints the sections named above it and nothing else; if any of them is missing from what it prints — a stale synced copy of the conventions may number its sections differently — read the file whole instead. References tied to a single step stay lazy: references/dependency_resolution.md (Step 3) and assets/env_report_template.md (the report-writing steps) are read when their step arrives, not up front.
Reusing an earlier load. Skip any part of the load above whose text you can still see verbatim in this conversation — the same conventions file in the same language, covering at least the sections named here, the same reference files, and the .env lookup's STAR_LANG / INVOLVE values. Read whatever you cannot see, in the one message described above. If the gap is only some conventions sections, fetch just those — an awk keyed on the ## headings prints exactly the sections it names — never the whole file again. Two things do not count as seeing it: a summary that survived a context compaction where the text itself did not, and a memory of having read it. When in doubt, read it again. What never carries over is a collector digest, where one is loaded above — the scan runs again every time. With the whole load already in hand the opening message is skipped outright; with only the scan left, it goes out on its own.
Role
You give the codebase a working runtime. Upstream, star-code-architect writes ${CODE_NAME}/ but stops at the environment — its runtime-check step prepares install commands and hands them to the user (STOP line). Downstream, star-plan-executor runs every command through the .env environment and assumes it works. This skill produces that environment: a conda env or .venv resolved from .env, a dependency layout under ${CODE_NAME}/requirements/ when one was missing, and an evidence-backed environment report under wkdrs/.
You build the environment; you do not implement or refactor research code. The only writes into ${CODE_NAME}/ are generated requirements files. If code changes are needed to make the project importable, hand off to star-plan-executor.
Core Principles
.envis the only path source; never activate (conventions §3). Resolve the target interpreter once —ENV_PY = $CONDA_HOME/envs/<ENV_NAME>/bin/pythonor<project>/.venv/bin/python— and run everything through that absolute path. This skill owns the environment: only it may create, rename, or install into one.- One confirmation point; situational asks. The single confirmation point is install-plan approval (Step 4): nothing installs before it; everything it covers runs autonomously after it. Situational questions — overwrite an existing env, a CUDA mismatch, uv missing, a conda-only dependency under a venv backend — are asked when hit, via AskUserQuestion.
- Rename, never delete. An existing environment is backed up by renaming it to
<name>_<YYYYMMDD>— the date fromdate +%Y%m%dat run time, never invented. Stale backups are the user's to clean. - Category is policy; the install order is uv > pip > conda. framework (CUDA-coupled, index-pinned) / runtime (ordinary PyPI) / optional (logging, viz, dev extras) / conda.txt (system-isolation items). Each category has its own route and failure handling: prefer uv, fall back to pip per package, conda only for the whitelist and only under a conda backend. Policy:
references/installer_policy.md. - Adopt what exists; generate only what is missing. Generated dependencies come from packaging metadata before import scanning (
references/dependency_resolution.md), go intorequirements.txtplus arequirements/folder, and are committed once the build is verified. - Evidence-based acceptance. The main agent runs the three runnable-check layers itself (
references/runnable_check_spec.md) and reports what was verified with evidence, not that it "works" (CLAUDE.md §11). The report and version list go towkdrs/env_<ENV_NAME>_<date>/.
Workflow
Step 0: Preliminary check
- Read
.envand resolveCODE_NAME,CONDA_HOME,PYTHON_HOME(conventions §3). ENV_NAME:= the argument, elseCODE_NAME. Anadd <package>…argument instead selects add mode: skip to Step 8, targeting the environment.envalready names — nothing created, renamed, or rebuilt.- Detect and record (feeds the install plan and the report): platform + arch;
nvidia-smi(driver's CUDA ceiling);nvcc --version/CUDA_HOME(local toolkit, often absent);$CONDA_HOME/bin/conda --version;uv --version. ${CODE_NAME}/missing or effectively empty → no dependency source; recommendstar-code-architectfirst, and offer a bare env (python only) if the user wants one anyway.
Step 1: Choose the backend (deterministic)
CONDA_HOMEnon-empty and the path exists → conda backend:$CONDA_HOME/bin/conda create -n <ENV_NAME> python=<X.Y> -y.- Otherwise → venv backend at
<project>/.venv: preferuv venv .venv --python <X.Y>; else$PYTHON_HOME/bin/python -m venv .venv; last resortpython3 -m venv .venv.ENV_NAMEis meaningless here — say so if one was passed, then continue. - Python version:
requires-python(pyproject.toml) →python_requires(setup.py / setup.cfg) → the upstream README's stated version → default 3.10. Conflicting signals → ask. - Record
ENV_PY(absolute path) and use it for every later command.
Step 2: When the environment already exists
- conda:
<ENV_NAME>already inconda env list→ ask one question, three options: backup & rebuild (rename to<ENV_NAME>_$(date +%Y%m%d)viaconda rename; older conda lackingrename:create --clone+remove, warn that disk usage temporarily doubles) / verify & repair in place (skip creation; jump to Step 5 for failed items or Step 6 — the resume path after an interrupted run) / abort (exit cleanly, nothing touched). - venv:
.venvexists → same three-way ask → backup ismv .venv .venv_$(date +%Y%m%d). Note in the report: a moved venv has old absolute paths baked into its scripts — a frozen backup to consult or restore from, not an activatable environment. - Backup name already taken → append
-<HHMM>(also fromdate).
Step 3: Resolve dependencies (first signal wins)
Recipe and mapping table: references/dependency_resolution.md.
${CODE_NAME}/requirements.txtor${CODE_NAME}/requirements/exists → adopt as-is; never rewrite, reorder, or "improve" it.- Else packaging metadata —
pyproject.toml [project.dependencies],setup.py/setup.cfginstall_requires,environment.yml— transcribe into the generated requirements files, keeping every version constraint. - Else import scan: AST top-level imports over
${CODE_NAME}/→ drop stdlib and local modules → map import names to PyPI distributions (verify unknowns on PyPI) → write the layout, versions unpinned except known-coupled pairs.
Generated layout: requirements.txt holds only -r requirements/framework.txt and -r requirements/runtime.txt lines (optional referenced as a comment); requirements/framework.txt opens with the matched --extra-index-url; conda-only items go to requirements/conda.txt with a "conda installs this, not pip" header. Written now, committed in Step 7 after the build is verified.
Step 4: Confirmation point — the user approves the install plan
Present as normal text: backend + env name + python version; dependency source used; per-category package counts and notable pins; the torch↔CUDA match (detected driver ceiling vs chosen wheel index); rough download size of the big wheels; conda.txt items; anything already flagged uncertain (CUDA mismatch, unresolved imports, version conflicts). Then ask via AskUserQuestion: approve and build / adjust (say what) / abort. Uncertainties are settled here — never silently.
Step 5: Install (uv > pip > conda)
Policy, whitelist, and wheel-index matrix: references/installer_policy.md. Order: conda.txt (conda backend only) → framework.txt → runtime.txt → optional.txt (only if approved) → editable project install (--no-deps -e) when packaging metadata exists.
- uv present →
uv pip install --python $ENV_PY -r <file>; uv absent → ask once: install uv / use pip for this run. - Per-package failure → retry via pip (≤2 attempts total per package) → still failing: record it, continue with the rest, resolve or hand over at the end.
- venv backend hits a conda-only item → stop and ask: user installs it system-wide themselves / skip it / a pip alternative if one exists.
- Source-build items (flash-attn and friends) → STOP line: prepare the exact command in the report; do not run it.
- Respect
PIP_INDEX_URL/UV_DEFAULT_INDEXalready configured; never write global config.
Step 6: Runnable check (three layers, run by the main agent)
Spec and evidence format: references/runnable_check_spec.md.
- L1 imports: every distribution in framework + runtime (and installed optional) imports and reports a version through
$ENV_PY. - L2 framework:
torch.cuda.is_available()+ device count + a small tensor op on the device (mps on macOS; CPU-only boxes noted as expected, not failed). - L3 project:
$ENV_PY -m compileall -q ${CODE_NAME}; thenimport <package>if editable-installed, else the cheapest entrypoint (--help, orpytest --collect-only -q). No data, no weights, no downloads — minutes, not hours.
A failed layer → diagnose from the traceback, fix (a missing transitive dep goes into the right generated requirements file), re-run it; ≤2 fix rounds per layer → still failing: mark it blocked with the error tail and continue where independent.
Step 7: Report, version list, commit
- Write
wkdrs/env_<ENV_NAME>_<YYYYMMDD>/ENV_REPORT.mdfromassets/env_report_template.md: identity +ENV_PY, machine detection, backup renames, per-category install results, the runnable-check results with evidence, failures/blocked items, awaiting-user commands. uv pip freeze --python $ENV_PY(or$ENV_PY -m pip freeze) →freeze.txtalongside the report.- Requirements files generated this run (including deps added while diagnosing runnable-check failures) are committed now:
star-env-builder: add requirements layout, staging only${CODE_NAME}/requirements*. .env'sPYTHON_HOMEdoes not resolve to the just-verifiedENV_PY→ downstream skills resolve the runtime from.env: offer to pointPYTHON_HOMEat it (conda:$CONDA_HOME/envs/<ENV_NAME>; venv:<project>/.venv) — only with explicit confirmation.- Chat report ≤500 words: what was verified (with evidence), failures, awaiting-user commands. Hand off downstream:
star-plan-executor <leaf>now has a runtime;star-flow-statusshows what to run next.
Step 8: Add packages (add mode only)
add <package>… runs this step and no other, and its seven items — resolving ENV_PY, categorising each package, the confirmation point nothing installs before, the tiered install, the runnable check on the new packages alone, the requirements and report updates, and the closing report — are in references/add_mode.md, read when that is the mode and not before. A run that builds or repairs an environment reads none of it.
State & File Rules
- Write only to: the environment itself (under
$CONDA_HOME/envs/or<project>/.venv),${CODE_NAME}/requirements*(only when generating a missing layout or filling a verified gap),wkdrs/env_<ENV_NAME>_<date>/, and — only with explicit user confirmation — thePYTHON_HOME=line in.env. Never touch source code,metds/plans/*, or other skills' outputs. - Never delete an environment; backups are renames stamped with the real run date. Never invent timestamps.
- Git: at most one commit per run — requirements generated, or packages added in add mode — staging only
${CODE_NAME}/requirements*(conventions §1). - On an execution branch that is not this run's target, a commit rides into that leaf's merge: before committing on one, say so and offer to switch back first (conventions §11).
- Installs approved at the confirmation point run autonomously, including framework-scale downloads. STOP line regardless of approval:
sudoor system package managers (apt / brew), driver or CUDA-toolkit system installs, CUDA source compilation (flash-attn-style builds), downloads over ~10 GB, deleting any environment. Prepare those as exact commands in the report instead. - Respect the user's mirror configuration (
PIP_INDEX_URL,UV_DEFAULT_INDEX); never writepip config,.condarc, oruv.toml. - Repeat invocation: a matching
wkdrs/env_<ENV_NAME>_*/ENV_REPORT.mdexists and the env is present → prefer verify & repair in place (Step 2), resuming from its failures instead of rebuilding.
Dialogue Discipline
- The confirmation point and all situational questions go through AskUserQuestion — one question per call, each with a recommendation. If it is unavailable (headless / scripted), fall back to plain text, still one at a time; the install plan then needs an explicit approval message before anything installs.
ENV_REPORT.mdbody language follows the dialogue language; keep technical terms in English inside Chinese reports.
Frequently asked questions
What to verify before installation and use
What does the star-env-builder source document cover?
Match the user's language. .env's STARLANG replaces it wherever it is set (conventions §7.6, the rule that picks a language), and it picks the chat reply's language exactly as it picks the language of the files this run writes — a reply is not exempt for having been drafted in a…
How do I install star-env-builder?
The source record exposes this install command: npx skills add https://github.com/wanghao9610/STAR --skill ".claude/skills/star-env-builder". Inspect the command and pinned source before running it.
Which permission-related actions were detected?
Static rules flagged read-files in the source; the page lists the matching lines and excerpts.
Alternatives
Compare before choosing
wanghao9610/STAR
star-env-builder
Build and verify the project's Python runtime so plan execution has a working interpreter. Reads .env: a valid CONDA_HOME creates conda env ENV_NAME (argument, default CODE_NAME); otherwise a .venv in the root. An existing environment is never deleted — after confirmation it is renamed to a dated backup first. Dependencies come from the first source that has them: existing CODE_NAME/requirements* → packaging metadata (pyproject / setup.py / environment.yml) → import scan of the code, written out
K-Dense-AI/scientific-agent-skills
dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
neurokit2
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
dotnet/skills
test-tagging
Analyzes test suites in any language and tags each test with standardized traits (positive, negative, critical-path, boundary, smoke, regression, integration, performance, security). Use when the user wants to categorize, audit, or label tests with traits. Works across .NET (MSTest/xUnit/NUnit/TUnit), Python (pytest), TS/JS (Jest/Vitest), Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++ — auto-editing when the framework has canonical tag syntax, otherwise report-only. Do not use for writ