agentsclimarketplace

Python config

Skill Mattakushi432/Claude-Code-Skills-Custom-DevTools-Pack/plugins/devtools-pack/skills/python-config

A curated pack of custom Claude Code skills for developers — installable as a Claude Code plugin marketplace.

Install
npx -y skills add Mattakushi432/Claude-Code-Skills-Custom-DevTools-Pack --skill python-config

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

When to activate: configuration management, pydantic-settings, env files, feature flags, environment-specific settings

SKILL.md

3.0 KB, 659 tokens by cl100k_base, as published. Nobody here has run it

Python Configuration Patterns

Pydantic Settings (12-Factor App)

from pydantic import PostgresDsn, RedisDsn, SecretStr, AnyHttpUrl, field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
from functools import lru_cache

class Settings(BaseSettings):
    model_config = SettingsConfigDict(
        env_file=".env",
        env_file_encoding="utf-8",
        case_sensitive=False,
    )
    
    # Application
    app_name: str = "MyApp"
    environment: str = "development"  # development | staging | production
    debug: bool = False
    
    # Database
    database_url: PostgresDsn
    database_pool_size: int = 10
    database_max_overflow: int = 20
    
    # Cache
    redis_url: RedisDsn = "redis://localhost:6379/0"
    
    # Auth
    secret_key: SecretStr
    access_token_expire_minutes: int = 30
    
    # External services
    sendgrid_api_key: SecretStr | None = None
    stripe_secret_key: SecretStr | None = None
    
    @field_validator("environment")
    @classmethod
    def validate_env(cls, v: str) -> str:
        allowed = {"development", "staging", "production"}
        if v not in allowed:
            raise ValueError(f"environment must be one of {allowed}")
        return v
    
    @property
    def is_production(self) -> bool:
        return self.environment == "production"

@lru_cache
def get_settings() -> Settings:
    return Settings()

# Usage in FastAPI
settings = Annotated[Settings, Depends(get_settings)]

Environment-Specific Settings

# config/base.py
class BaseConfig(BaseSettings):
    debug: bool = False
    log_level: str = "INFO"
    database_url: PostgresDsn
    
# config/development.py
class DevelopmentConfig(BaseConfig):
    debug: bool = True
    log_level: str = "DEBUG"

# config/production.py
class ProductionConfig(BaseConfig):
    debug: bool = False
    # Production enforces certain required fields
    sentry_dsn: AnyHttpUrl

def get_config() -> BaseConfig:
    env = os.getenv("ENVIRONMENT", "development")
    configs = {
        "development": DevelopmentConfig,
        "production": ProductionConfig,
    }
    return configs.get(env, DevelopmentConfig)()

Feature Flags

from pydantic import BaseModel

class FeatureFlags(BaseSettings):
    model_config = SettingsConfigDict(env_prefix="FEATURE_")
    
    new_dashboard: bool = False
    ai_recommendations: bool = False
    beta_api: bool = False

flags = FeatureFlags()

# Usage
if flags.new_dashboard:
    return new_dashboard_response()

# Runtime flags from Redis (for fast toggling without redeploy)
async def is_enabled(feature: str, redis: Redis) -> bool:
    raw = await redis.get(f"feature:{feature}")
    return raw == b"true" if raw else False

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,970. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.