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/15-spring-rest-api-conventions)<a href="https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/15-spring-rest-api-conventions"><img src="https://agentmods.dev/badge/rules/movebrickschi/harness-engineering-mcp/15-spring-rest-api-conventions/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/movebrickschi/harness-engineering-mcp/15-spring-rest-api-conventions"><img src="https://agentmods.dev/badge/rules/movebrickschi/harness-engineering-mcp/15-spring-rest-api-conventions.svg" alt="Reviewed on agentmods" width="80" 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.01360 | $0.01360 |
| Opus 5.5 | $0.00544 | $0.00544 |
| Sonnet 5.5 | $0.00272 | $0.00272 |
| Haiku 4.5 | $0.00136 | $0.00136 |
Grade A, and why
15-spring-rest-api-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 3mo 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 — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Spring Boot REST API 编码约定
统一响应格式
所有 Controller 方法必须返回 R<T>,禁止直接返回裸对象或 ResponseEntity。
// ✅ 正确
@GetMapping("/{id}")
public R<UserVO> getUser(@PathVariable Long id) {
return R.ok(userService.findById(id));
}
@DeleteMapping("/{id}")
public R<Void> deleteUser(@PathVariable Long id) {
userService.delete(id);
return R.ok();
}
// ❌ 禁止
@GetMapping("/{id}")
public UserVO getUser(@PathVariable Long id) { ... }
@GetMapping("/{id}")
public ResponseEntity<UserVO> getUser(@PathVariable Long id) { ... }
URL 路径规范
| 前缀 | 用途 | 鉴权要求 |
|---|---|---|
/api/admin/... |
后台管理接口 | @PreAuthorize("@authGuard.isSysUser(authentication)") |
/api/app/... |
前台用户接口 | @PreAuthorize("@authGuard.isAppUser(authentication)") 或 @PublicApi |
RESTful 风格:
- 列表:
GET /api/admin/user/list或GET /api/admin/user/page - 详情:
GET /api/admin/user/{id} - 新增:
POST /api/admin/user - 修改:
PUT /api/admin/user/{id} - 删除:
DELETE /api/admin/user/{id}
依赖注入
统一使用构造器注入 + Lombok @RequiredArgsConstructor,禁止 @Autowired 字段注入。
// ✅ 正确
@RestController
@RequiredArgsConstructor
public class UserController {
private final UserService userService;
private final AuditLogService auditLogService;
}
// ❌ 禁止
@RestController
public class UserController {
@Autowired
private UserService userService;
}
权限与认证
后台接口
类级别添加 @PreAuthorize + @SecurityRequirement:
@SecurityRequirement(name = "Bearer")
@PreAuthorize("@authGuard.isSysUser(authentication)")
@RestController
@RequestMapping("/api/admin/xxx")
public class AdminXxxController { }
公开接口
无需登录的接口使用 @PublicApi 注解,SecurityConfig 自动放行:
@PublicApi
@GetMapping("/public/list")
public R<List<ItemVO>> publicList() { }
获取当前用户
使用 @AuthenticationPrincipal LoginUser 获取当前登录用户信息:
@PostMapping
public R<Void> create(@RequestBody @Valid CreateDTO dto,
@AuthenticationPrincipal LoginUser loginUser) {
Long userId = loginUser.getUserId();
// ...
}
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.
- 3mo ago First seen · 204 lines · 1,360 tokens per session scan A 9bfffd352e56
15-spring-rest-api-conventions is a cursor rule published in the GitHub repository movebrickschi/harness-engineering-mcp (2 stars, last pushed 6mo ago), licensed MIT. It adds 1,360 tokens to every session, about $0.0054 per session on Opus 5.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.
15-spring-rest-api-conventions compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| 15-spring-rest-api-conventionsmovebrickschi/harness-engineering-mcp | Cursor rule | 2 | 6mo ago | MIT | A | 1,360 | Cursor |
| springboot-jpa-best-practicesholtwood/awesome-cursorrules-zh | Cursor rule | 244 | 1mo ago | MIT | A | 0 | Cursor |
| graftcode-javagrft-dev/graftcode | Cursor rule | 1.2k | 12d ago | none | A | 4,704 | Cursor |
| spring-boot-architecturelsampaioweb/ai-instructions | Cursor rule | 1 | 15d ago | MIT | A | 0 | Cursor |
| spring-boot-http-clientlsampaioweb/ai-instructions | Cursor rule | 1 | 15d ago | MIT | A | 0 | Cursor |
| java-springboot-standardspallerana/agentic-loop-engineering-kit | Cursor rule | 4 | 5mo ago | Apache-2.0 | A | 0 | Cursor |
| spring-bootnedcodes-ok/cursorrules-collection | Cursor rule | 38 | 9mo ago | MIT | A | 478 | Cursor |