specx-add-core-use-case

Create and refactor Specx core use cases with command/query inputs and transactions.

200|35|Updated Jun 17, 2021
One-click install
npx skills add https://github.com/maksimzayats/specx --skill specx-add-core-use-case
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: specx-add-core-use-case
Source: https://github.com/maksimzayats/specx/tree/main/.agents/skills/specx-add-core-use-case
Command: npx skills add https://github.com/maksimzayats/specx --skill specx-add-core-use-case

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of creating and refactoring core use cases within a Specx application, saving developers time and effort.

Core Features & Use Cases

  • Core Use Case Creation: Guide through the process of adding a new class-based application use case under a core scope use_cases package.
  • Command/Query Input Management: Assist in defining and managing command and query inputs for use cases.
  • Transaction Management: Provides rules for transaction ownership and managing database operations within use cases.
  • Test Pattern: Offer best practices for writing unit tests for the new use cases.

Quick Start

Create a new core use case named 'CreateInvoiceUseCase' under 'core/checkout/use_cases' with a command input named 'CreateInvoiceCommand'.

Frequently Asked Questions about specx-add-core-use-case

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new core use case in a Specx project?

To create a Specx core use case, you define a new class-based application use case under a core scope use_cases package, managing command and query inputs while adhering to code style standards. The process automates code generation for maintainability.

What is the best way to manage transactions in Specx use cases?

Transaction management in Specx use cases involves following specific rules for transaction ownership and managing database operations directly within the use case. This ensures database state consistency during command execution.

How do I write unit tests for Specx core use cases?

Writing unit tests for Specx core use cases involves following established test patterns and best practices provided during the creation process. This ensures the new use cases are maintainable and function correctly in isolation.

Does this approach support refactoring existing Specx use cases?

Yes, the approach supports refactoring existing Specx use cases by automating the modification of command and query inputs, transaction management, and unit test patterns. This maintains code adherence to Specx standards during structural changes.

When do I need to define command and query inputs for Specx use cases?

You need to define command and query inputs for Specx use cases whenever you create a new class-based application use case under the core scope. This separation helps manage database operations and transaction ownership effectively.