Agent skill

Specx Diwire Composition

by maksimzayats in maksimzayats/specx

Wire dependency injection for a specx Python service with diwire.

MITAuto-check passedBackend & APIs

Install Specx Diwire Composition

skills CLI
$ npx skills add maksimzayats/specx --skill specx-diwire-composition -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maksimzayats/specx specx-diwire-composition --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maksimzayats/specx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/specx-diwire-composition .claude/skills/specx-diwire-composition && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
specx-diwire-composition
GitHub stars
202
Token cost
~1.1k tokens
SKILL.md length
476 words
Files
3 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Wire dependency injection for a specx Python service with diwire.

  • Adding ioc/container.py
  • SKILL.md covers Rules, Code Style and References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Explicit dependency registrations for capabilities

What it does

Specx Diwire Composition is an agent skill from maksimzayats/specx. 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.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/diwire.md`).

It sits in Backend & APIs, covering Design patterns and Backend development. It works with Python and FastAPI. The repository describes itself as: ⚙️ Executable architecture guardrails and agent skills for building structured Python services! The licence is MIT.

When your agent uses it

  • Adding ioc/container.py
  • Explicit dependency registrations for capabilities
  • Injected[...] constructor fields
  • FastAPI app factory/lifecycle composition

Example prompts

  • “/specx-diwire-composition”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9362406. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Specx Diwire Composition loads about 1.1k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 103 tokens; SKILL.md has 476 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maksimzayats/specx at commit 9362406, republished under its MIT licence (© maksimzayats). 476 words, ~1,136 tokens.

Download SKILL.mdSave it as .claude/skills/specx-diwire-composition/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
specx-diwire-composition
description
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.

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 implementations, factories, and instances that auto-wiring cannot infer. Keep registration in private _register_dependencies(...) inside ioc/container.py.
  • Register the container instance itself with provides=Container only for the FastAPI lifecycle shutdown dependency.
  • Register concrete gateway implementations for their core BaseGateway ports.
  • Register health readiness gateway implementations, such as SQLAlchemyReadinessCheckGateway, for ReadinessCheckGateway when /readyz needs infrastructure checks.
  • Register unit-of-work managers for UoW abstractions. Persistence use cases inject the manager and open the active UoW inside execute(...); they do not inject repositories, active UoWs, providers, SQLAlchemy sessions, engines, session factories, or concrete infrastructure adapters directly.
  • Unit tests receive a fresh native pytest container fixture built by the project's real get_container(). Put project-wide test overrides in that fixture and register scenario-specific overrides directly in the test before resolving the target.
  • Integration tests receive the transactional real-app container fixture. They must use the real internal graph; do not mock internal use cases, services, or capabilities.
  • Use container.resolve(...) for normal synchronous graph construction, even for targets with async methods; use await container.aresolve(...) only when DI construction itself has async providers.
  • One-off class-based test doubles live in the test_*.py module that uses them. Reused unit-test doubles may live in mirrored tests/unit/core/<scope>/{capabilities,gateways,repositories}/fake_<source_module>.py modules.
  • Inline MagicMock or AsyncMock in the test function when only one behavior needs to change.
  • Do not create DI-backed test factories, target harnesses, harness.py, tests/_support/fakes, tests/**/_fakes.py, or fake modules outside those mirrored unit port/capability packages.
  • Keep tests on native pytest fixtures. Do not enable diwire.integrations.pytest_plugin, and do not use Injected[...] parameters in test functions.
  • FastAPI async test helpers must enter LifespanManager and pass the yielded manager's state-aware manager.app to the HTTPX2 ASGITransport.
Show full SKILL.md (43 more words)Show less

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

  • references/diwire.md - container code, registration examples, controller composition, and test override patterns.

© maksimzayats, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/specx-diwire-composition of maksimzayats/specx.

  • SKILL.md
  • agents/openai.yaml
  • references/diwire.md

Open the folder on GitHubat commit 9362406

Compare with similar skills

Specx Diwire Composition next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Specx Diwire Composition compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Specx Diwire Composition this skillmaksimzayats/specx202—~1.1kAutomated safety check: PassMIT
Framework Migration AssistantArabelaTso/Skills-4-SE253—~1.9kAutomated safety check: PassApache-2.0
Mastering Python SkillSpillwaveSolutions/agent-brain119—~1.4kAutomated safety check: NotesMIT
Python Backendyonatangross/orchestkit292—~2.8kAutomated safety check: NotesMIT
Fastapi Backendcohen-liel/hivemind110—~710Automated safety check: PassApache-2.0
Python Fastapi Patternsaiskillstore/marketplace4331 repos~1.3kAutomated safety check: NotesNone

Similar skills

  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Mastering Python Skill

    SpillwaveSolutions/agent-brain

    Modern Python coaching covering language foundations through advanced production patterns.

    119 GitHub stars~1.4k tokensUpdated 21 days ago
    DevelopmentAuto-check: notes
  • Python Backend

    yonatangross/orchestkit

    Production Python async patterns including asyncio TaskGroup, FastAPI dependency injection and middleware, SQLAlchemy 2.0 async sessions, and database connection pool tuning.

    292 GitHub stars~2.8k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Fastapi Backend

    cohen-liel/hivemind

    FastAPI best practices for building production Python backends.

    110 GitHub stars~710 tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • Python Fastapi Patterns

    aiskillstore/marketplace

    FastAPI web framework patterns. An agent skill from aiskillstore/marketplace.

    433 GitHub starsUsed in 1 repo~1.3k tokens
    Backend & APIsAuto-check: notes
  • Fastapi Itechmeat

    Kilo-Org/kilo-marketplace

    FastAPI Python framework. An agent skill from Kilo-Org/kilo-marketplace.

    190 GitHub stars~1.5k tokensUpdated 12 days ago
    Backend & APIsAuto-check passed

More from maksimzayats/specx

All 12 skills in this repo
  • Specx Add Core Service

    maksimzayats/specx

    Add or refactor a specx core scope service. An agent skill from maksimzayats/specx.

    202 GitHub stars~688 tokensUpdated 2 mo ago
    Auto-check passed
  • Specx Add Core Use Case

    maksimzayats/specx

    Add or refactor a specx core scope use case. An agent skill from maksimzayats/specx.

    202 GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Add delivery controllers for specx services, especially FastAPI HTTP routes.

    202 GitHub stars~704 tokensUpdated 2 mo ago
    Auto-check passed
  • Add technical infrastructure adapters for specx core scopes.

    202 GitHub stars~1k tokensUpdated 2 mo ago
    Auto-check passed
  • Design or review specx core scope boundaries in Python services.

    202 GitHub stars~1.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Specx Project Structure

    maksimzayats/specx

    Create or reshape a Python FastAPI service repo into the specx clean core/delivery architecture using packaged scoped foundation bases.

    202 GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Specx Diwire Composition

What does Specx Diwire Composition do?

Wire dependency injection for a specx Python service with diwire. Specx Diwire Composition is an agent skill from maksimzayats/specx. Wire dependency injection for a specx Python service with diwire.

When should I use Specx Diwire Composition?

Specx Diwire Composition fits situations like: adding ioc/container.py; explicit dependency registrations for capabilities; injected[...] constructor fields; fastAPI app factory/lifecycle composition.

How do I install Specx Diwire Composition in Claude Code?

Run `npx skills add maksimzayats/specx --skill specx-diwire-composition -a claude-code`. Or copy the skill folder (skills/specx-diwire-composition in maksimzayats/specx) into .claude/skills/specx-diwire-composition in your project. Claude Code loads it when a task matches its description.

How do I install Specx Diwire Composition in Codex?

Run `npx skills add maksimzayats/specx --skill specx-diwire-composition -a codex`. Or copy the skill folder (skills/specx-diwire-composition in maksimzayats/specx) into .agents/skills/specx-diwire-composition in your project. Codex loads it when a task matches its description.

Can I use Specx Diwire Composition in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maksimzayats/specx --skill specx-diwire-composition -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/specx-diwire-composition, .gemini/skills/specx-diwire-composition, .github/skills/specx-diwire-composition and .opencode/skills/specx-diwire-composition in your project.

What does Specx Diwire Composition need to run?

SKILL.md names no scripts, command-line tools or credentials: Specx Diwire Composition is instructions for the agent only. Our summary lists: Python 3.

Does Specx Diwire Composition access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Specx Diwire Composition safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Specx Diwire Composition use?

Specx Diwire Composition is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Specx Diwire Composition use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.

What are the alternatives to Specx Diwire Composition?

Skills that share tags, products or a category with Specx Diwire Composition: Framework Migration Assistant (ArabelaTso/Skills-4-SE, 253 stars), Mastering Python Skill (SpillwaveSolutions/agent-brain, 119 stars), Python Backend (yonatangross/orchestkit, 292 stars) and Fastapi Backend (cohen-liel/hivemind, 110 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Specx Diwire Composition?

maksimzayats (a GitHub user) maintains it in maksimzayats/specx, which has 202 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on August 8, 2026.

Source: maksimzayats/specx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.