Maintain env contract SSOT (env/contract.yaml), validate env/values + env/secrets refs coverage, and generate env/.env.example + docs/context/env/*. Use when adding/renaming/deprecating config keys.
Treat env/contract.yaml as the configuration contract Single Source of Truth (SSOT). Use the env-contractctl skill to:
env/values/*, env/secrets/*)env/.env.exampledocs/env.mddocs/context/env/contract.json (LLM-readable contract)The env-contractctl skill is designed for LLM-led development:
.env tribal knowledgeUse the skill only when the project env SSOT mode is repo-env-contract.
To check the mode, read:
docs/project/env-ssot.jsonIf the project is not in the required mode, STOP and do not apply the workflow.
If the file does not exist (first-time setup), you can scaffold the required structure using:
python3 -B -S .ai/skills/features/environment/env-contractctl/scripts/env_contractctl.py init --root . --out <EVIDENCE_DIR>/00-bootstrap.md
The command scaffolds a minimal safe template (no secret values) and will not overwrite existing files unless you pass --force.
Use when the user asks to:
env/.env.example and environment docs are accurateAvoid when:
env-localctl)env-cloudctl)secret: true variable must use a secret_ref.env/contract.yamlenv/values/*.yamlenv/.env.exampleenv/.env.exampledocs/env.mddocs/context/env/contract.jsonenv/contract.yamlenv/values/<env>.yamlenv/secrets/<env>.ref.yamlChoose one evidence location (no secrets):
dev-docs/active/<task-slug>/artifacts/env/.ai/.tmp/env-contract/<run-id>/Evidence files (templates available in ./templates/):
00-change-intent.md01-contract-diff.md02-compat-migration-plan.md03-validation-log.md04-context-refresh.mdenv/.env.exampledocs/env.mddocs/context/env/contract.jsonrepo-env-contract via docs/project/env-ssot.json.
env/contract.yaml:
secret: truesecret_ref: <logical_name>env/values/<env>.yaml only for non-secret keys.env/secrets/<env>.ref.yaml only for secret refs (no values).python3 -B -S .ai/skills/features/environment/env-contractctl/scripts/env_contractctl.py validate --root . --out <EVIDENCE_DIR>/03-validation-log.md
01-contract-diff.md and 02-compat-migration-plan.md:
env/.env.example, docs/env.md, and LLM context:python3 -B -S .ai/skills/features/environment/env-contractctl/scripts/env_contractctl.py generate --root . --out <EVIDENCE_DIR>/04-context-refresh.md
If your repo uses modules/ with modules/<module_id>/MANIFEST.yaml env declarations (env.owns / env.requires), refresh module env slices after contract changes:
node .ai/scripts/modules/ctl-env-contract-module.mjs verify --strict
node .ai/scripts/modules/ctl-env-contract-module.mjs conflicts
node .ai/scripts/modules/ctl-env-contract-module.mjs sync-slices
This keeps per-module LLM context in sync and catches ownership conflicts early (no SSOT changes).
env-localctl (compile/doctor/reconcile)env-cloudctl (plan/apply/verify)repo-env-contractenv/.env.example regenerateddocs/context/env/contract.json regeneratednode .ai/tests/run.mjs --suite environmentenv-contractctl workflow.