roninforge/roninforge-fastapi/fastapi-settings
Claude Code and agent skill by roninforge/roninforge-fastapi
- community
Checking that the SKILL.md file is still in the repository.
Set up pydantic-settings configuration for a FastAPI project with environment variables, .env file support, and dependency injection.
Install
npx vskill@latest install roninforge/roninforge-fastapi/fastapi-settingsSKILL.md
The same SKILL.md was published earlier as roninforge/roninforge-fastapi/fastapi-settings.
Set Up FastAPI Settings
When to Use
Use this skill when a FastAPI project has hardcoded configuration or needs environment-based settings.
Instructions
- Check if
pydantic-settingsis installed. If not, suggest adding it.
- Generate the Settings class:
```python from pydantic_settings import BaseSettings, SettingsConfigDict from functools import lru_cache
class Settings(BaseSettings): # App app_name: str = "My API" debug: bool = False
# Database database_url: str
# Auth secret_key: str access_token_expire_minutes: int = 30
# External services redis_url: str = "redis://localhost:6379"
model_config = SettingsConfigDict( env_file=".env", env_file_encoding="utf-8", case_sensitive=False, )
@lru_cache def get_settings() -> Settings: return Settings() ```
- Generate
.env.examplewith all required variables.
- Set up dependency injection:
```python from typing import Annotated from fastapi import Depends
SettingsDep = Annotated[Settings, Depends(get_settings)] ```
- Show how to override in tests:
```python def get_settings_override(): return Settings(database_url="sqlite+aiosqlite:///:memory:")
app.dependency_overrides[get_settings] = get_settings_override ```
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/fastapi-settings/SKILL.md
Popularity
- 7-day trend score
- 5
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/roninforge/roninforge-fastapi/fastapi-settings)