Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

kotlin-springboot-hexagonalkotlin springboot 六边形

Agent Skill

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

总安装

245

周安装

10

GitHub Stars

1

下载量

78
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:kotlin-springboot-hexagonal(kotlin springboot 六边形)
来源仓库:https://github.com/ujon/skills
仓库路径:skills/kotlin-springboot-hexagonal
安装命令:
npx skills add https://github.com/ujon/skills --skill kotlin-springboot-hexagonal
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ujon/skills --skill kotlin-springboot-hexagonal

简介

用于辅助 Java 项目开发、面向对象设计和 Spring 生态实践。

  • 适合分析类结构、设计接口、整理服务分层或生成测试用例。
  • 使用时需结合项目已有架构和依赖版本,避免盲目修改代码。
  • 涉及数据库、事务或框架配置时,应先确认运行环境和回归测试范围。
  • 建议在本地验证后再部署到生产环境。kotlin-springboot-hexagonal 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Kotlin + Spring Boot Hexagonal Architecture Guide

This skill defines the architectural conventions for a Kotlin Spring Boot modular monolith using hexagonal architecture (ports & adapters). Follow these patterns when creating or modifying any code.

Module Structure

The project is organized into strict layers with unidirectional dependencies:

presentation (REST)  →  application (Use Cases)  →  domain (Models)  →  support (Shared Kernel)
LayerResponsibilityMay Depend On
presentationREST controllers, request/response DTOs, security adapters, Spring config. There can be multiple presentation modules (e.g., *-api, *-admin) sharing the same application layer.application, support
applicationUse case interfaces (ports/in), service implementations, port/out interfacesdomain, support
domainEntities, value objects, domain exceptions, repository interfaces & implementationssupport
supportBase exception hierarchy, error codes, shared enums, cross-cutting types*(none)*
infrastructure/*External system adapters (Redis, messaging, etc.)domain, support

Critical rule: Presentation modules never import domain directly. All domain concepts are accessed through application layer DTOs (Command, Query, Result).

Creating a New Feature — Step by Step

When adding a new feature (e.g., "bookmark a post"), work bottom-up through the layers:

1. Domain Layer — Entity & Repository

If the feature requires a new entity, create it in domain/src/main/kotlin/{base-package}/domain/{aggregate}/.

For detailed entity patterns, value objects, repository conventions, and domain service patterns, see references/domain-patterns.md.

2. Application Layer — Use Case & Service

Create the use case interface, DTOs, and service implementation in application/src/main/kotlin/{base-package}/application/{feature}/.

For the full use case structure (Command/Query/Result naming, port/in and port/out organization, service patterns), see references/application-patterns.md.

3. Presentation Layer — Controller & DTOs

Create the controller, request/response DTOs in the target presentation module: {presentation-module}/src/main/kotlin/{base-package}/{presentation}/....

For controller patterns (Request→Command mapping, Response construction, ApiResponse wrapping), see references/presentation-patterns.md.

4. Shared Types — Support Module

If the feature introduces new enums or exception types shared across layers, add them to support/src/main/kotlin/{base-package}/support/.

For the exception hierarchy and shared type conventions, see references/support-patterns.md.

Quick Reference: File Placement

When you need to create a new file, use this table to determine the correct location:

What you're creatingModulePath
Entity classdomaindomain/.../domain/{aggregate}/{Entity}.kt
Value objectdomaindomain/.../domain/{aggregate}/vo/{ValueObject}.kt
Domain exceptiondomaindomain/.../domain/{aggregate}/exception/{Exception}.kt
Command repository (interface)domaindomain/.../domain/{aggregate}/repository/{Entity}CommandRepository.kt
Command repository (impl)domaindomain/.../domain/{aggregate}/repository/{Entity}CommandRepositoryImpl.kt
Query repository (interface)domaindomain/.../domain/{aggregate}/repository/{Entity}QueryRepository.kt
Query repository (impl)domaindomain/.../domain/{aggregate}/repository/{Entity}QueryRepositoryImpl.kt
Domain servicedomaindomain/.../domain/{aggregate}/{Entity}DomainService.kt
Use case interfaceapplicationapplication/.../application/{feature}/port/in/{Action}UseCase.kt
Command DTOapplicationapplication/.../application/{feature}/port/in/command/{Action}Command.kt
Query DTOapplicationapplication/.../application/{feature}/port/in/query/{Entity}Query.kt
Result DTOapplicationapplication/.../application/{feature}/port/in/result/{Entity}Result.kt
Port/out interfaceapplicationapplication/.../application/{feature}/port/out/{Capability}Port.kt
Service implementationapplicationapplication/.../application/{feature}/{Action}Service.kt
Controllerpresentation{presentation-module}/.../api/{feature}/{Feature}Controller.kt
Request DTOpresentation{presentation-module}/.../api/{feature}/request/{Action}Request.kt
Response DTOpresentation{presentation-module}/.../api/{feature}/response/{Entity}Response.kt
Port/out adapterpresentation{presentation-module}/.../api/common/{concern}/{Adapter}.kt
Shared enumsupportsupport/.../support/type/{TypeName}.kt
Shared exceptionsupportsupport/.../support/exception/{Exception}.kt
{base-package} and {presentation-module} are placeholders — resolve them from the actual project structure (e.g., by inspecting existing packages or build.gradle.kts). A project may have multiple presentation modules (e.g., *-api for public, *-admin for back-office).

Key Conventions Summary

DTO Naming

KindSuffixLocationExample
Write/action inputCommandport/in/command/CreatePostCommand
Read/query inputQueryport/in/query/PostsQuery
Use case outputResultport/in/result/PostDetailResult
API inputRequestapi/{feature}/request/CreatePostRequest
API outputResponseapi/{feature}/response/PostResponse

Use Case Rules

  • One use case = one action = one operator fun invoke method
  • Interface in port/in/, implementation as @Service class
  • Command for writes, Query for reads — never mix
  • Result types returned from use cases, never domain entities

Controller Rules

  • Request → Command/Query mapping via private extension functions inside the controller
  • Result → Response mapping via private extension functions inside the controller
  • All responses wrapped in ApiResponse

Repository Rules

  • Split into CommandRepository (writes) and QueryRepository (reads)
  • Interface defined in domain/{aggregate}/repository/
  • Implementation using SimpleJpaRepository (command) or JPAQueryFactory (query)
  • Both interface and impl live in the domain module

Transaction Rules

  • @Transactional on service methods that write
  • @Transactional(readOnly = true) on service methods that only read
  • Transaction boundaries at the application service layer, never at controller or domain

Kotlin Idioms

  • data class for DTOs, @JvmInline value class for value objects
  • private set on mutable entity fields — mutations only through domain methods
  • companion object {fun create(...)} factory methods on entities
  • Expression bodies for single-expression functions
  • val over var, immutable collections at public boundaries
  • Named arguments and trailing lambdas for clarity

Agents

This skill includes specialized agents for common workflows. Read the agent instructions before delegating:

  • agents/feature-scaffold.md — Scaffolds a complete vertical slice (entity → repository → use case → controller) for a new feature. Use when adding a new feature that spans all layers.
  • agents/architecture-reviewer.md — Reviews code for hexagonal architecture compliance, naming convention violations, and layer dependency issues. Use after scaffolding or before PRs.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.04%
按下载量换算27

Claude

28.48%
按下载量换算22

Cursor

18.88%
按下载量换算15

Gemini CLI

9.54%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills