Specx Add Core Use Case logo

Specx Add Core Use Case

Community
maksimzayats
specx-add-core-use-case

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.

Overview

Publishermaksimzayats
Repositoryspecx
Skill namespecx-add-core-use-case
Stars
201
Forks
34
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by maksimzayats on GitHub. Read the source before you install it.

Installation

Install the Specx Add Core Use Case AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/maksimzayats/specx/tree/main/.agents/skills/specx-add-core-use-case
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maksimzayats/specx.git /tmp/specx
mkdir -p .claude/skills
cp -r /tmp/specx/.agents/skills/specx-add-core-use-case .claude/skills/specx-add-core-use-case
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Specx Add Core Use Case in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Specx Add Core Use Case on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Specx Add Core Use Case is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Specx Add Core Use Case AI skill do?

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.

Why use Specx Add Core Use Case on TypingMind?

Because you install it once and use it with any model. Specx Add Core Use Case is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

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

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/maksimzayats/specx/tree/main/.agents/skills/specx-add-core-use-case. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Specx Add Core Use Case?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Specx Add Core Use Case?

As many as you like. As long as a model supports skills, you can use Specx Add Core Use Case with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Specx Add Core Use Case AI skill free?

Yes. It is published on GitHub by maksimzayats under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇