dify-docs-env-vars
Installation
SKILL.md
Dify Environment Variable Documentation
Not an entry point — run under dify-docs-write; the procedure below implements its stages for en/self-host/deploy/configuration/environments.mdx. Read references/style-overrides.md (in this skill directory — env-var-specific style rules and description anti-patterns) together with this pack. Use the ref pinned at S1; cite it in the S4 scope report.
Procedure (S2 → S6)
Work through in order. Every variable goes through steps 1–4 without exception — do not skip a variable because it seems "obvious".
Step 1 (S2): Trace each variable in the codebase
When using subagents for tracing, assign 3–5 related variables per agent. Tracing depth depends on variable type:
| Variable type | Depth |
|---|---|
Python config vars (defined in api/configs/) |
Full trace (below). |
Frontend vars (mapped in web/docker/entrypoint.sh) |
Trace the Docker-to-NEXT_PUBLIC_* mapping in entrypoint.sh; verify the default in both docker/.env.example and web/.env.example; run grep -rn "<VAR_NAME>" <path-to-dify-repo>/api/ — any match means the var is dual-purpose and needs a full trace. |
Docker/container service vars (only in docker-compose.yaml) |
grep -rn "<VAR_NAME>" <path-to-dify-repo>/api/ must return no matches; then document from .env.example comments. |
Plugin daemon vars (PLUGIN_* not in api/configs/) |
Document from .env.example comments. |