add-setting-env
Add server-side environment variables that control default values for user settings.
npx skills add lobehub/lobehub --skill add-setting-env --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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
- Steps
- 1. Define Environment Variable
- 2. Update Type (if new domain)
- 3. Assemble Server Config (if new domain)
- 4. Merge to User Store (if new domain)
- 5. Update .env.example
- 6. Update Documentation
- Example: AI\IMAGE\DEFAULT\IMAGE\NUM
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.