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/code-stylegit clone --depth 1 https://github.com/duckduckgo/apple-browsersWhat 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.05762 | $0.05762 |
| Opus 5 | $0.02881 | $0.02881 |
| Sonnet 5 | $0.01152 | $0.01152 |
| Haiku 4.5 | $0.00576 | $0.00576 |
Grade B, and why
code-style scanned grade B with 1 finding 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 today.
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.
Strips warnings and disclaimersmediumAnti-refusal
Omitting safety caveats hides risk from the user and is a common jailbreak preamble.
**Strive to make your code compile without warnings.** This rule informs many style decisions such as using `#selector` types instead of string literals. How it starts
The opening of the file, as written. The whole thing — 971 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Swift Code Style Guide
This style guide is based on the official iOS style guide and incorporates DuckDuckGo-specific patterns and requirements.
Correctness
Strive to make your code compile without warnings. This rule informs many style decisions such as using #selector types instead of string literals.
SwiftLint
We use SwiftLint for enforcing Swift style and conventions. See the SwiftLint configuration for specific rules.
Key SwiftLint settings:
- Line length: 150 characters (not the default 100)
- Force cast/try: warnings (not errors for pragmatic development)
- Identifier naming: flexible for single-letter variables in closures
Naming Conventions
Follow the Swift API Design Guidelines with these key principles:
Core Principles
- Clarity at the call site over brevity
- Use camelCase (not snake_case)
- UpperCamelCase for types and protocols
- lowerCamelCase for everything else
- Include all needed words while omitting needless words
- Use names based on roles, not types
Type Names
// ✅ CORRECT: Descriptive, UpperCamelCase
class UserAuthenticationManager { }
struct BookmarkItem { }
enum NavigationState { }
protocol DataSourceProtocol { }
// ❌ INCORRECT: Too generic
class Manager { }
struct Data { }
Variable and Function Names
// ✅ CORRECT: Descriptive lowerCamelCase
let maximumRetryCount = 3
var isLoading = false
func fetchUserData() { }
// Boolean properties should read like assertions
var isEnabled: Bool
var hasCompleted: Bool
var canDelete: Bool
// ❌ INCORRECT: Abbreviations and unclear names
let usrMgr = UserManager()
func calcTotal() { }
Protocol Naming
// ✅ CORRECT: Capability protocols end in -able, -ible, -ing
protocol Loadable { }
protocol Refreshable { }
protocol UserAuthenticating { }
// ✅ CORRECT: Type protocols are nouns
protocol DataSource { }
protocol Delegate { }
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.
- today First seen · 971 lines · 5,762 tokens per session scan B bf0c7790b7a3
code-style is a cursor rule published in the GitHub repository duckduckgo/apple-browsers (252 stars, last pushed today), licensed Apache-2.0. It adds 5,762 tokens to every session, about $0.0288 per session on Opus 5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). 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
utilities
Lodash 和 Moment.js 工具庫使用規範.
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.
knowledge-management-rule
Comprehensive knowledge management system for capturing, organizing, and applying project knowledge.
203-healthkit-integration-detailed
HealthKit & WorkoutKit 集成规范 - 详细参考.
010-healthkit-workoutkit
010: HealthKit and WorkoutKit integration patterns for iOS health apps.
main-refactoring-rules
ios cursor rules.