Use this skill whenever you are about to implement code that could be sensitive to Python/library versions, GPU/CPU availability, or dependency policy.
Goal: produce an explicit "environment contract" that constrains implementation choices and makes later failures reproducible.
Output (copy/paste into your response)
Provide this block near the top of your implementation report:
Environment contract
- Python: <version or "unknown">
- Platform: <os/arch or "unknown">
- Key deps: <package>=<version> (only those that matter)
- Dependency policy: <"no new deps" | "deps allowed" | "unknown">
- Hardware: <"cpu" | "gpu" | "unknown"> (only if relevant)
- Provenance: <how you inferred this>
Checklist (do in order)
- Prefer repo artifacts over assumptions
- Look for:
pyproject.toml, requirements*.txt, poetry.lock, uv.lock, Pipfile.lock, environment.yml, conda*.yml, Dockerfile, docker-compose.yml, Makefile, noxfile.py, tox.ini, .python-version, .tool-versions, setup.cfg, setup.py.
- Look for CI:
.github/workflows/**, ci/**.
- Look for runtime docs:
README*, docs/**.
- Infer Python version
- If
.python-version / .tool-versions exists: trust it.
- Else if CI pins Python: trust CI.
- Else if Dockerfile pins Python: trust Docker.
- Else: report as
unknown and constrain implementation to broadly compatible code.
- Identify the smallest set of "key deps"
- Only list packages that affect your change (e.g.,
torch, jax, transformers, numpy, pydantic, hydra, lightning, accelerate, datasets).
- Prefer pinned lockfiles over loose requirements.
- Determine dependency policy
- If the task explicitly allows new deps: set
deps allowed.
- Else default to
no new deps.
- If you truly cannot infer: mark
unknown and stop to ask phira only if it changes the implementation approach.
- Record provenance
- Cite exactly which artifacts/commands you used (e.g., "from
.github/workflows/ci.yml", "from pyproject.toml", "ran python --version in this env").
Guardrails
- If environment constraints are unknown and materially affect correctness, ask
phira one targeted question that requests only the missing constraint(s).
- Do not upgrade/bump dependencies by default.
1---2name: phira-env-contract3description: Procedural checklist to infer and state the repo's effective runtime environment and dependency policy.4---56Use this skill whenever you are about to implement code that could be sensitive to Python/library versions, GPU/CPU availability, or dependency policy.78Goal: produce an explicit "environment contract" that constrains implementation choices and makes later failures reproducible.910## Output (copy/paste into your response)1112Provide this block near the top of your implementation report:1314```15Environment contract16- Python: <version or "unknown">17- Platform: <os/arch or "unknown">18- Key deps: <package>=<version> (only those that matter)19- Dependency policy: <"no new deps" | "deps allowed" | "unknown">20- Hardware: <"cpu" | "gpu" | "unknown"> (only if relevant)21- Provenance: <how you inferred this>22```2324## Checklist (do in order)25261) Prefer repo artifacts over assumptions27- Look for: `pyproject.toml`, `requirements*.txt`, `poetry.lock`, `uv.lock`, `Pipfile.lock`, `environment.yml`, `conda*.yml`, `Dockerfile`, `docker-compose.yml`, `Makefile`, `noxfile.py`, `tox.ini`, `.python-version`, `.tool-versions`, `setup.cfg`, `setup.py`.28- Look for CI: `.github/workflows/**`, `ci/**`.29- Look for runtime docs: `README*`, `docs/**`.30312) Infer Python version32- If `.python-version` / `.tool-versions` exists: trust it.33- Else if CI pins Python: trust CI.34- Else if Dockerfile pins Python: trust Docker.35- Else: report as `unknown` and constrain implementation to broadly compatible code.36373) Identify the smallest set of "key deps"38- Only list packages that affect your change (e.g., `torch`, `jax`, `transformers`, `numpy`, `pydantic`, `hydra`, `lightning`, `accelerate`, `datasets`).39- Prefer pinned lockfiles over loose requirements.40414) Determine dependency policy42- If the task explicitly allows new deps: set `deps allowed`.43- Else default to `no new deps`.44- If you truly cannot infer: mark `unknown` and stop to ask `phira` only if it changes the implementation approach.45465) Record provenance47- Cite exactly which artifacts/commands you used (e.g., "from `.github/workflows/ci.yml`", "from `pyproject.toml`", "ran `python --version` in this env").4849## Guardrails5051- If environment constraints are unknown and materially affect correctness, ask `phira` one targeted question that requests only the missing constraint(s).52- Do not upgrade/bump dependencies by default.