env-management

Resolve missing or stale environment variables and secret keys for cortextOS agents.

88|108|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/grandamenium/cortextos --skill env-management-grandamenium
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-management
Source: https://github.com/grandamenium/cortextos/tree/main/templates/analyst/.claude/skills/env-management
Command: npx skills add https://github.com/grandamenium/cortextos --skill env-management-grandamenium

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of agents failing to access services because required environment variables and secrets are missing, stale, mis-scoped, or not loaded into the running PTY session.

Core Features & Use Cases

  • Credential lifecycle management: Add new shared secrets or agent-specific secrets, update existing values, and rotate compromised or expired keys.
  • Correct secret scoping across org vs agent: Ensures shared keys live in the org .env while per-agent secrets live in agents/{agent}/.env, preventing accidental disclosure or misconfiguration.
  • Deterministic restart behavior after changes: Hard-restarts the correct scope (all agents for org-level changes, only one agent for agent-level changes) so updated secrets actually take effect.
  • Secret visibility without exposure: Checks which keys are configured while never printing secret values.

Quick Start

Ask env-management to diagnose why a specific key (for example, OPENAI_API_KEY or BOT_TOKEN) appears missing for a given org or agent, then rotate it and hard-restart the affected scope.

Frequently Asked Questions about env-management

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

FAQPage Schema
Why does my agent fail to access services even after setting the required environment variables?

Environment variables may be missing, stale, or mis-scoped, preventing cortextOS agents from loading required service credentials into the active PTY session. This Skill diagnoses the specific key, resolves the scoping issue, and hard-restarts the agent to rebuild the effective environment.

How do I rotate compromised API keys and restart agents without causing downtime?

To rotate API keys safely, update the compromised secret value in the correct .env file, then hard-restart the affected scope. Org-level changes require restarting all agents, while agent-specific changes only require restarting that single agent to apply the new credentials.

Where should shared org credentials vs per-agent secrets be stored?

Shared org credentials must live in the org-level .env file, while per-agent secrets belong in agents/{agent}/.env. Correct secret scoping prevents accidental disclosure and ensures each agent loads only its authorized environment variables.

Can I check which environment variables are configured without exposing the actual secret values?

Yes, this Skill verifies which environment variables and secret keys are configured for a given org or agent while strictly avoiding printing the actual secret values. This allows safe credential auditing and diagnosing missing keys without risking exposure.

What's the best way to fix a missing OPENAI_API_KEY or BOT_TOKEN error for a specific agent?

Diagnose why the specific key appears missing for the given org or agent, add or update it in the correct scoped .env file, then hard-restart the affected agent. This ensures the PTY session rebuilds the effective environment and loads the new credentials.

Do I need to hard-restart agents after updating environment variables for changes to take effect?

Yes, a hard-restart is required after updating environment variables so the PTY session rebuilds the effective environment. Without restarting the correct scope, updated secrets and credentials will not be loaded into the running agent session.