specx-add-core-use-case

specx-add-core-use-case is a skill for Codex from maksimzayats/specx. It costs 70 tokens per session (930 once invoked), scanned A, original, MIT.

A guide for adding one meaningful application action to a specx Python service. It uses a use case to coordinate business behavior, with a command for changes or a query for read-only work, plus typed input and result data.

In plain words
What is it for?
Use it to add actions such as creating, updating, or reading records, define their inputs and results, coordinate services and external gateways, and run work inside a database transaction when required.
Why use it?
It gives each application action a clear boundary and keeps business work out of web routes and infrastructure adapters. This makes actions easier to test and connect to different delivery methods.

Skill for Codex

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

Good fit Use it to add actions such as creating, updating, or reading records, define their inputs and results, coordinate services and external gateways, and run work inside a database transaction when required.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/maksimzayats/specx/specx-add-core-use-case"><img src="https://agentmods.dev/badge/skills/maksimzayats/specx/specx-add-core-use-case.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 930 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.00070 $0.00930
Opus 5 $0.00035 $0.00465
Sonnet 5 $0.00014 $0.00186
Haiku 4.5 $0.00007 $0.00093

Measured 12d ago against content hash f7d194063610, 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-core-use-case 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-core-use-case/SKILL.md · 79 lines

How it starts

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

specx Add Core Use Case

Use this skill for one application action at a time. Read references/use-case.md before writing the use case.

Workflow

  1. Name the action directly, for example CreateInvoiceUseCase.
  2. Put it under core/<scope>/use_cases/<action>.py.
  3. Inherit BaseUseCase from specx.core.foundation.use_case.
  4. Define exactly one same-file input class: a Command for state-changing use cases or a Query for read-only use cases. Even empty inputs are explicit.
  5. Make commands inherit specx.core.foundation.command.BaseCommand, queries inherit specx.core.foundation.query.BaseQuery, and result DTOs inherit specx.core.foundation.dto.BaseDTO. Prefer @dataclass(frozen=True, kw_only=True, slots=True) for all of these core data classes unless the user asks for another model type.
  6. Treat commands and queries as input contracts, not DTOs. Do not make commands or queries inherit BaseDTO, put them under dtos/, or add a DTO suffix.
  7. execute(...) accepts exactly one keyword-only argument named command or query and returns DTOs, not entities.
  8. Inject services, capabilities, gateways, and UoW managers with Injected[...]. Keep infrastructure/runtime settings out of core use cases; expose required business policy as a typed core value or collaborator. For transactional persistence, inject the scope UnitOfWorkManager and open the active unit of work inside execute(...). Do not inject repositories, SQLAlchemy sessions/engines/session factories, or concrete infrastructure adapters directly into use cases.
  9. Keep framework schemas, routers, ORM models, Redis clients, HTTP clients, and entity return types out of the use case.
  10. Mark secret-bearing dataclass fields with field(repr=False) and never log whole commands, queries, or DTOs that may contain sensitive values.
  11. Add or update flat unit tests for the behavior. The test receives the native pytest container fixture, registers local doubles or inline mocks before resolution, and resolves the use case with container.resolve(UseCaseClass). If the use case injects a UnitOfWorkManager, also add a core integration test under tests/integration/core/... against the real persistence graph (and the transactional database graph when database-backed).

Read the full file on GitHub · 79 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 · 79 lines · 70 tokens per session scan A f7d194063610

Subscribe to this mod's changes

specx-add-core-use-case is a skill published in the GitHub repository maksimzayats/specx (201 stars, last pushed 1mo ago), licensed MIT. It adds 70 tokens to every session and 930 once invoked, about $0.0003 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.