Extract Python Environment Variables

> Scans a Python recipe to find every place an environment variable is accessed — including `os.environ.setdefault("V", "d")`, whose "d" would otherwise be a hidden default a user editing .env.example has no way to discover — then ensures all variables are declared in `.env.example`, that `load_dotenv()` is bootstrapped in the package `__init__.py`, and that `python-dotenv>=1.0.0` is listed in `pyproject.toml`. When a new entry is added to `.env.example`, the extracted default from source is written as the value (with a `# extracted-by:extract-env-vars` marker and provenance comment); values that look like stubs (`"my-project-id"`, `"changeme"`, `"<...>"`) are downgraded to the TODO placeholder but the source string is preserved in the marker comment. Also detects hardcoded model-name string literals (e.g. `"gemini-3.5-flash"` in `agent.py`) and rewrites them to bare...

thedixitjain 1cbcde7 4 files · 200.2 KB Updated 2 repo stars

File contents

thedixitjain/the-mega-skill-library/tree/main/library/ai-agents-and-harness/extract-python-environment-variables commit 1cbcde7900

Frequently asked questions

npx skillmds add thedixitjain/extract-python-environment-variables