springboot-standardizer

v1.0.0

Java SpringBoot + MyBatis 项目标准化重构工具。用于分析非标准项目结构, 生成标准化目录结构,提供重构迁移方案。支持标准三层架构(Controller → Service → DAO), 自动识别 Entity/DTO/VO 分层,生成 MyBatis/Redis/Kafka 等标准配置模...

0· 106·0 current·0 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The skill claims to analyze and generate SpringBoot/MyBatis project structure and includes two Python scripts that implement that behavior. However, the SKILL.md instructs running the scripts with the 'python' command but the manifest declares no required binaries — the skill should have declared that Python 3 is required. SKILL.md also references an 'assets/project-template/' but that directory is not present in the provided file manifest, which is an inconsistency to verify.
Instruction Scope
The runtime instructions are limited and specific: run analyze_project.py on a chosen project path and run generate_structure.py to create output at a specified path. The scripts read the target project directory and resource files and write a JSON report into the target project and create files under the given output path. This file/IO behavior is consistent with the stated purpose. Users should be aware the scripts operate on arbitrary paths you supply — review or run on a copy/sandbox first.
Install Mechanism
There is no install spec (instruction-only with Python scripts included). That is low risk — nothing is downloaded or executed from remote URLs. The only implicit requirement is a local Python runtime; no packages are installed automatically by the skill.
Credentials
The skill requests no environment variables, credentials, or config paths. The templates include placeholder environment-variable substitutions (e.g., ${MYSQL_USERNAME}, ${REDIS_PASSWORD}, ${KAFKA_SERVERS}) in generated application.yml, which is normal for configuration templates and not the skill itself requesting secrets.
Persistence & Privilege
The skill does not request persistent elevated privileges and 'always' is false. It only writes files to the project/output paths you provide. It does not modify other skills or global agent settings.
Assessment
This skill appears to do what it says: it scans a Java project and can generate a standard SpringBoot skeleton. Before running: (1) ensure you have Python 3 installed — the manifest did not declare this requirement but SKILL.md uses 'python'. (2) Review the scripts (they read the project path you pass and write a JSON report into that path and will create files under the output path) and run them on a copy or in a sandbox if the project contains sensitive data. (3) The provided config templates enable things that can be risky if used without care (e.g., Jackson default typing in Redis config which can make deserialization dangerous if untrusted data is stored, and configuration placeholders referencing DB/Redis/Kafka credentials); review and harden generated configs before deploying. (4) The SKILL.md mentions assets/project-template/ but that folder is not present in the manifest — verify the template assets you expect are actually included. If you need the skill to run automatically in an agent, consider whether you trust it with the file paths the agent will pass; otherwise run it manually.

Like a lobster shell, security has layers — review code before you run it.

latestvk97bc9xt63d2s22amefema13w5836rfx

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

SpringBoot 项目标准化工具

功能概述

将非标准的 SpringBoot + MyBatis 项目重构为业界标准结构。

标准项目结构

src/main/java/com/{company}/{project}/
├── controller/          # REST API 控制器
│   └── UserController.java
├── service/             # 业务层接口
│   ├── UserService.java
│   └── impl/            # 业务层实现
│       └── UserServiceImpl.java
├── dao/                 # 数据访问层(Mapper 接口)
│   └── UserMapper.java
├── entity/              # 数据库实体类
│   └── User.java
├── dto/                 # 数据传输对象(API 入参)
│   ├── UserCreateDTO.java
│   └── UserUpdateDTO.java
├── vo/                  # 视图对象(API 出参)
│   └── UserVO.java
├── config/              # 配置类
│   ├── MybatisConfig.java
│   ├── RedisConfig.java
│   └── KafkaConfig.java
└── util/                # 工具类
    └── JsonUtil.java

src/main/resources/
├── mapper/              # MyBatis XML 映射文件
│   └── UserMapper.xml
├── application.yml      # 主配置文件
├── application-dev.yml  # 开发环境配置
└── application-prod.yml # 生产环境配置

工作流程

1. 项目扫描分析

首先扫描现有项目,识别当前结构问题:

python scripts/analyze_project.py <项目路径>

输出报告包括:

  • 当前目录结构
  • 识别出的问题(如类放错位置、命名不规范)
  • 建议的迁移方案

2. 生成标准结构

生成标准目录结构和配置文件:

python scripts/generate_structure.py <输出路径> --package com.company.project

3. 配置文件模板

参考 references/ 目录下的标准配置模板:

  • mybatis-config.md — MyBatis 配置指南
  • redis-config.md — Redis 配置模板
  • kafka-config.md — Kafka 配置模板
  • naming-conventions.md — 命名规范

4. 项目骨架模板

assets/project-template/ 包含可直接使用的标准项目骨架。

使用方式

场景一:分析现有项目

  1. 运行分析脚本扫描项目
  2. 查看分析报告
  3. 根据建议手动或自动重构

场景二:创建新项目

  1. 复制 assets/project-template/ 作为起点
  2. 修改包名和配置
  3. 开始开发

场景三:生成配置模板

根据需要读取 references/ 中的配置模板,应用到项目中。

命名规范

包命名

  • 根包:com.{公司}.{项目}
  • 子包按层划分:controller, service, dao, entity, dto, vo, config, util

类命名

  • Controller:XxxController
  • Service 接口:XxxService
  • Service 实现:XxxServiceImpl
  • Mapper:XxxMapper
  • Entity:Xxx(对应表名,驼峰命名)
  • DTO:XxxDTO / XxxCreateDTO / XxxUpdateDTO
  • VO:XxxVO
  • Config:XxxConfig

方法命名

  • Controller:HTTP 方法对应(getXxx, createXxx, updateXxx, deleteXxx)
  • Service:业务语义(findXxx, saveXxx, updateXxx, deleteXxx)
  • Mapper:数据库操作(selectXxx, insertXxx, updateXxx, deleteXxx)

Files

7 total
Select a file
Select a file to preview.

Comments

Loading comments…