Agent skill

Specx Add Core Use Case

by maksimzayats in maksimzayats/specx

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

MITAuto-check passedDevelopment

Install Specx Add Core Use Case

skills CLI
$ npx skills add maksimzayats/specx --skill specx-add-core-use-case -a claude-code

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

GitHub CLI
$ gh skill install maksimzayats/specx specx-add-core-use-case --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-add-core-use-case .claude/skills/specx-add-core-use-case && 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-add-core-use-case
GitHub stars
202
Token cost
~1.1k tokens
SKILL.md length
491 words
Files
3 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 11 steps: Name the action directly, for example… → Put it under core//use_cases/.py. → Inherit BaseUseCase from… → …
  • Implementing an externally meaningful application action under a core scope usecases package
  • SKILL.md covers Workflow, Transaction Rule, Code Style and References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Specx Add Core Use Case is an agent skill from maksimzayats/specx. Add or refactor a specx core scope use case. Use when implementing an externally meaningful application action under a core scope usecases 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.

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/use-case.md`).

It sits in Development. 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

  • Implementing an externally meaningful application action under a core scope usecases package
  • Adding same-file command/query inputs
  • Coordinating services
  • Opening a unit-of-work transaction

Example prompts

  • “/specx-add-core-use-case”

Workflow steps

11 steps, taken from the first numbered list in SKILL.md.

  1. Name the action directly, for example CreateInvoiceUseCase.
  2. Put it under core//use_cases/.py.
  3. Inherit BaseUseCase from specx.core.foundation.use_case.
  4. Define exactly one same-file input class: a Command for state-changing
  5. Make commands inherit specx.core.foundation.command.BaseCommand, queries inherit
  6. Treat commands and queries as input contracts, not DTOs. Do not make
  7. execute(...) accepts exactly one keyword-only argument named command or
  8. Inject services, capabilities, gateways, and UoW managers with
  9. Keep framework schemas, routers, ORM models, Redis clients, HTTP clients,
  10. Mark secret-bearing dataclass fields with field(repr=False) and never log
  11. Add or update flat unit tests for the behavior. The test receives the

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 Add Core Use Case loads about 1.1k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 93 tokens; SKILL.md has 491 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
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
~4.6k

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). 491 words, ~1,052 tokens.

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

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).

CheckReadinessUseCase may live under core/health when readiness checks any required external dependency or multiple delivery layers reuse the policy. Add a core CheckLivenessUseCase only when framework-independent liveness policy is genuinely reused across deliveries; keep a simple process-only liveness response in delivery. HTTP paths, status codes, headers, and schemas always stay in delivery.

Show full SKILL.md (138 more words)Show less

Transaction Rule

A use case may open one unit-of-work scope inside execute(...) when database work is part of the action. Inject the manager, not Provider[UnitOfWork] and not an active UoW instance, repository, SQLAlchemy session/engine/session factory, or concrete infrastructure adapter. Read/effect services may receive the active unit_of_work, but services do not open transactions. Repository calls from a use case stay rooted in the manager-owned unit_of_work variable.

Commands are allowed to change state. Queries are read-only and should not call repository mutators such as add, save, create, update, or delete, or invoke gateways with external write effects.

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/use-case.md - use-case class shape, DTO examples, UoW examples, and test guidance.

© 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-add-core-use-case of maksimzayats/specx.

  • SKILL.md
  • agents/openai.yaml
  • references/use-case.md

Open the folder on GitHubat commit 9362406

Compare with similar skills

Specx Add Core Use Case 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 Add Core Use Case compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Specx Add Core Use Case this skillmaksimzayats/specx202—~1.1kAutomated safety check: PassMIT
Add Redis Command to go-redisredis/go-redis22k—~1.4kAutomated safety check: PassBSD-2-Clause
Citus Merge Loopcitusdata/citus13k—~2.5kAutomated safety check: PassAGPL-3.0
YugabyteDB ASH Instrumentationyugabyte/yugabyte-db11k—~4.5kAutomated safety check: PassCustom licence
SeekDB Code Reviewoceanbase/seekdb3.1k—~2.1kAutomated safety check: PassApache-2.0
Add Garnet RESP Commandmicrosoft/garnet12k—~9.7kAutomated safety check: PassMIT

Similar skills

  • Official

    Walks through adding a new Redis or Redis module command to the go-redis client, from fetching the spec and docs to the type, interface wiring, parsing and tests.

    22k GitHub stars~1.4k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Citus Merge Loop

    citusdata/citus

    Take a list of citusdata/citus PR links or numbers and merge each one independently: sync it with its base branch, fix a red check-style job with make reindent, retry other red checks a bounded…

    13k GitHub stars~2.5k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • YugabyteDB ASH Instrumentation

    yugabyte/yugabyte-db

    Procedure for adding or changing YugabyteDB Active Session History wait states in TServer and DocDB C++ code, including the macro to use for sync and async paths.

    11k GitHub stars~4.5k tokensUpdated today
    DevelopmentAuto-check passed
  • SeekDB Code Review

    oceanbase/seekdb

    Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.

    3.1k GitHub stars~2.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Add Garnet RESP Command

    microsoft/garnet

    Official

    Step-by-step guide for adding a new built-in RESP command to Garnet, from the command enum and parser to storage callbacks, command metadata JSON and tests.

    12k GitHub stars~9.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Connection Import Wasm

    feigeCode/navop

    A skill your agent uses when implementing, debugging, packaging, or host-enabling onetcli WASM connection importers such as DBeaver, Navicat, Navicat Lite, Termius, connection-import.wit components…

    1.8k GitHub stars~2.7k tokensUpdated today
    DevelopmentAuto-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
  • 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 Diwire Composition

    maksimzayats/specx

    Wire dependency injection for a specx Python service with diwire.

    202 GitHub stars~1.1k 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

Questions about Specx Add Core Use Case

What does Specx Add Core Use Case do?

Add or refactor a specx core scope use case. An agent skill from maksimzayats/specx. Specx Add Core Use Case is an agent skill from maksimzayats/specx. Add or refactor a specx core scope use case.

When should I use Specx Add Core Use Case?

Specx Add Core Use Case fits situations like: implementing an externally meaningful application action under a core scope usecases package; adding same-file command/query inputs; coordinating services; opening a unit-of-work transaction.

How do I install Specx Add Core Use Case in Claude Code?

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

How do I install Specx Add Core Use Case in Codex?

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

Can I use Specx Add Core Use Case 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-add-core-use-case -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-add-core-use-case, .gemini/skills/specx-add-core-use-case, .github/skills/specx-add-core-use-case and .opencode/skills/specx-add-core-use-case in your project.

What does Specx Add Core Use Case need to run?

SKILL.md names no scripts, command-line tools or credentials: Specx Add Core Use Case is instructions for the agent only.

Does Specx Add Core Use Case 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 Add Core Use Case 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 Add Core Use Case use?

Specx Add Core Use Case 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 Add Core Use Case use?

About 1.1k tokens (SKILL.md is roughly 4.2k 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 3.5k tokens, read only when the agent opens those files.

What are the alternatives to Specx Add Core Use Case?

Skills that share tags, products or a category with Specx Add Core Use Case: Add Redis Command to go-redis (redis/go-redis, 22k stars), Citus Merge Loop (citusdata/citus, 13k stars), YugabyteDB ASH Instrumentation (yugabyte/yugabyte-db, 11k stars) and SeekDB Code Review (oceanbase/seekdb, 3.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Specx Add Core Use Case?

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.