When to use this skill
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:
MyBatis-Plus code generation (explicitly mentions "MyBatis-Plus" or "mybatis-plus")
Generating MyBatis-Plus code from database tables
MyBatis-Plus generator or mybatis-plus-generator
Creating MyBatis-Plus Entity, Mapper, Service, Controller code
生成 MyBatis-Plus 代码 (explicitly mentions "MyBatis-Plus")
MyBatis-Plus 代码生成器 (MyBatis-Plus code generator)
使用 MyBatis-Plus 生成代码 (generate code using MyBatis-Plus)
Trigger phrases include:
"生成 MyBatis-Plus 代码" (generate MyBatis-Plus code) - must include "MyBatis-Plus"
"MyBatis-Plus 代码生成" (MyBatis-Plus code generation) - must include "MyBatis-Plus"
"mybatis-plus-generator" (explicitly mentions the generator)
"使用 MyBatis-Plus 根据表结构生成代码" (use MyBatis-Plus to generate code from table structure)
"MyBatis-Plus 生成 Entity、Service、Controller" (MyBatis-Plus generate Entity, Service, Controller)
"MyBatis-Plus 代码生成器" (MyBatis-Plus code generator)
DO NOT trigger this skill for:
Generic code generation without mentioning MyBatis-Plus
JPA/Hibernate code generation
Other ORM frameworks (TypeORM, Sequelize, etc.)
Generic CRUD operations without MyBatis-Plus context
"根据表结构生成代码" without "MyBatis-Plus" (too generic)
"生成 CRUD 代码" without "MyBatis-Plus" (too generic)
"代码生成器" without "MyBatis-Plus" (too generic)
Supported architectures:
Traditional MVC (Model-View-Controller)
DDD (Domain-Driven Design)
Layered Architecture
Clean Architecture
Supported languages:
Supported component types:
Entity (实体类)
Mapper (数据访问接口)
Service (服务接口)
ServiceImpl (服务实现类)
Controller (控制器)
DTO (Data Transfer Object)
VO (Value Object / View Object)
BO (Business Object)
Model (数据模型)
How to use this skill
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.
Workflow Overview
This skill follows a systematic 8-step workflow:
Collect Configuration - Collect database information, global configuration, package configuration, strategy configuration
Determine Architecture - Ask user about architecture type (MVC, DDD, etc.) to determine which objects to generate
Collect Requirements - Ask user for functional requirements to analyze and determine methods to generate
Determine Language - Ask user about programming language (Java or Kotlin)
Create Todo List - Generate a detailed todo list with table names, object types, and method names
Generate Code - Generate code files with intelligent comments based on table structure and requirements
Progress Updates - Provide real-time progress updates during code generation
Statistics - Output statistics after generation completes
Step-by-Step Process
Step 1: Collect Configuration
CRITICAL: Before generating any code, you MUST collect the following configuration:
Database Information:
Database type (MySQL, PostgreSQL, Oracle, etc.)
Database connection URL (or ask user to provide table structure)
Database name
Table names (one or multiple tables)
If user cannot provide database connection, ask for table structure (CREATE TABLE statement or table schema)
Global Configuration:
Author name
Output directory (default: src/main/java)
File override strategy (overwrite, skip, ask)
Enable Lombok (yes/no)
Enable API documentation (yes/no)
API Documentation Type (if enabled):
Swagger 2 (使用 io.swagger.annotations.*)
OpenAPI 3 (使用 io.swagger.v3.oas.annotations.*)
Enable validation annotations (yes/no)
Package Configuration:
Parent package name (e.g., com.example.app)
Entity package (default: entity)
Mapper package (default: mapper)
Service package (default: service)
ServiceImpl package (default: service.impl)
Controller package (default: controller)
DTO package (default: dto)
VO package (default: vo)
BO package (default: bo)
Strategy Configuration:
Naming strategy (camelCase, PascalCase, etc.)
Table prefix removal (yes/no, prefix name)
Field naming strategy
Primary key strategy (AUTO, UUID, etc.)
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.
Step 2: Determine Architecture
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:
Ask user for base package path (e.g., com.example.order)
Use architecture directory mapping to determine correct paths:
Quick Reference : See reference/architecture-directory-quick-reference.md for lookup table
Detailed Guide : See reference/architecture-directory-mapping-guide.md for complete mapping rules
Verify directory exists or create it if needed
Generate files in the correct location
Common Path Examples:
For user table with base package com.example.order:
MVC : Entity → com/example/order/entity/User.java, Controller → com/example/order/controller/UserController.java
DDD : Entity → com/example/order/domain/model/aggregate/user/User.java, Controller → com/example/order/interfaces/web/controller/UserController.java
Hexagonal : Entity → com/example/order/domain/model/entity/User.java, Controller → com/example/order/infrastructure/adapter/inbound/web/controller/UserController.java
Clean : Entity → com/example/order/domain/entity/User.java, Controller → com/example/order/infrastructure/web/controller/UserController.java
COLA : Entity → com/example/order/domain/model/entity/User.java, Controller → com/example/order/adapter/web/controller/UserController.java
CRITICAL : Always confirm the exact directory structure with the user if the project structure is unclear. Ask: "请确认项目的目录结构,以便我将生成的代码放在正确的位置。"
Step 3: Collect Requirements
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:
Standard CRUD methods (create, read, update, delete)
Custom query methods (findByEmail, findByUsername, etc.)
Custom business methods (statistics, aggregation, etc.)
Custom update methods (updateStatus, updatePassword, etc.)
For each table, identify:
Standard methods needed
Custom methods needed based on requirements
Method parameters and return types
Business logic hints (for method skeletons)
Output : A requirements analysis showing:
Standard methods for each table
Custom methods for each table
Method signatures (parameters and return types)
Step 4: Determine Language
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.
Step 5: Create Todo List
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 :
Organize by table
List all objects that need to be generated
Include all methods (standard + custom)
Use checkboxes for tracking progress
Step 6: Generate Code
CRITICAL: Generate code files with intelligent comments based on table structure and requirements.
Order of generation:
Entity - First (base for all other objects)
Mapper - Second (data access layer)
Service - Third (business interface)
ServiceImpl - Fourth (business implementation)
Controller - Fifth (API layer)
DTO/VO/BO - Sixth (if needed by architecture)
For each object:
Load appropriate template from templates/ directory based on object type and language
Analyze table structure : Read columns, types, constraints, primary keys, foreign keys, relationships
Generate intelligent comments : Based on business context, not just technical names
Class comments: Explain purpose, list main fields
Method comments: Explain business logic, include all parameters and return types
Field comments: Explain business meaning, not just column names
Generate code : Replace template variables, add annotations, generate method skeletons
For custom methods : Generate signatures, add business logic comments, add TODO hints
Determine output directory : Use architecture directory mapping (see Step 2)
Save files to correct location based on architecture and package configuration
After generating each object:
Update the todo list: mark completed items with [x]
Show progress to the user
Continue to the next object
Code Generation Standards : See reference/code-generation-standards.md for detailed requirements on comments, templates, and code quality.
Step 7: Progress Updates
CRITICAL: Provide real-time progress updates during code generation.
Update progress after:
Each table starts processing
Each object is generated
Each method is added
Each table completes
Progress Format : See reference/progress-and-statistics-formats.md for detailed progress update format and examples.
Step 8: Statistics
CRITICAL: After all code generation completes, output comprehensive statistics.
Statistics Format : See reference/progress-and-statistics-formats.md for detailed statistics format including:
Overall statistics (tables, objects, methods, files, lines)
Per-table statistics
Per-type statistics
File locations
Code quality checklist
Code Generation Standards
IMPORTANT: Generated code must include intelligent, context-aware comments, not just template placeholders.
Key Requirements:
Class Comments : Explain purpose based on business context, include table mapping, list main fields
Method Comments : Explain business logic, include all parameters with types, return value with type, exceptions
Field Comments : Explain business meaning, include data type and constraints, not just column names
Detailed Standards : See reference/code-generation-standards.md for:
Complete comment format requirements
Template usage guidelines
Template variables reference
Swagger annotation selection
Custom method generation standards
Code quality requirements
Best Practices
Intelligent Comments : Generate comments based on table structure analysis and business requirements, not just template placeholders
Context Awareness : Understand table relationships and business context to generate meaningful comments
Method Analysis : Analyze user requirements to determine what methods are needed
Progress Tracking : Always update todo list and show progress
Code Quality : Generate production-ready code with proper annotations and validation
Template Enhancement : Use templates as base, but enhance with intelligent additions
Language Support : Support both Java and Kotlin with appropriate templates
Reference Documentation
CRITICAL: Use these reference documents for detailed guidance:
Architecture & Directory Mapping
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 mappings
Code Generation Standards
reference/code-generation-standards.md - Detailed comment standards, template usage, and code quality requirements
reference/template-variables.md - Complete list of template variables
reference/swagger-annotations-guide.md - Swagger 2 vs OpenAPI 3 annotation comparison
Progress & Statistics
reference/progress-and-statistics-formats.md - Progress update and statistics output formats
MyBatis-Plus Reference
reference/mybatis-plus-generator-guide.md - MyBatis-Plus Generator usage guide
Examples
See the examples/ directory for complete examples:
examples/mvc-architecture-example.md - MVC architecture generation example
examples/ddd-architecture-example.md - DDD architecture generation example
examples/full-workflow-example.md - Complete workflow example
examples/architecture-directory-mapping.md - Directory mapping examples for different architectures
examples/swagger-annotations-example.md - Swagger 2 vs OpenAPI 3 annotation examples
Templates
Templates are located in templates/ directory, using FreeMarker syntax (.ftl files), strictly following ✓
Make data-driven prioritization decisions faster
Stakeholder Communication Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
✓ Save 3-5 hours/week on communication overhead
Implementation Guide Prerequisites
› Claude Desktop or compatible AI client › Access to product documentation and roadmap tools (Jira, Notion, etc.) › Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.) › Stakeholder contact information and communication channels Time Estimate
30-60 minutes to see productivity improvements
Steps
1 Install product management skill 2 Start with user story generation for known feature 3 Progress to competitive analysis: research 2-3 competitors 4 Use for roadmap prioritization: apply RICE/ICE scoring 5 Draft stakeholder communications and refine based on feedback 6 Build template library for recurring PM tasks 7 Share effective prompts with product team Common Pitfalls
⚠ Not validating competitive research—verify facts before sharing ⚠ Accepting user stories without involving engineering team ⚠ Over-relying on frameworks without qualitative judgment ⚠ Not customizing outputs to company culture and communication style ⚠ Skipping stakeholder validation of generated requirements Best Practices ✓ Do
+ Validate research and competitive analysis with real data + Collaborate with engineering when generating technical requirements + Customize frameworks and templates to your company context + Use skill for first drafts, refine with stakeholder input + Document successful prompt patterns for PM tasks + Combine AI efficiency with human judgment and intuition ✗ Don't
− Don't publish competitive analysis without fact-checking − Don't finalize user stories without engineering review − Don't make prioritization decisions solely on AI scoring − Don't skip customer validation of generated requirements − Don't ignore company-specific context and culture 💡 Pro Tips
★ Provide context: company goals, constraints, customer feedback ★ Ask for alternatives: 'Show 3 ways to prioritize this roadmap' ★ Request stakeholder-specific formatting: 'Executive summary vs. engineering spec' ★ Use skill for 70% generation + 30% customization to company needs When to Use This ✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path 1 Basic: user stories, feature specs, status updates 2 Intermediate: competitive analysis, prioritization frameworks, PRDs 3 Advanced: product strategy, go-to-market planning, OKR setting 4 Expert: product vision, market positioning, business model innovation Reviews 4.7 ★ ★ ★ ★ ★ 35 reviews
C
Chaitanya Patil ★ ★ ★ ★ ★ Dec 16, 2024
Keeps context tight: mybatis-plus-generator is the kind of skill you can hand to a new teammate without a long onboarding doc.
L
Liam Menon ★ ★ ★ ★ ★ Dec 12, 2024
mybatis-plus-generator is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
I
Isabella Chawla ★ ★ ★ ★ ★ Dec 4, 2024
I recommend mybatis-plus-generator for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
O
Olivia Desai ★ ★ ★ ★ ★ Nov 23, 2024
mybatis-plus-generator reduced setup friction for our internal harness; good balance of opinion and flexibility.
P
Piyush G ★ ★ ★ ★ ★ Nov 7, 2024
mybatis-plus-generator has been reliable in day-to-day use. Documentation quality is above average for community skills.
L
Liam Perez ★ ★ ★ ★ ★ Nov 3, 2024
Solid pick for teams standardizing on skills: mybatis-plus-generator is focused, and the summary matches what you get after install.
S
Shikha Mishra ★ ★ ★ ★ ★ Oct 26, 2024
Solid pick for teams standardizing on skills: mybatis-plus-generator is focused, and the summary matches what you get after install.
Z
Zara Ghosh ★ ★ ★ ★ ★ Oct 14, 2024
Registry listing for mybatis-plus-generator matched our evaluation — installs cleanly and behaves as described in the markdown.
R
Rahul Santra ★ ★ ★ ★ ★ Sep 17, 2024
We added mybatis-plus-generator from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
T
Tariq Flores ★ ★ ★ ★ ★ Sep 17, 2024
Registry listing for mybatis-plus-generator matched our evaluation — installs cleanly and behaves as described in the markdown.
showing 1-10 of 35
prev 1 / 4 next
Discussion Comments — not star reviews No comments yet — start the thread.