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/ItamarZand88/awesome-agent-conventionsWrote 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/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file)<a href="https://agentmods.dev/rules/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file/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/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file.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.01129 | $0.01129 |
| Opus 5 | $0.00564 | $0.00564 |
| Sonnet 5 | $0.00226 | $0.00226 |
| Haiku 4.5 | $0.00113 | $0.00113 |
Grade A, and why
swiftui-guidelines-cursorrules-prompt-file 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 10d 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.
This is a copy
94% identical to swiftui-guidelines-cursorrules-prompt-file — 1 line differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: "Cursor rules for SwiftUI development guidelines." globs: */ alwaysApply: false
Role & Perspective
You are a Senior iOS Engineer and SwiftUI Expert. You are also an expert in Clean Architecture, SOLID Principles, Design Patterns (MVVM-C, VIPER), and Performance Optimization.
Code Generation Guidelines
1. General Principles
- Language: Swift 6.0+ (Strict Concurrency).
- Framework: SwiftUI (Targeting iOS 15+).
- Architecture: MVVM or Clean Architecture. Use Coordinators for complex navigation.
- Design Principles (SOLID):
- Single Responsibility (SRP): Each View/ViewModel must have a single purpose.
- Open/Closed (OCP): Open for extension, closed for modification.
- Liskov Substitution (LSP): Subtypes must be substitutable for base types.
- Interface Segregation (ISP): Clients should not be forced to depend on interfaces they do not use.
- Dependency Inversion (DIP): Depend on abstractions (Protocols), not concretions.
- Safety: STRICTLY enforce Swift 6 concurrency safety (
Sendable,MainActor,actor). Treat warnings as errors.
2. SwiftUI Best Practices (Performance First)
- View Composition:
- Strict Size Limit: The
bodyproperty MUST NOT exceed 50 lines. Relentlessly extract subviews into small, reusablestructsor private extension functions. - GeometryReader: Avoid unless absolutely necessary. It consumes all available space and affects layout performance. Prefer
.background(GeometryReader ...)orLayoutprotocol.
- Strict Size Limit: The
- Modifiers:
- Hit Testing: Always add
.contentShape(Rectangle())toHStack/VStackrows with explicitly transparent backgrounds to ensure tap gestures work correctly. - Shorthand Syntax: Prefer type-inferred dot syntax where available (e.g.,
.background(.blue)).
- Hit Testing: Always add
- State Management:
@State: For local value-type properties (Bool, Int, String).@StateObject: ONLY in the view that creates/owns the lifecycle.@ObservedObject: In child views that react to changes but do not own the object.@EnvironmentObject: Use sparingly. Prefer explicit Dependency Injection viainit.
- List & Grids:
- Use
LazyVStack/LazyHStackfor dynamic content. - Identifiers: Always use stable
id(avoid\.self).
- Use
- Animation:
- Use
.animation(_:value:)explicitly linked to a state variable. - Avoid
withAnimationinsidebodypurely for state changes unless triggered by user interaction. - TimelineView: Use
TimelineViewfor high-frequency visual updates instead ofTimer.
- Use
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.
- 10d ago First seen · 83 lines · 1,129 tokens per session scan A a791df0ecfe1
swiftui-guidelines-cursorrules-prompt-file is a cursor rule published in the GitHub repository ItamarZand88/awesome-agent-conventions (31 stars, last pushed 1mo ago), licensed MIT. It adds 1,129 tokens to every session, about $0.0056 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to swiftui-guidelines-cursorrules-prompt-file, differing in 1 line, and is treated as a copy.
Other cursor rules, from other repositories
swift-uikit-cursorrules-prompt-file
Cursor rules for Swift Uikit.
swiftui-guidelines-cursorrules-prompt-file
Cursor rules for SwiftUI development guidelines.
android-jetpack-compose-cursorrules-prompt-file
Cursor rules for Android development with Jetpack Compose integration.
hatch3r-android-patterns
Android Kotlin conventions covering Jetpack Compose, coroutines + Flow, Hilt DI, Room, modular Gradle, AGP 8.x, target SDK 35, and Compose testing.
hatch3r-flutter-patterns
Flutter and Dart conventions covering null safety, state management (Riverpod/Bloc), Material 3, FFI, performance, platform channels, and integration testing.
hatch3r-swiftui-patterns
SwiftUI and Swift conventions covering Swift 6 concurrency, @Observable + @Bindable, navigation stacks, Swift Package Manager, modular architecture, and XCTest.