python-wiring-success

Builds Python config, route, and composition root constructs for program plumbing.

Updated Jul 15, 2026
One-click install
npx skills add https://github.com/kyzobuild/kyzo-python --skill python-wiring-success-kyzobuild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-wiring-success
Source: https://github.com/kyzobuild/kyzo-python/tree/main/cursor/skills/python-wiring-success
Command: npx skills add https://github.com/kyzobuild/kyzo-python --skill python-wiring-success-kyzobuild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydantic, pydantic-settings.

What problem does it solve? Python programs often scatter environment reads, hand-parse transport data in handlers, and bury orchestration logic in runners or pipelines. This Skill enforces a strict wiring layer where config, routes, and the composition root are the only places environment access, transport ingress, and program assembly occur. ## Core Features & Use Cases - Config Construct: Defines a single frozen BaseSettings model with env_prefix, declared scalars, and SecretStr fields, replacing scattered os.environ reads and settings dicts. - Route Construct: Structures transport ingress functions that validate raw data into contract or foreign models, dispatch the innermost value to a verb, and serialize the reply, with no domain logic. - Composition Root: Provides the main() entrypoint pattern (sync and async with signal handling) that constructs config, instantiates clients, binds the consistency model, and registers routes. - Use Case: When writing a new service entrypoint, use this Skill to produce a main.py that reads environment once via BaseSettings, wires clients through bindings, and delegates all request handling to thin route functions. ## Quick Start Ask the assistant to write the config, route, and composition root for a Python service that consumes venue fill messages from a message bus.

Frequently Asked Questions about python-wiring-success

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Python main.py entrypoint without domain logic?▼

Use a composition root pattern: one main() that constructs a frozen BaseSettings config, instantiates concrete clients, passes them to bindings, constructs the consistency model, and registers routes. Long-running programs use the async form with signal handlers, a shutdown event, and client drain.

How should Python services read environment variables with pydantic?▼

Define one frozen BaseSettings model with SettingsConfigDict(frozen=True, extra="forbid") and an env_prefix naming the program's namespace. Every field is a declared scalar or SecretStr, constructed once in the composition root and injected, replacing all direct os.environ reads.

What should a route handler do in a typed Python architecture?▼

A route constructs a contract or foreign model from raw transport data via model_validate_json, dispatches the innermost value to a verb, and serializes the reply with model_dump_json. It never parses fields by hand, computes domain facts, branches on domain cases, or defines types.

Can I use os.environ directly instead of pydantic-settings?▼

No. Direct os.environ reads scatter environment access through the program and hide it behind import order. If pydantic-settings is not installed, that gap must be reported and resolved rather than bypassed with manual environment reads.

Why should secrets use SecretStr instead of plain str in config?▼

SecretStr keeps secrets out of every dump, repr, and log that a bare str would leak into. get_secret_value() is called exactly once, at client instantiation in the composition root, which is a legal client binding site.