add-setting-env

Automate server-side environment variable configuration for user settings.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/samiabid/lobehub-railway --skill add-setting-env-samiabid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-setting-env
Source: https://github.com/samiabid/lobehub-railway/tree/main/.agents/skills/add-setting-env
Command: npx skills add https://github.com/samiabid/lobehub-railway --skill add-setting-env-samiabid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps teams configure user settings by introducing server-side environment variables to control default values, reducing manual, error-prone configuration.

Core Features & Use Cases

  • Define Environment Variable: Create src/envs/<domain>.ts to expose domain-specific server configuration.
  • Update Type & Assemble Server Config: Extend TypeScript types and assemble a global config from environment values.
  • Merge to User Store & Documentation: Integrate domain settings into the user store and keep docs up to date.

Quick Start

  • Create src/envs/<domain>.ts implementing get<Domain>Config and <domain>Env as shown in the guide.
  • Update packages/types/src/serverConfig.ts to include the domain in GlobalServerConfig.
  • Implement getServerGlobalConfig in src/server/globalConfig/index.ts to expose the configured env var.
  • Merge domain server settings into the user store in src/store/user/slices/common/action.ts.
  • Update .env.example with a sample value for YOUR_ENV_VAR.

Frequently Asked Questions about add-setting-env

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure user settings with environment variables on the server?

Configure user settings with environment variables by creating domain-specific TypeScript files in src/envs/<domain>.ts that expose server configuration, then merge those values into your user store. This centralizes defaults across deployment and self-hosting environments, eliminating manual configuration errors.

What's the best way to manage environment-based defaults across multiple deployment environments?

Define environment-based defaults by creating typed server config files, extending your GlobalServerConfig type, and implementing getServerGlobalConfig to assemble values from environment variables. This approach scales across dev, staging, and production while keeping configuration discoverable and version-controlled.

How do I keep environment variable documentation in sync with server configuration?

Update .env.example alongside your TypeScript config files and user store integration, enforcing YAML frontmatter with name and description fields. This keeps documentation authoritative and deployable teams aligned on required variables and their purposes.

Can I integrate server environment variables into an existing user store?

Yes. Merge domain server settings into your user store by updating the action layer in src/store/user/slices/common/action.ts to apply environment-configured defaults. This lets you preserve existing store structure while layering server-side configuration on top.

Do I need to modify TypeScript types to add server configuration?

Yes. Extend packages/types/src/serverConfig.ts to include your domain in GlobalServerConfig, then implement typed getter functions like get<Domain>Config in your env file. This ensures type safety and prevents configuration drift across your codebase.