Token导航 LogoToken导航TokenDH.com
待分类敏感数据github未标认证来源可访问许可证需确认审计通过

adding-env-variables添加环境变量

Agent Skill

adding-env-variables 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,170

周安装

50

GitHub Stars

1,088

下载量

391
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:adding-env-variables(添加环境变量)
来源仓库:https://github.com/inkeep/agents
仓库路径:skills/adding-env-variables
安装命令:
npx skills add https://github.com/inkeep/agents --skill adding-env-variables
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/inkeep/agents --skill adding-env-variables

简介

用于向 Inkeep Agent Framework 添加新的环境变量,确保类型安全和文档一致性。

  • 适用于 agents-api、agents-core、agents-cli 等模块的配置扩展,支持 CI 强制校验描述字段。
  • 通过 env.ts 文件定义变量,自动检测缺失的 .describe() 调用并在构建时报错。
  • 修改前应检查现有变量命名规范,避免重复或冲突;本地运行 pnpm check:env-descriptions 预检变更。
  • adding-env-variables 属于待分类类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Adding Environment Variables Guide

Comprehensive guidance for adding new environment variables to the Inkeep Agent Framework. This ensures consistency, documentation, and type safety across all packages.


CI Enforcement

Environment variable descriptions are enforced by CI. The check:env-descriptions script runs in CI and will fail if any variables in env.ts files are missing .describe() calls.

Run locally to check:

pnpm check:env-descriptions

Environment Architecture

The framework uses environment variables defined in multiple env.ts files:

PackageFilePurpose
agents-apiagents-api/src/env.tsMain API server configuration
agents-corepackages/agents-core/src/env.tsShared core configuration
agents-cliagents-cli/src/env.tsCLI tool configuration

Note: The following files are auto-generated and should NOT be edited:

  • packages/agents-mcp/src/lib/env.ts (Generated by Speakeasy)

Required Steps for Adding Environment Variables

Step 1: Add to .env.example

Location: .env.example (root of repository)

Add the variable with a descriptive comment:

# ============ SECTION NAME ============
# Description of what this variable does
# Additional context if needed (e.g., where to get API keys)
MY_NEW_VARIABLE=default-value-or-empty

Example:

# ============ AI PROVIDERS ============
# Required for agent execution
# Get your API keys from:
# Anthropic: https://console.anthropic.com/
# OpenAI: https://platform.openai.com/
ANTHROPIC_API_KEY=
OPENAI_API_KEY=

Step 2: Add to Relevant env.ts File(s)

Add the variable to the Zod schema with a .describe() call that matches the .env.example comment:

const envSchema = z.object({
  // ... existing variables ...

  MY_NEW_VARIABLE: z
    .string()
    .optional()
    .describe('Description of what this variable does'),
});

Step 3: Description Requirements

Every environment variable MUST have a .describe() call with a clear, concise description that:

  1. Explains what the variable is used for
  2. Matches the comment in .env.example
  3. Includes helpful context (e.g., where to get API keys, default behavior)

Examples of good descriptions:

// AI Provider keys
ANTHROPIC_API_KEY: z
  .string()
  .describe('Anthropic API key for Claude models (required for agent execution). Get from https://console.anthropic.com/'),

// Database configuration
INKEEP_AGENTS_MANAGE_DATABASE_URL: z
  .string()
  .describe('PostgreSQL connection URL for the management database (Doltgres with Git version control)'),

// Authentication
BETTER_AUTH_SECRET: z
  .string()
  .optional()
  .describe('Secret key for Better Auth session encryption (change in production)'),

// Feature flags
LANGFUSE_ENABLED: z
  .string()
  .optional()
  .transform((val) => val === 'true')
  .describe('Enable Langfuse LLM observability (set to "true" to enable)'),

Zod Schema Patterns

Required Variables

MY_REQUIRED_VAR: z
  .string()
  .describe('This variable is required for the application to function'),

Optional Variables

MY_OPTIONAL_VAR: z
  .string()
  .optional()
  .describe('Optional configuration for feature X'),

Variables with Defaults

MY_VAR_WITH_DEFAULT: z
  .string()
  .optional()
  .default('default-value')
  .describe('Configuration with a sensible default'),

Enum Variables

LOG_LEVEL: z
  .enum(['trace', 'debug', 'info', 'warn', 'error'])
  .default('info')
  .describe('Logging verbosity level'),

Numeric Variables

POOL_SIZE: z
  .coerce.number()
  .optional()
  .default(10)
  .describe('Maximum number of connections in the pool'),

Boolean Variables (as strings)

FEATURE_ENABLED: z
  .string()
  .optional()
  .transform((val) => val === 'true')
  .describe('Enable feature X (set to "true" to enable)'),

Variables with Validation

JWT_SECRET: z
  .string()
  .min(32, 'JWT_SECRET must be at least 32 characters')
  .optional()
  .describe('Secret key for signing JWT tokens (minimum 32 characters)'),

ADMIN_EMAIL: z
  .string()
  .optional()
  .refine((val) => !val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
    message: 'Invalid email address',
  })
  .describe('Admin email address for notifications'),

Category Organization

Group related variables with comments in both .env.example and env.ts:

In .env.example:

# ============ DATABASE ============
INKEEP_AGENTS_MANAGE_DATABASE_URL=...
INKEEP_AGENTS_RUN_DATABASE_URL=...

# ============ AI PROVIDERS ============
ANTHROPIC_API_KEY=
OPENAI_API_KEY=

In env.ts:

const envSchema = z.object({
  // Database
  INKEEP_AGENTS_MANAGE_DATABASE_URL: z
    .string()
    .describe('PostgreSQL connection URL for the management database'),
  INKEEP_AGENTS_RUN_DATABASE_URL: z
    .string()
    .describe('PostgreSQL connection URL for the runtime database'),

  // AI Providers
  ANTHROPIC_API_KEY: z
    .string()
    .describe('Anthropic API key for Claude models'),
  OPENAI_API_KEY: z
    .string()
    .optional()
    .describe('OpenAI API key for GPT models'),
});

Which env.ts File to Use?

Choose the appropriate file based on where the variable is used:

Use CaseFile
API server configurationagents-api/src/env.ts
Shared across packagespackages/agents-core/src/env.ts
CLI-specificagents-cli/src/env.ts
Multiple packagesAdd to agents-core and import where needed

Checklist for Adding Environment Variables

Before completing any environment variable addition, verify:

  • Variable added to .env.example with descriptive comment
  • Variable added to relevant env.ts file(s)
  • .describe() call added with clear description
  • Description matches .env.example comment
  • Appropriate Zod type used (string, number, enum, etc.)
  • optional() added if variable is not required
  • default() added if there's a sensible default
  • Validation added if needed (min, max, refine, etc.)
  • Variable grouped with related variables (using comments)
  • pnpm check:env-descriptions passes locally

Common Mistakes to Avoid

  1. Missing .describe() call - Every variable needs a description (CI will fail!)
  2. Inconsistent descriptions - Keep .env.example and .describe() in sync
  3. Wrong file - Add to the package that actually uses the variable
  4. Missing validation - Add constraints for sensitive values (min length for secrets, email validation, etc.)
  5. Editing auto-generated files - Never edit agents-mcp env files

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.13%
按下载量换算133

Claude

31.34%
按下载量换算123

Cursor

16.54%
按下载量换算65

Gemini CLI

8.49%
按下载量换算33

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills