swiftui-guidelines-cursorrules-prompt-file

swiftui-guidelines-cursorrules-prompt-file is a cursor rule for Cursor from ItamarZand88/awesome-agent-conventions. It costs 1,129 tokens per session, scanned A, a copy of swiftui-guidelines-cursorrules-prompt-file, MIT.

A set of Cursor rules for building SwiftUI applications in Swift 6. SwiftUI is Apple’s framework for creating app interfaces with code, while Swift is Apple’s programming language.

In plain words
What is it for?
It guides SwiftUI view design, MVVM or Clean Architecture, navigation, SOLID-based code organization, and Swift 6 concurrency safety.
Why use it?
It sets consistent expectations for application structure, code quality, performance, and Swift’s rules for safe concurrent work.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit It guides SwiftUI view design, MVVM or Clean Architecture, navigation, SOLID-based code organization, and Swift 6 concurrency safety.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file
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.

Clone the repo
git clone --depth 1 https://github.com/ItamarZand88/awesome-agent-conventions

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 swiftui-guidelines-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file/github.svg)](https://agentmods.dev/rules/itamarzand88/awesome-agent-conventions/swiftui-guidelines-cursorrules-prompt-file)
Your own site
<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.

agentmods 80×15 button for swiftui-guidelines-cursorrules-prompt-file

Your own site · 80×15
<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>
Per session 1,129 This file is loaded in full into every session.
When invoked 1,129 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 94% copy Near-identical to another mod 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.01129 $0.01129
Opus 5 $0.00564 $0.00564
Sonnet 5 $0.00226 $0.00226
Haiku 4.5 $0.00113 $0.00113

Measured 10d ago against content hash a791df0ecfe1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

Origin

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.

conventions/agent-rules/examples/awesome-cursorrules-swiftui/swiftui-guidelines-cursorrules-prompt-file.mdc · 83 lines

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 body property MUST NOT exceed 50 lines. Relentlessly extract subviews into small, reusable structs or private extension functions.
    • GeometryReader: Avoid unless absolutely necessary. It consumes all available space and affects layout performance. Prefer .background(GeometryReader ...) or Layout protocol.
  • Modifiers:
    • Hit Testing: Always add .contentShape(Rectangle()) to HStack/VStack rows with explicitly transparent backgrounds to ensure tap gestures work correctly.
    • Shorthand Syntax: Prefer type-inferred dot syntax where available (e.g., .background(.blue)).
  • 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 via init.
  • List & Grids:
    • Use LazyVStack / LazyHStack for dynamic content.
    • Identifiers: Always use stable id (avoid \.self).
  • Animation:
    • Use .animation(_:value:) explicitly linked to a state variable.
    • Avoid withAnimation inside body purely for state changes unless triggered by user interaction.
    • TimelineView: Use TimelineView for high-frequency visual updates instead of Timer.

Read the full file on GitHub · 83 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. 10d ago First seen · 83 lines · 1,129 tokens per session scan A a791df0ecfe1

Subscribe to this mod's changes

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.