Proj Gen logo

Proj Gen

Community
zhangloveyan
proj-gen

代码生成统一入口。生成 SQL、CRUD、API、枚举等代码。

Overview

Publisherzhangloveyan
Repositorybackend-skill
Skill nameproj-gen
Stars
102
Forks
31
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by zhangloveyan on GitHub. Read the source before you install it.

Installation

Install the Proj Gen AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhangloveyan/backend-skill/tree/main/.claude/skills/proj-gen
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhangloveyan/backend-skill.git /tmp/backend-skill
mkdir -p .claude/skills
cp -r /tmp/backend-skill/.claude/skills/proj-gen .claude/skills/proj-gen
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Proj Gen in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Proj Gen on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Proj Gen is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

代码生成

统一入口,根据参数生成不同类型的代码。

使用方式

/proj-gen sql      - 生成建表 SQL
/proj-gen crud     - 生成完整 CRUD 代码
/proj-gen api      - 生成单个接口
/proj-gen enum     - 生成枚举类
/proj-gen          - 自动模式(读取技术方案文档)

前置检查

  • 全流程任务文档已创建并可追溯
  • 技术方案已确认且路径已记录在产物清单
  • 任务清单已拆分并确认
  • 涉及新增或重命名的数据库表、字段时,按 SQL 命名规范 校验目标 MySQL 精确版本的全部关键字(含非保留关键字);范围包括 Entity 最终映射的列名,适用于 SQL、CRUD 和自动模式。新名称冲突修正后再生成,未核实版本或关键字清单时标记待核验,不得声称检查通过。已有冲突名称先记录影响并提出迁移方案,未经确认不得自动改名或改变映射。

未满足前置条件时:先补文档/确认流程,禁止生成代码。


自动模式

当存在技术方案文档时,直接执行 /proj-gen,自动:

  1. 从任务文档的产物清单读取技术方案路径
  2. 提取表结构、实体、接口等信息
  3. 按顺序生成:SQL → Entity → Mapper → DTO → Service → Controller

同步更新任务文档:

  • 流程状态总览标记“代码生成”为进行中/已完成
  • 产物清单记录生成代码清单或路径
  • 更新下一步指令为“业务开发”

触发时机:任务拆分完成后,开始编码前。

注意:自动模式生成的是代码骨架,业务逻辑仍需手动实现。


1. 生成 SQL (/proj-gen sql)

输入参数

参数必填说明示例
表名是小写下划线feedback
表描述是中文建议反馈
业务字段是字段列表

字段类型、通用字段与建表模板


2. 生成 CRUD (/proj-gen crud)

输入参数

参数必填说明示例
模块名是小写feedback
实体名是大驼峰Feedback
表名是小写下划线feedback
中文描述是建议反馈
端类型是Web/App/Both

生成文件清单

core/{module}/
├── entity/{Entity}.java
├── mapper/{Entity}Mapper.java
├── service/{Entity}Service.java
└── service/impl/{Entity}ServiceImpl.java

admin/  (Web端)
├── controller/{Entity}Controller.java
├── service/{Entity}ManageService.java
├── service/impl/{Entity}ManageServiceImpl.java
└── model/
    ├── request/{Entity}CreateRequest.java
    ├── request/{Entity}UpdateRequest.java
    ├── request/{Entity}QueryRequest.java
    └── response/{Entity}Response.java

api/  (App端)
├── controller/{Entity}Controller.java
├── service/{Entity}AppService.java
└── model/...

代码模板


3. 生成 API (/proj-gen api)

输入参数

参数必填说明示例
模块名是已有模块user
端类型是Web/AppWeb
HTTP方法是GET/POST/PUT/DELETEPOST
路径是接口路径/export
功能描述是中文导出用户

常用接口模板

参考 API 接口示例


4. 生成枚举 (/proj-gen enum)

输入参数

参数必填说明示例
枚举名是大驼峰FeedbackStatus
模块名是所属模块feedback
描述是中文反馈状态
枚举值是code-desc0-待处理, 1-已处理

枚举模板

参考 枚举模板


自检清单

  • 命名符合规范(参考 CLAUDE.md)
  • 新增或重命名的表、字段已通过目标 MySQL 版本关键字检查(大小写不敏感、完整名称匹配),并记录来源和结果;没有使用反引号绕过命名规则
  • 已有冲突名称的迁移已确认,DDL、Entity 映射、Mapper SQL、索引引用、测试和文档保持一致
  • 通用字段完整
  • 必填字段有校验注解
  • 写操作有 @ApiLog
  • 接口路径符合 RESTful
  • 每个字段有注释/Schema
  • 类属性赋值优先使用 BeanUtil.copyProperties
  • 返回日期字段必须添加 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

详细模板文件

以下模板包含完整代码示例和注意事项:

模板文件说明
SQL 建表sql-reference.md字段类型、索引规范
Entity 实体entity.md实体类模板
Mapper 接口mapper.md数据访问层
Service 服务service.md业务逻辑层
Controller 控制器controller.md接口层
DTO 传输对象dto.md请求响应对象
枚举类enum.md枚举定义

命名规范详细说明

基础命名规则

类型规则示例
类名大驼峰UserService
方法/变量小驼峰getUserById
常量大写下划线MAX_PAGE_SIZE
表名小写下划线,单数,避开 MySQL 关键字sys_user, order_item
字段名小写下划线user_id, create_time

类命名约定

类型格式示例
实体类{Entity}User, FeedbackType
Mapper{Entity}MapperUserMapper
Service 接口{Entity}ServiceUserService
Service 实现{Entity}ServiceImplUserServiceImpl
Controller{Entity}ControllerUserController
请求DTO{Entity}CreateRequest / {Entity}UpdateRequestUserCreateRequest
响应DTO{Entity}ResponseUserResponse
枚举类{业务}Status / {业务}TypeFeedbackStatus

接口规范详细说明

URL 格式规范

标准格式:/{项目}/{端类型}/v{版本}/{模块}/{资源}

端类型说明:

  • web - 管理后台
  • api - App端/小程序
  • open - 开放接口

示例:

  • /toy/api/v1/feedback - 小程序反馈接口
  • /toy/web/v1/user - 管理后台用户接口

RESTful 路径规范

操作HTTP方法路径格式示例
列表查询GET/{module}GET /toy/api/v1/feedback
详情查询GET/{module}/{id}GET /toy/api/v1/feedback/123
创建POST/{module}POST /toy/api/v1/feedback
更新PUT/{module}/{id}PUT /toy/api/v1/feedback/123
删除DELETE/{module}/{id}DELETE /toy/api/v1/feedback/123

响应格式规范

统一响应格式:

json
{
  "code": 0,
  "message": "成功",
  "data": {}
}

分页响应格式:

json
{
  "code": 0,
  "message": "成功",
  "data": {
    "records": [],
    "total": 100,
    "current": 1,
    "size": 20
  }
}

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Proj Gen AI skill do?

代码生成统一入口。生成 SQL、CRUD、API、枚举等代码。

Why use Proj Gen on TypingMind?

Because you install it once and use it with any model. Proj Gen is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Proj Gen in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhangloveyan/backend-skill/tree/main/.claude/skills/proj-gen. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Proj Gen?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Proj Gen?

As many as you like. As long as a model supports skills, you can use Proj Gen with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Proj Gen AI skill free?

Yes. It is published on GitHub by zhangloveyan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇