implement-prepare-environment-script
Implement Prepare Environment Script
This skill produces a single executable script that performs the one-time per-build setup that precedes a conformance-test run, following a consistent, language-agnostic pattern.
The reference implementation is assets/prepare_environment_java.sh and assets/prepare_environment_python.sh. Read it first — every script you produce must be a faithful translation of that pattern into the target language's tooling and the user's shell environment.
What a prepare-environment script is for
prepare_environment_<lang> is an optional sibling of run_conformance_tests_<lang>. It runs immediately before the conformance script and exists to:
- Stage the build into a working folder (the same one the conformance script will use).
- Pre-warm the dependency cache / build artifacts so the conformance script can start cold without re-downloading or re-compiling anything.
When this script exists for a project, the corresponding conformance script's own dependency-install phase degrades to "activate only" (see implement-conformance-testing-script/SKILL.md → "Skipping setup when prepare_environment exists"). When it doesn't exist, the conformance script does the setup inline.
Why this script exists at all (the structural reason)
The conformance test runner is invoked once per functional spec by the renderer — not once per render. Each functional spec in a module has its own conformance_tests/<module>/<spec>/ folder, and after the renderer finishes generating code for a new spec, it runs the conformance tests of every previous spec in the same module to detect regressions. For a module with N functional specs, the conformance script is invoked roughly N times on every render.