feature-flags-addition

Interactive pattern for adding feature flags to iOS and/or macOS with proper configuration.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/duckduckgo/apple-browsers/feature-flags-addition
Clone the repo
git clone --depth 1 https://github.com/duckduckgo/apple-browsers

Made for: Cursor.

Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,944 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found 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 $0.00016 $0.04944
Opus 5 $0.00008 $0.02472
Sonnet 5 $0.00003 $0.00989
Haiku 4.5 $0.00002 $0.00494

Measured today against content hash ea095794a8de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

feature-flags-addition 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 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.

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.

.cursor/rules/feature-flags-addition.mdc · 761 lines

How it starts

The opening of the file, as written. The whole thing — 761 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Feature Flag Addition Pattern

When This Pattern Applies

This pattern is activated when the user explicitly requests to add a feature flag, such as:

  • "Add a feature flag for [feature name]"
  • "Create a feature flag for [feature name] on [platform]"
  • "I need a feature flag to control [feature name]"

Overview

Adding a feature flag requires careful consideration of several factors:

  1. Platform (iOS, macOS, or both)
  2. Source type (how the flag is controlled)
  3. Default value (fallback behavior)
  4. Local overriding (debug menu access)
  5. Remote configuration (if applicable)

Step 1: Validate and Check for Duplicates

Before adding a new feature flag, check if a similar flag already exists:

# Search for similar flags
grep -i "case.*[searchTerm]" iOS/Core/FeatureFlag.swift
grep -i "case.*[searchTerm]" macOS/LocalPackages/FeatureFlags/Sources/FeatureFlags/FeatureFlag.swift

Step 1.5: Create Asana Task (REQUIRED)

STOP: Before proceeding with implementation, the user must create an Asana task.

Instruct the user:

Please create an Asana task in the Apple Feature Flags Registry:

1. Open Asana
2. Navigate to the "Apple Feature Flags Registry" project
3. Create a new task default feature flag task
4. Copy the task URL

Paste the Asana task URL when ready to continue.

This is mandatory - all feature flags must be tracked in the Apple Feature Flags Registry.

Step 2: Ask Clarifying Questions

Question 1: Platform Selection

Ask the user:

Which platform(s) should this feature flag target?
  a) iOS only
  b) macOS only
  c) Both iOS and macOS

Default: Infer from user's request. If ambiguous, ask.

Question 2: Feature Flag Source Type

Ask the user:

What source type should this feature flag use?

  a) .remoteReleasable - Can be controlled remotely in production (RECOMMENDED for most features)
     • Allows gradual rollout
     • Can be toggled without app updates
     • Requires Privacy Config setup
     
  b) .remoteDevelopment - Remote control in development environments only
     • For testing remote config before production
     • Not visible in production builds
     
  c) .internalOnly() - Only enabled for internal users
     • Always on for internal users
     • Always off for external users
     • No remote control
     
  d) .disabled - Always off for everyone
     • Placeholder for future features
     • Code is present but inactive

Which option? (a is recommended for new features)

Read the full file on GitHub · 761 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. today First seen · 761 lines · 16 tokens per session scan A ea095794a8de

Subscribe to this mod's changes

feature-flags-addition is a cursor rule published in the GitHub repository duckduckgo/apple-browsers (252 stars, last pushed today), licensed Apache-2.0. It adds 16 tokens to every session and 4,944 once invoked, about $0.0001 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-09-01.