/java-skills:mybatis-plus-generatorfrom java-skills
Generates MyBatis-Plus code (Entity, Mapper, Service, Controller, DTO, VO, BO) from database tables. Supports Java and Kotlin, MVC and DDD architectures. Activate only when MyBatis-Plus is explicitly mentioned.
Ships in java-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
CRITICAL: This skill should ONLY be triggered when the user explicitly mentions MyBatis-Plus or mybatis-plus-generator.
ALWAYS use this skill when the user mentions:
Trigger phrases include:
DO NOT trigger this skill for:
Supported architectures:
Supported languages:
Supported component types:
CRITICAL: This skill should ONLY be triggered when the user explicitly mentions MyBatis-Plus or mybatis-plus-generator. Do NOT trigger for generic code generation requests without MyBatis-Plus context.
This skill follows a systematic 8-step workflow:
CRITICAL: Before generating any code, you MUST collect the following configuration:
Database Information:
Global Configuration:
src/main/java)io.swagger.annotations.*)io.swagger.v3.oas.annotations.*)Package Configuration:
com.example.app)entity)mapper)service)service.impl)controller)dto)vo)bo)Strategy Configuration:
IMPORTANT: API Documentation Type Selection:
When user enables API documentation, you MUST ask:
请选择 API 文档类型:
- [ ] Swagger 2
- 使用注解:@ApiModel, @ApiModelProperty, @Api, @ApiOperation
- 依赖:springfox-swagger2, springfox-swagger-ui
- 适用于:Spring Boot 2.x 项目
- [ ] OpenAPI 3
- 使用注解:@Schema, @Tag, @Operation, @Parameter
- 依赖:springdoc-openapi-ui
- 适用于:Spring Boot 2.2+ 和 Spring Boot 3.x 项目
Wait for user confirmation before proceeding.
Output: A configuration summary showing all collected information, including API documentation type.
CRITICAL: You MUST ask the user about the architecture type to determine which objects to generate.
Present architecture options:
请选择项目架构类型:
- [ ] 传统 MVC (Model-View-Controller)
- 生成:Entity, Mapper, Service, ServiceImpl, Controller
- [ ] DDD (领域驱动设计)
- 生成:Entity, Mapper, Service, ServiceImpl, Controller, DTO, VO, BO
- [ ] 分层架构 (Layered Architecture)
- 生成:Entity, Mapper, Service, ServiceImpl, Controller
- [ ] 整洁架构 (Clean Architecture)
- 生成:Entity, Repository, UseCase, Controller, DTO
- [ ] 自定义架构
- 请指定需要生成的对象类型
Wait for user confirmation before proceeding.
IMPORTANT: Directory Mapping Based on Architecture
After determining the architecture type, you MUST identify the correct output directories for each generated object.
CRITICAL Steps:
com.example.order)reference/architecture-directory-quick-reference.md for lookup tablereference/architecture-directory-mapping-guide.md for complete mapping rulesCommon Path Examples:
For user table with base package com.example.order:
com/example/order/entity/User.java, Controller → com/example/order/controller/UserController.javacom/example/order/domain/model/aggregate/user/User.java, Controller → com/example/order/interfaces/web/controller/UserController.javacom/example/order/domain/model/entity/User.java, Controller → com/example/order/infrastructure/adapter/inbound/web/controller/UserController.javacom/example/order/domain/entity/User.java, Controller → com/example/order/infrastructure/web/controller/UserController.javacom/example/order/domain/model/entity/User.java, Controller → com/example/order/adapter/web/controller/UserController.javaCRITICAL: Always confirm the exact directory structure with the user if the project structure is unclear. Ask: "请确认项目的目录结构,以便我将生成的代码放在正确的位置。"
CRITICAL: Ask user for functional requirements to understand what methods need to be generated.
Ask the user:
请描述此次生成代码的功能需求:
例如:
- 用户管理:需要根据邮箱查询用户、根据用户名查询用户、用户登录验证
- 订单管理:需要订单统计、订单分页查询、订单状态更新
- 商品管理:需要商品搜索、商品分类查询、库存管理
请详细描述每个表需要哪些功能,我会根据需求自动分析需要生成的方法。
After user provides requirements:
Analyze requirements to identify:
For each table, identify:
Output: A requirements analysis showing:
CRITICAL: Ask user about programming language.
请选择编程语言:
- [ ] Java
- [ ] Kotlin
Wait for user confirmation before proceeding.
Note: Templates in templates/ directory support both Java and Kotlin. Use appropriate templates based on user's choice.
CRITICAL: After collecting all information, create a detailed todo list.
For each table, generate a structured todo list:
## Todo List: MyBatis-Plus Code Generation
### Table: user
#### Entity 层
- [ ] User.java - 实体类
- [ ] 类注释
- [ ] 字段定义(id, username, email, password, status, createTime, updateTime)
- [ ] 字段注释
#### Mapper 层
- [ ] UserMapper.java - 数据访问接口
- [ ] 类注释
- [ ] 基础 CRUD 方法(继承 BaseMapper)
#### Service 层
- [ ] UserService.java - 服务接口
- [ ] 类注释
- [ ] saveUser() - 保存用户
- [ ] findById() - 根据ID查询
- [ ] updateUser() - 更新用户
- [ ] deleteById() - 删除用户
- [ ] findByEmail() - 根据邮箱查询(自定义方法)
- [ ] findByUsername() - 根据用户名查询(自定义方法)
#### ServiceImpl 层
- [ ] UserServiceImpl.java - 服务实现类
- [ ] 类注释
- [ ] 实现所有 Service 接口方法
- [ ] 方法注释和实现骨架
#### Controller 层
- [ ] UserController.java - 控制器
- [ ] 类注释
- [ ] createUser() - 创建用户
- [ ] getUserById() - 查询用户
- [ ] updateUser() - 更新用户
- [ ] deleteUser() - 删除用户
- [ ] getUserByEmail() - 根据邮箱查询(自定义接口)
#### DTO 层(如果架构需要)
- [ ] UserCreateDTO.java - 创建用户DTO
- [ ] UserUpdateDTO.java - 更新用户DTO
- [ ] UserQueryDTO.java - 查询用户DTO
#### VO 层(如果架构需要)
- [ ] UserVO.java - 用户视图对象
### Table: order
...
Important:
CRITICAL: Generate code files with intelligent comments based on table structure and requirements.
Order of generation:
For each object:
templates/ directory based on object type and languageAfter generating each object:
[x]Code Generation Standards: See reference/code-generation-standards.md for detailed requirements on comments, templates, and code quality.
CRITICAL: Provide real-time progress updates during code generation.
Update progress after:
Progress Format: See reference/progress-and-statistics-formats.md for detailed progress update format and examples.
CRITICAL: After all code generation completes, output comprehensive statistics.
Statistics Format: See reference/progress-and-statistics-formats.md for detailed statistics format including:
IMPORTANT: Generated code must include intelligent, context-aware comments, not just template placeholders.
Key Requirements:
Detailed Standards: See reference/code-generation-standards.md for:
CRITICAL: Use these reference documents for detailed guidance:
reference/architecture-directory-mapping-guide.md - Complete directory mapping guide for all architectures (CRITICAL)reference/architecture-directory-quick-reference.md - Quick lookup table for directory mappingsreference/code-generation-standards.md - Detailed comment standards, template usage, and code quality requirementsreference/template-variables.md - Complete list of template variablesreference/swagger-annotations-guide.md - Swagger 2 vs OpenAPI 3 annotation comparisonreference/progress-and-statistics-formats.md - Progress update and statistics output formatsreference/mybatis-plus-generator-guide.md - MyBatis-Plus Generator usage guideSee the examples/ directory for complete examples:
examples/mvc-architecture-example.md - MVC architecture generation exampleexamples/ddd-architecture-example.md - DDD architecture generation exampleexamples/full-workflow-example.md - Complete workflow exampleexamples/architecture-directory-mapping.md - Directory mapping examples for different architecturesexamples/swagger-annotations-example.md - Swagger 2 vs OpenAPI 3 annotation examplesTemplates are located in templates/ directory, using FreeMarker syntax (.ftl files), strictly following MyBatis-Plus official templates.
Java Templates:
entity.java.ftl - Entity class templatemapper.java.ftl - Mapper interface templateservice.java.ftl - Service interface templateserviceImpl.java.ftl - Service implementation templatecontroller.java.ftl - Controller templatedto.java.ftl - DTO templatevo.java.ftl - VO templatebo.java.ftl - BO templateKotlin Templates:
entity.kt.ftl - Entity data class templatemapper.kt.ftl - Mapper interface templateservice.kt.ftl - Service interface templateserviceImpl.kt.ftl - Service implementation templatecontroller.kt.ftl - Controller templatedto.kt.ftl - DTO templatevo.kt.ftl - VO templatebo.kt.ftl - BO templateAll DDD templates are located in templates/ root directory, supporting both Java and Kotlin:
Domain Layer:
aggregate-root.java.ftl / aggregate-root.kt.ftl - Aggregate root templaterepository.java.ftl / repository.kt.ftl - Repository interface template (domain layer)domain-service.java.ftl / domain-service.kt.ftl - Domain service templatevalue-object.java.ftl / value-object.kt.ftl - Value object templatedomain-event.java.ftl / domain-event.kt.ftl - Domain event templateApplication Layer:
application-service.java.ftl / application-service.kt.ftl - Application service templateInterface Layer:
assembler.java.ftl / assembler.kt.ftl - DTO assembler templateTemplate Features:
Reference: See MyBatis-Plus official templates at:
English keywords: mybatis-plus, mybatis-plus-generator, mybatis-plus code generator, mybatis-plus code generation, generate mybatis-plus code, mybatis-plus entity generator, mybatis-plus mapper generator, mybatis-plus service generator, mybatis-plus controller generator, mybatis-plus crud generation, mybatis-plus from table, mybatis-plus code from database
Chinese keywords (中文关键词): MyBatis-Plus, mybatis-plus-generator, MyBatis-Plus 代码生成器, MyBatis-Plus 代码生成, 生成 MyBatis-Plus 代码, MyBatis-Plus 实体类生成, MyBatis-Plus Mapper 生成, MyBatis-Plus Service 生成, MyBatis-Plus Controller 生成, MyBatis-Plus CRUD 生成, MyBatis-Plus 根据表生成代码, MyBatis-Plus 数据库转代码, MyBatis-Plus 表转 Java, 使用 MyBatis-Plus 生成代码
IMPORTANT: All keywords must include "MyBatis-Plus" or "mybatis-plus" to avoid false triggers. Generic terms like "代码生成器" (code generator) or "根据表生成代码" (generate code from table) without "MyBatis-Plus" should NOT trigger this skill.
LICENSE.txt (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)examples/architecture-directory-mapping.md (opens in a new tab)examples/ddd-architecture-example.md (opens in a new tab)examples/full-workflow-example.md (opens in a new tab)examples/mvc-architecture-example.md (opens in a new tab)examples/swagger-annotations-example.md (opens in a new tab)reference/architecture-directory-mapping-guide.md (opens in a new tab)reference/architecture-directory-quick-reference.md (opens in a new tab)reference/code-generation-standards.md (opens in a new tab)reference/mybatis-plus-generator-guide.md (opens in a new tab)reference/progress-and-statistics-formats.md (opens in a new tab)reference/swagger-annotations-guide.md (opens in a new tab)reference/template-variables.md (opens in a new tab)templates/aggregate-root.java.ftl (opens in a new tab)templates/aggregate-root.kt.ftl (opens in a new tab)templates/application-service.java.ftl (opens in a new tab)templates/application-service.kt.ftl (opens in a new tab)templates/assembler.java.ftl (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (full-stack-skills/java-skills) — no native marketplace selected
npx claudepluginhub p/full-statck-skills-java-skills39 skills in this plugin
/caffeine-patternsCaffeine JVM 本地缓存技能。覆盖本地缓存 vs 远程缓存(Redis)选择决策树、expireAfterWrite vs expireAfterAccess vs refreshAfterWrite 三种过期策略对比与组合规则(refresh < expire)、CacheLoader加载与reload异步刷新模式、Spring Cache @Cacheable集成、maximumSize驱逐策略、recordStats缓存统计。 纠正 LLM:用 ConcurrentHashMap+手动过期、所有缓存走Redis、refreshAfterWrite > expireAfterWrite导致永远不刷新、CacheLoader返回null导致缓存穿透。/commons-patternsApache Commons 最佳实践模式。从官方文档提炼,覆盖 Commons Lang3(StringUtils千面判空/isEmpty vs isBlank/Validate抛NullPointerException迁移)、Commons IO(IOUtils.toString大文件陷阱/FileUtils.lineIterator逐行读模式/FilenameUtils.normalize路径规范化)、Commons Collections4(CollectionUtils.union/intersection/subtract集合运算)。 纠正 LLM 误用:混淆 StringUtils.isBlank vs isEmpty、IOUtils.toString 读大文件OOM、不知道 LineIterator 逐行读模式、用 lang 而非 lang3 包名。/easy4j-deployeasy4j 组织标准发布流程与多分支 Maven 发布规范。适用于 io.github.easy4j 仓库(如 openclaw-java-sdk、okhttp3-extension 及其他 easy-4-java 组织组件)的以下场景:(1) SDK 三分支正式版发布(标准流程:创建 tag → 发布 Maven Central → bump SNAPSHOT,支持子智能体并行编排),(1b) xxx-spring-boot-starter 十分支发布(依赖 SDK 先转正式版 + tag + Central + bump),(2) 发布阿里云私有库 SNAPSHOT,(3) 三分支(feature/1.0.x JDK 8、feature/2.0.x JDK 17、feature/3.0.x JDK 21)源码同步,(4) 发布前 CVE 扫描与依赖升级(Jackson BOM 版本控制规则、JDK 依赖天花板),(5) 发布故障排查(409 冲突、Central 拒绝 SNAPSHOT 依赖、argLine 问题)。触发词:发布、上线、deploy、release、发版、发布正式版、同步分支、版本号升级。/easyexcel-fill基于 Alibaba EasyExcel(com.alibaba:easyexcel:4.0.3)的 Excel 模板填充技能。覆盖简单对象填充、列表填充({.}+forceNewRow)、横向多列组合填充(FillWrapper+WriteDirectionEnum.HORIZONTAL)、复杂填充(含合计行/统计行/先 fill 后 write)、Spring Boot 集成、模板设计规范、转义字符、03版/07版差异、性能优化(分次 fill、文件缓存)。当用户需要把 Java 对象或 Map 数据按预制 .xlsx 模板(变量语法 {var}、{.}、{prefix.})填充生成报表(工资条/合同/对账单/发票/财务报表/统计表/汇总表)时使用此技能,不适用于不基于模板的"程序生成 Excel"场景(改用 easyexcel-write)。/easyexcel-read基于 Alibaba EasyExcel(com.alibaba:easyexcel:4.0.3)的 Excel 数据读取技能。覆盖监听器模式(ReadListener/AnalysisEventListener/PageReadListener)、同步读取(doReadSync)、多 Sheet 读取、@ExcelProperty(index/name)匹配、多行表头(headRowNumber)、日期数字自定义转换器(@DateTimeFormat/@NumberFormat/Converter)、监听器异常处理(onException + ExcelDataConvertException)、额外信息读取(批注/超链接/合并单元格,extraRead + CellExtra)、公式和单元格类型(CellData<T>)、不创建对象的读(ReadListener<Map<Integer,String>>)、Web 上传读取(MultipartFile→InputStream)。当用户需要解析 Excel(导入数据/批量入库/对账文件/用户上传/Excel 转对象/Excel 转 Map)时使用此技能,不适用于按预制模板填充(改用 easyexcel-fill)、不适用于程序化生成 Excel(改用 easyexcel-write)。/easyexcel-write基于 Alibaba EasyExcel(com.alibaba:easyexcel:4.0.3)的 Excel 数据写入技能。覆盖最简写入(3 种写法)、复杂表头(多级)、@ExcelProperty/@ExcelIgnore/@DateTimeFormat/@NumberFormat 注解、includeColumn/excludeColumn 选择列、@ColumnWidth/@ContentRowHeight 样式注解、@HeadStyle/@ContentStyle 自定义样式、合并单元格(@ContentLoopMerge/LoopMergeStrategy)、图片导出(File/InputStream/URL/byte[])、超链接/批注/公式/富文本(WriteCellData)、动态表头、自动列宽、自定义拦截器(CellWriteHandler/SheetWriteHandler/RowWriteHandler)、分页分批写入、Web 下载直接写 OutputStream、03/07 版兼容。当用户需要程序化生成 Excel(无预制模板)导出订单/用户/财务/库存/报表/对账单/审批单等结构化数据时使用此技能,不适用于按预制模板填充(改用 easyexcel-fill)、不适用于读取 Excel(改用 easyexcel-read)。