specx-component-architecture

specx-component-architecture is a skill for Codex from maksimzayats/specx. It costs 74 tokens per session (1,529 once invoked), scanned A, original, MIT.

An architecture guide for organizing a specx Python service into clear areas, such as core business behavior, web delivery, external-system adapters, shared code, and dependency setup. It explains which kinds of code belong in each area and which areas may depend on one another.

In plain words
What is it for?
Use it when planning or reviewing service boundaries, moving code between layers, splitting application actions, or adding shared bases, use cases, services, data objects, repositories, and gateways.
Why use it?
It helps prevent business logic from becoming tangled with web frameworks, databases, or other external systems. This makes larger changes easier to place and review.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

Good fit Use it when planning or reviewing service boundaries, moving code between layers, splitting application actions, or adding shared bases, use cases, services, data objects, repositories, and gateways.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maksimzayats/specx/specx-component-architecture
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maksimzayats/specx --skill specx-component-architecture
Clone the repo
git clone --depth 1 https://github.com/maksimzayats/specx

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for specx-component-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/maksimzayats/specx/specx-component-architecture/github.svg)](https://agentmods.dev/skills/maksimzayats/specx/specx-component-architecture)
Your own site
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-component-architecture"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-component-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for specx-component-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-component-architecture"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-component-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.01529
Opus 5 $0.00037 $0.00764
Sonnet 5 $0.00015 $0.00306
Haiku 4.5 $0.00007 $0.00153

Measured 10d ago against content hash ead89194869f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

specx-component-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/specx-component-architecture/SKILL.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

specx Scope Architecture

Use this skill before broad structural changes or when a feature crosses more than one layer. Read references/boundaries.md for the full rules.

Boundary Model

  • core/<scope>/: application behavior and contracts. Inner packages are capabilities/, dtos/, entities, exceptions/, gateways/, repositories/, services/, and use_cases/.
  • core/<scope>/infrastructure/: scope-owned external IO adapters such as SQLAlchemy repositories, Redis stores, HTTP clients, file storage, and queues. Inner core packages must not import it.
  • Scoped specx foundation packages: packaged base classes under specx.core.foundation, specx.delivery.foundation, and specx.infrastructure.foundation. Every non-foundation source class must inherit an explicit packaged base directly or through a project-local base; local bases explicitly inherit the packaged or framework base they extend.
  • foundation/: optional project-local extension point for base definitions only: real project-local base categories or stateful framework bases that must not be shared globally, such as a SQLAlchemy declarative base.
  • delivery/: runnable framework apps, controllers, schemas, auth dependencies, request parsing, response serialization, HTTP error translation, app lifecycle managers, and delivery-only services.
  • infrastructure/: app-wide technical resources such as SQLAlchemy session factories, logging, telemetry, and external client factories.
  • Runtime logging lives in top-level infrastructure/logging. Configure it once with a BaseConfigurator; do not inject logging.Logger.
  • shared/: tiny stable cross-scope primitives. It is not a dumping ground.
  • ioc/: diwire container creation and explicit bindings.

Decision Rules

  • Use a use case for an externally meaningful action.
  • Use a service for focused reusable business/application behavior.
  • Use a capability for one small replaceable injectable ability that is narrower than a service.
  • Name every service class with a Service suffix.
  • Name direct concrete BaseCapability subclasses with a Capability suffix.
  • Do not call small collaborators services by default.
  • Core services inherit BasePureService, BaseReadService, or BaseEffectService; do not add or use a generic BaseService.
  • Do not add base_ prefixes to project-local foundation module filenames. Class names stay prefixed, for example clock.py defines BaseClock.
  • Use gateway ports under core/<scope>/gateways/ for outbound business capabilities such as OpenAI summaries, payments, email, queues, and external APIs. Gateway ports inherit BaseGateway, declare external effects, and do not return entities.
  • Put concrete gateway implementations under core/<scope>/infrastructure/<technology>/.
  • Use packaged scoped specx foundation bases before adding project-local bases.
  • Do not create an empty local foundation/ package.
  • Add a project-local foundation base only when a real project-local base category exists or a stateful framework base must own project-local state, such as SQLAlchemy MetaData.
  • Use a port or ABC only for a real external boundary or multiple implementations.
  • Use one delivery controller per scoped set of use cases.
  • Use core/health when readiness checks any required external dependency or probe policy is reusable across delivery layers. Keep a simple framework-specific liveness probe in delivery, and do not invent core probe services and use cases solely to satisfy the layer diagram.
  • When core/health is justified, keep framework route/status/header mapping in delivery and technical checks behind gateway adapters.
  • Keep request/response schemas in top-level delivery/. Keep use-case DTOs in core/<scope>/dtos/.
  • Prefer @dataclass(frozen=True, kw_only=True, slots=True) for commands, queries, DTOs, entities, and other core data classes unless the user asks for another model type. Keep Pydantic at delivery schemas and settings edges.
  • Use BaseStrEnum for limited known application value sets instead of plain str or Literal[...].
  • When creating or reshaping a repo, keep root AGENTS.md architecture guidance aligned with these boundaries.
  • Define each use-case input as a same-file Command or Query: commands are state-changing, queries are read-only, and even empty inputs are explicit.
  • Keep commands and queries independent from DTOs. They inherit BaseCommand or BaseQuery, not BaseDTO, and live beside the use case that consumes them.
  • Use cases return DTOs, not entities.
  • Persistence use cases inject UnitOfWorkManager for transactional work and open the active UoW inside execute(...). They do not inject repositories, SQLAlchemy sessions/engines/session factories, or concrete infrastructure adapters directly.
  • Services may receive an active UoW from a use case, but services must not open UoW scopes or own commit/rollback.
  • Give every project source class a docstring that explains scope and includes a concrete Example:; the packaged rule checks abstract ports, local bases, enums, and errors as well as concrete behavior classes.
  • Keep controller-only helpers such as auth and rate limiting in delivery/.
  • Keep FastAPI lifespan ownership in delivery/fastapi/lifecycle.py. The lifecycle releases app-owned resources and closes the DI container on shutdown.
  • Keep SQL and external API calls in scope infrastructure adapters.
  • Classes that actually emit logs create a private stdlib logger in __post_init__ using the full module plus class name. Do not add logger fields to DTOs, entities, commands, queries, or classes with no log records.
  • Logs should describe important application events and failures without secrets, credentials, request bodies, full external URLs, or infrastructure topology.
  • Do not create bare classes without explicit bases.
  • Packaged framework-neutral guardrails run by default when select is omitted. New generated projects use select = ["ALL"], which enables every rule whose required project surface exists. Projects with a narrower base selection enable technology families explicitly, for example extend-select = ["fastapi"]. Do not copy FastAPI paths or guidance into a project that uses another delivery technology.

Read the full file on GitHub · 123 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 123 lines · 74 tokens per session scan A ead89194869f

Subscribe to this mod's changes

specx-component-architecture is a skill published in the GitHub repository maksimzayats/specx (201 stars, last pushed 1mo ago), licensed MIT. It adds 74 tokens to every session and 1,529 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.