specx-add-infrastructure-adapter

specx-add-infrastructure-adapter is a skill for Codex from maksimzayats/specx. It costs 76 tokens per session (840 once invoked), scanned A, original, MIT.

A guide for adding infrastructure adapters to a specx service. These are the concrete parts that communicate with external systems such as databases, Redis, HTTP services, files, queues, payment systems, email, or OpenAI.

In plain words
What is it for?
Use it to implement repositories, network clients, Redis or file stores, queue integrations, unit-of-work implementations, external API gateways, and their dependency-injection wiring.
Why use it?
It keeps external-system details out of core business code and gives those systems clear interfaces. This makes integrations easier to replace, test, and maintain.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents); $skill-name invocation.

Good fit Use it to implement repositories, network clients, Redis or file stores, queue integrations, unit-of-work implementations, external API gateways, and their dependency-injection wiring.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maksimzayats/specx/specx-add-infrastructure-adapter
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-add-infrastructure-adapter
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-add-infrastructure-adapter

README.md
[![agentmods](https://agentmods.dev/badge/skills/maksimzayats/specx/specx-add-infrastructure-adapter/github.svg)](https://agentmods.dev/skills/maksimzayats/specx/specx-add-infrastructure-adapter)
Your own site
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-add-infrastructure-adapter"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-add-infrastructure-adapter/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-add-infrastructure-adapter

Your own site · 80×15
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-add-infrastructure-adapter"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-add-infrastructure-adapter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 840 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.00076 $0.00840
Opus 5 $0.00038 $0.00420
Sonnet 5 $0.00015 $0.00168
Haiku 4.5 $0.00008 $0.00084

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

Security

Grade A, and why

specx-add-infrastructure-adapter 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 12d 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-add-infrastructure-adapter/SKILL.md · 73 lines

How it starts

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

specx Add Infrastructure Adapter

Use this skill whenever code talks to external systems. Read references/adapter.md before writing adapters.

Workflow

  1. Define or reuse a repository under repositories/ for owned persistence. Repository ports inherit BaseRepository and mark required methods with @abstractmethod.
  2. Define or reuse a gateway under gateways/ for outbound business capabilities to external systems such as OpenAI, payments, email, queues, or external HTTP APIs. Gateway ports inherit BaseGateway, mark required methods with @abstractmethod, declare external effects, and do not return entities.
  3. Put concrete implementations under core/<scope>/infrastructure/<technology>/.
  4. Inject external clients, session factories, Redis clients, SDK clients, or project-owned client factories. Do not hide client construction inside business methods. Generated HTTP adapters use httpx2, imported from the httpx2 namespace; do not generate new legacy httpx imports.
  5. A bounded short-lived client factory may stay beside its scope adapter. Put every app-owned pooled client factory or wrapper under top-level infrastructure/<technology>/, even with only one current consumer.
  6. Give long-lived app-owned infrastructure resources an explicit async close() method; FastAPI lifecycle owns calling it on shutdown.
  7. Keep technical query/request code in infrastructure.
  8. Repositories may return entities. Gateways must not return entities; return DTOs, primitives, enums, or explicit result objects. Do not return ORM models or SDK response objects to core.
  9. Translate low-level exceptions into core exceptions only when callers need to handle them. Catch narrow driver or SDK exceptions, preserve the cause, and never expose raw provider messages, SQL, parameters, bodies, or URLs.
  10. For transactional persistence, implement an active UnitOfWork and a UnitOfWorkManager; register the manager, not repositories, active UoWs, or UoW providers for use-case injection.
  11. Register adapter bindings in private _register_dependencies(...) inside ioc/container.py. Register every technical resource once at its owner boundary and close that same app-scoped instance from lifecycle.
  12. Add focused integration tests only when the adapter has meaningful project-owned behavior to protect; do not add generic CRUD or upstream library tests just because an adapter file exists.
  13. For SQLAlchemy adapters, add or update Alembic migrations with $specx-sqlalchemy-migrations.

Read the full file on GitHub · 73 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. 12d ago First seen · 73 lines · 76 tokens per session scan A d9146b3fb159

Subscribe to this mod's changes

specx-add-infrastructure-adapter is a skill published in the GitHub repository maksimzayats/specx (201 stars, last pushed 1mo ago), licensed MIT. It adds 76 tokens to every session and 840 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.

Related

Other skills, from other repositories

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog-foss · 148 tokens

spring-boot-cache

Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring…

giuseppe-trisciuoglio/developer-kit · 79 tokens

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog · 148 tokens

spring-data-redis

Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.

rrezartprebreza/spring-boot-skills · 37 tokens

background-job-orchestrator

Expert in background job processing with Bull/BullMQ (Redis), Celery, and cloud queues. Implements retries, scheduling, priority queues, and worker management. Use for async task processing, email campaigns, report generation, batch operations. Activate on "background job", "async task", "queue", "worker", "BullMQ"…

curiositech/some_claude_skills · 95 tokens

nw-sd-patterns

Core distributed systems patterns - load balancing, caching, sharding, consistent hashing, message queues, rate limiting, CDN, Bloom filters, ID generation, replication, conflict resolution, CAP theorem.

nWave-ai/nWave · 43 tokens