OmoiOS: Cursor rule for Cursor

.cursorrules

cursorrules is a cursor rule for Cursor from kivo360/OmoiOS. It costs 698 tokens per session, scanned A, original, Apache-2.0.

A project-specific rule sheet for an AI coding assistant working on OmoiOS Python code, especially SQLAlchemy database models. SQLAlchemy is a Python library for defining and working with database tables.

In plain words
What is it for?
Use it when creating or editing OmoiOS SQLAlchemy models, checking JSON database fields, or reviewing model inheritance, relationships, and naming.
Why use it?
It prevents the assistant from using attribute names that SQLAlchemy reserves and guides it toward consistent names for model fields and relationships.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions CLAUDE.md; mentions Cursor.

This is kivo360/OmoiOS's own configuration. It tells Cursor how to work on OmoiOS itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything OmoiOS configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kivo360/OmoiOS. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kivo360/OmoiOS/main/.cursorrules
Clone the repo
git clone --depth 1 https://github.com/kivo360/OmoiOS

Made for: Cursor.

Wrote 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.

agentmods badge for cursorrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/kivo360/omoios/cursorrules/github.svg)](https://agentmods.dev/rules/kivo360/omoios/cursorrules)
Your own site
<a href="https://agentmods.dev/rules/kivo360/omoios/cursorrules"><img src="https://agentmods.dev/badge/rules/kivo360/omoios/cursorrules/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.

agentmods 80×15 button for cursorrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/kivo360/omoios/cursorrules"><img src="https://agentmods.dev/badge/rules/kivo360/omoios/cursorrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 698 This file is loaded in full into every session.
When invoked 698 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00698 $0.00698
Opus 5.5 $0.00279 $0.00279
Sonnet 5.5 $0.00140 $0.00140
Haiku 4.5 $0.00070 $0.00070

Measured 1mo ago against content hash 3c1751ff67e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cursorrules 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.

.cursorrules · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor Rules for OmoiOS Project

You are an AI assistant working with the OmoiOS codebase. Follow these rules when working with Python files, especially those containing SQLAlchemy models.

SQLAlchemy Model Rules (CRITICAL)

Reserved Keywords - ABSOLUTELY FORBIDDEN

NEVER use these attribute names in SQLAlchemy model classes:

  • metadata - RESERVED by SQLAlchemy Declarative API
  • registry - RESERVED by SQLAlchemy internal system
  • declared_attr - RESERVED by SQLAlchemy declarative system

Safe Alternatives for Common Patterns

  • For change tracking: change_metadata, item_metadata, config_data, extra_data
  • For registry patterns: agent_registry, service_registry, component_registry
  • For dynamic attributes: custom_field, dynamic_attribute, computed_field

Model Validation Checklist

When editing or creating SQLAlchemy models, ALWAYS check:

  1. No metadata attributes in model classes
  2. No registry attributes in model classes
  3. No declared_attr attributes in model classes
  4. All JSONB fields use descriptive names ending with _data, _config, or _metadata
  5. Model inherits from Base correctly
  6. All relationships are properly typed

Trigger Patterns

Apply these rules when files contain:

  • from sqlalchemy import or import sqlalchemy
  • class.*Base) (SQLAlchemy model inheritance)
  • Mapped[, mapped_column, relationship
  • File paths: **/models.py, **/model*.py

Error Prevention

If you see metadata: as a model attribute, IMMEDIATELY:

  1. Stop the operation
  2. Alert the user to the SQLAlchemy conflict
  3. Suggest alternatives: change_metadata, item_metadata, etc.
  4. Reference the CLAUDE.md rule for detailed explanation

General Python Best Practices

Type Safety

  • Use proper type hints for all function parameters and return values
  • Prefer Mapped[T] over Column(T) for SQLAlchemy models
  • Use Optional[T] for nullable database fields

Import Organization

  1. Standard library imports first
  2. Third-party imports second (sqlalchemy, pydantic, fastapi)
  3. Local imports third (omoi_os.*)
  4. Use relative imports within the same package

Read the full file on GitHub · 82 lines

Changes

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.

  1. 1mo ago First seen · 82 lines · 698 tokens per session scan A 3c1751ff67e9

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository kivo360/OmoiOS (81 stars, last pushed 14d ago), licensed Apache-2.0. It adds 698 tokens to every session, about $0.0028 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-30.