Skip to content
Agentmart
Submit a tool

spring-boot-clean-architecture

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

Skill by 2428424081cn

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/2428424081cn-spring-boot-clean-architecture

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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

Use cases: backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/spring-boot-clean-architecture

What's inside

Skill name
spring-boot-clean-architecture
Description
Spring Boot 3 / Java 企业级 DDD 领域驱动设计与六边形 (Hexagonal) 干净架构规范。
License
MIT
Instructions
43 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • skill.json

SKILL.md (first lines)

# 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 进行严格解耦转换。

From 2428424081cn/Skill-mcp, MIT.

More from 2428424081cn/Skill-mcp

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Aug 24, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from 2428424081cn

Cite this page

spring-boot-clean-architecture skill. Agent Mart. https://agentmart.dev/skills/2428424081cn-spring-boot-clean-architecture (last updated 2026-10-24)