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/theimaginaryfoundation/what-iffWrote 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/theimaginaryfoundation/what-iff/ent)<a href="https://agentmods.dev/rules/theimaginaryfoundation/what-iff/ent"><img src="https://agentmods.dev/badge/rules/theimaginaryfoundation/what-iff/ent/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/theimaginaryfoundation/what-iff/ent"><img src="https://agentmods.dev/badge/rules/theimaginaryfoundation/what-iff/ent.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.00000 | $0.00430 |
| Opus 5 | $0.00000 | $0.00215 |
| Sonnet 5 | $0.00000 | $0.00086 |
| Haiku 4.5 | $0.00000 | $0.00043 |
Grade A, and why
ent 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 yesterday.
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.
What it actually says
Ent ORM Best Practices
This document outlines our best practices for using Ent as the ORM layer in this project.
Schema Structure
- All entity schemas should implement the
ent.Schemainterface - Always include descriptive comments for each schema type
- Implement the four main methods for each schema:
Fields(): Define all fields of the entityEdges(): Define relationships to other entitiesIndexes(): Define database indexes for query optimizationMixin(): Include shared behaviors like timestamps
Primary Keys
- Use UUID v4 as the primary key for all entities
- Always set UUIDs to be immutable and auto-generated:
field.UUID("id", uuid.UUID{}).
Default(uuid.New).
Immutable()
Field Validation
- Add appropriate validation to all fields:
- Use
NotEmpty()for required string fields - Use
Positive()orNonNegative()for numeric fields that should be ≥ 0 - Use
Range()for fields with specific bounds (e.g., percentages)
- Use
- Mark optional fields with
Optional()and provide sensible defaults withDefault()
Indexes
- Create indexes for fields commonly used in queries
- Use composite indexes for fields frequently queried together
- Always index foreign key fields and fields used for filtering
Time Tracking
- Use the
TimeMixinfor all entities to track creation and update times - Always include the TimeMixin in your schema's
Mixin()method:
func (YourEntity) Mixin() []ent.Mixin {
return []ent.Mixin{
TimeMixin{},
}
}
Edge Relationships
- Define clear and meaningful relationships between entities when applicable
- Document the cardinality and purpose of each relationship
Code Style
- Use descriptive field and edge names
- Follow Go naming conventions for schema types (PascalCase)
- Keep field definitions clean and aligned for readability
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.
- yesterday First seen · 66 lines · 0 tokens per session scan A 3edce0d310c6
ent is a cursor rule published in the GitHub repository theimaginaryfoundation/what-iff (15 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 430 tokens. 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-09-09.
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.