Agent skill · Backend & API

add-setting-env

Add server-side environment variables that control default values for user settings.

LobeHub80,937★ · +310/wk · 1 repos on radarProfile →
claude-codeNOASSERTION
Install
npx skills add lobehub/lobehub --skill add-setting-env --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 3 KB
Bundled scripts: none
Path: .agents/skills/add-setting-env/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 81,252 · +315 this week
Language: TypeScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Adding Environment Variable for User Settings Add server-side environment variables to configure default values for user settings. **Priority**: User Custom > Server Env Var > Hardcoded Default ## Steps ### 1. Define Environment Variable Create `packages/env/src/<domain>.ts` (import path stays `@/envs/<domain>` — tsconfig maps to `packages/env/src/*` first): ```typescript import { createEnv } from '@t3-oss/env-core'; import { z } from 'zod'; export const get<Domain>Config = () => { return createEnv({ server: { YOUR_ENV_VAR: z.coerce.number().min(MIN).max(MAX).optional(), }, runtimeEnv: { YOUR_ENV_VAR: process.env.YOUR_ENV_VAR, }, }); }; export const <domain>Env = get<Domain>Config(); ``` ### 2. Update Type (if new domain) Add to `packages/types/src/serverConfig.ts`: ```typescript import { User<Domain>Config } from './user/settings'; export interface GlobalServerConfig { <domain>?: PartialDeep<User<Domain>Config>; } ``` **Prefer reusing existing types** from `packages/types/src/user/settings`. ### 3. Assemble Server Config (if new domain) In `apps/server/src/globalConfig/index.ts`: ```typescript import { <domain>Env } from '@/envs/<domain>'; export const getServerGlobalConfig = as

What's inside
Steps it walks through
  1. Steps
  2. 1. Define Environment Variable
  3. 2. Update Type (if new domain)
  4. 3. Assemble Server Config (if new domain)
  5. 4. Merge to User Store (if new domain)
  6. 5. Update .env.example
  7. 6. Update Documentation
  8. Example: AI\IMAGE\DEFAULT\IMAGE\NUM
Ships with 1 file
  • agents/openai.yaml
More from lobehub
All skills →
About this skill
What does the add-setting-env skill do?

Add server-side environment variables that control default values for user settings.

How do I install it?

Run `npx skills add lobehub/lobehub --skill add-setting-env --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From lobehub/lobehub, a repository with 81,252 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going