Demo Create logo

Demo Create

Community
southliu
demo-create

基于项目中 .vscode/south.code-snippets 定义的 CRUD 模板,快速生成后台管理系统的标准 CRUD 页面代码。该技能根据用户提供的业务模块信息(如模块名称、API路径、字段配置等),自动生成完整的页面文件(Page)、数据模型文件(Model)和 API 接口文件(Api),支持分页列表页面(demoPage)、独立操作页面(demoOptionPage)两种页面模式。

Overview

Publishersouthliu
Repositorysouth-admin-react
Skill namedemo-create
Stars
580
Forks
108
Bundled files
3
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.

  • 3 bundled files

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

  • Open source

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

Installation

Install the Demo Create 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/southliu/south-admin-react/tree/main/.claude/skills/demo-create
  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/southliu/south-admin-react.git /tmp/south-admin-react
mkdir -p .claude/skills
cp -r /tmp/south-admin-react/.claude/skills/demo-create .claude/skills/demo-create
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Demo Create 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 Demo Create 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 Demo Create 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.

demo-create

Description

基于项目中 .vscode/south.code-snippets 定义的 CRUD 模板,快速生成后台管理系统的标准 CRUD 页面代码。根据用户提供的业务模块信息(模块名称、API路径、字段配置等),自动生成完整的页面文件(Page)、数据模型文件(Model)和 API 接口文件(Api),支持弹窗模式(demoPage)和独立页面模式(demoOptionPage)两种。

Instructions

1. 收集必要信息

在生成代码前,向用户确认以下信息(未提供则主动询问,一个一个询问):

  • moduleName:模块名称(英文 PascalCase),如 User、Article
  • apiPath:API 路径前缀,如 /system/user
  • permissionPrefix:权限前缀路径,如 /system/user
  • pageMode:modal(弹窗模式)或 page(独立页面模式)
  • enableI18n:是否开启国际化(true/false),开启时使用 t() 函数包裹标签文本
  • fatherPath:父路径(仅 page 模式),如 /system/user
  • zhTitle / enTitle:中英文标题(仅 page 模式),如 用户 / User
  • fields:业务字段列表,每个字段包含:
    • dataIndex(字段名)
    • label(标签)
    • component(组件类型:Input/InputNumber/Select/DatePicker/RangePicker/TextArea/Switch/Upload)
    • search(是否搜索项)
    • table(是否表格列)
    • form(是否表单字段)
    • required(是否必填)
    • width(表格列宽度,默认200)

2. 生成文件结构

Modal 模式
src/pages/{modulePath}/
├── index.tsx # 主页面(demoPage 模板)
└── model.ts # 数据模型(demoModel 模板)
src/servers/{modulePath}.ts # API 接口(demoApi 模板)
Page 模式
src/pages/{modulePath}/
├── index.tsx # 列表页(demoPage 模板,新增/编辑改为路由跳转)
├── model.ts # 数据模型(demoModel 模板)
└── option.tsx # 操作页(demoOptionPage 模板)
src/servers/{modulePath}.ts # API 接口(demoApi 模板)

3. 代码生成规则

3.1 通用替换规则

所有模板中进行以下替换:

  • getXXXPage → get{ModuleName}Page
  • getXXXById → get{ModuleName}ById
  • createXXX → create{ModuleName}
  • updateXXX → update{ModuleName}
  • deleteXXX → delete{ModuleName}
  • batchDeleteXXX → batchDelete{ModuleName}
  • API.URL = '/xxx' → 实际 apiPath
  • @/servers/xxx → @/servers/{实际模块路径}
  • permissionPrefix = '/xxx' → 实际权限前缀
  • fatherPath = '/xxx' → 实际父路径(page 模式)
3.2 API 文件(基于 south.code-snippets 中 demoApi 模板)

参照 .vscode/south.code-snippets 中 demoApi 的 body 内容生成,替换所有 XXX/xxx 为对应模块名称和路径。保持所有函数签名、类型定义和注释不变。

3.3 Model 文件(基于 south.code-snippets 中 demoModel 模板)

参照 .vscode/south.code-snippets 中 demoModel 的 body 内容生成:

  • searchList:仅包含 search: true 的字段,wrapperWidth 默认 200
    • enableI18n = true:label 使用 t('moduleName.fieldName') 格式
    • enableI18n = false:label 使用中文字符串
  • tableColumns:仅包含 table: true 的字段,始终保留 operate 操作列,width 默认 200
    • enableI18n = true:title 使用 t('moduleName.fieldName') 格式,保留 createdAt/updatedAt 使用 t('public.creationTime')/t('public.updateTime')
    • enableI18n = false:title 使用中文字符串
  • createList:仅包含 form: true 的字段,必填字段添加 rules: FORM_REQUIRED
    • enableI18n = true:label 使用 t('moduleName.fieldName') 格式
    • enableI18n = false:label 使用中文字符串
3.4 Page 文件(基于 south.code-snippets 中 demoPage 模板)

参照 .vscode/south.code-snippets 中 demoPage 的 body 内容生成:

  • RowData 接口:根据用户字段生成,始终包含 id: string
  • initCreate:设置合理的默认值(如 status: 1)
  • 替换 import 中的 API 函数名和路径
  • 替换 permissionPrefix
3.5 Option 文件(仅 page 模式,基于 south.code-snippets 中 demoOptionPage 模板)

参照 .vscode/south.code-snippets 中 demoOptionPage 的 body 内容生成:

  • 替换 fatherPath、zhTitle、enTitle
  • 替换 useSingleTab 中的标题
  • 替换 permissionPrefix

4. 国际化处理

根据 enableI18n 参数决定如何处理标签文本:

  • 开启国际化(enableI18n = true):所有标签使用 t() 函数包裹,如 t('public.name')、t('product.code')
  • 关闭国际化(enableI18n = false):所有标签使用中文字符串,如 '产品编码'、'产品名称'

5. 文件生成要求

重要:使用 Python 脚本生成代码,而不是手动输出代码块。

5.1 使用 Python 脚本生成
  1. 准备配置 JSON,包含所有收集的信息

  2. 调用 Python 脚本生成文件:

    bash
    python3 .claude/skills/demo-create/scripts/generate.py '<config_json>'

    或使用包装脚本:

    bash
    bash .claude/skills/demo-create/scripts/run.sh '<config_json>'
  3. 脚本会自动:

    • 创建必要的目录
    • 生成所有文件内容
    • 写入文件到正确位置
    • 运行 prettier 格式化
    • 输出生成进度
5.2 配置 JSON 格式
json
{
  "module_name": "Product",
  "api_path": "/product",
  "permission_prefix": "/product",
  "page_mode": "modal",
  "enable_i18n": true,
  "project_root": "/Users/south/Desktop/case/react-admin",
  "fields": [
    {
      "dataIndex": "name",
      "label_zh": "产品名称",
      "label_en": "Product Name",
      "component": "Input",
      "search": true,
      "table": true,
      "form": true,
      "required": true,
      "width": 200
    }
  ]
}

配置说明:

  • module_name: 模块名称(PascalCase,如 Product)
  • api_path: API 路径前缀(如 /product)
  • permission_prefix: 权限前缀(如 /product)
  • page_mode: 页面模式("modal" 或 "page")
  • enable_i18n: 是否开启国际化(true 或 false)
  • project_root: 项目根路径(可选,默认为当前目录)
  • fields: 字段配置数组

字段配置说明:

  • dataIndex: 字段名
  • label_zh: 字段中文标签(由 AI 根据字段名智能生成)
  • label_en: 字段英文标签(由 AI 根据字段名智能生成)
  • component: 组件类型(Input/InputNumber/Select/DatePicker/RangePicker/TextArea/Switch/Upload)
  • search: 是否作为搜索项
  • table: 是否作为表格列
  • form: 是否作为表单字段
  • required: 是否必填
  • width: 表格列宽度(默认200)

重要:AI 应根据字段的业务含义智能生成合适的中英文标签,而不是使用固定的映射表。例如:

  • name → "产品名称" / "Product Name"(在产品模块中)
  • name → "分类名称" / "Category Name"(在分类模块中)
  • title → "文章标题" / "Article Title"(在文章模块中)

6. 注意事项

  • 不修改模板中已有的工具函数、hooks、组件使用方式
  • 保持代码风格与模板一致(缩进、空行、注释)
  • 所有类型引用保持与模板一致:BaseFormData、PagePermission、BaseSearchList、TableColumn、TableOptions、PaginationData、PageServerResult
  • 保留所有工具函数引用:checkPermission、useCommonStore、usePublicStore、useTabsStore、INIT_PAGINATION、ADD_TITLE、EDIT_TITLE、FORM_REQUIRED、useSingleTab、useEffectOnActive、useTranslation、useLocation
  • 生成的代码应可直接使用,无需额外修改

7. 国际化文件生成(仅当 enableI18n = true 时)

当开启国际化时,额外生成以下文件:

7.1 中文国际化文件

文件路径:src/locales/zh/{moduleName}.ts

根据字段配置生成翻译对象,格式:

typescript
export default {
  fieldName1: '中文名称1',
  fieldName2: '中文名称2',
  // ...
};

注意:翻译内容由 AI 根据字段名和业务模块智能生成,例如:

  • 产品模块的 name → "产品名称"
  • 分类模块的 name → "分类名称"
  • 文章模块的 title → "文章标题"
7.2 英文国际化文件

文件路径:src/locales/en/{moduleName}.ts

格式同中文文件,使用英文翻译:

typescript
export default {
  fieldName1: 'Field Name 1',
  fieldName2: 'Field Name 2',
  // ...
};

注意:翻译内容由 AI 根据字段名和业务模块智能生成,例如:

  • 产品模块的 name → "Product Name"
  • 分类模块的 name → "Category Name"
  • 文章模块的 title → "Article Title"

8. 输出顺序

  1. API 文件(src/servers/{modulePath}.ts)
  2. Model 文件(src/pages/{modulePath}/model.ts)
  3. Page 文件(src/pages/{modulePath}/index.tsx)
  4. Option 文件(仅 page 模式,src/pages/{modulePath}/option.tsx)
  5. 中文国际化文件(仅 enableI18n = true,src/locales/zh/{moduleName}.ts)
  6. 英文国际化文件(仅 enableI18n = true,src/locales/en/{moduleName}.ts)

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 Demo Create AI skill do?

基于项目中 .vscode/south.code-snippets 定义的 CRUD 模板,快速生成后台管理系统的标准 CRUD 页面代码。该技能根据用户提供的业务模块信息(如模块名称、API路径、字段配置等),自动生成完整的页面文件(Page)、数据模型文件(Model)和 API 接口文件(Api),支持分页列表页面(demoPage)、独立操作页面(demoOptionPage)两种页面模式。

Why use Demo Create on TypingMind?

Because you install it once and use it with any model. Demo Create 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 Demo Create in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/southliu/south-admin-react/tree/main/.claude/skills/demo-create. 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 Demo Create?

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 Demo Create?

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

Is the Demo Create AI skill free?

Yes. It is published on GitHub by southliu 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 👇