hafizfasih/agentic-crisis-orchestrator/pydantic-settings-management
Claude Code and agent skill by hafizfasih/agentic-crisis-orchestrator
- community
Checking that the SKILL.md file is still in the repository.
Guides the professional implementation of application configuration using pydantic-settings and .env files. Use when the user needs to manage environment variables, validate config schemas, or structure settings for agents and web apps (FastAPI, etc.).
Install
npx vskill@latest install hafizfasih/agentic-crisis-orchestrator/pydantic-settings-managementSKILL.md
The same SKILL.md was published earlier as hafizfasih/agentic-crisis-orchestrator/pydantic-settings-management.
Pydantic Settings & Env Management
This skill provides a standardized, type-safe workflow for managing application configuration in 2025.
Workflow Summary
- Isolation: Use
.envfor local secrets; never commit it to git. - Validation: Use
BaseSettingsto enforce types (e.g., ensurePORTis anint). - Singleton Pattern: Instantiate settings once in a
config.pyand import the instance.
Implementation Guide
1. Environment File (.env)
Store your keys in a standard .env format at the project root.
2. Configuration Schema
Define your settings in a dedicated config.py file.
3. Usage in Application
Always import the settings instance, not the class.
Advanced Patterns
For complex integrations (Prefixes, Nested Models, or Secrets Directories), refer to the bundled documentation: references/advanced_config.md
Common Troubleshooting
| Error | Cause | Solution | |
|---|---|---|---|
| ValidationError | Missing or wrong type in .env | Check that PORT is a number and required keys exist. | |
| ModuleNotFoundError | pydantic-settings missing | Run uv add pydantic-settings. | |
| .env not loading | Wrong file path | Set env_file=".env" in SettingsConfigDict. | |
| Third-party SDK can't find env var | pydantic-settings reads .env into object, not os.environ | Export to os.environ in __init__ (see pitfall below) |
Pitfall: Third-Party SDKs That Read os.environ
pydantic-settings reads .env into Settings object properties but does NOT export them to os.environ. SDKs like OpenAI, Stripe, and others that read directly from os.environ will fail with "API key not set" errors even though the key is in .env.
Fix: Bridge the gap in __init__:
The not os.environ.get(...) guard avoids overwriting explicitly set env vars (e.g., from Docker/CI).
Resources
references/advanced_config.md
Documentation for advanced configuration patterns including environment prefixes, nested settings, and secret masking.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/pydantic-settings-management/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hafizfasih/agentic-crisis-orchestrator/pydantic-settings-management)