spring-modulith-verifier

验证代码是否遵循 Spring Modulith 代码结构。列出检测到的违规项,并为每项提供可行的修复建议。使用场景:在审查使用 Spring Modulith 的 Spring Boot 应用时,或在验证 Spring Boot 应用代码包结构是否符合 Spring Modulith 要求时使用此技能。

仓库最近推送
GitHub Stars
198
Forks
48
Issues / PRs
2

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "spring-modulith-verifier":https://skillpi.com/zh/skills/deepskill-c7248f4539b7a4c8732ba3e31705c91413bbec2afb2a93c7aa72ee0b2f4e4ff3。安装前核对上游来源和版本:https://github.com/sivaprasadreddy/sivalabs-agent-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

验证代码是否遵循 Spring Modulith 代码结构。列出检测到的违规项,并为每项提供可行的修复建议。使用场景:在审查使用 Spring Modulith 的 Spring Boot 应用时,或在验证 Spring Boot 应用代码包结构是否符合 Spring Modulith 要求时使用此技能。

0 下载

介绍来源: third_party · sivaprasadreddy · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: spring-modulith-verifier
description: >
  Verifies whether code follows Spring Modulith code structure or not.
  Show list of violations along with recommendations on how to fix them.
  Use this skill:
    * When reviewing Spring Boot applications which uses Spring Modulith
    * When verifying whether Spring Boot application code follows Spring Modulith package structure

Spring Modulith Verifier Skill

Use a domain-driven, modular layout: organize packages by business modules, not by technical layers.

Recommended Example Package Structure

dev.sivalabs.projectname/
├── Application                      # Main Spring Boot entrypoint class
├── shared/                          # Cross-cutting concerns
│   ├── package-info.java
├── users/                           # Users module (bounded context)
│   ├── config/                      # Users module-specific config
│   ├── domain/                      # Domain logic
│   │   ├── models/                  # Domain models
│   │   │   ├── package-info.java
│   │   ├── exceptions/              # Domain custom Exception classes
│   │   │   ├── package-info.java
│   │   ├── {entities, repositories, mappers, services}
│   ├── api/                        # REST API layer
│   │   ├── {controllers, DTOs}      # REST controllers, Request, Response payload DTOs
│   └── UsersAPI.java                # Module's public API (facade)
│
├── catalog/                         # Catalog module
├── orders/                          # Orders module
└── config/                          # Global Configuration
    └── WebMvcConfig.java
    └── SecurityConfig.java
    └── WebSecurityConfig.java
    └── GlobalExceptionHandler.java

Explanation of the above package structure:

  • Application.java: The main Spring Boot entry point class annotated with @SpringBootApplication. Contains the main() method that bootstraps the application.

  • shared/: Contains cross-cutting concerns and utilities shared across multiple modules (e.g., common utilities, shared DTOs, base classes, custom annotations).

  • {module}/ (e.g., users/, catalog/, orders/): Each business module represents a bounded context and contains:

    • config/: Module-specific configuration classes annotated with @Configuration for beans, properties, or third-party integrations relevant only to this module.

    • domain/: Core business logic layer containing:

      • models/: Domain model classes (Command, Query objects, Enums, Value Objects, Result objects, etc) representing business concepts (not JPA entities). These are pure Java objects that encapsulate business rules.
      • exceptions/: Domain specific custom Exception classes.
      • entities: JPA entity classes annotated with @Entity that map to database tables. These should not be public to prevent direct instantiation and ensure encapsulation.
      • repositories: Spring Data JPA repository interfaces extending JpaRepository or CrudRepository for data access. These should not be public.
      • mappers: Mapper classes/interfaces (e.g., MapStruct mappers) for converting between entities, domain models, and DTOs. These should not be public.
      • services: Service classes annotated with @Service containing business logic, converting beans using mappers, transaction management, and orchestration of repository calls.
    • api/: REST API layer containing:

      • controllers: REST controller classes annotated with @RestController that handle HTTP requests, validate input, and delegate to services.
      • DTOs: Data Transfer Objects including request payloads (data coming from clients) and response payloads (data sent to clients).
    • {Module}API.java: A facade class that serves as the module's public API, delegating calls to services, exposing only what other modules should access while hiding internal implementation details.

  • config/: Global application-wide configuration classes including:

    • WebMvcConfig.java: MVC configuration (CORS, interceptors, formatters).
    • SecurityConfig.java: Spring Security configuration for authentication and authorization.
    • GlobalExceptionHandler.java: Centralized exception handling using @RestControllerAdvice for consistent error responses.

Visibility Modifiers

Default to minimum necessary visibility. Only expose what other modules or layers genuinely need.

Component Class Constructor Methods
Controller package-private package-private package-private
Service public package-private public
Repository package-private (interface) — —
Entity package-private protected public
DTO / record public or package-private — —
Module API facade public package-private public
Request/Response records package-private — —
Config/Exception handler package-private — —

Naming Conventions

Type Convention Example
Entities *Entity UserEntity, AddressEntity
Value Objects Domain name (record) Email, UserCode, UserId
Commands *Cmd CreateUserCmd, UpdateAddressCmd
Command Response *Result LoginResult, RegistrationResult
DTOs *Dto UserDto, AddressDto
HTTP Request *Request CreateUserRequest, CreateAddressRequest
HTTP Response *Response CreateUserResponse, CreateAddressResponse
Repositories *Repository UserRepository, AddressBookRepository
Services *Service UserService, AddressBookService
Domain Exceptions *Exception InvalidUserCreationException, UserCancellationException
Module API *API UsersAPI

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 面向 Spring Boot 开发者提供 Spring Modulith 包结构验证能力
  • 具有明确场景和广泛实用价值
触发精准92/100

亮点

  • 触发词精准完整,覆盖多种使用场景
  • 边界清晰,无歧义
结构规范75/100

待提升项

  • 缺少独立示例章节 原报告严重程度:轻微

    文档缺少具体的端到端执行示例或验证输出样例

    改进建议:建议增加实际验证命令和输出示例章节

  • 文档过长 原报告严重程度:轻微

    文档内容约450行,超出推荐长度

    改进建议:建议精简内容或拆分为多个子章节

  • frontmatter格式 原报告严重程度:轻微

    description使用了>折叠写法

    改进建议:建议展开description内容以提升可读性

亮点

  • 结构清晰,包含推荐包结构、可见性修饰符、命名规范等完整内容
  • frontmatter完整,内容组织良好
执行可靠80/100

亮点

  • 作为代码结构规范指导类Skill,提供标准而非执行操作,可靠性良好
证据可验 (前四项均值)81/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。