Agent Skills › baserow/baserow › add-config-env-var

add-config-env-var

GitHub

用于在Baserow项目中添加或审查配置环境变量,确保后端、前端、Docker及文档的一致性更新。

.agents/skills/add-config-env-var/SKILL.md baserow/baserow

触发场景

需要添加新的环境变量配置 审查现有环境变量是否完整覆盖前后端及部署配置

安装

npx skills add baserow/baserow --skill add-config-env-var -g -y
更多选项

非标准路径

npx skills add https://github.com/baserow/baserow/tree/develop/.agents/skills/add-config-env-var -g -y

不安装直接使用

npx skills use baserow/baserow@add-config-env-var

指定 Agent (Claude Code)

npx skills add baserow/baserow --skill add-config-env-var -a claude-code -g -y

安装 repo 全部 skill

npx skills add baserow/baserow --all -g -y

预览 repo 内 skill

npx skills add baserow/baserow --list

SKILL.md

Frontmatter
{
    "name": "add-config-env-var",
    "description": "Add a Baserow configuration environment variable for the backend, frontend, or both, and propagate it through settings, Nuxt runtime config, Docker Compose, documentation, consumers, and tests as applicable. Use when adding or reviewing any env-backed configuration value, including requests that reference `INTEGRATION_LOCAL_BASEROW_PAGE_SIZE_LIMIT` as a pattern."
}

Add Config Env Var

Copy the closest existing variable used by the same application layer. Public Baserow-specific env names should normally use the BASEROW_ prefix; internal Django setting names and Nuxt runtime-config keys do not.

Keep the change simple and explicit. Do not add abstractions for this.

Files To Check

Check the files relevant to the variable's consumers:

  • Backend: backend/src/baserow/config/settings/base.py
  • Frontend defaults: usually web-frontend/modules/core/module.js
  • Frontend env mapping: web-frontend/env-remap.mjs
  • Deployment: docker-compose.yml and docker-compose.no-caddy.yml
  • docs/installation/configuration.md — the canonical env-var reference table; add a row in the right section
  • Backend or frontend code that uses the setting
  • A focused test if behavior changes

Workflow

  1. Identify whether the value is consumed by the backend, frontend, or both. Define one clear default and keep defaults consistent across layers.

  2. If the backend needs it, add the Django setting in backend/src/baserow/config/settings/base.py near the closest related setting.

Example:

MY_SETTING = int(os.getenv("BASEROW_MY_SETTING", 123))
  1. If the frontend needs it, declare the Nuxt runtime-config default near the closest related key and add the public env mapping to web-frontend/env-remap.mjs.

    Before doing so, classify every frontend consumer:

    • Runtime consumers can read useRuntimeConfig() or nuxtApp.$config after env-remap.mjs runs when the container starts.
    • Build-time consumers, including modules/*/routes.js, Nuxt module setup, and direct process.env.NUXT_* reads, are compiled before self-hosters provide container environment variables. env-remap.mjs cannot make those consumers runtime-configurable.

    Do not derive a compiled route or other build artifact from a runtime env var. Compile a stable structure and apply the setting at runtime instead, for example by filtering a catch-all route and transforming its path using runtime config.

  2. If the variable should be configurable in Docker, add it to every service that consumes it and everywhere the closest example appears in:

  • docker-compose.yml
  • docker-compose.no-caddy.yml
  1. Update consumers to use the configured value:
  • Backend: settings.MY_SETTING
  • Frontend: useRuntimeConfig() or nuxtApp.$config
  • Backend tests: override_settings(MY_SETTING=...)
  1. Add or update a targeted test if the setting changes behavior.

  2. Add the related documentation in docs/installation/configuration.md — find the right section and add a table row matching the nearest existing entry.

  3. When frontend routing, module registration, or another build artifact is involved, run a production yarn build without the deployment env var and inspect the generated behavior. Confirm that setting the variable only when the built server starts still works.

Quick Checklist

  1. Identify backend and frontend consumers
  2. Add the backend setting when needed
  3. Add the Nuxt default and env remap when needed
  4. Check whether frontend consumers run at build time or runtime
  5. Keep compiled routes and artifacts independent of runtime-only values
  6. Mirror every required Docker service and Compose file
  7. Update consumers and add focused tests
  8. Document the public env variable

Guardrails

  • Do not add a raw os.getenv(...) in application code when the value belongs in Django settings.
  • Do not update only one Docker location if the example appears in several places.
  • Do not add a Django setting for a frontend-only value.
  • Do not expose a backend-only setting to Nuxt unless the frontend actually needs it.
  • Do not assume that adding a variable to env-remap.mjs makes build-time Nuxt code configurable in an official image. The remap runs when the built server starts, after its route table and bundles already exist.
  • Prefer copying the closest existing setting instead of inventing a new pattern.

版本历史

  • 2.3.4 当前 2026-09-22 22:43

同 Skill 集合

.agents/skills/add-django-config-env-var/SKILL.md
.agents/skills/add-update-builder-element-type/SKILL.md
.agents/skills/baserow-registry/SKILL.md
.agents/skills/builder-data-scopes/SKILL.md
.agents/skills/core-graph/SKILL.md
.agents/skills/create-changelog/SKILL.md
.agents/skills/create-in-app-notification/SKILL.md
.agents/skills/create-update-runtime-formula/SKILL.md
.agents/skills/create-update-service/SKILL.md
.agents/skills/manage-backend-layers/SKILL.md
.agents/skills/manage-permissions/SKILL.md
.agents/skills/review-pr/SKILL.md
.agents/skills/runtime-formulas/SKILL.md
.agents/skills/silk-profiler/SKILL.md
.agents/skills/write-backend-unit-test/SKILL.md
.agents/skills/write-e2e-test/SKILL.md
.agents/skills/write-frontend-unit-test/SKILL.md

元信息

文件数
0
版本
2.4.1
Hash
2bd43874
收录时间
2026-09-22 22:43

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-06 01:27
浙ICP备14020137号-1