specx-add-core-service

Automate adding core services with naming, dependency injection, and pytest guidance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the challenge of implementing focused, reusable core services within Specx architecture, providing a structured approach to encapsulate business logic and enhance maintainability.

Core Features & Use Cases

  • Core Service Creation: Facilitates the creation of core services for business logic, ensuring clear boundaries and maintainable code.
  • Service Naming Conventions: Offers guidelines on naming services, such as using 'Service' suffix and choosing appropriate base classes.
  • Dependency Injection: Instructs on injecting dependencies and ports for external IO, framework-bound dependencies, or multiple real implementations.
  • Unit Testing: Provides guidance on writing unit tests with pytest, using container fixtures and resolving services programmatically.

Quick Start

To add a core service for order pricing, use the specx-add-core-service skill with the following command: "Add a core service for order pricing, named 'OrderPricingService', under the 'orders' scope."

Frequently Asked Questions about specx-add-core-service

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

FAQPage Schema
How do I add a focused core service in Specx for encapsulating business logic?

You create a focused core service in Specx by following naming conventions like using the 'Service' suffix and selecting an appropriate base class. This encapsulates business logic with clear boundaries to enhance maintainability.

How do I handle dependency injection for external IO in Specx core services?

You handle dependency injection in Specx by injecting dependencies and ports for external IO, framework-bound dependencies, or multiple real implementations. This approach maintains clear service boundaries and decoupled logic.

How do I write unit tests for Specx core services using pytest?

You write unit tests for Specx core services using pytest by leveraging container fixtures and resolving services programmatically. This allows you to isolate business logic and verify behavior without external dependencies.

Do I need Python programming knowledge to create Specx core services?

Yes, you need Python programming knowledge to create Specx core services. The framework requires Python expertise to implement service naming conventions, dependency injection, and unit testing guidelines effectively.

What is the best way to name core services within the Specx architecture?

The best way to name core services in Specx is by using the 'Service' suffix and choosing appropriate base classes. This standardizes your architecture and clearly communicates the service's role within its specific scope.