File contents 6. 自动化工作流
.claude/skills/ttc-crud-generator/SKILL.md
---
name: crud-generator
description: 自动生成标准 CRUD 代码(Controller, Service, Repository, DTO, Mapper)
triggers:
- "生成CRUD"
- "创建增删改查"
- "新建模块"
---
# CRUD 代码生成器
## 触发条件
用户输入包含 "生成CRUD" 或 "创建增删改查" 等关键词时自动触发。
## 工作流程
### 1. 收集信息
询问用户:
- 实体名称(如 User, Product)
- 字段列表(名称 + 类型)
- 是否需要分页
- 是否需要软删除
### 2. 生成文件
按照标准包结构生成:
src/main/java/com/company/project/
├── entity/{Entity}.java
├── dto/{Entity}Request.java
├── dto/{Entity}Response.java
├── controller/{Entity}Controller.java
├── service/{Entity}Service.java
├── service/impl/{Entity}ServiceImpl.java
├── repository/{Entity}Repository.java
└── mapper/{Entity}Mapper.java
text
### 3. 代码模板示例
#### Entity 模板
```java
@Entity
@Table(name = "{{tableName}}")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class {{Entity}} {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
{% for field in fields %}
@Column(name = "{{field.name}}", nullable = false)
private {{field.type}} {{field.name}};
{% endfor %}
@CreatedDate
private LocalDateTime createdAt;
@LastModifiedDate
private LocalDateTime updatedAt;
}
4. 生成数据库迁移
自动创建 Flyway 迁移脚本:
sql
-- V{{timestamp}}__create_{{tableName}}_table.sql
CREATE TABLE {{tableName}} (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
{% for field in fields %}
{{field.name}} {{field.sqlType}} NOT NULL,
{% endfor %}
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
---
> Source: [shuigedeng/taotao-cloud-project](https://github.com/shuigedeng/taotao-cloud-project) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-30 -->
1 --- 2 name: shuigedeng-taotao-cloud-project-taotao-cloud-project 3 description: 6. 自动化工作流 4 --- 5 ## 6. 自动化工作流 6 7 **`.claude/skills/ttc-crud-generator/SKILL.md`** 8 ```markdown 9 --- 10 name: crud-generator 11 description: 自动生成标准 CRUD 代码(Controller, Service, Repository, DTO, Mapper) 12 triggers: 13 - "生成CRUD" 14 - "创建增删改查" 15 - "新建模块" 16 --- 17 18 # CRUD 代码生成器 19 20 ## 触发条件 21 用户输入包含 "生成CRUD" 或 "创建增删改查" 等关键词时自动触发。 22 23 ## 工作流程 24 25 ### 1. 收集信息 26 询问用户: 27 - 实体名称(如 User, Product) 28 - 字段列表(名称 + 类型) 29 - 是否需要分页 30 - 是否需要软删除 31 32 ### 2. 生成文件 33 按照标准包结构生成: 34 src/main/java/com/company/project/ 35 ├── entity/{Entity}.java 36 ├── dto/{Entity}Request.java 37 ├── dto/{Entity}Response.java 38 ├── controller/{Entity}Controller.java 39 ├── service/{Entity}Service.java 40 ├── service/impl/{Entity}ServiceImpl.java 41 ├── repository/{Entity}Repository.java 42 └── mapper/{Entity}Mapper.java 43 44 text 45 46 ### 3. 代码模板示例 47 48 #### Entity 模板 49 ```java 50 @Entity 51 @Table(name = "{{tableName}}") 52 @Data 53 @Builder 54 @NoArgsConstructor 55 @AllArgsConstructor 56 public class {{Entity}} { 57 @Id 58 @GeneratedValue(strategy = GenerationType.IDENTITY) 59 private Long id; 60 61 {% for field in fields %} 62 @Column(name = "{{field.name}}", nullable = false) 63 private {{field.type}} {{field.name}}; 64 {% endfor %} 65 66 @CreatedDate 67 private LocalDateTime createdAt; 68 69 @LastModifiedDate 70 private LocalDateTime updatedAt; 71 } 72 4. 生成数据库迁移 73 自动创建 Flyway 迁移脚本: 74 75 sql 76 -- V{{timestamp}}__create_{{tableName}}_table.sql 77 CREATE TABLE {{tableName}} ( 78 id BIGINT AUTO_INCREMENT PRIMARY KEY, 79 {% for field in fields %} 80 {{field.name}} {{field.sqlType}} NOT NULL, 81 {% endfor %} 82 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 83 updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 84 ); 85 86 --- 87 > Source: [shuigedeng/taotao-cloud-project](https://github.com/shuigedeng/taotao-cloud-project) — distributed by [TomeVault](https://tomevault.io). 88 <!-- tomevault:4.0:skill_md:2026-06-30 -->
tomevault-io/skills-registry/tree/main/shuigedeng--taotao-cloud-project--taotao-cloud-project commit 9e22cfb16d
Frequently asked questions How do I install the Shuigedeng Taotao Cloud Project Taotao Cloud Project skill? Run npx skillmds@latest add tomevault-io/shuigedeng-taotao-cloud-project-taotao-cloud-project in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Shuigedeng Taotao Cloud Project Taotao Cloud Project skill do? 6. 自动化工作流 It is listed under DevOps & Infra on SkillMD.
Is Shuigedeng Taotao Cloud Project Taotao Cloud Project safe to use? This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Shuigedeng Taotao Cloud Project Taotao Cloud Project? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Shuigedeng Taotao Cloud Project Taotao Cloud Project free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Shuigedeng Taotao Cloud Project Taotao Cloud Project? tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.