Specx Diwire Composition

Wire dependency injection for a specx Python service with `diwire`. Use when adding `ioc/container.py`, explicit dependency registrations for capabilities, repositories, gateways, UoW managers, clients, settings, or factories, `Injected[...]` constructor fields, FastAPI app factory/lifecycle composition, test overrides, or rules that keep containers out of core use cases and services.

198 stars 33 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add maksimzayats/specx --skill specx-diwire-composition
Manual install
git clone --depth 1 https://github.com/maksimzayats/specx.git /tmp/specx
mkdir -p ~/.claude/skills
cp -r /tmp/specx/.agents/skills/specx-diwire-composition ~/.claude/skills/specx-diwire-composition

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# specx Diwire Composition

Use this skill whenever object graphs, factories, controllers, adapters, or test
overrides need `diwire`. Read `references/diwire.md` before writing DI code.

## Rules

- Application classes receive dependencies through constructor fields typed as
  `Injected[DependencyType]`.
- Keep injection constructor-based. Do not hide dependency resolution in
  application functions with `resolver_context.inject`.
- Capabilities are normal injectable collaborators. Register only capability
  abstractions or existing instances that auto-wiring cannot infer.
- Only `ioc/`, top-level delivery `__main__.py`/factory/lifecycle modules, and
  tests create or use `diwire.Container`.
- Do not inject `Container` except in `FastAPILifecycle`, where it is used only
  to call `container.aclose()` during app shutdown.
- Do not inject `logging.Logger` or register loggers in the container. Runtime
  logging is configured once by a top-level infrastructure configurator; classes
  that log create local stdlib loggers.
- Do not call `container.resolve()` inside core use cases or services.
- Let `diwire` auto-wire concrete project classes.
- Let `diwire` auto-register `BaseRuntimeSettings` subclasses as root-scoped
  singleton factories. Register a settings instance only for an intentional
  test override or an explicitly prebuilt configuration object.
- Register only abstractions, external adapter bindings, gateway
Read the full skill on GitHub

Details

Skill name
specx-diwire-composition
Path
.agents/skills/specx-diwire-composition/SKILL.md
License
MIT
Repo updated
8 August 2026

FAQ

What does the Specx Diwire Composition skill do?

Wire dependency injection for a specx Python service with `diwire`. Use when adding `ioc/container.py`, explicit dependency registrations for capabilities, repositories, gateways, UoW managers, clients, settings, or factories, `Injected[...]` constructor fields, FastAPI app factory/lifecycle composition, test overrides, or rules that keep containers out of core use cases and services.

How do I install the Specx Diwire Composition skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add maksimzayats/specx --skill specx-diwire-composition. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Specx Diwire Composition popular?

It lives in maksimzayats/specx, which has 198 GitHub stars and 33 forks.

Related skills

Specx Add Core Service

198

maksimzayats/specx

Add or refactor a specx core scope service. Use when implementing focused reusable business/application behavior under a core scope services package, extracting logic from a use case, injecting deterministic collaborators, accepting an active unit of work, choosing between Service and Capability, or keeping business decisions away from delivery and infrastructure.

Marketing, Sales & Business33

Specx Add Core Use Case

198

maksimzayats/specx

Add or refactor a specx core scope use case. Use when implementing an externally meaningful application action under a core scope use_cases package, adding same-file command/query inputs, result DTOs, coordinating services, opening a unit-of-work transaction, or moving behavior out of delivery or infrastructure into class-based application code.

Software Development33

Specx Add Delivery Controller

198

maksimzayats/specx

Add delivery controllers for specx services, especially FastAPI HTTP routes. Use when creating top-level `delivery/` request/response schemas, one controller per scoped use-case set, route registration, FastAPI lifecycle managers, HTTP error translation, delivery-only auth/rate-limit/request services, or integration tests that exercise the delivery edge.

Software Development33

Specx Foundation

198

maksimzayats/specx

Use specx foundation bases in Python services, or add a tiny project-local `foundation/` base for missing categories or stateful framework bases.

Software Development33

Specx Component Architecture

198

maksimzayats/specx

Design or review specx core scope boundaries in Python services. Use when deciding where code belongs across packaged scoped foundation bases, optional local foundation extensions, `core/`, capabilities, delivery, infrastructure, `shared/`, and `ioc`; when adding guardrails or splitting use cases, services, DTOs, schemas, ports, and adapters.

Software Development33

Specx Project Structure

198

maksimzayats/specx

Create or reshape a Python FastAPI service repo into the specx clean core/delivery architecture using packaged scoped foundation bases. Use when starting an API backend, adding the first src package, or establishing `AGENTS.md`, `core/`, optional local `foundation/`, `delivery/`, infrastructure, `ioc/`, migrations, and tests.

Software Development33

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.