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/mywand/cusrsor-do-itWrote 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/mywand/cusrsor-do-it/database)<a href="https://agentmods.dev/rules/mywand/cusrsor-do-it/database"><img src="https://agentmods.dev/badge/rules/mywand/cusrsor-do-it/database/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/mywand/cusrsor-do-it/database"><img src="https://agentmods.dev/badge/rules/mywand/cusrsor-do-it/database.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.10817 | $0.10817 |
| Opus 5.5 | $0.04327 | $0.04327 |
| Sonnet 5.5 | $0.02163 | $0.02163 |
| Haiku 4.5 | $0.01082 | $0.01082 |
Grade A, and why
database 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 1mo 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 — 1,380 lines — stays where its author put it; the contents beside it link to each section on GitHub.
最近更新: 2025-12-28
数据库设计规范
涵盖数据库设计、建模、索引、约束、事务等核心规范
1. 外键约束原则
1.1 核心规则
- 禁止物理外键:在数据库层面不要添加物理外键关联(FOREIGN KEY 约束)
- 业务逻辑层处理:表之间的关联关系仅在业务逻辑层(应用层)进行维护和校验
1.2 原因说明
| 维度 | 说明 |
|---|---|
| 灵活性 | 避免级联删除/更新带来的意外影响,业务逻辑更可控 |
| 扩展性 | 便于分库分表和水平扩展,不受外键约束限制 |
| 性能 | 减少数据库层面的锁竞争,提高并发性能 |
| 维护性 | 支持更灵活的关联关系变更,无需修改数据库结构 |
1.3 实践示例
-- ❌ 不推荐:使用物理外键
CREATE TABLE orders (
id BIGINT PRIMARY KEY,
user_id BIGINT NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- ✅ 推荐:不使用物理外键,在业务逻辑层校验
CREATE TABLE orders (
id BIGINT PRIMARY KEY,
user_id BIGINT NOT NULL,
INDEX idx_user_id (user_id) -- 仅添加索引以优化查询性能
-- 不在数据库层面添加 FOREIGN KEY 约束
);
2. 关联关系维护
2.1 维护原则
- 应用层校验:在应用层通过代码逻辑保证数据一致性
- 事务保证:使用事务确保关联操作的原子性
- 约束替代:通过唯一索引保证业务层面的唯一性约束
2.2 Java 示例
// ✅ 在业务逻辑层进行关联校验
public class OrderService {
@Transactional
public Order createOrder(CreateOrderRequest request) {
// 1. 在业务逻辑层验证用户是否存在
User user = userRepository.findById(request.getUserId())
.orElseThrow(() -> new BusinessException("用户不存在"));
// 2. 验证商品库存
for (OrderItem item : request.getItems()) {
Product product = productRepository.findById(item.getProductId())
.orElseThrow(() -> new BusinessException("商品不存在"));
if (product.getStock() < item.getQuantity()) {
throw new BusinessException("商品库存不足");
}
}
// 3. 创建订单(在事务中保证原子性)
Order order = new Order();
order.setUserId(request.getUserId());
order.setStatus(OrderStatus.PENDING);
order = orderRepository.save(order);
// 4. 创建订单项并扣减库存
for (OrderItem item : request.getItems()) {
item.setOrderId(order.getId());
orderItemRepository.save(item);
productRepository.decreaseStock(item.getProductId(), item.getQuantity());
}
return order;
}
}
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.
- 1mo ago First seen · 1,380 lines · 10,817 tokens per session scan A d178615dff6f
database is a cursor rule published in the GitHub repository mywand/cusrsor-do-it (2 stars, last pushed 9mo ago), licensed Apache-2.0. It adds 10,817 tokens to every session, about $0.0433 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.
Other cursor rules, from other repositories
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.
ehs-ims-conventions
EHS IMS app — RBAC, data layer, tRPC, migrations, AI boundaries.
sync-timedb-archive-janitor-contract
Day-close / cold-path worker contracts for synctimedb (A invariants; B tick coordinator retired).
schema
Scalable and secure schema design patterns for relational databases, NoSQL, and APIs. / TR: İlişkisel veri tabanları, NoSQL ve API'ler için ölçeklenebilir ve güvenli şema tasarım kalıpları.