on-load-rule

on-load-rule is a cursor rule for Cursor from brunogama/ios-cursor-rules. It costs 1,161 tokens per session, scanned A, original, MIT.

Development rules for a Swift project using Clean Architecture and domain-driven design, ways of structuring code around business rules and clear layer boundaries.

In plain words
What is it for?
Use them when designing or changing Swift domain models, application use cases, adapters, infrastructure, repositories, events, or bounded contexts.
Why use it?
They help keep business logic independent from frameworks and prevent dependencies from crossing the architecture in the wrong direction.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/brunogama/ios-cursor-rules/on-load-rule
Clone the repo
git clone --depth 1 https://github.com/brunogama/ios-cursor-rules

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 on-load-rule

README.md
[![agentmods](https://agentmods.dev/badge/rules/brunogama/ios-cursor-rules/on-load-rule.svg)](https://agentmods.dev/rules/brunogama/ios-cursor-rules/on-load-rule)
Your own site
<a href="https://agentmods.dev/rules/brunogama/ios-cursor-rules/on-load-rule"><img src="https://agentmods.dev/badge/rules/brunogama/ios-cursor-rules/on-load-rule.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,161 This file is loaded in full into every session.
When invoked 1,161 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01161 $0.01161
Opus 5 $0.00580 $0.00580
Sonnet 5 $0.00232 $0.00232
Haiku 4.5 $0.00116 $0.00116

Measured 4d ago against content hash be0e4820f7c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

on-load-rule 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 4d 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.

.cursor/rules/on-load-rule.mdc · 148 lines

How it starts

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

Swift Project Development Guidelines

This guide outlines the critical development principles for this Swift project.

actions:

  • type: suggest message: |

    Critical Development Principles

    This Swift project follows strict architectural and code quality guidelines:

    1. Architecture

    We follow Clean Architecture with:

    • Domain Layer: Pure business logic, no frameworks
    • Application Layer: Use cases orchestrating domain entities
    • Interface Adapters Layer: Bridges between domain and external systems
    • Infrastructure Layer: Frameworks, drivers, and UI

    Key principle: Dependencies point inward. Outer layers depend on inner layers, never the reverse.

    2. Domain-Driven Design

    All domain modeling must use DDD tactical patterns:

    • Entities: Objects with identity (User, Order)
    • Value Objects: Immutable objects defined by their attributes (Email, Money)
    • Aggregates: Consistency boundaries with a single entry point (OrderAggregate)
    • Domain Events: Record important business events (OrderPlaced, PaymentReceived)
    • Repositories: Data access abstractions for aggregates

    Bounded Contexts define boundaries between different domain areas.

    3. Object Callisthenics

    Strictly follow these 9 rules:

    1. One level of indentation per method
    2. Don't use the ELSE keyword
    3. Wrap all primitives and strings
    4. Use first-class collections
    5. One dot per line (no method chaining)
    6. Don't abbreviate names
    7. Keep entities small (50 lines per class, 10 files per package)
    8. No classes with more than 2 instance variables
    9. No getters/setters/properties (focus on behavior)

    4. Testing Principles

    Every public function must have unit tests.

    Test coverage requirements:

    • Domain Layer: 100%
    • Application Layer: 100%
    • Interface Adapters: 90%+
    • Infrastructure: Critical paths

    Always follow AAA pattern (Arrange-Act-Assert).

    5. Package Structure

    Packages are organized by layer first, then by bounded context:

    Sources/
    ├── Domain/
    │   ├── [BoundedContext1]/
    │   ├── [BoundedContext2]/
    ├── Application/
    │   ├── [BoundedContext1]/
    │   ├── [BoundedContext2]/
    ├── InterfaceAdapters/
    │   ├── [BoundedContext1]/
    │   ├── [BoundedContext2]/
    └── Infrastructure/
        ├── [BoundedContext1]/
        ├── [BoundedContext2]/
    

    6. Naming Conventions

    • Domain classes: Business terms (User, Order, Product)
    • Use cases: VerbNoun format (CreateOrderUseCase, AuthenticateUserUseCase)
    • Protocols: Nouns or adjectives (UserRepository, Authenticatable)
    • Extensions: Extended type + feature (String+Validation)

    7. Error Handling

    • Domain errors should be typed, not strings (enum OrderError)
    • Use Swift's Result type for operations that can fail
    • Fail early and explicitly
    • Prefer throwing specific errors over optionals for failure cases

    8. Dependency Injection

    • Dependencies must be explicit through constructor injection
    • Use protocols to define dependencies, not concrete classes
    • Do not use service locators or global singletons

    9. Documentation Requirements

    • Domain models: Full documentation with business purpose
    • Use cases: Documentation with inputs, outputs, and errors
    • Public APIs: Fully documented with examples
    • Tests: Clear arrange-act-assert sections

    10. Code Review Checklist

    • Follows Clean Architecture dependencies
    • Adheres to DDD principles
    • Satisfies Object Callisthenics rules
    • Has required test coverage
    • Properly documented
    • No code smells

Read the full file on GitHub · 148 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. 4d ago First seen · 148 lines · 1,161 tokens per session scan A be0e4820f7c9

Subscribe to this mod's changes

on-load-rule is a cursor rule published in the GitHub repository brunogama/ios-cursor-rules (74 stars, last pushed 1y ago), licensed MIT. It adds 1,161 tokens to every session, about $0.0058 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-30.