backend-module-structure

Enforces clean architecture and correct module placement for Java backend code in SkillHub.

4.9k|780|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/iflytek/skillhub --skill backend-module-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-module-structure
Source: https://github.com/iflytek/skillhub/tree/main/.agents/skills/backend-module-structure
Command: npx skills add https://github.com/iflytek/skillhub --skill backend-module-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill ensures that new Java backend code in SkillHub adheres to a clean architecture, preventing cross-module dependencies and improving maintainability.

Core Features & Use Cases

  • Dependency Direction: Defines the correct module placement and dependency flow.
  • Code Placement: Specifies where to place different types of code (entities, repositories, services, etc.).
  • Maven Modules: Describes the structure of Maven modules in the SkillHub backend.
  • Read-Model Assembly: Differentiates between domain repositories and query repositories.
  • Building Tests: Provides instructions for running backend tests.

Quick Start

Use the backend-module-structure skill to enforce the correct module structure for new backend code in SkillHub.

Frequently Asked Questions about backend-module-structure

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

FAQPage Schema
How do I enforce clean architecture and correct module placement in a Java backend?

To enforce clean architecture in a Java backend, define strict module placement rules and dependency directions. This prevents cross-module dependencies by specifying where entities, repositories, and services belong within the project structure, improving overall maintainability.

What is the correct Maven module structure for Java backend development?

The correct Maven module structure organizes Java backend code into distinct modules with enforced dependency flows. It separates domain logic from query repositories, ensuring read-model assembly follows clean architecture principles without unauthorized cross-module dependencies.

How do I differentiate domain repositories and query repositories for read-model assembly?

Differentiating domain and query repositories involves separating write-side domain logic from read-model assembly. Place domain repositories with core entities and query repositories in distinct modules to enforce clean architecture and maintain correct dependency directions.

Where should I place entities, repositories, and services in a clean architecture backend?

Place entities, repositories, and services in specific Maven modules following clean architecture rules. Code placement dictates that domain logic remains isolated, preventing unauthorized cross-module dependencies and ensuring the backend module structure stays maintainable.

How do I run backend tests for Java Maven modules?

Running backend tests for Java Maven modules requires following specific building instructions. Execute the Maven build lifecycle commands configured for the module structure to validate code placement and ensure no cross-module dependencies exist in the backend.

Why does my Java backend have cross-module dependency issues?

Cross-module dependency issues in a Java backend occur when code placement violates clean architecture rules. Correcting the Maven module structure and enforcing proper dependency directions for entities and services resolves these maintainability problems.