roninforge/roninforge-fastapi/fastapi-settings

Claude Code and agent skill by roninforge/roninforge-fastapi

Trust tier 3
  • community
Source check pending

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-settings

SKILL.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

  1. Check if pydantic-settings is installed. If not, suggest adding it.
  1. 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() ```

  1. Generate .env.example with all required variables.
  1. Set up dependency injection:

```python from typing import Annotated from fastapi import Depends

SettingsDep = Annotated[Settings, Depends(get_settings)] ```

  1. 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/roninforge/roninforge-fastapi/fastapi-settings/badge)](https://verified-skill.com/skills/roninforge/roninforge-fastapi/fastapi-settings)

Something wrong with this skill or its page? Tell us.