Specx settings

From maksimzayats/specx · View interactive version

Specx settings is an AI agent skill from the GitHub repository maksimzayats/specx. Add runtime configuration to specx Python services with `pydantic-settings`. Use when creating settings classes, environment variables, `.env.example`, injecting settings at delivery, infrastructure, or composition edges, documenting config, mapping configuration into typed core policy collaborators

How to use this skill

Skill file

specx Settings

Use this skill whenever runtime configuration is needed. Read

references/settings.md before adding settings code.

Rules

and includes a concrete Example:.

application-wide.

infrastructure/logging/configurator.py and its LoggingConfigurator.

classes. Do not inject BaseRuntimeSettings subclasses into core use cases,

services, capabilities, entities, repositories, or gateway ports.

composition root into a typed core value or capability that has no dependency

on Pydantic or BaseRuntimeSettings.

settings instance explicitly only for an intentional override.

SettingsClass.from_environment(). Build explicit test or composition

overrides with SettingsClass.model_validate({...}) so strict type checking

does not mistake raw input strings for already-validated field types.

them only at the adapter call that needs the raw value.

tmp_path, then override environment values with monkeypatch.

specx.infrastructure.foundation.settings.BaseRuntimeSettings.

Code Style

Use blank lines as logical separators in all code. Keep related statements

together, but separate independent setup, action, assertion, response, branch,

and transformation groups so long blocks stay readable.

References

overrides.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.