2428424081cn/skill-mcp/spring-boot-clean-architecture

Claude Code and agent skill by 2428424081cn/skill-mcp

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Spring Boot 3 / Java 企业级 DDD 领域驱动设计与六边形 (Hexagonal) 干净架构规范。

Install

npx vskill@latest install 2428424081cn/skill-mcp/spring-boot-clean-architecture

SKILL.md

The same SKILL.md was published earlier as 2428424081cn/skill-mcp/spring-boot-clean-architecture.

Spring Boot 3 DDD 与六边形干净架构规范

1. 严格四层依赖单向原则 (Dependency Rule)

text
Presentation (Controller / REST API)
↓ 依赖
Application (Use Cases / Application Services / DTOs)
↓ 依赖
Domain (Entities / Value Objects / Domain Events / Ports) ← 核心:零框架依赖!
↑ 被实现
Infrastructure (JPA / MyBatis / Redis / Kafka / Feign Adapters)

铁律:Domain 核心层绝不允许引入 Spring / JPA / MyBatis 相关的任何注解与框架依赖,保持纯 POJO。

2. 领域实体与值对象规范

  • Entity:具有唯一标识(ID)和业务生命周期变化。
  • Value Object:不可变(Immutable),使用 Java 17+ record 编写(如 Money, EmailAddress):
java
public record Money(BigDecimal amount, Currency currency) {
public Money {
Objects.requireNonNull(amount, "Amount cannot be null");
Objects.requireNonNull(currency, "Currency cannot be null");
if (amount.compareTo(BigDecimal.ZERO) < 0) {
throw new IllegalArgumentException("Amount cannot be negative");
}
}
public Money add(Money other) {
if (!this.currency.equals(other.currency)) {
throw new IllegalArgumentException("Currency mismatch");
}
return new Money(this.amount.add(other.amount), this.currency);
}
}

3. 防腐层与 DTO 转换

  • 严禁将数据库实体(JPA Entity)直接返回给前端或跨微服务暴露。
  • 必须使用 MapStruct 等工具在 Controller 层将 DTO 与 Domain Model 进行严格解耦转换。

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/2428424081cn/skill-mcp/spring-boot-clean-architecture/badge)](https://verified-skill.com/skills/2428424081cn/skill-mcp/spring-boot-clean-architecture)

Something wrong with this skill or its page? Tell us.