ios-dev-agent / rules
Cursor rule4 starsChanged 6 months agoMITView on GitHub
iOS development rule
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,183 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/currency.mdcCursor rule
- .cursor/rules/design-system.mdcCursor rule
- .cursor/rules/file-structure.mdcCursor rule
- .cursor/rules/forbidden-patterns.mdcCursor rule
- .cursor/rules/mvvm-architecture.mdcCursor rule
- .cursor/rules/pricing-display.mdcCursor rule
- .cursor/rules/scope.mdcCursor rule
- .cursor/rules/swift-conventions.mdcCursor rule
- accessibilitySkill
- animationsSkill
- apple-developer-authSkill
- apple-signinSkill
- app-store-preflightSkill
- asc-app-create-uiSkill
- asc-aso-auditSkill
- asc-build-lifecycleSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-localize-metadataSkill
- asc-metadata-syncSkill
- asc-metadata-yamlSkill
- asc-notarizationSkill
- asc-ppp-pricingSkill
- asc-release-flowSkill
- asc-revenuecat-catalog-syncSkill
- asc-screenshot-resizeSkill
- asc-shots-pipelineSkill
- asc-signing-setupSkill
- ascSkill
- asc-submission-healthSkill
- asc-subscription-localizationSkill
- asc-testflight-orchestrationSkill
- asc-wall-submitSkill
- asc-whats-new-writerSkill
- asc-workflowSkill
- asc-xcode-buildSkill
- billing-finance-calculatorSkill
- buildSkill
- business-modelSkill
- chartsSkill
- consolidate-errorsSkill
- content-composerSkill
- crashSkill
- debuggingSkill
- feature-directory-structureSkill
- feedback-statesSkill
- fix-errorSkill
- formsSkill
- foundation-modelsSkill
- hapticsSkill
- healthkitSkill
- layoutSkill
- listsSkill
- navigationSkill
- notificationsSkill
- onboarding-questionnaireSkill
- onboardingSkill
- The first 60 shown.
The file
We split this components.mdc into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
All cards, insight boxes, and content containers MUST use .frame(maxWidth: .infinity) to fill their parent
- Distinctive: line 12
Never let a card or container shrink to fit its content — it must stretch to the parent width
- Distinctive: line 13
Use real asset images (from Assets.xcassets) when available — never use generic SF Symbols for content that has a custom asset (e.g., use …
- Distinctive: line 26
ALWAYS use Button() — never .onTapGesture for actions.
- Distinctive: line 99
Use Toggle for binary settings with immediate effect.
- Distinctive: line 109
Always use ContentUnavailableView for empty lists/collections.
- Distinctive: line 111
Never show a blank screen — empty state guides the user to the first action.
- Distinctive: line 114
Use sparingly — prefer spacing to create visual separation.
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: iOS development rule
globs: "**/*.swift"
alwaysApply: true
---
# Component Patterns
FULL-WIDTH CONTAINERS — REQUIRED:
- All cards, insight boxes, and content containers MUST use `.frame(maxWidth: .infinity)` to fill their parent
- VStack with `.alignment: .leading` still needs `.frame(maxWidth: .infinity, alignment: .leading)` for full width
- Never let a card or container shrink to fit its content — it must stretch to the parent width
- Use real asset images (from Assets.xcassets) when available — never use generic SF Symbols for content that has a custom asset (e.g., use head location images, severity faces, etc.)
BUTTON HIERARCHY (one primary per screen/section):
| Level | Style | Use Case | Code |
|------------|----------------------|-----------------------------------|----------------------------------------------------|
| Primary | .borderedProminent | Main action (Save, Submit, Start) | .buttonStyle(.borderedProminent).controlSize(.large)|
| Secondary | .bordered | Alternative action (Cancel, Edit) | .buttonStyle(.bordered) |
| Tertiary | .borderless | Low-emphasis (Skip, Learn More) | .buttonStyle(.borderless) |
| Destructive| .borderedProminent | Delete, Remove | .buttonStyle(.borderedProminent).tint(.red) |
- ONE .borderedProminent per screen/section — multiple primaries confuse the user.
- Full-width primary: .controlSize(.large).frame(maxWidth: .infinity).
- ALWAYS use Button() — never .onTapGesture for actions.
- Disabled buttons: .disabled(condition) — SwiftUI auto-handles opacity.
CARD DESIGN PATTERN:
```swift
VStack(alignment: .leading, spacing: AppTheme.Spacing.xSmall) {
HStack {
Image(systemName: "icon.name")
.font(AppTheme.Fonts.title3)
.foregroundStyle(AppTheme.Colors.primary)
Spacer()
Text("metadata")
.font(AppTheme.Fonts.caption)
.foregroundStyle(.secondary)
}
Text("Title")
.font(AppTheme.Fonts.headline)
Text("Description text goes here")
.font(AppTheme.Fonts.subheadline)
.foregroundStyle(.secondary)
}
.padding(AppTheme.Spacing.medium)
.background(AppTheme.Colors.surface)
.clipShape(RoundedRectangle(cornerRadius: AppTheme.Style.cornerRadius))
.shadow(color: .black.opacity(0.06), radius: 8, y: 4)
```
INPUT FIELD STATES:
- Normal: TextField with .textFieldStyle(.roundedBorder).
- Focused: @FocusState with visual highlight (border color change or underline).
- Error: red border + error message below field.
```swift
TextField("Email", text: $email)
.textFieldStyle(.roundedBorder)
.overlay(
RoundedRectangle(cornerRadius: 8)
.stroke(emailError != nil ? .red : .clear, lineWidth: 1)
)
if let error = emailError {
Text(error)
.font(AppTheme.Fonts.caption)
.foregroundStyle(AppTheme.Colors.error)
}
```
- Disabled: .disabled(true) — auto grays out.
- Form grouping: use Form or GroupBox for related fields.
LOADING STATES:
| Pattern | Use Case | Code |
|-------------------|-----------------------------------|-----------------------------------------|
| Inline spinner | Button action, single item | ProgressView().controlSize(.small) |
| Full-screen | Initial data load | ProgressView("Loading...") |
| Pull-to-refresh | List refresh | .refreshable { await refresh() } |
| Skeleton | Content placeholder | .redacted(reason: .placeholder) |
| Overlay | Blocking operation | .overlay { if loading { ProgressView() } } |
- Disable the triggering button while loading to prevent double-taps.
- Show loading for operations > 300ms. Instant operations need no indicator.
BADGE/CHIP PATTERN:
```swift
Text("Label")
.font(AppTheme.Fonts.caption)
.fontWeight(.medium)
.padding(.horizontal, 8)
.padding(.vertical, 4)
.background(AppTheme.Colors.primary.opacity(0.15))
.foregroundStyle(AppTheme.Colors.primary)
.clipShape(Capsule())
```
TOGGLE/SWITCH:
- Use Toggle for binary settings with immediate effect.
- Label must clearly describe the ON state.
- Group related toggles in a Section with a header.
PICKER PATTERNS:
- 2-4 options: Picker with .segmentedStyle.
- 5+ options: Picker with default menu style or NavigationLink to selection list.
- Date selection: DatePicker with appropriate displayedComponents.
EMPTY STATES:
- Always use ContentUnavailableView for empty lists/collections.
- Include: icon (SF Symbol), title, description, and action button if applicable.
- Never show a blank screen — empty state guides the user to the first action.
DIVIDERS:
- Use sparingly — prefer spacing to create visual separation.
- In lists: SwiftUI List provides dividers automatically.
- Custom dividers: Divider() with .padding(.horizontal) for inset style.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

