dsh-spring-admin-kit
面向 Spring Boot + MyBatis Plus + Thymeleaf + LayUI 企业后台开发者的 DSH 技能插件,把两个实战验证过的技能打包为一个可安装的插件,通过 DSH 官方的运行时技能注册 API(ctx.skills.register())注入,模型可自动触发,用户也可在技能目录中手动调用。
内置技能
1. excel-batch-import-export
为后台管理页面实现 EasyExcel 批量导入/导出/模板下载三件套:
- 统一 VO(
@ExcelProperty 列头与 index 规范)
- Controller 三个端点(downloadTemplate / export / import)
- Service 层按业务唯一键 Upsert(
@Transactional + 空行过滤)
- Thymeleaf + LayUI 前端(
upload.render 在 table done 回调重绑、导出确认弹窗、<a> 模板链接)
- 附实现后检查清单
触发:批量导入、批量导出、导入模板、Excel导入、EasyExcel。
2. thymeleaf-layui-guard
Thymeleaf + LayUI 模板语法安全守卫,防止 cols: [[...]]、onclick="fn({...})" 等写法被 Thymeleaf 内联解析导致 TemplateInputException。含 6 条强制规则(th:inline="none"/"javascript" 分离、cols 写法、禁内联事件、块注释、变量注入标准写法、页面标准结构)与提交前检查清单。编辑 templates/**/*.html 时应激活。
触发:Thymeleaf、LayUI、模板页面、后台管理、cols、table.render。
安装(本地路径)
node "<DSH app>/node_modules/@deepseek-ai/dsh/lib/bin.js" plugin --profile web add /path/to/dsh-spring-admin-kit
安装后重启 / 刷新 DSH Desktop,在技能目录(或 /skill 列表)中应能看到两个技能;模型在匹配场景下会自动建议加载。
使用示例
- 「给门店列表页加批量导入、批量导出和模板下载」→ 自动匹配
excel-batch-import-export,按模板生成 VO/Controller/Service/前端代码。
- 「新建一个用户管理页面」→ 生成
templates/**.html 时按 thymeleaf-layui-guard 的 6 条规则产出安全模板。
- 手动调用:对话中直接说「用 thymeleaf-layui-guard 检查这个页面」。
设计说明
- 技能注册使用官方通道:插件作为 cordis host 服务加载,
inject: ["skills"] 后在 apply() 中对每个技能调用 ctx.skills.register(),SKILL.md 的 YAML front matter 提供官方 description,正文作为 content 注入。无需 slash command 或 hook 等替代方案。
- 兼容性对齐
dsh-subagent-sidebar(dsh: 0.1.7-alpha.1,profiles: ["web"])。
- 插件内不含任何用户本机路径或密钥;技能正文中出现的项目内相对路径仅为示例项目结构。
License
MIT
dsh-spring-admin-kit (English)
A DSH skill plugin for enterprise admin developers on Spring Boot + MyBatis Plus + Thymeleaf + LayUI. Bundles two battle-tested skills and injects them via DSH's official runtime-skill API (ctx.skills.register()); both are model-invocable automatically and user-invocable from the skill catalog.
Bundled skills
- excel-batch-import-export — EasyExcel batch import / export / template download for admin pages: unified VO, three controller endpoints, service-layer upsert by business key with
@Transactional, Thymeleaf+LayUI frontend wiring, plus a post-implementation checklist.
- thymeleaf-layui-guard — Template syntax safety rules preventing
TemplateInputException from cols: [[...]] / inline {...} clashes between Thymeleaf inline parsing and LayUI JS. Six mandatory rules and a pre-commit checklist.
Install (local path)
node "<DSH app>/node_modules/@deepseek-ai/dsh/lib/bin.js" plugin --profile web add /path/to/dsh-spring-admin-kit
Restart/refresh DSH Desktop; both skills then appear in the skill catalog and are triggered by their keywords.
Design notes
- Skills register through the official channel: the plugin loads as a cordis host service, injects the
skills service, and calls ctx.skills.register() once per bundled SKILL.md (front-matter description + markdown body as content). No slash-command or hook workaround is needed.
- Compatibility mirrors
dsh-subagent-sidebar (dsh: 0.1.7-alpha.1, profiles: ["web"]).
- No user-specific paths or secrets are hardcoded.
License
MIT