with one click
backend-module-structure
// Rules for the SkillHub backend Maven multi-module clean architecture. Ensures agents place new code in the correct module and respect dependency direction.
// Rules for the SkillHub backend Maven multi-module clean architecture. Ensures agents place new code in the correct module and respect dependency direction.
API design conventions, namespace coordinate system, RBAC roles, ClawHub compatibility layer, OpenAPI contract sync rules, and CSRF/session handling.
Code style, logging, and testing conventions for SkillHub backend (Java) and frontend (TypeScript). Use when writing or reviewing code.
The complete development workflow for SkillHub contributors including local dev, staging validation, testing, and PR creation. Ensures agents follow the correct sequence of steps.
Coding conventions, architecture patterns, and testing rules for the SkillHub React frontend. Ensures agents follow Feature-Sliced Design and use the generated OpenAPI types.
PR title format, commit conventions, and pre-PR checklist for SkillHub. Use when preparing or reviewing pull requests.
The authoritative skill lifecycle state model including container states, version states, review workflow states, visibility overlay, and governance actions. Ensures agents don't introduce invalid states or transitions.
| name | backend-module-structure |
| description | Rules for the SkillHub backend Maven multi-module clean architecture. Ensures agents place new code in the correct module and respect dependency direction. |
| license | Apache-2.0 |
Use this skill when:
The design-doc dependency direction:
app → domain, auth, search, storage, infra, notification
infra → domain # implements domain repository interfaces
auth → domain
search → domain
notification → domain
storage → (independent) # pure SPI
Design intent: skillhub-domain should be the innermost layer, defining entities,
repository interfaces, and domain services without depending on infra, auth, search, or storage.
Code reality: skillhub-domain declares a Maven dependency on skillhub-storage (via
pom.xml), and several domain services (SkillHardDeleteService, SkillDownloadService,
SkillPublishService, SkillGovernanceService, SkillQueryService,
SkillStorageDeletionCompensationService) import com.iflytek.skillhub.storage.ObjectStorageService.
This is an existing deviation from the ideal clean architecture. New code should avoid adding
further cross-module dependencies from domain.
| Code Type | Module | Java Package |
|---|---|---|
| Entity / Value Object | skillhub-domain | com.iflytek.skillhub.domain.{submodule}/ |
| Repository Interface | skillhub-domain | com.iflytek.skillhub.domain.{submodule}/ |
| Domain Service | skillhub-domain | com.iflytek.skillhub.domain.{submodule}/service/ |
| Domain Event | skillhub-domain | com.iflytek.skillhub.domain/event/ |
| Domain Exception | skillhub-domain | com.iflytek.skillhub.domain/shared/exception/ |
| JPA Repository Impl | skillhub-infra | com.iflytek.skillhub.infra.repository/ |
| Controller | skillhub-app | com.iflytek.skillhub.controller/ |
| App Service | skillhub-app | com.iflytek.skillhub.service/ |
| Query Repository | skillhub-app | com.iflytek.skillhub.repository/ |
| DTO / Response | skillhub-app | com.iflytek.skillhub.dto/ |
| OAuth2 / Auth Config | skillhub-auth | com.iflytek.skillhub.auth/ |
| Search SPI / Impl | skillhub-search | com.iflytek.skillhub.search/ |
| Storage SPI / Impl | skillhub-storage | com.iflytek.skillhub.storage/ |
| Notification Service | skillhub-notification | com.iflytek.skillhub.notification/ |
The parent POM (server/pom.xml) defines 7 modules with spring-boot-starter-parent:3.2.3:
skillhub-app | skillhub-domain | skillhub-auth | skillhub-search
skillhub-storage | skillhub-infra | skillhub-notification
skillhub-domain): Aggregate reads, state transitions, rule evaluation.
Returns domain objects. Defined as interfaces, implemented in skillhub-infra via Spring Data JPA.com.iflytek.skillhub.repository): Read-model assembly, joins multiple
sources, presentation projection. Returns DTOs. Implemented directly in skillhub-app.Current query repositories:
GovernanceQueryRepository / JpaGovernanceQueryRepositoryMySkillQueryRepository / JpaMySkillQueryRepositoryProfileReviewQueryRepository / JpaProfileReviewQueryRepositoryAdminSkillReportQueryRepository / JpaAdminSkillReportQueryRepositoryWhen a new read use case arrives:
Never run ./mvnw -pl skillhub-app clean test directly under server/. Use:
make test-backend-app # skillhub-app + dependencies (includes -am)
make test-backend # all backend modules
Running clean test on skillhub-app alone can fall back to stale artifacts from the local Maven
repository, surfacing misleading cannot find symbol and signature-mismatch errors.
User identity is always String throughout the codebase. This covers:
The UserAccount entity uses @Column(length = 128) for its ID. The platform needs to support
external SSO/OIDC/SCIM identity sources whose UIDs are typically stable strings.