components

components is a cursor rule for Cursor from moasq/ios-dev-agent. It costs 1,141 tokens per session, scanned A, original, MIT.

A set of SwiftUI rules for sizing containers, choosing button styles, and using custom image assets in iOS screens.

In plain words
What is it for?
Use it when building or reviewing SwiftUI views, cards, content sections, buttons, and image-based interface elements.
Why use it?
It reduces inconsistent layouts and unclear action buttons across the app. It also helps ensure content fills the available space and uses the intended visual assets.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when building or reviewing SwiftUI views, cards, content sections, buttons, and image-based interface elements.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/moasq/ios-dev-agent/components
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.

Clone the repo
git clone --depth 1 https://github.com/moasq/ios-dev-agent

Made for: Cursor.

Wrote 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.

agentmods badge for components

README.md
[![agentmods](https://agentmods.dev/badge/rules/moasq/ios-dev-agent/components/github.svg)](https://agentmods.dev/rules/moasq/ios-dev-agent/components)
Your own site
<a href="https://agentmods.dev/rules/moasq/ios-dev-agent/components"><img src="https://agentmods.dev/badge/rules/moasq/ios-dev-agent/components/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for components

Your own site · 80×15
<a href="https://agentmods.dev/rules/moasq/ios-dev-agent/components"><img src="https://agentmods.dev/badge/rules/moasq/ios-dev-agent/components.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,141 This file is loaded in full into every session.
When invoked 1,141 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original 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.1 $0.01141 $0.01141
Opus 5 $0.00571 $0.00571
Sonnet 5 $0.00228 $0.00228
Haiku 4.5 $0.00114 $0.00114

Measured 5d ago against content hash ce1f1bb8d5d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

components 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 5d 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.

.cursor/rules/components.mdc · 117 lines

How it starts

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

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:

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.
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:

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())

Read the full file on GitHub · 117 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. 5d ago First seen · 117 lines · 1,141 tokens per session scan A ce1f1bb8d5d0

Subscribe to this mod's changes

components is a cursor rule published in the GitHub repository moasq/ios-dev-agent (4 stars, last pushed 3mo ago), licensed MIT. It adds 1,141 tokens to every session, about $0.0057 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-03.