一键导入
taotao-cloud-project
**`.claude/skills/ttc-crud-generator/SKILL.md`** Use when this capability is needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
**`.claude/skills/ttc-crud-generator/SKILL.md`** Use when this capability is needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Morning update routine: merge Renovate PRs, rebase local work, apply chezmoi changes Use when this capability is needed.
Use when the user wants to set, change, or clear git commit co-authors for pair or mob programming.
Use when the user asks to install, add, or set up a package, tool, CLI, or application
Use when the user wants to fetch and contextualize a GitHub repository for future reference.
Use when writing or reviewing GitHub-flavored Markdown (README, issues, PRs, docs)
Copy content to my clipboard using `pbcopy`. Use when this capability is needed.
| name | taotao-cloud-project |
| description | **`.claude/skills/ttc-crud-generator/SKILL.md`** Use when this capability is needed. |
.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 -->