本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Backend Module Structure Skill

Trigger

Use this skill when:

  • Adding or modifying Java backend code
  • Creating new services, controllers, repositories, or entities
  • Refactoring backend code across files
  • Reviewing backend code placement

Rules

Dependency Direction

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.

Where to Place Code

Code TypeModuleJava Package
Entity / Value Objectskillhub-domaincom.iflytek.skillhub.domain.{submodule}/
Repository Interfaceskillhub-domaincom.iflytek.skillhub.domain.{submodule}/
Domain Serviceskillhub-domaincom.iflytek.skillhub.domain.{submodule}/service/
Domain Eventskillhub-domaincom.iflytek.skillhub.domain/event/
Domain Exceptionskillhub-domaincom.iflytek.skillhub.domain/shared/exception/
JPA Repository Implskillhub-infracom.iflytek.skillhub.infra.repository/
Controllerskillhub-appcom.iflytek.skillhub.controller/
App Serviceskillhub-appcom.iflytek.skillhub.service/
Query Repositoryskillhub-appcom.iflytek.skillhub.repository/
DTO / Responseskillhub-appcom.iflytek.skillhub.dto/
OAuth2 / Auth Configskillhub-authcom.iflytek.skillhub.auth/
Search SPI / Implskillhub-searchcom.iflytek.skillhub.search/
Storage SPI / Implskillhub-storagecom.iflytek.skillhub.storage/
Notification Serviceskillhub-notificationcom.iflytek.skillhub.notification/

Maven Modules

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

Repository vs Query Repository

  • Domain Repository (skillhub-domain): Aggregate reads, state transitions, rule evaluation. Returns domain objects. Defined as interfaces, implemented in skillhub-infra via Spring Data JPA.
  • Query Repository (com.iflytek.skillhub.repository): Read-model assembly, joins multiple sources, presentation projection. Returns DTOs. Implemented directly in skillhub-app.

Current query repositories:

  • GovernanceQueryRepository / JpaGovernanceQueryRepository
  • MySkillQueryRepository / JpaMySkillQueryRepository
  • ProfileReviewQueryRepository / JpaProfileReviewQueryRepository
  • AdminSkillReportQueryRepository / JpaAdminSkillReportQueryRepository

When a new read use case arrives:

  1. If it's for state transition or domain rule → domain repository port
  2. If it's for page/list/detail response assembly with joins → app query repository
  3. If it's a thin single-aggregate read → direct domain repository call from app service
  4. If direct SQL/EntityManager is needed → add class-level comment explaining why

Building Backend Tests

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 Type

User identity is always String throughout the codebase. This covers:

  • Authentication, API params, permissions, audit
  • Resource owner, creator, reviewer, actor, submittedBy
  • All user-associated fields

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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Evaluate factual claims in AI-generated text and teach a lightweight verification habit. Use when a learner wants to fact-check an AI answer, identify uncertainty, choose appropriate independent sources, or practise critical AI literacy.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1692026年10月10日 更新

API design conventions, namespace coordinate system, RBAC roles, ClawHub compatibility layer, OpenAPI contract sync rules, and CSRF/session handling.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1692026年10月10日 更新

Code style, logging, and testing conventions for SkillHub backend (Java) and frontend (TypeScript). Use when writing or reviewing code.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1692026年10月10日 更新

Parse and understand an HTTP(S) URL or an authorized local document, audio, or video source through Cue Omni Reader when the Agent has the official Omni MCP tools.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1692026年10月10日 更新

Generate concise daily standups, reflection prompts, and weekly retrospectives for individuals or teams. Use for planning a day, surfacing blockers, reviewing user-provided entries, or drafting a check-in without assuming prior history.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1692026年10月10日 更新

Compare options with weighted scoring, pros and cons, pre-mortems, opportunity costs, and ICE prioritization. Use when a user wants to reason through a choice, expose assumptions, or rank alternatives.

日本語の概要は準備中です。原文の説明を表示しています。

iflytek/skillhub5,1692026年10月10日 更新

iflytek のスキルをすべて見る

このスキルの問題を報告する