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/duckduckgo/apple-browsers/ios-architecturegit clone --depth 1 https://github.com/duckduckgo/apple-browsersWrote 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/duckduckgo/apple-browsers/ios-architecture)<a href="https://agentmods.dev/rules/duckduckgo/apple-browsers/ios-architecture"><img src="https://agentmods.dev/badge/rules/duckduckgo/apple-browsers/ios-architecture.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.02280 |
| Opus 5 | $0.00000 | $0.01140 |
| Sonnet 5 | $0.00000 | $0.00456 |
| Haiku 4.5 | $0.00000 | $0.00228 |
Grade A, and why
ios-architecture 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.
How it starts
The opening of the file, as written. The whole thing — 443 lines — stays where its author put it; the contents beside it link to each section on GitHub.
iOS DuckDuckGo Browser Architecture Rules
Dependency Injection and AppDependencies
Use AppDependencyProvider Pattern
ALWAYS use the centralized dependency provider for all service dependencies:
// ✅ CORRECT - Use the shared dependency provider
final class FeatureViewModel: ObservableObject {
private let networkService: NetworkServiceProtocol
init(dependencies: DependencyProvider = AppDependencyProvider.shared) {
self.networkService = dependencies.networkService
}
}
// ❌ INCORRECT - Direct singleton access
final class FeatureViewModel: ObservableObject {
private let networkService = NetworkService.shared // Avoid singletons
}
Protocol-Based Dependencies
ALWAYS define protocols for dependencies to enable testing:
// ✅ CORRECT - Protocol abstraction
protocol FeatureServiceProtocol {
func fetchData() async throws -> [Item]
}
final class FeatureService: FeatureServiceProtocol {
// Implementation
}
// ❌ INCORRECT - Concrete dependency
final class ViewModel {
private let service: FeatureService // Hard to test
}
AppSettings and Configuration
Use AppSettings Protocol
ALWAYS access settings through the AppSettings protocol:
// ✅ CORRECT - Protocol-based settings access
final class SettingsViewModel: ObservableObject {
private let appSettings: AppSettings
init(appSettings: AppSettings) {
self.appSettings = appSettings
}
var isFeatureEnabled: Bool {
get { appSettings.featureEnabled }
set { appSettings.featureEnabled = newValue }
}
}
// ❌ INCORRECT - Direct UserDefaults access
final class SettingsViewModel: ObservableObject {
var isFeatureEnabled: Bool {
get { UserDefaults.standard.bool(forKey: "feature_enabled") }
set { UserDefaults.standard.set(newValue, forKey: "feature_enabled") }
}
}
UserDefaults Property Wrapper
Use the established @UserDefaultsWrapper pattern for new settings:
// ✅ CORRECT - Property wrapper usage
extension AppUserDefaults {
@UserDefaultsWrapper(key: .newFeatureEnabled, defaultValue: false)
var newFeatureEnabled: Bool
}
// ❌ INCORRECT - Manual UserDefaults handling
extension AppUserDefaults {
var newFeatureEnabled: Bool {
get { userDefaults.bool(forKey: "new_feature_enabled") }
set { userDefaults.set(newValue, forKey: "new_feature_enabled") }
}
}
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.
- 4d ago First seen · 443 lines · 0 tokens per session scan A 4e7c05f9c258
ios-architecture is a cursor rule published in the GitHub repository duckduckgo/apple-browsers (251 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,280 tokens. 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-09-01.
Other cursor rules, from other repositories
react-native-debugger-mcp
使用 react-native-debugger-mcp 工具讀取 React Native 台日誌.
storage-rules
本地儲存規範 - 禁止直接使用 AsyncStorage.
create-ios-release
As an AI assistant helping with iOS app releases, I should guide through the following process for successfully deploying iOS applications to the App Store.
203-healthkit-integration-detailed
HealthKit & WorkoutKit 集成规范 - 详细参考.
010-healthkit-workoutkit
010: HealthKit and WorkoutKit integration patterns for iOS health apps.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.