Xbatis
npx -y skills add chengliang4810/jimuqu-skills --skill xbatisAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
辅助开发、迁移、调试和解释 Xbatis ORM / SQL API。只要用户提到 Xbatis、cn.xbatis、QueryChain、UpdateChain、DeleteChain、BaseMapper、MybatisMapper、@Table/@TableId/@TableField、@Condition/@ConditionTarget、逻辑删除、乐观锁、租户、分表、嵌套 VO、mapWithKey、SQL 模板、分页、AutoTable 组合使用,或需要根据 Xbatis 官方开源仓库确认 API 与机制,都必须使用此技能。此技能只记录通用 Xbatis 能力,不写入某个业务项目的专属规范。
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.1 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Xbatis Skill
你在辅助 Xbatis 开发。Xbatis 公开资料相对少,回答和实现必须优先以目标项目依赖版本和官方源码为准,而不是套用 MyBatis-Plus、JPA 或通用 MyBatis 习惯。
官方仓库:https://gitee.com/xbatis/xbatis
首要原则
- 先判定任务类型:实体映射、Mapper/DAO、链式查询、条件对象、分页、增删改、逻辑删除、乐观锁、租户/分表、VO 映射、SQL 模板、问题排查。
- 优先查证官方源码:不确定的注解、方法、参数语义、返回类型、模块依赖必须在官方仓库或目标项目依赖源码中查证。
- 避免框架惯性:不要默认使用 MyBatis-Plus 的
Wrapper、IService、BaseMapper语义,也不要套 JPA 注解或 Spring Data 写法。 - 区分通用框架与项目规范:本技能只说明 Xbatis 通用能力。具体项目的目录结构、权限、返回包装、BaseMapperPlus 等以项目技能或项目文档为准。
- 输出要可落地:给 Java 代码、依赖坐标、查询链写法、注解写法和验证方式;机制解释要引用
path:line。
资料入口
按任务读取对应 reference,必要时再读源码:
- 仓库结构、模块与源码入口:
references/source-map.md - 实体、注解、主键、默认值:
references/entity-annotations.md - QueryChain / UpdateChain / DeleteChain 与 Mapper:
references/chain-and-mapper.md - 条件对象、分页、返回映射:
references/condition-paging-result.md - 高级能力与排查:
references/advanced-debugging.md
如果任务很具体,直接 grep 源码优先于泛读 reference。
工作流
业务开发
- 查当前项目已有 Xbatis 写法与封装;如果当前项目有专属技能,先遵守项目技能。
- 读取本技能对应 reference,确认 Xbatis 原生 API。
- 写实体/Mapper/查询链时用当前项目已有封装承接 Xbatis 能力;不要把某项目的封装当成 Xbatis 原生 API。
- 验证:至少编译;涉及 SQL 行为时优先写或运行相关单测,或输出生成 SQL/预期条件。
源码机制解释
- 定位源码:在 Xbatis 官方仓库根目录执行
rg "class QueryChain|@interface Condition|interface BaseMapper"。 - 读取定义和测试用例,不只读 README。
- 输出结构:结论 → 关键源码路径 → 机制流程 → 使用建议/坑点。
问题排查
- 收集实体注解、Mapper 类型、链式调用、异常堆栈、数据库类型与依赖版本。
- 对照源码确认失败点:实体未标
@Table、未指定 entityType、Query 对象 target/storey 错误、分页对象不兼容、逻辑删除/租户自动条件、返回类型自动 select 等。 - 给最小修复,不做无关重构。
常用查证命令
# 核心链式 API 与 Mapper
rg "class QueryChain|class UpdateChain|class DeleteChain|interface BaseMapper|interface MybatisMapper" xbatis-core/src/main/java
# 核心注解
rg "@interface Table|@interface TableId|@interface TableField|@interface Condition|@interface ConditionTarget" xbatis-annotation/src/main/java
# 测试示例
rg "QueryChain.of|UpdateChain.of|DeleteChain.of|mapWithKey|returnType|paging" xbatis-core/src/test/java
输出规范
- 用中文说明;Java 标识符保持原样。
- 涉及源码机制时必须引用
path:line。 - 涉及 API 不确定时,先查证再回答;查不到就明确说“源码中未确认”。
- 代码示例尽量短,优先贴近 Xbatis 官方源码和测试示例。
- 明确哪些是 Xbatis 原生能力,哪些是项目自定义封装。
What ships with it: 5 files
16.2 KB alongside SKILL.md
references/
- advanced-debugging.md3.5 KB
- chain-and-mapper.md3.4 KB
- condition-paging-result.md3.3 KB
- entity-annotations.md2.9 KB
- source-map.md3.0 KB
Gives 0 of the 12 instructions most databases sql skills give in ~1.2k tokens
Counted across 589 of the 662 authors here whose files we hold, read 2026-08-07
- Use parameterized queriesin 37 of 589, across 34 files
- Use timestamptz for timestampsin 30 of 589, across 14 files
- Index foreign keysin 29 of 589, across 18 files
- Create indexes concurrentlyin 29 of 589, across 24 files
- Use numeric type for moneyin 25 of 589, across 8 files
- Use cursor pagination instead of offsetin 24 of 589, across 17 files
- Select only required columnsin 24 of 589, across 20 files
- Add indexes manually on foreign key columnsin 22 of 589, across 12 files
- Normalize to third normal formin 19 of 589, across 10 files
- Configure connection poolingin 19 of 589, across 17 files
- Put equality columns before range columns in indexesin 18 of 589, across 10 files
- Read individual rule files for detailed explanationsin 18 of 589, across 4 files
Said here and by no other author read
- determine task type first
- verify against official source code
- avoid mybatis-plus or jpa conventions
- grep source code for specific tasks
- compile the code
- write tests for sql behavior
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.