[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69905NSBNX4V7BG16FJC2CW":3,"skill-same:01M69905NSBNX4V7BG16FJC2CW":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":65,"ownerHtmlUrl":66,"ownerBlogUrl":67,"ownerDescription":68,"updatedAt":69,"install":70,"resources":83},"01M69905NSBNX4V7BG16FJC2CW","extract-python-environment-variables","Python 环境变量提取","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\"`, `\"\u003C...>\"`) 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 an `os.getenv(...)` call. The variable name is derived from the assignment target when it names a model (`DEFAULT_EMBEDDING_MODEL` → `EMBEDDING_MODEL`), else `MODEL_NAME` (single model) or `MODEL_NAME_GENERATED_1` \u002F `MODEL_NAME_GENERATED_2`, … (multiple models). Normally no fallback default is written into the Python source; the one exception is when no `load_dotenv()` bootstrap could be installed (no package `__init__.py`), where the original literal is kept as the fallback so the lookup cannot evaluate to `None` at runtime. The model string is written as the value in `.env.example` with a comment prompting a rename.   When re-run against a recipe whose `.env.example` already has entries, the writer classifies each entry (skill-authored vs. user-authored, TODO vs. real value) and only rewrites lines it can prove it authored; user-authored lines are always preserved. A stale TODO (either skill-authored or a bare v1-era `\u003CTODO: update-this-value>` with no inline comment) is upgraded in place when source can supply a real default. IMPORTANT — two hard rules the skill NEVER breaks: (1) USER-EDIT SAFETY. Any `.env.example` line the skill cannot prove it authored is USER_OWNED and is never modified. The rewriter fails closed on any structural ambiguity (quoted values, backslash continuation, duplicate declarations) — a stale TODO left in place is cheap; a clobbered user edit is not. (2) ADDITIVE-ONLY FOR PYTHON FILES. The skill never writes new `os.environ.setdefault(...)` bootstrap lines into any Python file. Pre-existing `os.environ.setdefault(...)` or `os.getenv(\"VAR\", \"default\")` calls that the recipe author wrote by hand are LEFT UNTOUCHED — the skill's only writes to Python files are (a) the `load_dotenv()` bootstrap; (b) `# noqa: E402` on trailing relative imports that would otherwise trip Ruff; (c) hardcoded model-literal replacement. Use when the user wants to \"extract env vars\", \"update .env.example\", \"add load_dotenv\", \"surface setdefault defaults\", \"upgrade stale TODOs in .env.example\", \"replace hardcoded model names\", or \"fix environment variables\" in a Python recipe.","扫描 Python 配方，找出访问环境变量的每一处——包括 `os.environ.setdefault(\"V\", \"d\")`，其中的 \"d\" 若不提取，将成为编辑 .env.example 的用户无法发现的隐藏默认值——然后确保所有变量都在 `.env.example` 中声明、在包 `__init__.py` 中引导了 `load_dotenv()`，且 `python-dotenv>=1.0.0` 已列入 `pyproject.toml`。当向 `.env.example` 添加新条目时，将从源码提取的默认值写为该值（带有 `# extracted-by:extract-env-vars` 标记和来源注释）；看起来像占位符的值（\"my-project-id\"、\"changeme\"、\"\u003C...>\"）会被降级为 TODO 占位符，但源字符串会保留在标记注释中。技能还会检测硬编码的模型名称字符串字面量（例如 `agent.py` 中的 \"gemini-3.5-flash\"），并将其重写为 `os.getenv(...)` 调用。变量名在赋值目标命名了模型时从该目标派生（`DEFAULT_EMBEDDING_MODEL` → `EMBEDDING_MODEL`），否则为 `MODEL_NAME`（单个模型）或 `MODEL_NAME_GENERATED_1` \u002F `MODEL_NAME_GENERATED_2` ……（多个模型）。通常不会向 Python 源码写入回退默认值；唯一的例外是无法安装 `load_dotenv()` 引导时（没有包 `__init__.py`），此时保留原始字面量作为回退，以免查找在运行时求值为 `None`。模型字符串会作为值写入 `.env.example`，并附带提示重命名的注释。当针对 `.env.example` 已有条目的配方重新运行时，写入器会对每个条目进行分类（技能编写 vs. 用户编写、TODO vs. 真实值），并且只重写它能够证明由自己编写的行；用户编写的行始终予以保留。陈旧的 TODO（无论是技能编写的，还是没有内联注释的 v1 时代裸 `\u003CTODO: update-this-value>`）在源码能提供真实默认值时就地升级。重要——技能绝不违反的两条硬性规则：(1) 用户编辑安全。技能无法证明由自己编写的任何 `.env.example` 行均视为 USER_OWNED，永不修改。写入器在遇到任何结构歧义（带引号的值、反斜杠续行、重复声明）时都会失败关闭——留下一个陈旧的 TODO 代价很小；覆盖用户的编辑则不然。(2) Python 文件仅追加。技能从不向任何 Python 文件写入新的 `os.environ.setdefault(...)` 引导行。配方作者手写的既有 `os.environ.setdefault(...)` 或 `os.getenv(\"VAR\", \"default\")` 调用保持原样不动——技能对 Python 文件的唯一写入是：(a) `load_dotenv()` 引导；(b) 在尾部相对导入上添加 `# noqa: E402`，避免触发 Ruff；(c) 替换硬编码的模型字面量。当用户想要在 Python 配方中“提取环境变量”、“更新 .env.example”、“添加 load_dotenv”、“暴露 setdefault 默认值”、“升级 .env.example 中的陈旧 TODO”、“替换硬编码模型名称”或“修复环境变量”时使用。","google\u002Fadk-recipes","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M6990124CWS5627VKGSKJXRD",10626,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextract-python-environment-variables\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRK82SYBDNZ3SG8YAH5A3D","凭证与密钥管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,10,46,47,48,49,50,51],"python","extract python environment variables","Variables","extract","environment variables","environment","todo","inline","at","re","dotenv","project","upgrade","writer","either","files","fix","update","run","placeholder","gemini","2026-11-10 10:12:30",false,"---\nname: extract-python-environment-variables\ndescription: >\n  Scans a Python recipe to find every place an environment variable is\n  accessed — including `os.environ.setdefault(\"V\", \"d\")`, whose \"d\" would\n  otherwise be a hidden default a user editing .env.example has no way to\n  discover — then ensures all variables are declared in `.env.example`,\n  that `load_dotenv()` is bootstrapped in the package `__init__.py`, and\n  that `python-dotenv>=1.0.0` is listed in `pyproject.toml`. When a new\n  entry is added to `.env.example`, the extracted default from source is\n  written as the value (with a `# extracted-by:extract-env-vars` marker\n  and provenance comment); values that look like stubs\n  (`\"my-project-id\"`, `\"changeme\"`, `\"\u003C...>\"`) are downgraded to the TODO\n  placeholder but the source string is preserved in the marker comment.\n  Also detects hardcoded model-name string literals (e.g.\n  `\"gemini-3.5-flash\"` in `agent.py`) and rewrites them to an\n  `os.getenv(...)` call. The variable name is derived from the assignment\n  target when it names a model (`DEFAULT_EMBEDDING_MODEL` →\n  `EMBEDDING_MODEL`), else `MODEL_NAME` (single model) or\n  `MODEL_NAME_GENERATED_1` \u002F `MODEL_NAME_GENERATED_2`, … (multiple models).\n  Normally no fallback default is written into the Python source; the one\n  exception is when no `load_dotenv()` bootstrap could be installed (no\n  package `__init__.py`), where the original literal is kept as the\n  fallback so the lookup cannot evaluate to `None` at runtime. The\n  model string is written as the value in `.env.example` with a comment\n  prompting a rename.   When re-run against a recipe whose `.env.example` already has entries,\n  the writer classifies each entry (skill-authored vs. user-authored,\n  TODO vs. real value) and only rewrites lines it can prove it authored;\n  user-authored lines are always preserved. A stale TODO (either\n  skill-authored or a bare v1-era `\u003CTODO: update-this-value>` with no\n  inline comment) is upgraded in place when source can supply a real\n  default.\n  IMPORTANT — two hard rules the skill NEVER breaks:\n  (1) USER-EDIT SAFETY. Any `.env.example` line the skill cannot prove\n  it authored is USER_OWNED and is never modified. The rewriter fails\n  closed on any structural ambiguity (quoted values, backslash\n  continuation, duplicate declarations) — a stale TODO left in place is\n  cheap; a clobbered user edit is not.\n  (2) ADDITIVE-ONLY FOR PYTHON FILES. The skill never writes new\n  `os.environ.setdefault(...)` bootstrap lines into any Python file.\n  Pre-existing `os.environ.setdefault(...)` or\n  `os.getenv(\"VAR\", \"default\")` calls that the recipe author wrote by\n  hand are LEFT UNTOUCHED — the skill's only writes to Python files are\n  (a) the `load_dotenv()` bootstrap; (b) `# noqa: E402` on trailing\n  relative imports that would otherwise trip Ruff; (c) hardcoded\n  model-literal replacement.\n  Use when the user wants to \"extract env vars\", \"update .env.example\",\n  \"add load_dotenv\", \"surface setdefault defaults\", \"upgrade stale TODOs\n  in .env.example\", \"replace hardcoded model names\", or \"fix environment\n  variables\" in a Python recipe.\nmetadata:\n  author: Google\n  license: Apache-2.0\n  version: 2.3.0\n---\n\n# Extract Python Environment Variables\n\nUse this skill to ensure a Python recipe properly declares and loads all\nenvironment variables it uses.\n\n---\n\n## What This Skill Does\n\nRuns `scripts\u002Fextract_env_vars.py` against a recipe directory. The script:\n\n1. **Scans** all `.py` files (excluding `tests\u002F` and common cache\u002Fvenv\n   directories) for environment variable accesses:\n   - `os.environ[\"VAR\"]`\n   - `os.environ.get(\"VAR\")` \u002F `os.environ.get(\"VAR\", \"default\")`\n   - `os.getenv(\"VAR\")` \u002F `os.getenv(\"VAR\", \"default\")`\n   - `os.environ.setdefault(\"VAR\", \"default\")` &nbsp;&nbsp;*(v2)*\n\n   Only names matching `^[A-Z_][A-Z0-9_]*$` (UPPER_SNAKE_CASE) are captured;\n   a lowercase name like `os.getenv(\"my_api_key\")` is **skipped** and a\n   `[WARN]` line lists any that were dropped. Rename such vars to uppercase\n   in source, or add them to `.env.example` by hand.\n\n2. **Updates `.env.example`** — appends any variables not already\n   declared AND upgrades stale TODO entries in place. Existing\n   user-authored lines are always preserved (see Rule 1 below).\n   - Creates `.env.example` from scratch if it does not exist.\n   - Each new\u002Fupgraded line has the shape:\n     ```\n     VAR=\u003Cvalue>  # extracted-by:extract-env-vars; \u003Cprovenance>\n     ```\n   - `\u003Cvalue>` is the **resolved default** extracted from source when the\n     author committed to one — with `os.environ.setdefault(...)` beating\n     `os.getenv(\"V\", \"d\")` \u002F `os.environ.get(\"V\", \"d\")` (setdefault is a\n     stronger commitment: it mutates the process environment, while getenv\n     fallback is per-read). Alphabetical file order breaks ties.\n   - Values that look like **stubs** are downgraded to\n     `\u003CTODO: update-this-value>` — e.g. `my-project-id`, `your-api-key`,\n     `changeme`, `\u003C...>`, anything containing `example.com`. The source\n     string is preserved in the marker comment so the maintainer sees\n     what was found and can fix the source too.\n   - When no source supplied a string-literal default, the value is\n     `\u003CTODO: update-this-value>` with a `no default in source` note.\n   - **Stale TODO upgrade (v2.1):** if an existing entry is either a\n     skill-authored TODO (has the marker) or a bare v1-era TODO (exact\n     value `\u003CTODO: update-this-value>`, no marker, no inline comment)\n     AND source can now supply a real default, the line is rewritten in\n     place. This closes the discoverability loop for recipes originally\n     processed by v1 (which always wrote TODOs regardless of what source\n     said).\n\n3. **Injects `load_dotenv()`** into the package `__init__.py` (the first\n   subdirectory inside the recipe that contains an `__init__.py`, skipping\n   `tests\u002F` and hidden directories). The snippet injected is:\n\n   ```python\n   from dotenv import load_dotenv\n\n   # Load variables from .env if present. In production the environment is\n   # already populated by the platform (Cloud Run, GKE, etc.), so a missing\n   # .env is expected and not an error.\n   load_dotenv()\n   ```\n\n   If `load_dotenv` is already present the injection is skipped.\n\n   **If no package `__init__.py` exists** (common in vertical plugins under\n   `plugins\u002F`, where the code lives in a plain `scripts\u002F` directory rather\n   than an importable package) the injection is skipped with a `[WARN]`,\n   and the step reports that no bootstrap is in place. Step 4 below depends\n   on that answer.\n\n   **Additionally — always, regardless of whether we injected** — appends\n   `# noqa: E402 -- must come after load_dotenv()` to any top-level relative\n   import (`from .x import y`) that sits AFTER a non-import module-level\n   statement. Two cases this covers:\n\n   - **Fresh injection.** The injected `load_dotenv()` call pushes\n     pre-existing trailing relative imports below a non-import statement, so\n     they'd trigger Ruff `E402` (\"module-level import not at top of file\")\n     when Phase 4 (ruff) of `prepare-python-recipe` runs.\n\n   - **Author-written bootstrap.** The recipe author already wrote\n     `load_dotenv()` + `os.environ.setdefault(...)` calls followed by a\n     trailing `from . import agent`, but never marked the trailing import.\n     The skill did NOT inject anything (load_dotenv was already present) but\n     still adds the noqa suffix so the file is lint-clean on the pipeline's\n     next ruff pass.\n\n   The suppression pass is precise — a relative import at the very TOP of\n   the file (before any non-import statement) is fine and left untouched.\n   Idempotent: a line that already carries `# noqa: E402` is skipped.\n\n4. **Replaces hardcoded model names** in source (e.g. `model=\"gemini-3.5-flash\"`\n   in `agent.py`) with an `os.getenv(...)` call.\n\n   **Position decides eligibility.** A model string is only promoted when it\n   is a *configurable constant*. Three positions mean it is something else,\n   and are left untouched:\n\n   - **Collection-literal entries** (dict keys and values, list\u002Fset\u002Ftuple\n     items) — lookup tables and enumerations of supported models:\n\n     ```python\n     IMAGE_MODELS = {\n         \"flash\": \"gemini-2.5-flash-image\",\n         \"pro\":   \"gemini-2.5-pro-image\",\n     }\n     ```\n\n     Rewriting the values collapses the table onto one env var; rewriting the\n     **keys** is worse, because `IMAGE_MODELS.get(\"flash\")` then never\n     matches anything. A dict key must stay a static literal.\n   - **Subscript indices** — `IMAGE_MODELS[\"gemini-3.1\"]` is a key *into*\n     such a table, so replacing it looks up a different entry.\n   - **Comparison operands** — `if \"gemini-3.1\" in model_id` tests a value\n     rather than configuring one.\n\n   Skipping a legitimate extraction is cheap (lift it by hand); silently\n   breaking a lookup table is not, so this errs towards skipping. Every\n   skipped literal is listed in an `[INFO]` block, so nothing is hidden — and\n   because these strings never reach the naming step, a dict target like\n   `IMAGE_MODELS` can no longer leak into `.env.example` as a variable name.\n\n   **Variable name.** The assignment target that holds the literal is used\n   when it names a model, since it carries far more meaning than a generic\n   fallback — `DEFAULT_EMBEDDING_MODEL = \"gemini-embedding-001\"` and\n   `embedding_model = cfg.get(\"embedding_model\", \"gemini-embedding-001\")`\n   both yield `EMBEDDING_MODEL`. This matters in recipes that already read a\n   *different* model var (say `GEMINI_MODEL` for the LLM), where a second\n   bare `MODEL_NAME` would be actively misleading. When a string is assigned\n   to conflicting target names, the most frequent wins, ties broken\n   alphabetically. Otherwise:\n   - A single unnamed model → `MODEL_NAME`\n   - The rest → `MODEL_NAME_GENERATED_1`, `MODEL_NAME_GENERATED_2`, … (sorted\n     alphabetically for determinism)\n\n   **Fallback argument.** Normally the emitted call is **bare** —\n   `os.getenv(\"EMBEDDING_MODEL\")`, no default — because default values are\n   the maintainer's decision, not the skill's. That is only safe when the\n   `load_dotenv()` bootstrap from step 3 is in place to populate the\n   environment.\n\n   **When step 3 could not install a bootstrap** (no package `__init__.py`),\n   nothing reads `.env`, so a bare lookup would evaluate to `None` at runtime\n   and silently break the recipe. In that case the original literal is\n   preserved as the fallback — `os.getenv(\"EMBEDDING_MODEL\",\n   \"gemini-embedding-001\")` — which keeps behaviour identical to before the\n   rewrite while still lifting the value into the environment. The step logs\n   an `[INFO]` line explaining the choice.\n\n   The actual model string is written as the value in `.env.example` (e.g.\n   `EMBEDDING_MODEL=gemini-embedding-001`) with a comment prompting the\n   maintainer to rename the variable if the derived name isn't right.\n\n5. **Updates `pyproject.toml`** — adds `python-dotenv>=1.0.0` to `[project]`\n   dependencies if it is not already there.\n\n---\n\n## Hard rules the skill NEVER breaks\n\n**Rule 1 — User-edit safety for `.env.example`.** The writer classifies\nevery existing entry before touching anything, and only rewrites lines\nit can prove it authored. Concretely:\n\n| Existing entry looks like | Source now provides | Action |\n|---|---|---|\n| Missing | any | **append** with resolved default (or TODO) |\n| A line the skill wrote (has `# extracted-by:extract-env-vars` marker) with `\u003CTODO: update-this-value>` value | a REAL default (not placeholder-shape) | **upgrade in place** |\n| Same as above | no default OR a placeholder-shape default | **skip** (would be TODO → TODO churn) |\n| Bare `VAR=\u003CTODO: update-this-value>` line with **no marker AND no inline comment** — a v1-era TODO | a REAL default | **upgrade in place** (v1 → v2 migration) |\n| A line the skill wrote with a REAL value | source has any value (even different) | **skip** (never overwrite skill-authored values on drift) |\n| Anything else (user typed value, user-authored comment, non-standard formatting) | any | **skip — never touched** |\n\nGolden rule underneath all of this: **fail closed**. If the classifier\ncan't confidently prove a line was skill-authored or is a bare v1 TODO,\nit's `USER_OWNED` and untouchable. If the rewriter finds a line whose\nstructure it doesn't understand (quoted value, backslash continuation,\nduplicate declarations), it refuses and warns rather than guessing. And\nbefore any write, the assembled file is re-parsed to verify every\nplanned upgrade re-parses as a skill-authored real value — a bug in the\nrewriter cannot silently corrupt `.env.example`.\n\nTo force regeneration of a line the skill would otherwise skip, delete\nthe line and re-run.\n\n*Rationale for extracting defaults (v2) and upgrading stale TODOs\n(v2.1): a value hidden inside a Python file that a user must know about\nbut has no reason to look at is, in practice, undocumented.\n`.env.example` is the documented configuration surface. Surfacing what\nthe author already committed to in code — and updating a stale TODO\nonce source can supply a real default — makes the configuration\ndiscoverable without inventing anything new. The value in source WAS\nthe value; we're only lifting it into view.*\n\n**Rule 2 — Additive-only for Python files.** The skill never writes new\n`os.environ.setdefault(...)` bootstrap lines into any Python file.\nPre-existing `os.environ.setdefault(...)` or\n`os.getenv(\"VAR\", \"default\")` calls that a recipe author wrote by hand\nare LEFT UNTOUCHED. The skill's only writes to Python files are:\n- Adding the `from dotenv import load_dotenv` + `load_dotenv()` snippet\n  (once, only if not already present).\n- Appending `# noqa: E402` to trailing relative imports that would\n  otherwise trip Ruff after the env-bootstrap block.\n- Replacing hardcoded model literals with `os.getenv(...)` calls — bare\n  when a `load_dotenv()` bootstrap is in place, otherwise retaining the\n  original literal as the fallback (see step 4 above).\n\nNote that scanning `os.environ.setdefault(...)` and lifting its value\ninto `.env.example` (v2) does NOT violate Rule 2 — the skill READS from\nPython source (unchanged behaviour) and WRITES only to `.env.example`.\n\n---\n\n## Rules for the Agent\n\n1. **Always use the script** — never manually edit `.env.example`, `__init__.py`,\n   or `pyproject.toml` to perform these changes.\n2. **Ask for the recipe directory** if the user has not provided one. Do not\n   assume a path.\n3. **After the script succeeds**, remind the user to:\n   - Copy `.env.example` → `.env` and fill in real values before running locally.\n   - Run `uv sync` to pick up the `python-dotenv` dependency if it was newly added.\n\n---\n\n## Input\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Recipe directory | Yes | Path to the recipe root (e.g. `contrib\u002Fpython\u002Fmy-recipe`, `core\u002Fpython\u002Fmy-recipe`, or `plugins\u002Fretail\u002Fstore-ops`) |\n\nIf the user has not specified the recipe directory, ask for it before proceeding.\n\n---\n\n## Run\n\nRun it through `uv` so it always executes on a Python 3.11+ interpreter — the\nscript uses the stdlib `tomllib`, which only exists from 3.11 onward. A bare\n`python3` that resolves to 3.9\u002F3.10 fails with `ModuleNotFoundError: tomllib`.\nNo `--with` packages are needed (the script is stdlib-only).\n\n```bash\nuv run --no-project python3 \\\n  .agents\u002Fskills\u002Fextract-python-environment-variables\u002Fscripts\u002Fextract_env_vars.py \\\n  --recipe-dir \u003CRECIPE_DIR>\n```\n\n### Preview first (optional)\n\nAdd `--dry-run` to report exactly what *would* change without modifying any\nfiles. Nothing is written to `.env.example`, `__init__.py`, `pyproject.toml`, or\nany source file. Useful for inspecting a recipe before committing to the edits:\n\n```bash\nuv run --no-project python3 \\\n  .agents\u002Fskills\u002Fextract-python-environment-variables\u002Fscripts\u002Fextract_env_vars.py \\\n  --recipe-dir \u003CRECIPE_DIR> --dry-run\n```\n\nIn dry-run output, actions are prefixed with `[DRY-RUN]` and phrased as\n\"Would add\" \u002F \"Would inject\" \u002F \"Would replace\".\n\n---\n\n## Respond\n\nDo not show the script's raw stdout. Reformat its results into clear Markdown\ntables (variables to add, files to update, model replacements) so they are easy\nto read — this is especially important for `--dry-run` output. For each variable\nor model string, include a column with the source file where it was found\n(locate it in the recipe's Python source; ignore `.env` and `.env.example`).\n\nFor added variables, surface the **resolved default** and **its provenance**\nso the maintainer knows which value the skill chose and where it came from:\n\n| Variable | Value written to .env.example | Source |\n|----------|-------------------------------|--------|\n| `GOOGLE_CLOUD_PROJECT` | `\u003CTODO: update-this-value>` *(downgraded — source had `\"my-project-id\"`)* | `agent.py` (setdefault) |\n| `GOOGLE_GENAI_USE_VERTEXAI` | `TRUE` | `__init__.py` (setdefault) |\n| `LOG_LEVEL` | `INFO` | `logging_setup.py` (getenv fallback) |\n| `API_KEY` | `\u003CTODO: update-this-value>` *(no default in source)* | `client.py` (getenv, no fallback) |\n\nIf the script reports **upgrades** (stale TODO entries rewritten in\nplace with real defaults from source), surface those in a separate table\nso the maintainer can eyeball each one:\n\n| Variable | Was | Now | Source |\n|----------|-----|-----|--------|\n| `USE_VERTEX` | `\u003CTODO: update-this-value>` | `TRUE` | `__init__.py` (setdefault) |\n\nIf the script logged `[WARN] Refused to upgrade …` for any variable,\nsurface that too — the line's structure was ambiguous and was left\nuntouched deliberately.\n\nOnce the script finishes successfully, summarise what changed:\n\n- Which variables were **added** to `.env.example` (with resolved value +\n  source) or confirm it was already up to date.\n- Which existing TODOs were **upgraded** in place (v2.1) with real\n  defaults from source.\n- Any values that were **downgraded to `\u003CTODO>` because they looked like\n  placeholders** — the maintainer should fix the source too.\n- Whether `load_dotenv()` was injected or was already present.\n- Whether `python-dotenv` was added to `pyproject.toml` or was already there.\n\nThen remind the user of the next steps:\n\n```\nNext steps:\n  cp \u003CRECIPE_DIR>\u002F.env.example \u003CRECIPE_DIR>\u002F.env   # then fill in real values\n  cd \u003CRECIPE_DIR> && uv sync                        # install python-dotenv if newly added\n```\n\nDo not make any further changes. End your turn.\n","# Extract Python Environment Variables\n\nUse this skill to ensure a Python recipe properly declares and loads all\nenvironment variables it uses.\n\n---\n\n## What This Skill Does\n\nRuns `scripts\u002Fextract_env_vars.py` against a recipe directory. The script:\n\n1. **Scans** all `.py` files (excluding `tests\u002F` and common cache\u002Fvenv\n   directories) for environment variable accesses:\n   - `os.environ[\"VAR\"]`\n   - `os.environ.get(\"VAR\")` \u002F `os.environ.get(\"VAR\", \"default\")`\n   - `os.getenv(\"VAR\")` \u002F `os.getenv(\"VAR\", \"default\")`\n   - `os.environ.setdefault(\"VAR\", \"default\")` &nbsp;&nbsp;*(v2)*\n\n   Only names matching `^[A-Z_][A-Z0-9_]*$` (UPPER_SNAKE_CASE) are captured;\n   a lowercase name like `os.getenv(\"my_api_key\")` is **skipped** and a\n   `[WARN]` line lists any that were dropped. Rename such vars to uppercase\n   in source, or add them to `.env.example` by hand.\n\n2. **Updates `.env.example`** — appends any variables not already\n   declared AND upgrades stale TODO entries in place. Existing\n   user-authored lines are always preserved (see Rule 1 below).\n   - Creates `.env.example` from scratch if it does not exist.\n   - Each new\u002Fupgraded line has the shape:\n     ```\n     VAR=\u003Cvalue>  # extracted-by:extract-env-vars; \u003Cprovenance>\n     ```\n   - `\u003Cvalue>` is the **resolved default** extracted from source when the\n     author committed to one — with `os.environ.setdefault(...)` beating\n     `os.getenv(\"V\", \"d\")` \u002F `os.environ.get(\"V\", \"d\")` (setdefault is a\n     stronger commitment: it mutates the process environment, while getenv\n     fallback is per-read). Alphabetical file order breaks ties.\n   - Values that look like **stubs** are downgraded to\n     `\u003CTODO: update-this-value>` — e.g. `my-project-id`, `your-api-key`,\n     `changeme`, `\u003C...>`, anything containing `example.com`. The source\n     string is preserved in the marker comment so the maintainer sees\n     what was found and can fix the source too.\n   - When no source supplied a string-literal default, the value is\n     `\u003CTODO: update-this-value>` with a `no default in source` note.\n   - **Stale TODO upgrade (v2.1):** if an existing entry is either a\n     skill-authored TODO (has the marker) or a bare v1-era TODO (exact\n     value `\u003CTODO: update-this-value>`, no marker, no inline comment)\n     AND source can now supply a real default, the line is rewritten in\n     place. This closes the discoverability loop for recipes originally\n     processed by v1 (which always wrote TODOs regardless of what source\n     said).\n\n3. **Injects `load_dotenv()`** into the package `__init__.py` (the first\n   subdirectory inside the recipe that contains an `__init__.py`, skipping\n   `tests\u002F` and hidden directories). The snippet injected is:\n\n   ```python\n   from dotenv import load_dotenv\n\n   # Load variables from .env if present. In production the environment is\n   # already populated by the platform (Cloud Run, GKE, etc.), so a missing\n   # .env is expected and not an error.\n   load_dotenv()\n   ```\n\n   If `load_dotenv` is already present the injection is skipped.\n\n   **If no package `__init__.py` exists** (common in vertical plugins under\n   `plugins\u002F`, where the code lives in a plain `scripts\u002F` directory rather\n   than an importable package) the injection is skipped with a `[WARN]`,\n   and the step reports that no bootstrap is in place. Step 4 below depends\n   on that answer.\n\n   **Additionally — always, regardless of whether we injected** — appends\n   `# noqa: E402 -- must come after load_dotenv()` to any top-level relative\n   import (`from .x import y`) that sits AFTER a non-import module-level\n   statement. Two cases this covers:\n\n   - **Fresh injection.** The injected `load_dotenv()` call pushes\n     pre-existing trailing relative imports below a non-import statement, so\n     they'd trigger Ruff `E402` (\"module-level import not at top of file\")\n     when Phase 4 (ruff) of `prepare-python-recipe` runs.\n\n   - **Author-written bootstrap.** The recipe author already wrote\n     `load_dotenv()` + `os.environ.setdefault(...)` calls followed by a\n     trailing `from . import agent`, but never marked the trailing import.\n     The skill did NOT inject anything (load_dotenv was already present) but\n     still adds the noqa suffix so the file is lint-clean on the pipeline's\n     next ruff pass.\n\n   The suppression pass is precise — a relative import at the very TOP of\n   the file (before any non-import statement) is fine and left untouched.\n   Idempotent: a line that already carries `# noqa: E402` is skipped.\n\n4. **Replaces hardcoded model names** in source (e.g. `model=\"gemini-3.5-flash\"`\n   in `agent.py`) with an `os.getenv(...)` call.\n\n   **Position decides eligibility.** A model string is only promoted when it\n   is a *configurable constant*. Three positions mean it is something else,\n   and are left untouched:\n\n   - **Collection-literal entries** (dict keys and values, list\u002Fset\u002Ftuple\n     items) — lookup tables and enumerations of supported models:\n\n     ```python\n     IMAGE_MODELS = {\n         \"flash\": \"gemini-2.5-flash-image\",\n         \"pro\":   \"gemini-2.5-pro-image\",\n     }\n     ```\n\n     Rewriting the values collapses the table onto one env var; rewriting the\n     **keys** is worse, because `IMAGE_MODELS.get(\"flash\")` then never\n     matches anything. A dict key must stay a static literal.\n   - **Subscript indices** — `IMAGE_MODELS[\"gemini-3.1\"]` is a key *into*\n     such a table, so replacing it looks up a different entry.\n   - **Comparison operands** — `if \"gemini-3.1\" in model_id` tests a value\n     rather than configuring one.\n\n   Skipping a legitimate extraction is cheap (lift it by hand); silently\n   breaking a lookup table is not, so this errs towards skipping. Every\n   skipped literal is listed in an `[INFO]` block, so nothing is hidden — and\n   because these strings never reach the naming step, a dict target like\n   `IMAGE_MODELS` can no longer leak into `.env.example` as a variable name.\n\n   **Variable name.** The assignment target that holds the literal is used\n   when it names a model, since it carries far more meaning than a generic\n   fallback — `DEFAULT_EMBEDDING_MODEL = \"gemini-embedding-001\"` and\n   `embedding_model = cfg.get(\"embedding_model\", \"gemini-embedding-001\")`\n   both yield `EMBEDDING_MODEL`. This matters in recipes that already read a\n   *different* model var (say `GEMINI_MODEL` for the LLM), where a second\n   bare `MODEL_NAME` would be actively misleading. When a string is assigned\n   to conflicting target names, the most frequent wins, ties broken\n   alphabetically. Otherwise:\n   - A single unnamed model → `MODEL_NAME`\n   - The rest → `MODEL_NAME_GENERATED_1`, `MODEL_NAME_GENERATED_2`, … (sorted\n     alphabetically for determinism)\n\n   **Fallback argument.** Normally the emitted call is **bare** —\n   `os.getenv(\"EMBEDDING_MODEL\")`, no default — because default values are\n   the maintainer's decision, not the skill's. That is only safe when the\n   `load_dotenv()` bootstrap from step 3 is in place to populate the\n   environment.\n\n   **When step 3 could not install a bootstrap** (no package `__init__.py`),\n   nothing reads `.env`, so a bare lookup would evaluate to `None` at runtime\n   and silently break the recipe. In that case the original literal is\n   preserved as the fallback — `os.getenv(\"EMBEDDING_MODEL\",\n   \"gemini-embedding-001\")` — which keeps behaviour identical to before the\n   rewrite while still lifting the value into the environment. The step logs\n   an `[INFO]` line explaining the choice.\n\n   The actual model string is written as the value in `.env.example` (e.g.\n   `EMBEDDING_MODEL=gemini-embedding-001`) with a comment prompting the\n   maintainer to rename the variable if the derived name isn't right.\n\n5. **Updates `pyproject.toml`** — adds `python-dotenv>=1.0.0` to `[project]`\n   dependencies if it is not already there.\n\n---\n\n## Hard rules the skill NEVER breaks\n\n**Rule 1 — User-edit safety for `.env.example`.** The writer classifies\nevery existing entry before touching anything, and only rewrites lines\nit can prove it authored. Concretely:\n\n| Existing entry looks like | Source now provides | Action |\n|---|---|---|\n| Missing | any | **append** with resolved default (or TODO) |\n| A line the skill wrote (has `# extracted-by:extract-env-vars` marker) with `\u003CTODO: update-this-value>` value | a REAL default (not placeholder-shape) | **upgrade in place** |\n| Same as above | no default OR a placeholder-shape default | **skip** (would be TODO → TODO churn) |\n| Bare `VAR=\u003CTODO: update-this-value>` line with **no marker AND no inline comment** — a v1-era TODO | a REAL default | **upgrade in place** (v1 → v2 migration) |\n| A line the skill wrote with a REAL value | source has any value (even different) | **skip** (never overwrite skill-authored values on drift) |\n| Anything else (user typed value, user-authored comment, non-standard formatting) | any | **skip — never touched** |\n\nGolden rule underneath all of this: **fail closed**. If the classifier\ncan't confidently prove a line was skill-authored or is a bare v1 TODO,\nit's `USER_OWNED` and untouchable. If the rewriter finds a line whose\nstructure it doesn't understand (quoted value, backslash continuation,\nduplicate declarations), it refuses and warns rather than guessing. And\nbefore any write, the assembled file is re-parsed to verify every\nplanned upgrade re-parses as a skill-authored real value — a bug in the\nrewriter cannot silently corrupt `.env.example`.\n\nTo force regeneration of a line the skill would otherwise skip, delete\nthe line and re-run.\n\n*Rationale for extracting defaults (v2) and upgrading stale TODOs\n(v2.1): a value hidden inside a Python file that a user must know about\nbut has no reason to look at is, in practice, undocumented.\n`.env.example` is the documented configuration surface. Surfacing what\nthe author already committed to in code — and updating a stale TODO\nonce source can supply a real default — makes the configuration\ndiscoverable without inventing anything new. The value in source WAS\nthe value; we're only lifting it into view.*\n\n**Rule 2 — Additive-only for Python files.** The skill never writes new\n`os.environ.setdefault(...)` bootstrap lines into any Python file.\nPre-existing `os.environ.setdefault(...)` or\n`os.getenv(\"VAR\", \"default\")` calls that a recipe author wrote by hand\nare LEFT UNTOUCHED. The skill's only writes to Python files are:\n- Adding the `from dotenv import load_dotenv` + `load_dotenv()` snippet\n  (once, only if not already present).\n- Appending `# noqa: E402` to trailing relative imports that would\n  otherwise trip Ruff after the env-bootstrap block.\n- Replacing hardcoded model literals with `os.getenv(...)` calls — bare\n  when a `load_dotenv()` bootstrap is in place, otherwise retaining the\n  original literal as the fallback (see step 4 above).\n\nNote that scanning `os.environ.setdefault(...)` and lifting its value\ninto `.env.example` (v2) does NOT violate Rule 2 — the skill READS from\nPython source (unchanged behaviour) and WRITES only to `.env.example`.\n\n---\n\n## Rules for the Agent\n\n1. **Always use the script** — never manually edit `.env.example`, `__init__.py`,\n   or `pyproject.toml` to perform these changes.\n2. **Ask for the recipe directory** if the user has not provided one. Do not\n   assume a path.\n3. **After the script succeeds**, remind the user to:\n   - Copy `.env.example` → `.env` and fill in real values before running locally.\n   - Run `uv sync` to pick up the `python-dotenv` dependency if it was newly added.\n\n---\n\n## Input\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| Recipe directory | Yes | Path to the recipe root (e.g. `contrib\u002Fpython\u002Fmy-recipe`, `core\u002Fpython\u002Fmy-recipe`, or `plugins\u002Fretail\u002Fstore-ops`) |\n\nIf the user has not specified the recipe directory, ask for it before proceeding.\n\n---\n\n## Run\n\nRun it through `uv` so it always executes on a Python 3.11+ interpreter — the\nscript uses the stdlib `tomllib`, which only exists from 3.11 onward. A bare\n`python3` that resolves to 3.9\u002F3.10 fails with `ModuleNotFoundError: tomllib`.\nNo `--with` packages are needed (the script is stdlib-only).\n\n```bash\nuv run --no-project python3 \\\n  .agents\u002Fskills\u002Fextract-python-environment-variables\u002Fscripts\u002Fextract_env_vars.py \\\n  --recipe-dir \u003CRECIPE_DIR>\n```\n\n### Preview first (optional)\n\nAdd `--dry-run` to report exactly what *would* change without modifying any\nfiles. Nothing is written to `.env.example`, `__init__.py`, `pyproject.toml`, or\nany source file. Useful for inspecting a recipe before committing to the edits:\n\n```bash\nuv run --no-project python3 \\\n  .agents\u002Fskills\u002Fextract-python-environment-variables\u002Fscripts\u002Fextract_env_vars.py \\\n  --recipe-dir \u003CRECIPE_DIR> --dry-run\n```\n\nIn dry-run output, actions are prefixed with `[DRY-RUN]` and phrased as\n\"Would add\" \u002F \"Would inject\" \u002F \"Would replace\".\n\n---\n\n## Respond\n\nDo not show the script's raw stdout. Reformat its results into clear Markdown\ntables (variables to add, files to update, model replacements) so they are easy\nto read — this is especially important for `--dry-run` output. For each variable\nor model string, include a column with the source file where it was found\n(locate it in the recipe's Python source; ignore `.env` and `.env.example`).\n\nFor added variables, surface the **resolved default** and **its provenance**\nso the maintainer knows which value the skill chose and where it came from:\n\n| Variable | Value written to .env.example | Source |\n|----------|-------------------------------|--------|\n| `GOOGLE_CLOUD_PROJECT` | `\u003CTODO: update-this-value>` *(downgraded — source had `\"my-project-id\"`)* | `agent.py` (setdefault) |\n| `GOOGLE_GENAI_USE_VERTEXAI` | `TRUE` | `__init__.py` (setdefault) |\n| `LOG_LEVEL` | `INFO` | `logging_setup.py` (getenv fallback) |\n| `API_KEY` | `\u003CTODO: update-this-value>` *(no default in source)* | `client.py` (getenv, no fallback) |\n\nIf the script reports **upgrades** (stale TODO entries rewritten in\nplace with real defaults from source), surface those in a separate table\nso the maintainer can eyeball each one:\n\n| Variable | Was | Now | Source |\n|----------|-----|-----|--------|\n| `USE_VERTEX` | `\u003CTODO: update-this-value>` | `TRUE` | `__init__.py` (setdefault) |\n\nIf the script logged `[WARN] Refused to upgrade …` for any variable,\nsurface that too — the line's structure was ambiguous and was left\nuntouched deliberately.\n\nOnce the script finishes successfully, summarise what changed:\n\n- Which variables were **added** to `.env.example` (with resolved value +\n  source) or confirm it was already up to date.\n- Which existing TODOs were **upgraded** in place (v2.1) with real\n  defaults from source.\n- Any values that were **downgraded to `\u003CTODO>` because they looked like\n  placeholders** — the maintainer should fix the source too.\n- Whether `load_dotenv()` was injected or was already present.\n- Whether `python-dotenv` was added to `pyproject.toml` or was already there.\n\nThen remind the user of the next steps:\n\n```\nNext steps:\n  cp \u003CRECIPE_DIR>\u002F.env.example \u003CRECIPE_DIR>\u002F.env   # then fill in real values\n  cd \u003CRECIPE_DIR> && uv sync                        # install python-dotenv if newly added\n```\n\nDo not make any further changes. End your turn.\n",{"name":5,"metadata":57,"description":59},{"author":13,"license":16,"version":58},"2.3.0","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\"`, `\"\u003C...>\"`) 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 an `os.getenv(...)` call. The variable name is derived from the assignment target when it names a model (`DEFAULT_EMBEDDING_MODEL` → `EMBEDDING_MODEL`), else `MODEL_NAME` (single model) or `MODEL_NAME_GENERATED_1` \u002F `MODEL_NAME_GENERATED_2`, … (multiple models). Normally no fallback default is written into the Python source; the one exception is when no `load_dotenv()` bootstrap could be installed (no package `__init__.py`), where the original literal is kept as the fallback so the lookup cannot evaluate to `None` at runtime. The model string is written as the value in `.env.example` with a comment prompting a rename.   When re-run against a recipe whose `.env.example` already has entries, the writer classifies each entry (skill-authored vs. user-authored, TODO vs. real value) and only rewrites lines it can prove it authored; user-authored lines are always preserved. A stale TODO (either skill-authored or a bare v1-era `\u003CTODO: update-this-value>` with no inline comment) is upgraded in place when source can supply a real default. IMPORTANT — two hard rules the skill NEVER breaks: (1) USER-EDIT SAFETY. Any `.env.example` line the skill cannot prove it authored is USER_OWNED and is never modified. The rewriter fails closed on any structural ambiguity (quoted values, backslash continuation, duplicate declarations) — a stale TODO left in place is cheap; a clobbered user edit is not. (2) ADDITIVE-ONLY FOR PYTHON FILES. The skill never writes new `os.environ.setdefault(...)` bootstrap lines into any Python file. Pre-existing `os.environ.setdefault(...)` or `os.getenv(\"VAR\", \"default\")` calls that the recipe author wrote by hand are LEFT UNTOUCHED — the skill's only writes to Python files are (a) the `load_dotenv()` bootstrap; (b) `# noqa: E402` on trailing relative imports that would otherwise trip Ruff; (c) hardcoded model-literal replacement. Use when the user wants to \"extract env vars\", \"update .env.example\", \"add load_dotenv\", \"surface setdefault defaults\", \"upgrade stale TODOs in .env.example\", \"replace hardcoded model names\", or \"fix environment variables\" in a Python recipe.\n","main","665f7b2a181686f2ba3c6c942e9b30a084b12ec3",".agents\u002Fskills\u002Fextract-python-environment-variables",2962,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes","https:\u002F\u002Fadk.dev","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 04:01:32",{"source":9,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add google\u002Fadk-recipes --skill extract-python-environment-variables",{"tool":76,"command":77},"bunx","bunx skills add google\u002Fadk-recipes --skill extract-python-environment-variables",{"tool":79,"command":80},"pnpm","pnpm dlx skills add google\u002Fadk-recipes --skill extract-python-environment-variables","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextract-python-environment-variables\u002FSKILL.md",true,[84,90,94],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fextract_env_vars.py","SCRIPT","脚本",102141,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextract-python-environment-variables\u002Fscripts\u002Fextract_env_vars.py",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"tests\u002Fconftest.py",919,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextract-python-environment-variables\u002Ftests\u002Fconftest.py",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"tests\u002Ftest_extract_env_vars.py",120324,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fextract-python-environment-variables\u002Ftests\u002Ftest_extract_env_vars.py",[99,121,149,179,204,233],{"skillNo":100,"name":101,"nameZh":102,"description":103,"descriptionZh":104,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":105,"categories":106,"keywords":113,"publishedAt":52},"01M6991EKEG8XEM3VWW4VGV0ZQ","retail-virtual-tryon","零售虚拟试穿智能体开发","Creates virtual try-on agents supporting image and video (catwalk animation) try-ons on Google Cloud (Gemini image models and Veo on Gemini Enterprise Agent Platform). Handles resource setup, user photo uploading, image\u002Fvideo generation pipelines, local testing, and evaluation.","创建虚拟试穿智能体，在 Google Cloud 上支持图片和视频（走秀动画）试穿（使用 Gemini 图像模型和 Gemini Enterprise Agent Platform 上的 Veo）。负责资源设置、用户照片上传、图片\u002F视频生成流水线、本地测试和评估。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002Fplugins\u002Fretail\u002Fskills\u002Fvirtual-tryon\u002FSKILL.md",[107,110],{"categoryNo":108,"categoryName":109,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",{"categoryNo":111,"categoryName":112,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发",[114,115,116,10,117,51,118,119,120],"retail virtual tryon","google cloud","image","testing","genai","adk","gemini enterprise agent platform",{"skillNo":122,"name":123,"nameZh":124,"description":125,"descriptionZh":126,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":127,"categories":128,"keywords":131,"publishedAt":52},"01M6991ABTZW7FCPREXY8GD4RG","retail-product-search","零售产品搜索智能体构建","Creates product search agents with semantic search and RAG on Google Cloud (Vector Search on Gemini Enterprise Agent Platform, BigQuery, embeddings). Use when the user wants to \"build a product search agent\", \"create an e-commerce search\", \"make a shopping assistant\", \"set up semantic catalog discovery\", \"ingest products into Vector Search\", or \"deploy a retail RAG agent\". Handles the full pipeline: catalog data ingestion to BigQuery, Gemini Enterprise Agent Platform Vector Search collection setup, ADK agent scaffolding, evaluation, and Cloud Run deployment.","在 Google Cloud 上创建具备语义搜索和 RAG 能力的产品搜索智能体（基于 Gemini Enterprise Agent Platform 上的 Vector Search、BigQuery 和 embeddings）。当用户想要“构建产品搜索智能体”“创建电商搜索”“制作购物助手”“搭建语义化目录发现”“将产品导入 Vector Search”或“部署零售 RAG 智能体”时使用。涵盖完整流程：目录数据导入 BigQuery、Gemini Enterprise Agent Platform 的 Vector Search 集合配置、ADK 智能体脚手架搭建、评估以及 Cloud Run 部署。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002Fplugins\u002Fretail\u002Fskills\u002Fproduct-search\u002FSKILL.md",[129,130],{"categoryNo":108,"categoryName":109,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":111,"categoryName":112,"taxonomyType":28,"taxonomyTypeDesc":29},[132,133,134,120,119,51,135,10,115,136,137,138,139,140,141,142,143,144,145,146,49,147,148],"retail product search","product","search","assistant","pipeline","when","commerce","scaffolding","shopping","up","ingestion","collection","SET","vector","apache","create","rag",{"skillNo":150,"name":151,"nameZh":152,"description":153,"descriptionZh":154,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":155,"categories":156,"keywords":161,"publishedAt":52},"01M69918HZCYZHD7K9Y9ZSD287","routines","定时例行任务管理","Use for a recurring unattended task (cron; pull data, open a PR, post a digest), or to test\u002Fdry-run a routine first. Explains authoring and testing via the routine tool.","用于周期性、无人值守的任务（cron；如拉取数据、创建 PR、发布摘要），或先对某个例行程序进行测试／试运行。介绍如何通过 routine 工具编写和测试例行任务。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002Fcore\u002Fpython\u002Flong-horizon-harness\u002Fhorizon\u002Fbuiltin_skills\u002Froutines\u002FSKILL.md",[157,158],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":159,"categoryName":160,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSFHC0DJXKNN0QBZDDS4K9","定时任务与自动化编排",[151,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,49,177,117,178],"dry","routine","for","post","via","authoring","digest","task","use","recurring","pr","tool","open","first","pull","test","data",{"skillNo":180,"name":181,"nameZh":182,"description":183,"descriptionZh":184,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":185,"categories":186,"keywords":193,"publishedAt":52},"01M699178ZDFDXEZ11DG1Y9CTF","policy","工具权限策略检查","Inspect the per-workspace tool-policy overlay (.lha\u002Fpolicies.jsonl) that gates destructive or sensitive tool calls, and tell the user what to change if they want a rule added or removed.","检查按工作区划分的工具策略覆盖层（.lha\u002Fpolicies.jsonl），该覆盖层用于对破坏性或敏感的工具调用进行门控，并告知用户若想新增或删除规则应修改哪些内容。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002Fcore\u002Fpython\u002Flong-horizon-harness\u002Fhorizon\u002Fbuiltin_skills\u002Fpolicy\u002FSKILL.md",[187,190],{"categoryNo":188,"categoryName":189,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师",{"categoryNo":191,"categoryName":192,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0CV1NMDZ5TEJX1GVM29","插件与技能管理",[181,194,195,196,197,198,199,200,201,202,173,203],"gates","overlay","tool calls","inspect","calls","jsonl","rule","user","workspace","change",{"skillNo":205,"name":206,"nameZh":207,"description":208,"descriptionZh":209,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":210,"categories":211,"keywords":218,"publishedAt":52},"01M69915F8591SQBA1ZHK6NDA7","google-workspace","Google Workspace 办公套件操作","Read\u002Fwrite Google Drive, Docs, Sheets, Gmail, Calendar, Chat, Tasks, Slides via the `gws` CLI. Needs an OAuth client or service account configured first. Use for any Google Workspace task.","通过 `gws` 命令行工具读写 Google Drive、Docs、Sheets、Gmail、Calendar、Chat、Tasks、Slides。需先配置 OAuth 客户端或服务账号。适用于任何 Google Workspace 任务。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002Fcore\u002Fpython\u002Flong-horizon-harness\u002Fhorizon\u002Fbuiltin_skills\u002Fgoogle-workspace\u002FSKILL.md",[212,215],{"categoryNo":213,"categoryName":214,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TPH3VQWKQZXV7EPF8VZ","办公行政人员",{"categoryNo":216,"categoryName":217,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQGD3WKAZKP84N22M6Q0DM","办公管理与协作",[202,219,10,220,170,221,222,223,175,224,225,226,227,228,169,164,229,230,166,231,232],"google workspace","calendar","write","read","slides","OAuth","tasks","docs","cli","gmail","sheets","client","chat","gws",{"skillNo":234,"name":235,"nameZh":236,"description":237,"descriptionZh":238,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":239,"categories":240,"keywords":243,"publishedAt":52},"01M69914416KTZ6Z0WD425YYJ0","find-skills","智能体技能发现与安装","Discover\u002Finstall NEW agent skills from external sources (skills.sh). Use for capabilities you lack, e.g. \"find a skill for X\". Do NOT use to list skills you already have; see `\u003Cavailable_skills>`.","从外部来源（skills.sh）发现并安装全新的智能体技能。用于弥补自身缺失的能力，例如“找一个能做 X 的技能”。不要用于列出你已有的技能；请参阅 `\u003Cavailable_skills>`。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fadk-recipes\u002Fblob\u002Fmain\u002Fcore\u002Fpython\u002Flong-horizon-harness\u002Fhorizon\u002Fbuiltin_skills\u002Ffind-skills\u002FSKILL.md",[241,242],{"categoryNo":191,"categoryName":192,"taxonomyType":28,"taxonomyTypeDesc":29},{"categoryNo":108,"categoryName":109,"taxonomyType":23,"taxonomyTypeDesc":24},[244,245,164,246,247,248,249,250,170,251,252,253,254],"find skills","find","you","sources","discover","new agent","do","install","list","list skills","capabilities"]