Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/movebrickschi/harness-engineering-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/14-mybatis-plus-conventions)<a href="https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/14-mybatis-plus-conventions"><img src="https://agentmods.dev/badge/rules/movebrickschi/harness-engineering-mcp/14-mybatis-plus-conventions.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01036 | $0.01036 |
| Opus 5 | $0.00518 | $0.00518 |
| Sonnet 5 | $0.00207 | $0.00207 |
| Haiku 4.5 | $0.00104 | $0.00104 |
Grade A, and why
14-mybatis-plus-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MyBatis-Plus 使用规范
Mapper 定义
所有 Mapper 接口继承 BaseMapper<T>,添加 @Mapper 注解:
@Mapper
public interface XxxMapper extends BaseMapper<Xxx> { }
查询构造器
优先使用 LambdaQueryWrapper / LambdaUpdateWrapper(类型安全),禁止使用字符串列名。
// ✅ 正确:Lambda 方式,编译时检查
LambdaQueryWrapper<SysRole> wrapper = new LambdaQueryWrapper<SysRole>()
.eq(SysRole::getRoleCode, roleCode)
.eq(SysRole::getTenantId, tenantId)
.orderByDesc(SysRole::getCreatedAt);
// ❌ 禁止:字符串列名,重构时易出错
QueryWrapper<SysRole> wrapper = new QueryWrapper<SysRole>()
.eq("role_code", roleCode);
条件构造支持动态条件(第一个参数为 boolean):
wrapper.eq(StringUtils.isNotBlank(name), SysRole::getRoleName, name);
自定义 SQL
简单的关联查询使用 @Select 注解直接写在 Mapper 接口上。复杂 SQL(动态条件多、超过 5 行)才使用 XML Mapper。
@Select("SELECT DISTINCT m.* FROM sys_menu m " +
"INNER JOIN sys_role_menu rm ON rm.menu_id = m.id " +
"WHERE rm.role_id = #{roleId} AND m.status = 1 " +
"ORDER BY m.sort_order")
List<SysMenu> selectMenusByRoleId(@Param("roleId") Long roleId);
分页查询
统一使用 MyBatis-Plus 的 Page<T> + IPage<T>,不要手写 LIMIT/OFFSET。
// Controller
@GetMapping("/list")
public R<IPage<UserVO>> list(
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size) {
Page<User> pageParam = new Page<>(page, size);
IPage<UserVO> result = userService.findByPage(pageParam);
return R.ok(result);
}
// Service / Mapper
IPage<User> selectPage(Page<User> page, @Param("ew") Wrapper<User> wrapper);
Entity 继承与审计字段
所有业务实体必须继承 BaseEntity,自动获得 createdAt、updatedAt、createBy、createByType、updateBy、updateByType 六个审计字段,由 AuditMetaObjectHandler 自动填充。
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("xxx")
public class Xxx extends BaseEntity {
@TableId(type = IdType.AUTO)
private Long id;
private Long tenantId;
// ... 业务字段 ...
}
逻辑删除
需要逻辑删除的表在 Entity 字段上标记 @TableLogic:
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 126 lines · 1,036 tokens per session scan A 296cb010dd0b
14-mybatis-plus-conventions is a cursor rule published in the GitHub repository movebrickschi/harness-engineering-mcp (2 stars, last pushed 3mo ago), licensed MIT. It adds 1,036 tokens to every session, about $0.0052 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
prefer-assertions-over-defensive-checks
Prefer assertions over defensive checks when data is guaranteed to be valid.
as-contract-cast-smell
// ❌ WRONG — bypasses the family ContractSerializer seam const contract = JSON.parse(raw) as Contract; const contract = JSON.parse(raw) as Contract .
no-backward-compatibility
Do not add backward-compatibility shims or migration scaffolding.
postgresql
This guide defines the definitive best practices for writing clean, performant, and maintainable PostgreSQL SQL, focusing on modern conventions and avoiding common pitfalls.
query-optimization
A database performance rule that requires measuring PostgreSQL queries with EXPLAIN ANALYZE under the same user permissions and row-level security (RLS) conditions used in production.
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.