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.
npx agentmods add rules/getsentry/xcodebuildmcp-ios-template/swift-concurrencygit clone --depth 1 https://github.com/getsentry/XcodeBuildMCP-iOS-TemplateWhat 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 | $0.00048 | $0.01600 |
| Opus 5 | $0.00024 | $0.00800 |
| Sonnet 5 | $0.00010 | $0.00320 |
| Haiku 4.5 | $0.00005 | $0.00160 |
Grade A, and why
swift-concurrency 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.
name: "Swift Concurrency Guidelines" description: "Swift 6 strict concurrency patterns, actor isolation, @MainActor usage, async/await best practices, structured concurrency, and Sendable conformance. Apply when working with async code, actors, concurrent operations, or resolving concurrency warnings/errors." agent_requested: true applies_to: ["**/*.swift"]
Swift Concurrency Guidelines
Actor Isolation (Swift 6 Strict Mode)
All code must follow Swift 6 strict concurrency rules. The project uses strict concurrency mode as configured in MyProjectPackage/Package.swift.
@MainActor for UI Code
All UI-related code must be isolated to the main actor:
@MainActor
struct ContentView: View {
@State private var model = DataModel()
var body: some View {
// All UI code runs on main actor
List(model.items) { item in
Text(item.title)
}
}
}
@MainActor
class UIModel: ObservableObject {
@Published var state: ViewState = .idle
func updateUI() {
// Safe to update UI properties here
state = .loaded
}
}
Actors for Shared Mutable State
Use actors for managing shared mutable state safely:
actor DataStore {
private var items: [Item] = []
func addItem(_ item: Item) {
items.append(item)
}
func getItems() -> [Item] {
return items
}
}
Async/Await Patterns
Required: Use .task Modifier in Views
Always use .task for async operations tied to view lifecycle:
// ✅ CORRECT: Use .task for view lifecycle
struct DataView: View {
@State private var items: [Item] = []
var body: some View {
List(items, id: \.id) { item in
Text(item.name)
}
.task {
// Automatically cancels when view disappears
do {
items = try await loadItems()
} catch {
// Handle error
}
}
}
}
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.
- 2d ago First seen · 272 lines · 48 tokens per session scan A 77d811e1a08c
swift-concurrency is a cursor rule published in the GitHub repository getsentry/XcodeBuildMCP-iOS-Template (43 stars, last pushed 1y ago), licensed MIT. It adds 48 tokens to every session and 1,600 once invoked, about $0.0002 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.
Other cursor rules, from other repositories
kotlin-springboot-rules
Cursor rule "kotlin-springboot-rules" from holtwood/awesome-cursorrules-zh, covering 项目结构与组织, 编码风格与约定, 地道的 kotlin 用法 and 实现模式与设计.
ktnip-ksp-processor
KSP processor architecture, collectors, and codegen for ktnip.
android-viewmodel
Android ViewModel conventions — StateFlow, repository abstraction, coroutines, no LiveData.
cursorrules
ROLE: Android Development Expert EXPERIENCELEVEL: Advanced (10+ years) SPECIALTIES.
trove-swift
Swift 6 and SwiftUI coding conventions for iOS development. Auto-activates when working with Swift files. Covers @Observable, async/await, NavigationStack, Swift Testing, and accessibility.
20-android-kotlin
There is no Android SDK/NDK available in most sandboxed dev environments (including the one this codebase was originally scaffolded in). Kotlin code in this repo has generally not been compiled or run by an AI agent — only reviewed for logical consistency. Treat Kotlin changes as higher-risk than Rust changes until a…