agentleFS
kelvinkosbabkelvinkosbab/AppBootstrapAI/CLAUDE.md

AppBootstrapAI

CLAUDE.md8 starsChanged 12 days agoMITView on GitHub

AppBootstrapAI is a drop-in bundle of Claude Code skills and AI steering rules for bootstrapping new app projects. Covers Apple platforms (iOS, macOS, tvOS, watchOS, visionOS — Swift 6.4 concurrency, SwiftUI, Swift Testing, Foundation Models, Objective-C) and Android (Kotlin, Jetpack Compose, MVVM, Hilt, coroutines) in one bundle. Skills (deep-dive review agents) ship for both sides — 18 Apple, 11 Android, 9 cross-platform — alongside the always-loaded steering rules. This repo is not a Swift package. It is a collection of…

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

36 rules. About 0 are common, 8 are distinctive, and 28 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 28

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the installer from the target repo.

    line 133
  2. Very specific:

    Prefer @MainActor at the type level over per-method annotations.

    line 258
  3. Very specific:

    Never use @unchecked Sendable — redesign instead.

    line 259
  4. Very specific:

    Avoid DispatchQueue.main.async.

    line 260
  5. Very specific:

    Avoid global mutable static var state.

    line 261
  6. Very specific:

    Keep one LanguageModelSession alive per conversation.

    line 276
  7. Very specific:

    Reduced motion: every spatial, scaling, or looping animation has a crossfade-or-nothing alternative (accessibilityReduceMotion.

    line 383
  8. Very specific:

    All UI code reads through a type-safe enum facade (Strings.Sections.title, Strings.Errors.portMin(value)) so a typo is a compile error, not …

    line 460
  9. Very specific:

    Every facade entry has a comment: for translators.

    line 465
  10. Very specific:

    Every user-facing string in res/values/strings.xml.

    line 471
  11. Very specific:

    Document every public / open symbol — summary line + - Parameter / - Returns / - Throws / complexity / concurrency / side effects / …

    line 561
  12. Very specific:

    Use double-backticks for symbol links ( User.ID ).

    line 563
  13. Very specific:

    Use // MARK: - for source navigation.

    line 565
  14. Distinctive:

    Prefer DocC Articles over multi-paragraph doc comments.

    line 566
  15. Distinctive:

    Keep it true: every path and command exists, placeholders filled, minimal committed permissions.

    line 584
  16. Distinctive:

    Test pyramid: bulk unit tests, fewer integration, fewest UI (XCUITest, on schedule).

    line 601
  17. Distinctive:

    Test the *behavior* through public API.

    line 602
  18. Very specific:

    Default to Swift Testing for new tests, including UI tests on Xcode 27 (XCUIAutomation in @MainActor suites).

    line 605
  19. Very specific:

    ARC only: No manual retain/release/autorelease.

    line 626
  20. Very specific:

    Properties: Prefer over ivars; explicit ownership (copy for strings/arrays/blocks).

    line 629
  21. Distinctive:

    When a project mixes Swift and Objective-C (or has any sizable ObjC surface area), a few workflow disciplines keep AI agents from making …

    line 636
  22. Distinctive:

    Refactor in small scopes: Ask Claude to refactor a single method or a single file at a time, not "modernize the whole module." Large, …

    line 638
  23. Very specific:

    Be explicit about bridging-header changes: When adding a new ObjC class that Swift needs to call, say so: *"Add MyService.h to …

    line 640
  24. Very specific:

    Safety: never hardcode secrets; all UI text in strings.xml.

    line 652
  25. Very specific:

    Always collectAsStateWithLifecycle() in Compose — never raw collectAsState().

    line 660
  26. Very specific:

    Always collectAsStateWithLifecycle() for Flow/StateFlow.

    line 671
  27. Very specific:

    Every interactive element needs .accessibilityLabel (and .accessibilityHint where non-obvious).

    line 685
  28. Very specific:

    Always check @Environment(\.accessibilityReduceMotion) before animating.

    line 689
  29. Very specific:

    Use semantic fonts (.font(.headline)), never .font(.system(size:)).

    line 690
  30. Distinctive:

    Never hardcode English in accessibility strings — localize everything.

    line 691
  31. Very specific:

    Every meaningful Image/Icon sets contentDescription via stringResource().

    line 699
  32. Very specific:

    All user-facing strings via stringResource(R.string.…) — including a11y attributes.

    line 706
  33. Distinctive:

    When you copy this into a new app, also think about adding:

    line 712
  34. Very specific:

    Keep rules prescriptive, not descriptive.

    line 747
  35. Very specific:

    Keep each rule under 12 KB (validate-frontmatter.py enforces it): a rule loads every time a matching file is open.

    line 749
  36. Very specific:

    After adding, renaming, or re-describing a rule or skill, run python3 .github/scripts/generate-catalog.py to refresh docs/catalog.md (the …

    line 751

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Project Overview

AppBootstrapAI is a drop-in bundle of Claude Code skills and AI steering rules for bootstrapping new app projects. Covers Apple platforms (iOS, macOS, tvOS, watchOS, visionOS — Swift 6.4 concurrency, SwiftUI, Swift Testing, Foundation Models, Objective-C) and Android (Kotlin, Jetpack Compose, MVVM, Hilt, coroutines) in one bundle. Skills (deep-dive review agents) ship for both sides — 18 Apple, 11 Android, 9 cross-platform — alongside the always-loaded steering rules.

This repo is not a Swift package. It is a collection of .claude/ assets intended to be copied (or referenced) into a target app repository so that Claude Code picks up consistent review, testing, and style guidance across projects.

What's in the box

.claude/
├── rules/                         # Always-loaded AI steering (Cursor-style rule files)
│   ├── android-accessibility-best-practices.md    # Android: TalkBack / Compose semantics
│   ├── android-ai-best-practices.md               # Android: Gemini Nano / ML Kit GenAI / Firebase AI Logic
│   ├── android-compose-best-practices.md          # Android: Jetpack Compose patterns
│   ├── android-coroutines-best-practices.md       # Android: Kotlin coroutines / structured concurrency
│   ├── android-design-system.md                   # Android: M3 AppTheme, tokens, core components
│   ├── android-documentation-strategy.md          # Android: KDoc strategy + Dokka
│   ├── android-gradle-conventions.md              # Android: Gradle DSL / version catalogs / modules
│   ├── android-iconography.md                     # Android: Material Symbols, adaptive/themed launcher icons
│   ├── android-large-screen-best-practices.md     # Android: tablets / foldables / desktop windows (tablet-gated)
│   ├── android-library-authoring.md               # Android: library modules, explicit API, ABI, publishing (opt-in)
│   ├── android-linting-strategy.md                # Android: ktlint + detekt + Android Lint
│   ├── android-localization-best-practices.md     # Android: strings.xml / plurals / RTL
│   ├── android-logging-strategy.md                # Android: Timber, levels, release-stripping
│   ├── android-memory-management.md               # Android: leaks, bitmaps, caches, onTrimMemory
│   ├── android-motion-design.md                   # Android: motion tokens, MotionScheme, reduced motion, Lottie
│   ├── android-modular-architecture.md            # Android: thin :app over feature/core modules (NiA)
│   ├── android-mvvm-architecture.md               # Android: MVVM / UDF, UiState, Route vs Screen (opt-in)
│   ├── android-play-beta-deployment.md            # Android: Play beta tracks, signing, CI
│   ├── android-project-rules.md                   # Android: Kotlin/Compose/MVVM/Hilt
│   ├── android-regional-compliance.md             # Android: per-country Play / China store rules
│   ├── android-repository-pattern.md              # Android: data layer / repositories (opt-in)
│   ├── android-storage-management.md              # Android: scoped storage, DataStore, backup rules
│   ├── android-testing-strategy.md                # Android: test strategy + JaCoCo
│   ├── apple-accessibility-best-practices.md      # Apple: SwiftUI a11y
│   ├── apple-adaptive-layout.md                   # Apple: resizable apps / iPhone Duo
│   ├── apple-app-intents.md                       # Apple: App Intents, App Shortcuts, Siri tools (opt-in)
│   ├── apple-build-security.md                    # Apple: security warnings, Enhanced Security, bounds safety (opt-in)
│   ├── apple-design-system.md                     # Apple: tokens, component styles, Liquid Glass
│   ├── apple-documentation-strategy.md            # Apple: DocC strategy + deprecation
│   ├── apple-foundation-models.md                 # Apple: On-device LLM (FoundationModels)
│   ├── apple-iconography.md                       # Apple: SF Symbols facade, Icon Composer app icons
│   ├── apple-infoplist-localization.md            # Apple: Info.plist / usage-description strings
│   ├── apple-library-authoring.md                 # Apple: Swift packages / frameworks apps consume (opt-in)
│   ├── apple-linting-strategy.md                  # Apple: SwiftLint + formatter discipline
│   ├── apple-localization-best-practices.md       # Apple: String Catalogs / plurals / RTL
│   ├── apple-logging-strategy.md                  # Apple: os.Logger, privacy markers, levels
│   ├── apple-mac-touch.md                         # Apple: touchscreen Mac / Sidecar touch (macos-gated)
│   ├── apple-memory-management.md                 # Apple: retain cycles, image decode size, jetsam
│   ├── apple-motion-design.md                     # Apple: motion tokens, springs, Reduce Motion, Lottie
│   ├── apple-modular-architecture.md              # Apple: thin app shell + fat local SPM package
│   ├── apple-objc-accessibility-best-practices.md # Apple: UIKit a11y in Objective-C
│   ├── apple-objc-best-practices.md               # Apple: Modern Objective-C
│   ├── apple-regional-compliance.md               # Apple: per-storefront App Store rules
│   ├── apple-repository-pattern.md                # Apple: data layer / repositories (opt-in)
│   ├── apple-spm-package-conventions.md           # Apple: Package.swift authoring
│   ├── apple-storage-management.md                # Apple: directories, backup, Keychain, free space
│   ├── apple-swift6-strict-concurrency.md         # Apple: Swift 6.4 strict concurrency
│   ├── apple-swiftui-mvvm.md                      # Apple: SwiftUI MVVM conventions
│   ├── apple-testflight-deployment.md             # Apple: TestFlight, ASC API, signing, CI
│   ├── apple-testing-strategy.md                  # Apple: test strategy + coverage
│   ├── apple-visionos-best-practices.md           # Apple: visionOS / RealityKit / spatial UX
│   ├── ai-steering-files.md                       # Cross-platform: CLAUDE.md / AGENTS.md / agent rules
│   ├── concise-comments-and-commits.md            # Cross-platform: terse comments + commits
│   ├── cross-platform-development.md              # Cross-platform: Apple + Android together with AI (--platform both)
│   └── project-documentation.md                   # Cross-platform: README/CHANGELOG/ADR
├── skills/                        # On-demand Claude Code skills
│   ├── android-accessibility-pro/          # Android: TalkBack / keyboard / contrast audit
│   ├── android-adaptive-layout-pro/        # Android: large-screen / foldable audit (tablet-gated)
│   ├── android-compose-pro/                # Android: Compose deep review
│   ├── android-coroutines-pro/             # Android: coroutines/Flow deep review
│   ├── android-design-system-pro/          # Android: icons + theme + components bootstrap/audit
│   ├── android-gradle-architecture-pro/    # Android: NiA-style convention plugins
│   ├── android-library-pro/                # Android: library modules, ABI, Maven Central publishing
│   ├── android-memory-storage-pro/         # Android: leak, footprint, and storage audit
│   ├── android-modularization-pro/         # Android: plan/migrate/audit a multi-module app
│   ├── app-intents-pro/                    # Apple: App Intents + Siri tools write/review
│   ├── beta-deployment-pro/                # Both: TestFlight / Play beta pipelines + upload triage
│   ├── coredata-swift6-pro/                # Apple: Core Data under Swift 6
│   ├── cross-platform-parity-pro/          # Both: port features, audit drift, set up a two-platform repo
│   ├── flaky-tests-pro/                    # Both: reproduce, classify, fix, and quarantine flaky tests
│   ├── foundation-models-pro/              # Apple: Foundation Models write/review
│   ├── instruments-profiling-pro/          # Apple: xctrace profiling + hang triage
│   ├── linting-pro/                        # Both: SwiftLint / ktlint / detekt / Android Lint setup + triage
│   ├── localization-pro/                   # Both: strings, plurals, formatters, RTL audit
│   ├── motion-design-pro/                  # Both: motion system, designer spec, patterns, review
│   ├── r8-shrink-pro/                      # Android: ProGuard/R8 rules
│   ├── store-compliance-pro/               # Both: regional store-rejection audit + response
│   ├── swift-accessibility-pro/            # Apple: VoiceOver / keyboard / contrast audit
│   ├── swift-adaptive-layout-pro/          # Apple: resizable / iPhone Duo audit
│   ├── swift-concurrency-pro/              # Apple: Swift concurrency review
│   ├── swift-design-system-pro/            # Apple: icons + tokens + components bootstrap/audit
│   ├── swift-docc-pro/                     # Apple: DocC documentation
│   ├── swift-error-handling-pro/           # Apple: typed throws, Result
│   ├── swift-library-pro/                  # Apple: library API stability, XCFrameworks, releases
│   ├── swift-logging-pro/                  # Apple: os.Logger review
│   ├── swift-memory-storage-pro/           # Apple: leak, footprint, and storage audit
│   ├── swift-modularization-pro/           # Apple: plan/migrate/audit a local SPM package
│   ├── swift-package-pro/                  # Apple: SPM library design
│   ├── swift-testing-pro/                  # Apple: Swift Testing code
│   ├── swiftdata-pro/                      # Apple: SwiftData review
│   ├── swiftui-pro/                        # Apple: SwiftUI review
│   ├── visionos-pro/                       # Apple: visionOS scenes, comfort, RealityKit, performance
│   ├── xcode-security-pro/                 # Apple: build-setting + Enhanced Security audit
│   └── xml-to-compose-migration-pro/       # Android: XML/Fragment → Compose
└── settings.json                  # Baseline Claude Code permissions (git, xcodebuild, gradlew, etc.)

Plus, at the repo root:

  • install.sh — one-command bootstrap into any target repo (--platform apple|android|both, --agents claude,copilot,cursor,gemini,codex,kiro,android-studio|all; android-studio writes the AGENTS.md index, mirrors Android skills into .agents/skills/, and writes .aiexclude).
  • playbooks/audit.md — vendor-neutral, read-only audit for a developer who only found the repo on GitHub ("use kelvinkosbab/AppBootstrapAI to audit my package"): clone to a temp dir, install.sh audit <repo> --no-install-check, triage, deep reviews, report in chat. The audit tags the target kind: package|app; libraries skip store-only checks and get swift-package-pro / android-gradle-architecture-pro reviews. It also reviews the target's own AI steering files (steering JSON block, steering-* findings from lib/steering.py) against ai-steering-files.md and recommends improvements without editing them; --steering-only audits just those files.
  • playbooks/sync-and-audit.md — vendor-neutral agent workflow: sync a repo to the latest bundle, run install.sh audit, triage findings against the rules, run the listed skills, and write a report. Agents start it with /appbootstrap-sync, which the install writes per agent from templates/commands/ alongside /appbootstrap-audit <topic> (a read-only audit of one area, install.sh audit --topic, topics in lib/topics.json); the manifest's bundle.path / bundle.repo tell it where the bundle is. Accepted audit findings go in .claude/appbootstrap-audit-baseline.json (install.sh audit --write-baseline).
  • templates/CLAUDE.template.apple.md — starter CLAUDE.md for Apple-only projects.
  • templates/CLAUDE.template.android.md — starter CLAUDE.md for Android-only projects.
  • templates/CLAUDE.template.md — starter CLAUDE.md for cross-platform projects.
  • templates/Package.template.swift — starter Package.swift with a makeTargets() helper that collapses per-module boilerplate; adding a new module is a two-line change (one in products:, one + makeTargets(...) block).
  • scripts/scaffold-spm-package.sh — generates a KozBon-style local SPM package (<App>Packages/) from --modules Core,…,AppCore: a makeTargets()-based Package.swift plus a compiling source + passing test placeholder per module, with an AppCore umbrella (the only product, with an AppRootView) the app target links. --main-actor <csv|all> switches to tools 6.2 with .defaultIsolation(MainActor.self) on those modules. .github/workflows/swift.yml builds and tests the output in a swift:6.2 container. Non-destructive (--dry-run / --force, never overwrites). Run from the bundle against a target repo; it's not copied in. Pairs with the apple-modular-architecture.md rule.

The installer picks the right CLAUDE.md template based on --platform. The Package.template.swift is copied manually into new SPM packages — install.sh doesn't drop it because the bundle target is usually an existing app, not a fresh package. The scaffold-spm-package.sh script is a one-shot generator, separate from install.sh's steering content.

Each skill ships with:

  • SKILL.md — the skill's entry point and review checklist (loaded when the skill is invoked).
  • references/ — topic-specific deep-dive notes the skill loads on demand.
  • agents/openai.yaml — interface metadata (display name, icon, default prompt).
  • assets/ — SVG/PNG icons for the skill.

How to onboard this into a new app project

Use the installer from the target repo. It takes a command verb — install (the default, so it can be omitted), upgrade, uninstall, list, list-mcps, or setup — each with a legacy --flag alias (--upgrade, --uninstall, --list, -i/--interactive, …) that stays fully supported:

# Not sure where to start? Guided, prompt-driven setup detects
# create vs. adopt vs. update and walks through every choice with defaults.
/path/to/AppBootstrapAI/install.sh setup        # alias: --interactive

# New project (green-field) — create the dir, git init, then install
/path/to/AppBootstrapAI/install.sh install ~/Projects/MyNewApp --new --platform apple

# Adopt into an existing repo (platform auto-detects; 'install' verb optional)
/path/to/AppBootstrapAI/install.sh .

# Update an already-managed repo — never a plain re-install
/path/to/AppBootstrapAI/install.sh upgrade .             # plan-only
/path/to/AppBootstrapAI/install.sh upgrade . --apply     # execute

# Pure-Swift Apple project — installs the "recommended" features set (default)
/path/to/AppBootstrapAI/install.sh . --platform apple

# Opt in to specialized features (Core Data, Foundation Models, etc.)
/path/to/AppBootstrapAI/install.sh . --platform apple --features all

# Cherry-pick categories
/path/to/AppBootstrapAI/install.sh . --platform apple --features core,testing,ui

# Legacy / Objective-C only
/path/to/AppBootstrapAI/install.sh . --platform apple --apple-language objc

# Mixed-language Apple project
/path/to/AppBootstrapAI/install.sh . --platform apple --apple-language both

# Android (default: recommended features)
/path/to/AppBootstrapAI/install.sh . --platform android

# Android + all features (including XML→Compose migration, R8/ProGuard)
/path/to/AppBootstrapAI/install.sh . --platform android --features all

# Cross-platform (one repo with both)
/path/to/AppBootstrapAI/install.sh . --platform both

# Preview catalog with category tags
/path/to/AppBootstrapAI/install.sh --list --platform apple --features all

# Full help — enumerates all 23 feature categories
/path/to/AppBootstrapAI/install.sh --help

The --features flag layers a feature-category filter on top of platform/language scoping. Default is recommended: a curated subset (core, concurrency, ui, testing, docs, error-handling, packaging, logging, localization, linting, compliance, memory-storage, performance). --features all adds the specialized opt-ins (persistence, ai, migration, shrinking, spatial, deployment, architecture, intents, security, library). Custom CSV lists give fine-grained control. The categories span both platforms — --features testing brings in both Apple's swift-testing-pro and Android's testing-strategy rule. spatial is visionOS-only and not in recommended — opt in via --features recommended,spatial, or equivalently --apple-platforms ios,visionos (the --apple-platforms selector — ios,macos,tvos,watchos,visionos|all, default everything-but-visionOS — stays in sync with the spatial category; macos gates the touch-on-Mac rule apple-mac-touch.md; every other Apple rule is cross-sub-platform). On Android, --android-platforms tablet (in the default phone,tablet) gates the large-screen / foldable rule + android-adaptive-layout-pro skill — the first form-factor gate; other tokens are recorded for future rules. deployment covers TestFlight + Play beta shipping flows; opt in via --features recommended,deployment when CI / release pipelines matter. architecture adds Android MVVM/UDF and the Apple + Android repository-pattern rules for teams that want that structure; opt in via --features recommended,architecture.

The installer copies skills (when Swift or Android is in scope) intersected with --features, platform-matching rules, settings, the platform-appropriate starter CLAUDE.md, and appends .gitignore entries. It never overwrites existing CLAUDE.md or settings.json — it prints what it skipped.

Then customize the new repo's CLAUDE.md to describe that project's specifics: modules, build commands, dependency graph, gotchas. Keep the steering rules and skills as-is — they apply to any modern Apple or Android app.

Invoking the skills

Skills auto-trigger when the description matches the task. You can also invoke them explicitly:

  • "Use swift-concurrency-pro to review the changes in NetworkClient.swift."
  • "Use swiftui-pro to review SettingsView.swift for modern API and a11y."
  • "Use swift-design-system-pro to set up a DesignSystem module with an icon facade and button styles."
  • "Use swift-design-system-pro to audit hardcoded colors, fonts, and SF Symbol strings across the app."
  • "Use swift-accessibility-pro to audit the scan screens for VoiceOver and keyboard access."
  • "Use swift-adaptive-layout-pro to get this app ready for iPhone Duo."
  • "Use swift-testing-pro to write tests for UserSession."
  • "Use flaky-tests-pro to find out why FeedViewModelTests fails one run in twenty on CI."
  • "Use coredata-swift6-pro to review the persistence layer."
  • "Use swift-docc-pro to review documentation in this package."
  • "Use swift-error-handling-pro to review error types and throwing functions."
  • "Use swift-logging-pro to audit Logger usage."
  • "Use swift-memory-storage-pro to find why the photo grid gets killed on older iPhones."
  • "Use android-memory-storage-pro to audit leaks and what the app writes to disk and backs up."
  • "Use app-intents-pro to review our App Intents and make the shopping-list actions work with Siri."
  • "Use xcode-security-pro to audit build settings and plan turning on Enhanced Security."
  • "Use instruments-profiling-pro to find out why the feed hangs on first launch."
  • "Use motion-design-pro to define our motion tokens and write the motion spec with our designer."
  • "Use motion-design-pro to review the onboarding animations for timing, consistency, and Reduce Motion."
  • "Use swift-package-pro to review Package.swift and the public API."
  • "Use swift-library-pro to check whether this PR needs a major version bump."
  • "Use swift-library-pro to ship our SDK as a signed XCFramework binary target."
  • "Use android-library-pro to set up explicit API, an ABI dump, and Maven Central publishing for :widgets."
  • "Use swift-modularization-pro to plan moving this app's code into a local Swift package."
  • "Use swift-modularization-pro to audit the module graph in MyAppPackages."
  • "Use swiftdata-pro to review the SwiftData models and queries."
  • "Use android-accessibility-pro to audit FeedScreen.kt for TalkBack and contrast."
  • "Use android-adaptive-layout-pro to make the app tablet- and foldable-ready."
  • "Use android-compose-pro to review FeedScreen.kt for recomposition and effect bugs."
  • "Use android-design-system-pro to scaffold :core:designsystem with an AppTheme, AppIcons, and core components."
  • "Use android-design-system-pro to audit launcher, notification, and in-app icons."
  • "Use android-coroutines-pro to review cancellation and Flow usage in the data layer."
  • "Use android-gradle-architecture-pro to review my multi-module Gradle setup."
  • "Use android-modularization-pro to split this single-module app into feature and core modules."
  • "Use xml-to-compose-migration-pro to migrate SettingsFragment to Compose."
  • "Use r8-shrink-pro to audit my ProGuard rules before release."
  • "Use cross-platform-parity-pro to port the iOS task list to Android."
  • "Use cross-platform-parity-pro to audit the two apps for drift in strings, icons, and analytics events."
  • "Use store-compliance-pro to check the app and its App Store metadata before shipping to China."
  • "Use store-compliance-pro to respond to this rejection for the China mainland storefront."

Each skill produces a file-by-file findings report with before/after code fixes and a prioritized summary.

Git workflow expectations

These apply to every AI session in this repo or in any repo that adopts this bundle. They're behavioral guardrails, not file-pattern rules, so they live in CLAUDE.md (always loaded) rather than .claude/rules/.

  • Never commit without an explicit instruction. Edits to the working tree are fine; turning those into commits is a separate action that requires direct user instruction (e.g., "commit this", "make a commit", "commit the changes"). If a task naturally produces a commit and you're unsure whether the user wants one yet, ask first.
  • Never push to origin without an explicit instruction. Pushing has user-visible side effects: CI runs, teammates see the changes, branches get published. Always wait for direct instruction ("push", "push to origin", "open a PR").
  • Never amend an existing commit unless the user explicitly asks ("amend the last commit"). Default to a new commit; amending rewrites history that may already be shared.
  • Never run destructive git commands without explicit confirmation: git push --force, git reset --hard, git checkout ., git restore ., git clean -f, git branch -D, interactive git rebase. These can lose work irreversibly. If you think one is genuinely needed, name the command and ask before running it.
  • Never skip git hooks (--no-verify, --no-gpg-sign) unless the user explicitly asks. Hooks usually catch real problems; bypassing them silently is exactly the kind of "surprising" behavior these rules exist to prevent.
  • Never force-push to main/master even if the user asks. Warn them; offer a safer path (revert commit, new branch, etc.). The risk to teammates' local clones is too high.
  • When committing IS requested, follow the standard project commit-message conventions (review recent git log first), stage specific files rather than git add -A (which can capture .env / credentials / temp files), and prefer creating a new commit over --amend.

The principle: commits and pushes are user-driven actions. Edits to the working tree are AI-driven; promoting them to history is the user's call.

Baseline conventions (steering rules)

The rules in .claude/rules/ are loaded automatically for every Swift file in the target repo. They encode:

Swift 6.4 strict concurrency (apple-swift6-strict-concurrency.md)

  • Strict concurrency is a compile error, not a warning.
  • Prefer @MainActor at the type level over per-method annotations.
  • Never use @unchecked Sendable — redesign instead.
  • Avoid DispatchQueue.main.async; prefer structured concurrency.
  • Avoid global mutable static var state.
  • ObjC delegate conformances use @preconcurrency, not nonisolated methods.

SwiftUI MVVM conventions (apple-swiftui-mvvm.md)

  • Extract a view model when the View has business logic, multi-step async, 5+ interacting @State, needs unit-testing, or is split across extension files.
  • View models are @MainActor @Observable final class with state + long-lived deps captured at init.
  • Choose ownership by lifecycle: @State (per-view) vs @Bindable (shared when two instances would race over a single resource — delegate slots, scans, persistent connections).
  • View models stay free of @Environment and Binding<T>. Pass environment values into methods as parameters.
  • View keeps @FocusState, @Environment reads, pure UI flags, and SwiftUI-specific bindings; the view model holds everything else.
  • Split large VMs into +Send.swift/+Scroll.swift/+Intents.swift extension files; use internal for cross-file helpers, private only for in-file helpers.

Apple Foundation Models (apple-foundation-models.md)

  • Session holders are @MainActor @Observable final class — never structs, views, or background actors.
  • Keep one LanguageModelSession alive per conversation; only recreate on config change (document that history is lost).
  • Gate at two levels: SystemLanguageModel.default.availability (handle each .unavailable(_) reason distinctly) AND a user preference.
  • Streaming pattern: append placeholder → mutate in place → remove on error. Check Task.isCancelled inside the loop; defer { isGenerating = false } at function top.
  • Catch errors broadly and surface error.localizedDescription; do not pattern-match specific cases (the enum changes across OS releases).
  • Testability: protocol wrapper + Real/Mock/Simulator implementations, injected via @Environment with lazy fallback. Real impl is the only file that touches import FoundationModels.

visionOS (apple-visionos-best-practices.md)

Specialized opt-in (--features ...,spatial). Not in recommended — vision teams pull it in explicitly. Covers the patterns that 2D-SwiftUI habits don't translate to:

  • Scene types — WindowGroup / Volume (.windowStyle(.volumetric)) / ImmersiveSpace aren't interchangeable; only one ImmersiveSpace can open system-wide. Use @Environment(\.openImmersiveSpace) + dismissImmersiveSpace; always check OpenImmersiveSpaceAction.Result (user can cancel the consent dialog); tear down on scenePhase background.
  • Immersion styles — default .mixed. Use .progressive for opt-in environmental separation; .full only when content IS the experience. Provide a visible exit; never trap.
  • Spatial gestures — SpatialTapGesture, RotateGesture3D, .targetedToEntity(). Every interactive Entity needs a hover affordance (HoverEffectComponent + InputTargetComponent + CollisionComponent, or .hoverEffect(.highlight) on SwiftUI views).
  • Accessibility on an HMD is safety, not polish — @Environment(\.accessibilityReduceMotion) is a vestibular guardrail; honor it for any motion (camera moves, particles, large transforms). Head-locked text causes vertigo; world-lock readable content. Never override system focus indicators.
  • RealityKit — author in Reality Composer Pro, not code. Shallow Entity hierarchies. .head anchor only for HUD; .plane for world-locked default. Cache findEntity(named:) results; never re-walk in update closures.
  • Performance — target 90fps. Frame drops cause nausea. Particles <1000 active; ~100k tri budget per Entity at 1–2m; prefer IBL over realtime lights; bake shadows.
  • USDZ pipeline — .usda source, .usdz ship. Reality Composer Pro is the authoring tool. Load via Entity(named:in: realityKitContentBundle); handle the throwing async path.

TestFlight deployment (apple-testflight-deployment.md)

Specialized opt-in (--features ...,deployment). Operational rule — fires on Fastfile, ExportOptions.plist, Info.plist, *.xcconfig, CI YAML.

  • Versioning — CFBundleShortVersionString (user-visible, semver-ish, reuse OK) vs CFBundleVersion (build number, must monotonically increment, never reuse). Compute build number from a monotonic CI source (agvtool / PlistBuddy); never hardcode in source.
  • App Store Connect API key (.p8) is the modern auth — issuer + key ID + .p8 file, stored as base64 CI secrets. Don't use app-specific passwords for new automations (Apple is deprecating that path).
  • Canonical archive + export flow: xcodebuild archive → xcodebuild -exportArchive -exportOptionsPlist → xcrun altool --upload-app. ExportOptions.plist must use method: app-store-connect (Xcode 15+), signingStyle: manual (for CI), explicit provisioningProfiles keyed by bundle ID.
  • Code signing: match (fastlane) for shared certs across a team, or direct keychain import for solo teams. Never check .p12 certs into source. Manual signing for CI; automatic only for local dev.
  • TestFlight tester groups: Internal (≤100, no review, fast loop) vs External (≤10k, beta-review on each new CFBundleShortVersionString). Pick deliberately.
  • dSYM upload to Crashlytics/Sentry runs as a post-archive CI step; uploadSymbols: true in ExportOptions.plist sends them to Apple separately for App Store Connect crash logs.
  • CI: fastlane / GitHub Actions / Xcode Cloud. Same nine-step shape regardless of tool. Pin Xcode version, Ruby/Bundler/fastlane, dependency lockfiles.

Play beta deployment (android-play-beta-deployment.md)

Specialized opt-in (--features ...,deployment). Operational rule — fires on Fastfile, build.gradle{,.kts}, gradle.properties, keystore.properties, proguard-rules.pro, CI YAML.

  • Versioning — versionCode (integer, monotonic, never reused, Play rejects duplicates silently) vs versionName (string, user-visible). Compute versionCode from a CI env var; don't hardcode-and-commit (merge order becomes load-bearing).
  • Play App Signing — use it. Splits keys: upload key (yours) and app signing key (Google's). Lose the upload key → reset via Play Console. Don't use Play App Signing → lose the app signing key → app is permanently un-updatable for existing users.
  • AAB, not APK. New apps must upload .aab since August 2021. ./gradlew bundleRelease (not assembleRelease). bundletool to convert AAB → device-specific APKs for local install testing.
  • Service account JSON for CI — Play Console → API access → link a GCP service account, grant "Release manager" role on specific apps (not org-wide). Store JSON as a single CI secret.
  • Testing tracks: internal (≤100, no review) → closed (review on first track upload) → open (public early-access listing). All version-locked — higher track blocks older builds in lower tracks.
  • Upload tools: Triple-T gradle-play-publisher (Kotlin DSL, lowest-friction for Gradle projects) or fastlane supply (consistent CLI with the iOS side).
  • ProGuard / R8: isMinifyEnabled = true on Release. mapping.txt auto-uploads to Play Console with the AAB; verify Crashlytics/Sentry plugins also upload (or release crashes show as a.a.b()).
  • Keystores never in source. Decode from a base64 CI secret to disk; clean up on job exit.

Regional store compliance (apple-regional-compliance.md, android-regional-compliance.md)

In recommended (compliance). Written after KozBon was rejected for the China mainland storefront over ChatGPT mentions in the app and its metadata.

  • Availability is a per-region decision, recorded in docs/compliance/regions.md; exclude a storefront or country rather than ship a feature that's illegal or unlicensed there.
  • China mainland: ICP filing; generative AI needs a CAC filing, so no third-party AI brand names (ChatGPT, Claude, Gemini, …) in the UI or metadata and no calls to unfiled foreign model APIs; game licenses; CallKit off; approved maps. Android ships through non-Play stores with consent before any data collection and a GMS-free flavor.
  • Elsewhere: EU DSA trader status on both stores, Android developer verification, per-country licensing for gambling, loans, crypto, and VPNs, age assurance (with the deployment rules).
  • Trademarks and AI consent everywhere: describe capabilities, not providers; name the provider only on the region-gated 5.1.2(i) consent screen.
  • Gate by storefront, not locale: one injected RegionPolicy built from Storefront.countryCode (alpha-3) or Play's BillingConfig.countryCode (alpha-2), failing closed when unknown and covering shortcuts, widgets, and notifications too.
  • Metadata is reviewed per storefront, and unlocalized storefronts show the primary language; keep listings neutral and in the repo.

The store-compliance-pro skill audits the app and listing for these risks and runs the regional-rejection playbook.

Touch on Mac (apple-mac-touch.md)

In recommended (ui), installed when macos is in --apple-platforms (the default). Fires on Swift, ObjC, and plists. Covers the touchscreen MacBook Pro and Sidecar touch on macOS 27:

  • Touch is secondary input: same layout and control sizes, 36pt hit targets (not bigger controls), every action reachable by pointer and touch alike. Branch on the interaction, not on NSScreen.touchCapabilities (true for every display once Sidecar is connected).
  • SwiftUI: standard controls and gestures are touch-native. GestureInputKinds (inputKinds: on every gesture, default .all) narrows only touch-specific affordances. .directTouchSystemGesturesDisabled() (27.3 beta) is window-wide; use it only for 3+ simultaneous touches.
  • Hover has no touch equivalent: essential hover-only controls get a tap reveal that auto-hides, plus a context-menu entry. Tooltips can stay pointer-only.
  • AppKit: gesture recognizers are the only way to receive touches. mouseDown(with:) overrides and tracking loops get single-finger emulation only, and any mouse override on an NSControl subclass forces a tracking-loop fallback; use NSControl.Events, delegate drag methods, or a touch-only recognizer (buttonMask = 0). Custom recognizers must reach a terminal state and override location(in:).
  • NSIsTouchNative is only for apps embedding a non-AppKit UI or game framework. Games follow TN3216.
  • Test with Sidecar (iPad on iPadOS 27). install.sh audit flags mouse-method overrides and tracking loops; swiftui-pro reviews with references/mac-touch.md.

Apple iconography (apple-iconography.md)

In recommended (ui). Fires on .swift. Encodes:

  • SF Symbols first, custom symbols (from an SF Symbols template, as Symbol Image Sets) only when nothing fits; never an SF Symbol as the app icon or logo.
  • Typed AppIcon facade, no raw systemName: strings — a typo or too-new symbol renders nothing silently. Cases named by meaning; a CaseIterable test proves every case resolves on the minimum deployment target. .forward/.backward names so glyphs mirror in RTL.
  • Size via font (.font, .imageScale, @ScaledMetric slots), never .resizable().frame(...) on a symbol; 44pt hit targets.
  • Rendering modes / variants / variable values set per context; built-in symbol effects, indefinite ones gated on Reduce Motion.
  • Icon accessibility: decorative hidden, icon-only buttons keep a Label with .labelStyle(.iconOnly), state never by icon color alone.
  • App icons in Icon Composer (.icon, layered for Liquid Glass; Default/Dark/Clear/Tinted reviewed) — flat full-bleed art, no baked mask or shadow; bundle: .module for packaged assets.

Apple design system (apple-design-system.md)

In recommended (ui). Fires on .swift. Encodes:

  • One DesignSystem module (tokens, icons, styles, components, gallery) depending on Core at most; components take data + closures, never view models.
  • Role-named color tokens built on system semantic colors, brand colors as asset-catalog sets with Dark + High Contrast variants; no literal colors in features.
  • Text styles as the type scale; custom fonts via relativeTo: so they keep Dynamic Type. Spacing scale + @ScaledMetric; concentric corners (ConcentricRectangle).
  • Liquid Glass: standard components adopt it free — remove custom bar backgrounds; glass for the floating control layer only (.glassEffect, GlassEffectContainer, .buttonStyle(.glass)); UIDesignRequiresCompatibility is temporary.
  • Styles before wrappers (ButtonStyle, LabelStyle, …); composite components use @ViewBuilder slots; check system components (ContentUnavailableView, LabeledContent) first.
  • Theming via @Entry environment values, not global state; previews for every state + a component gallery.

Android iconography (android-iconography.md)

In recommended (ui). Fires on .kt/.kts/.xml. Encodes:

  • Material Symbols imported as vector drawables (one style app-wide) behind a meaning-named AppIcons object; avoid material-icons-extended in new code.
  • 24dp icons, 48dp targets via IconButton; tint from LocalContentColor / theme roles, never literals; android:autoMirrored="true" on directional glyphs.
  • contentDescription from resources for meaningful icons, null (not "") for decorative ones.
  • Adaptive launcher icon with a <monochrome> layer (themed icons, Android 13+), art inside the 66dp safe zone, no baked shape; Play listing icon matches.
  • Notification small icons are alpha-only silhouettes (ic_stat_*); splash via the SplashScreen API, not a custom Activity.

Motion design (apple-motion-design.md, android-motion-design.md)

In recommended (ui). Fires on .swift and .kt/.kts. Adapted from the LottieFiles motion design skill (MIT), credited in each file.

  • Purpose before properties: feedback, orientation, state change, attention, or delight; no purpose, no animation. System components keep their own motion.
  • Motion tokens by role in the design-system module: SwiftUI springs (.smooth, .snappy, .spring(duration:bounce:)) and curves; Compose MaterialTheme.motionScheme or named specs with the M3 easing and duration tokens. Spatial specs may overshoot; color and alpha never do.
  • Timing: phone-baseline durations by element, longer for distance, exits ~65–75% of entrances; decelerate in, accelerate out; never linear movement.
  • Craft: render-only properties (SwiftUI opacity/scaleEffect/offset, Compose graphicsLayer), one hero per moment, stagger capped at ~500 ms, input never blocked, haptics paired with feedback.
  • Reduced motion: every spatial, scaling, or looping animation has a crossfade-or-nothing alternative (accessibilityReduceMotion; the animator duration scale on Android); motion never carries information alone.
  • Lottie: one wrapper component per platform, play once for feedback, still frame under reduced motion, themed layers, hidden from screen readers when decorative.

The motion-design-pro skill (either platform) defines a motion personality and tokens, writes the docs/design/motion.md spec designers and developers share (with Lottie / dotLottie handoff rules), builds sequences from recipes, and reviews existing motion. install.sh audit --topic motion flags looping animations in files that never check reduced motion.

Android design system (android-design-system.md)

In recommended (ui). Fires on .kt/.kts/.xml. Encodes:

  • One :core:designsystem module (Now in Android shape) depending on Compose/M3 only; components take primitives, state, and lambdas.
  • AppTheme over MaterialTheme — schemes generated from a brand seed, dynamic color as an explicit decision with a full fallback; Material 3 Expressive opted into centrally.
  • Roles, not literals — colorScheme.* with matching on* pairs, M3 type and shape scales, sp text; extended colors + spacing via staticCompositionLocalOf with a fail-loud default.
  • Thin, stateless wrappers over M3 components — modifier as first optional param applied to the root, slot APIs, XxxDefaults objects; never clickable boxes posing as buttons.
  • Edge-to-edge (enforced at targetSdk 35+): enableEdgeToEdge() + insets handling.
  • Previews via multipreview annotations inside AppTheme, a component catalog, and screenshot tests for the design system.

Cross-platform development (cross-platform-development.md)

In core, but installs only with --platform both. Fires on Swift, Kotlin, resources, config, and docs. Encodes:

  • Decide what to share once, in an ADR: native × 2 (default; share specs, contracts, tokens, names) or Kotlin Multiplatform for domain + data logic. UI stays SwiftUI + Compose.
  • Monorepo for agents: apple/ and android/ each with their own CLAUDE.md (loaded only when working there), shared/ for contracts, docs/features/ specs, docs/parity.md. One root install with --platform both.
  • Spec first, then two implementations: states, strings, icons, events, links, a11y, acceptance checks; one reference platform then a port, or both in parallel worktrees once the spec settles. Name the platform in prompts.
  • One vocabulary: same type/file/module names, string keys mapped . → _ on Android, matching icon vocabularies, same event and flag names.
  • Generated shared contracts: OpenAPI clients, design tokens, analytics events, flags, deep-link routes — never hand-copied per platform.
  • Parity is behavior, not pixels: HIG on Apple, Material on Android; platform-only features declared in docs/parity.md.
  • CI path filters: apple/** on macOS, android/** on Linux, shared/** runs both.

The cross-platform-parity-pro skill ports features (concept map + porting workflow), audits drift (string-key / icon / event / flag / deep-link diff scripts), and sets up the repo (root + platform CLAUDE.md, apple-engineer / android-engineer subagents, shared-contract generation, CI). Its kmp.md reference covers sharing logic with Kotlin Multiplatform behind a Swift adapter.

App Intents and Siri (apple-app-intents.md)

Specialized opt-in (--features ...,intents). Fires on *Intent*, *Entity*, *Shortcut*, and *Query* Swift files. Rewritten from Apple's Xcode 27 App Intents and Siri agent skills as published by Artem Novichkov in artemnovichkov/xcode-skills (credited in each file).

  • perform() is nonisolated and may run in an extension: hop to @MainActor explicitly; never @MainActor on the intent type.
  • Restarts rerun perform() from the top (needsValueError, restartPerform): side effects last, requestConfirmation right before them, never try?.
  • Persisted contracts: entity ids stable across launches and devices, AppEnum raw values explicit and append-only with a display entry per case, intent type names and phrases never renamed.
  • Queries: one batched entities(for:), a bounded suggestedEntities(); @Dependency registered in App.init(), Sendable, only on intents and queries.
  • Errors conform to CustomLocalizedStringResourceConvertible (a LocalizedError shows a generic failure); strings are source literals.
  • App Shortcuts: shortTitle + systemImageName, \(.applicationName) in every phrase, at most 10.
  • iOS 26 / 27: supportedModes over openAppWhenRun, @AppIntent(schema:) over @Assistant*, interactive snippets with pure-read perform(); Siri 27.3 tools (@AppIntent(.tool)), described metadata, no search tools, sirimetadataanalyzer after each build.

The app-intents-pro skill covers depth (execution, entities, parameters, iOS 26/27 APIs, Siri integration, AppIntentsTesting and SiriEvaluations). install.sh audit flags openAppWhenRun and @Assistant* macros.

Xcode build security (apple-build-security.md)

Specialized opt-in (--features ...,security). Fires on .xcconfig, .entitlements, .pbxproj. Rewritten from Apple's Xcode 27 security-settings and C bounds-safety agent skills as published by Artem Novichkov.

  • ENABLE_ENHANCED_SECURITY = YES at project level on eligible targets, with com.apple.security.hardened-process and the version-string entitlement.
  • Pointer-auth overrides only per target for an arm64e-less binary dependency, recorded in docs/xcode-security-settings.md.
  • C-family warnings and analyzer checks on; xcodebuild analyze in CI. Pure Swift skips them.
  • Phased rollout: compile-time → runtime restrictions → pointer auth / C++ hardening → MTE (soft mode first) and checked pointer arithmetic.
  • -fbounds-safety file by file, headers first, with <ptrcheck.h> annotations.
  • Never weaken a setting to fix a build.

The xcode-security-pro skill audits per target and plans the next phase. install.sh audit flags ENABLE_POINTER_AUTHENTICATION = NO and ENABLE_ENHANCED_SECURITY = NO in xcconfigs.

Library authoring (apple-library-authoring.md, android-library-authoring.md)

Specialized opt-in (--features ...,library) for repos whose product is a library that apps consume. recommend and audit suggest it when the repo is a Swift package or Android library with no app target. Fires on Swift and Package.swift / .spi.yml, and on Kotlin, consumer-rules.pro, and gradle.properties.

  • Small surface: internal by default, package access for cross-module helpers (Swift), explicitApi() (Kotlin); no public globals, retroactive conformances, or public data classes.
  • SemVer, enforced: swift package diagnose-api-breaking-changes <last-tag> in CI; a committed ABI dump (binary-compatibility-validator or KGP abiValidation) on Android. Deprecate before removing.
  • Binary compatibility: library evolution only for XCFrameworks; @frozen / @inlinable are permanent; defaulted Kotlin parameters need @JvmOverloads.
  • Distribution: signed XCFrameworks with a privacy manifest as checksummed .binaryTargets; signed Maven Central (Central Portal) artifacts with sources, Dokka, and a full POM, released from CI on a tag.
  • Consumers' floors: minimum OS, minSdk, Kotlin apiVersion / coreLibrariesVersion, and Java target chosen for consumers; raising one is a major change.
  • Android modules: no targetSdk, resourcePrefix, not self-minified, reflection keeps in consumer-rules.pro.

The swift-library-pro skill classifies API changes, builds XCFrameworks, and runs releases; android-library-pro sets up library modules, ABI checks, and publishing. install.sh audit flags a Swift library with no breaking-change check in CI, and Android library modules without explicit API mode or an ABI check, that minify themselves, or that set targetSdk.

Profiling (instruments-profiling-pro, performance)

In recommended (performance), skill only. Uses xctrace to record and read Instruments traces (toc → list tracks → show, heaviest stacks, symbolication, output redirected to scratch files) and triages hangs by tier and busy vs. blocked. Every fix reports before / after numbers. Rewritten from Apple's Xcode 27 xctrace agent skill as published by Artem Novichkov.

Apple localization (apple-localization-best-practices.md)

  • String Catalogs (.xcstrings) are the modern source-of-truth (Xcode 15 / iOS 17+); legacy .strings / .stringsdict stays stable, new entries route through the catalog.
  • All UI code reads through a type-safe enum facade (Strings.Sections.title, Strings.Errors.portMin(value)) so a typo is a compile error, not a runtime broken string. UI never calls String(localized:) / NSLocalizedString directly.
  • Text(_:) / .accessibilityLabel(_:) accept LocalizedStringResource directly — use it.
  • Plurals via String Catalog variations (Russian has 4 forms, Arabic has 6); never count == 1 ? "item" : "items".
  • Locale-aware formatters: Text(value, format: .number), Text(date, format: .dateTime.year().month().day()), .formatted(.currency(code:)). Never String(format: "%.2f", ...) for user-visible output.
  • RTL: use .leading / .trailing, never .left / .right. Test with the RTL pseudo-language scheme. .flipsForRightToLeftLayoutDirection(true) on directional images only.
  • Every facade entry has a comment: for translators. Key naming carries context (settings.save_button over save).

Android localization (android-localization-best-practices.md)

Scoped to **/*.{kt,kts,xml} (covers code and res/values*/strings.xml). Encodes:

  • Every user-facing string in res/values/strings.xml; locale overrides in values-<locale>/, region overrides in values-<lang>-r<REGION>/.
  • Compose: stringResource(R.string.…) / pluralStringResource(R.plurals.…, count, count); non-Compose: context.getString(...) / getQuantityString(...).
  • Always positional format args (%1$s, %2$d) — never bare %s/%d. Translators reorder.
  • <plurals> for any count-dependent string, even if English is one/other. Pass count twice to get it formatted in.
  • Locale-aware NumberFormat / java.time.DateTimeFormatter; never String.format("%.2f", ...) or SimpleDateFormat.
  • RTL: <application android:supportsRtl="true">; use start/end modifiers, never left/right. android:autoMirrored="true" on directional drawables.
  • Comment blocks in strings.xml describe where strings appear and what each %1$s means.

Apple linting (apple-linting-strategy.md)

In recommended. Fires on .swift + .swiftlint.yml / .swiftformat / .swift-format. Encodes:

  • Formatter vs linter — different jobs. A formatter owns whitespace/layout deterministically; SwiftLint owns style + correctness smells. Pick one formatter (SwiftFormat or Apple's swift-format, never both) and disable SwiftLint's overlapping formatting rules so they don't fight.
  • opt_in_rules is where the value is — SwiftLint ships ~200 rules with the best ones OFF by default. Enable force_unwrapping (top crash-class catch), empty_count, first_where, explicit_init, unused_import/unused_declaration (analyzer), etc.
  • Suppression hygiene — // swiftlint:disable:next <rule> (single-line, auto-scoped) over the region disable/enable form; never blanket disable all (move to excluded: instead); every suppression gets a why-comment.
  • Analyzer rules (unused_import, unused_declaration) need swiftlint analyze + a compiler log — CI only, not the build path.
  • Triage decision-order when a rule fires — fix the code (default) > tune the rule's threshold globally > scope-suppress with a reason > disable project-wide (rare). Never invert it to clear one finding. Prioritize a backlog by tier: correctness (force_unwrapping) first → smells → style (autocorrect handles it).
  • Placement — SPM build-tool plugin / Xcode Run Script / pre-commit / CI. CI uses --strict (warnings → errors); pin the SwiftLint version (rule sets change between releases).
  • Legacy adoption — excluded: generated code, get to zero on default rules, add opt_in_rules a few at a time; no giant disabled_rules shortcut.

Android linting (android-linting-strategy.md)

In recommended. Fires on .kt/.kts + .editorconfig / detekt.yml / lint.xml / build scripts. Three linters, three non-overlapping jobs — running one doesn't cover the others:

  • ktlint — formatter + basic Kotlin style via .editorconfig (ktlint_code_style). ktlintFormat locally, ktlintCheck in CI. Disable function-naming so Compose @Composable PascalCase doesn't fight it.
  • detekt — static analysis (complexity, bugs, smells). buildUponDefaultConfig = true and override thresholds; don't enable detekt's formatting ruleset alongside standalone ktlint (they duplicate). Type-resolution task (detektMain) in CI for the rules that need the classpath.
  • Android Lint (lintDebug) — Android-platform checks ktlint/detekt can't see (resources, manifest, API misuse, a11y, security). lint { abortOnError = true; warningsAsErrors = true; checkDependencies = true }. Use lintDebug, not just lintRelease.
  • Baselines (detekt + Android Lint) for legacy adoption — generate once, burn down; never regenerate to silence a failing CI (re-accepts new debt — the worst Android linting habit).
  • Suppression — @Suppress / @SuppressLint scoped to the smallest element with a reason; never @file:Suppress as a shortcut.
  • Triage decision-order when a rule fires — fix the code (default) > tune the rule's threshold/severity globally > scope-suppress with a reason > disable project-wide (rare). ktlint mostly skips triage (auto-fixable via ktlintFormat); triage is really for detekt + Android Lint. Prioritize by tier: correctness/security first → smells (baseline the rest) → formatting (ktlint owns it).
  • CI — ./gradlew ktlintCheck detekt lintDebug, all three as blocking checks; pin all three versions via the catalog.

Apple logging (apple-logging-strategy.md)

In recommended. Always-on steering that complements the swift-logging-pro skill (rule = while writing; skill = deep review). Fires on .swift. Encodes:

  • Logger (os.Logger), never print / NSLog in shipping code. print is unstructured/unfilterable/no-privacy; acceptable only in tests/scripts/CLIs.
  • Subsystem = reverse-DNS bundle id (app-wide constant); category per area (Networking, Auth). One Logger per category, held as a static let.
  • Privacy markers — the part people get wrong. Interpolated values are <private> by default; mark .public for non-sensitive values you need to see, .private(mask: .hash) to correlate without exposing. Never mark secrets/PII .public.
  • Levels — .debug (free in release, not persisted) / .info / .notice (default, persisted) / .error / .fault. Match level to severity; reserve .error/.fault for real problems.
  • Lazy @autoclosure interpolation — interpolate directly in the call (don't pre-build the string); no manual level guards needed. Signposts (OSSignposter) for Instruments timing.
  • Never log secrets, tokens, PII beyond a hashed correlation ID, or whole request/response bodies. Retrieve via Console / log CLI / in-app OSLogStore.

Architecture: MVVM + repository pattern (android-mvvm-architecture.md, apple-repository-pattern.md, android-repository-pattern.md)

Specialized opt-in (--features ...,architecture) for teams that want an explicit layered structure. The SwiftUI side of MVVM stays in apple-swiftui-mvvm.md (ui).

  • Android MVVM / UDF — one StateFlow<UiState> per screen derived with combine + stateIn(viewModelScope, WhileSubscribed(5_000), Loading); events are ViewModel functions; one-off effects modeled as state; SavedStateHandle (+ toRoute) for process-death state and nav args; stateful …Route collects, stateless …Screen renders; no Context/NavController in ViewModels; use cases only when reused or combining repositories.
  • Repositories (both platforms) — named by data type, not screen; the local store is the single source of truth and the network writes into it; live data as Flow / AsyncSequence, one-shots as suspend / async throws; DTO / persistence / domain models stay separate and only domain models cross the boundary; transport errors mapped to domain errors; cancellation never swallowed.
  • Apple specifics — protocol in a domain module, actor (or stateless Sendable class) implementation, never @MainActor; Sendable value types, never NSManagedObject / @Model across the boundary; typed throws; wired at the AppCore composition root. A plain @Query SwiftData app may skip repositories.
  • Android specifics — Hilt @Binds @Singleton implementations in :core:data; Room as source of truth; @ApplicationScope / WorkManager for work that outlives the screen; fakes in a shared test module.
  • No generic Repository<T> CRUD base on either platform.

Modular architecture (apple-modular-architecture.md, android-modular-architecture.md)

In recommended (packaging). The structure KozBon uses on Apple and Now in Android uses on Android: a thin app shell over many small modules.

  • Apple: a thin app target over a local Swift package (<App>Packages/, one directory per module, makeTargets() manifest, AppCore umbrella). The app target keeps only @main (returning AppCoreScene()), Info.plist, entitlements, assets, the privacy manifest, InfoPlist.xcstrings, and the AppShortcutsProvider with its main-bundle catalogs. Interface / implementation / umbrella modules for interchangeable backends; @_exported used sparingly; every module tested under swift test.
  • Android: a thin :app over :feature:* (with an api/impl split when another feature navigates in), :core:data, optional :core:domain, pure-Kotlin :core:model, data-source modules, :core:designsystem, :core:testing. Only :app sees impl modules and owns the NavHost; features take navigation as lambdas. Hilt bindings internal per module; non-transitive R; parallel, build cache, and configuration cache on.
  • Both: the graph flows one way, features never depend on each other's implementation, the graph is enforced in CI, and CLAUDE.md holds a module table. Migrate leaf-first, one module per change.

The swift-modularization-pro and android-modularization-pro skills plan a graph, migrate step by step, and audit an existing one with a dependency-rule script. scripts/scaffold-spm-package.sh creates the Apple package skeleton; Android build mechanics stay with android-gradle-architecture-pro.

Android logging (android-logging-strategy.md)

In recommended. Fires on .kt/.kts. Encodes:

  • Timber over android.util.Log — plant a tree in Application.onCreate(): DebugTree in debug, a CrashReportingTree in release. Direct Log can't be redirected/stripped/routed.
  • Levels V/D/I/W/E/WTF; pass the Throwable as the first arg (Timber.e(e, …)), don't string-concat it — the crash reporter gets the real stack + groups by format string. Use Timber format args, not Kotlin templates (lazy).
  • Strip debug logs from release — two layers: DebugTree only in debug, AND R8 -assumenosideeffects on Log.v/Log.d (never on Log.e/Log.w). See r8-shrink-pro.
  • No PII/secrets/bodies — log a hashed correlation ID; redact known-sensitive fields in the release tree before forwarding (Logcat is semi-public).
  • Crash-reporter integration — the release tree forwards INFO+ as breadcrumbs and WARN/ERROR Throwables as non-fatals (recordException / Sentry). Don't double-report at the call site.

Memory and storage (apple-memory-management.md, apple-storage-management.md, android-memory-management.md, android-storage-management.md)

In recommended (memory-storage). Short checklists; examples and the audit workflow live in the swift-memory-storage-pro and android-memory-storage-pro skills. install.sh audit --topic memory and --topic storage audit each half.

  • Leaks: Apple, a cycle needs a stored closure, a long-lived Task, a Combine subscription, a target-retaining timer, or a strong delegate pointing back at self; Android, no Activity / View / Context in singletons, objects, or ViewModels, and every registration has a matching unregister. LeakCanary in Android debug builds; a leak test per Apple view model with closures or Tasks.
  • Footprint: decode images at display size (decoded bytes are width × height × 4), bounded in-memory caches (NSCache with a cost limit, LruCache from memoryClass), release caches on memory warnings / onTrimMemory, lazy lists and paging, no largeHeap. Extensions and watchOS have far smaller budgets; jetsam and low-memory kills leave no crash log.
  • Locations: Documents / Application Support / Caches / tmp on Apple, filesDir / cacheDir / noBackupFilesDir / getExternalFilesDir on Android, chosen by whether the data is user-created, rebuildable, or device-specific. Offline content excluded from backup, not in a cache.
  • Secrets and preferences: Keychain / Android Keystore for credentials; UserDefaults and DataStore for small values only; security-crypto is deprecated.
  • Shared storage on Android: MediaStore, the Photo Picker, and SAF instead of broad storage permissions; MANAGE_EXTERNAL_STORAGE and READ_MEDIA_IMAGES/VIDEO need a Play declaration.
  • Backup: iCloud backup excludes caches and re-downloadable data; Android Auto Backup gets data extraction rules that exclude caches, tokens, and Keystore-encrypted files.
  • Writing: atomic writes, I/O off the main thread, free-space checks before large writes, a size cap on every disk cache, app size watched per release.
  • Privacy manifest: disk-space and file-timestamp APIs need their required-reason categories.

install.sh audit flags target-retaining timers, assign(to:on: self), strong delegates, full-size image decodes, credentials in UserDefaults or preferences, caches in Documents, undeclared disk-space / timestamp APIs, StaticFieldLeak, ViewModels holding UI, largeHeap, commit(), deprecated security-crypto and external-storage APIs, Room main-thread queries, broad storage and media permissions, unscoped Auto Backup, and a missing LeakCanary.

Apple documentation strategy (apple-documentation-strategy.md)

  • Document every public / open symbol — summary line + - Parameter / - Returns / - Throws / complexity / concurrency / side effects / preconditions.
  • Skip the signature-restating noise, generated code (Codable, @Observable), trivial accessors, and negative facts the type system already encodes.
  • Use double-backticks for symbol links (``User.ID``); single backticks are just code formatting and don't link.
  • Deprecate with mandatory message: and renamed: (when applicable) — no rotting deprecations; escalate to obsoleted: over releases.
  • Use // MARK: - for source navigation; use DocC ## Topics for the rendered API page.
  • Prefer DocC Articles over multi-paragraph doc comments; samples must compile.

Android documentation strategy (android-documentation-strategy.md)

  • KDoc with @param / @return / @throws / @property / @sample / @see. Symbol references in [brackets], not single backticks (Dokka doesn't link single backticks).
  • For @Composables: document state hoisting, semantics exposed to TalkBack, and skippable-vs-restartable status.
  • For Hilt modules: explain what is bound and why, not just that the module exists.
  • Suspend functions: document cancellation behavior and dispatcher requirements.
  • Deprecate with mandatory message = and replaceWith = ReplaceWith(...). Escalate WARNING → ERROR → HIDDEN over releases.
  • Wire Dokka externalDocumentationLink to AndroidX/stdlib so symbols like [Activity] resolve.

AI steering files (ai-steering-files.md)

In core. Fires on CLAUDE.md, AGENTS.md, GEMINI.md, .github/copilot-instructions.md, .cursor/rules/**, .kiro/steering/**, and .claude/ rules, skills, and settings. Encodes:

  • What earns a place: working commands, the module map, project decisions that differ from defaults, gotchas, what needs a human. Leave out generic advice, restated lint or bundle rules, secrets, personal preferences, history.
  • Always-loaded files stay under ~300 lines; topic guidance is path-scoped per agent (paths:, applyTo:, alwaysApply, Kiro inclusion), long procedures become skills.
  • One source across agents (AGENTS.md imported by CLAUDE.md, or .claude/rules/ fanned out); generated files say so; retire .cursorrules.
  • Keep it true: every path and command exists, placeholders filled, minimal committed permissions.
  • Improve in order: fix what's false, remove what's unsafe, cut noise, add what's missing, restructure.

install.sh audit runs steering-* checks on the project's own steering files (stale paths and commands, placeholders, secrets, oversized or duplicated files, contradictions with bundle rules, unscoped rules, permissive settings), skipping files the bundle installed.

Project-level documentation (project-documentation.md)

Scoped to README.md / CHANGELOG.md / CONTRIBUTING.md / docs/**/*.md. Encodes:

  • README: title + one-line description, badges (only if accurate), Quick Start (3–5 lines, real commands), Install, Usage (one realistic example), Configuration, Examples link, Contributing link, License link. No marketing copy before runnable code.
  • CHANGELOG: Keep a Changelog format — Added / Changed / Deprecated / Removed / Fixed / Security, ISO dates, PR/issue links per entry.
  • ADRs: under docs/adr/####-title.md, immutable once accepted, supersede with new ADRs that link back.
  • Inline comments explain why, not what. If you need a "what" comment, refactor first.
  • Link rot defenses: pin versions in install commands, permalink to source by SHA (not main), avoid blog posts as canonical sources.

Apple test strategy & coverage (apple-testing-strategy.md)

  • Test pyramid: bulk unit tests, fewer integration, fewest UI (XCUITest, on schedule).
  • Test the behavior through public API; skip private impl, third-party SDKs, generated code, DI wiring.
  • Name tests by behavior (loginRejectsExpiredToken), not by method-under-test.
  • Determinism is mandatory: inject clocks/UUIDs/randomness/network. No Date() / UUID() / Thread.sleep / live network in code under test.
  • Default to Swift Testing for new tests, including UI tests on Xcode 27 (XCUIAutomation in @MainActor suites); keep XCTest only for performance (measure) and for UI tests on older Xcode.
  • XCUITest: locate by .accessibilityIdentifier, never visible localized text.
  • Coverage: track in CI (Slather / Codecov / xcrun xccov), set a policy gate (commonly 70–80%), exclude generated code, DI, model-only types, and @main. Coverage is a hint, not a goal — don't game it.

Objective-C accessibility (apple-objc-accessibility-best-practices.md)

Scoped to **/*.{h,m,mm}. UIKit-side mirror of apple-accessibility-best-practices.md:

  • Required properties: accessibilityLabel (localized via NSLocalizedString), accessibilityHint only when label is ambiguous, accessibilityValue for stateful controls, accessibilityTraits for semantic role.
  • accessibilityIdentifier is for UI tests and never localized; accessibilityLabel is user-facing and always localized. Don't confuse them.
  • Dynamic Type: [UIFont preferredFontForTextStyle:] + adjustsFontForContentSizeCategory = YES. Never systemFontOfSize: for user-visible text.
  • Reduce Motion: UIAccessibilityIsReduceMotionEnabled() before animating; observe UIAccessibilityReduceMotionStatusDidChangeNotification for runtime toggles.
  • VoiceOver announcements via UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, ...); use sparingly.
  • Modal overlays: accessibilityViewIsModal = YES so VoiceOver focus doesn't escape.
  • Custom long-press / swipe actions: expose via accessibilityCustomActions so they're reachable from the VoiceOver rotor.
  • Bluetooth assistive tech: custom actionable views override canBecomeFocused (Full Keyboard Access) and accessibilityRespondsToUserInteraction (Switch Control); braille-friendly short labels; announcement priority via UIAccessibilitySpeechAttributeAnnouncementPriority.

Modern Objective-C (apple-objc-best-practices.md)

Scoped to **/*.{h,m,mm}. Encodes the evergreen modern-ObjC patterns:

  • ARC only. No manual retain/release/autorelease. __weak/__strong dance for blocks. @autoreleasepool { } in long allocating loops.
  • Nullability everywhere. NS_ASSUME_NONNULL_BEGIN/END wrapping every header; explicit nullable annotations; NS_NOESCAPE on non-escaping block parameters.
  • Type system. instancetype not id; lightweight generics on collections; forward-declare with @class/@protocol in headers.
  • Properties. Prefer over ivars; explicit ownership (copy for strings/arrays/blocks); nonatomic default; class extensions for private API.
  • Initializers. NS_DESIGNATED_INITIALIZER + NS_UNAVAILABLE on inherited inits. Never call subclassable methods inside -init/-dealloc.
  • Modern syntax. Literal/subscript syntax; typedef'd block types; -isEqualToString: not ==; #pragma mark - Section for organization.
  • Swift interop. Bridging-header discipline; NS_SWIFT_NAME(...) to control names; NS_REFINED_FOR_SWIFT to wrap raw APIs.

Working with AI on legacy / mixed-language Apple codebases

When a project mixes Swift and Objective-C (or has any sizable ObjC surface area), a few workflow disciplines keep AI agents from making things worse:

  • Refactor in small scopes. Ask Claude to refactor a single method or a single file at a time, not "modernize the whole module." Large, unbounded refactors mix unrelated concerns and produce diffs that are hard to review.
  • Don't paste the full build log on failures. Paste the failing function name, the specific compiler error lines (typically 5–20), and the immediately surrounding source. Pasting hundreds of lines of unrelated warnings drowns the actual signal and inflates context.
  • Be explicit about bridging-header changes. When adding a new ObjC class that Swift needs to call, say so: "Add MyService.h to <ProjectName>-Bridging-Header.h." Claude will not infer this from context — and a missing import causes "Cannot find type" errors that look unrelated.
  • State the language explicitly when ambiguous. "Implement MyViewController in Objective-C, not Swift" — file extensions disambiguate but prompt phrasing sometimes doesn't.
  • Verify against the actual toolchain, not my training data. If you ask Claude about a specific Xcode menu path, simulator behavior, or new SDK API, treat the answer as a starting point — confirm in Xcode itself before encoding it as a rule. The package's value is that its rules are ground truth.
  • Optional companion tooling: XcodeBuildMCP is a community MCP server that lets agents drive Xcode (build schemes, simulators, log capture). Useful when you want Claude to run real builds and tests instead of guessing at outcomes.

Android project rules (android-project-rules.md)

Scoped to **/*.{kt,kts}. Encodes:

  • Stack: Kotlin + Jetpack Compose (no XML), MVVM, Hilt DI, StateFlow + collectAsStateWithLifecycle(), Retrofit + Moshi.
  • Style: ktlint, PascalCase Composables, camelCase members, no wildcard imports.
  • Workflow: ./gradlew assembleDebug | test | ktlintCheck (run ktlint before every commit).
  • Safety: never hardcode secrets; all UI text in strings.xml.

Kotlin coroutines (android-coroutines-best-practices.md)

  • Right scope for the lifetime: viewModelScope for VMs, lifecycleScope for UI, WorkManager for process-death-surviving work. Never GlobalScope. Never runBlocking in app code.
  • Dispatchers: Main for UI, IO for blocking I/O, Default for CPU. Inject dispatchers so tests can substitute.
  • Cancellation is cooperative — never catch CancellationException; use try { } finally { } for cleanup.
  • Flow (cold) / StateFlow (hot value-holding) / SharedFlow (hot one-shot). Expose read-only base types from VMs.
  • Always collectAsStateWithLifecycle() in Compose — never raw collectAsState().
  • supervisorScope / SupervisorJob for sibling-failure isolation. CoroutineExceptionHandler for top-level uncaught.

Jetpack Compose (android-compose-best-practices.md)

  • State hoisting: stateless Composables receive value + onValueChange; stateful wrappers read from VMs.
  • remember for in-composition state; rememberSaveable for config-change survivable state. Business state lives in VMs, never in remember.
  • Side effects in their proper wrappers: LaunchedEffect, DisposableEffect, SideEffect, rememberCoroutineScope, produceState. Never start work directly in the Composable body.
  • @Stable / @Immutable on data flowing into Composables to enable skippable composition. kotlin.collections.List is not stable by default — use ImmutableList or annotate the holder.
  • Modifier order matters: layout → drawing → input. .padding().background() ≠ .background().padding().
  • derivedStateOf to filter recomposition noise; stable key lambdas on LazyColumn/LazyRow.
  • Always collectAsStateWithLifecycle() for Flow/StateFlow.

Android test strategy & coverage (android-testing-strategy.md)

  • Source-set discipline: src/test/ for unit tests (JUnit, MockK, Turbine, optional Robolectric), src/androidTest/ for instrumentation (Compose UI, real Room, Hilt-injected components).
  • Coroutines: runTest, StandardTestDispatcher for virtual time, UnconfinedTestDispatcher for eager. Inject dispatchers; install/reset Dispatchers.Main via a MainDispatcherRule. Never runBlocking or Thread.sleep.
  • Flow/StateFlow testing: Turbine .test { awaitItem(); awaitComplete() }; close every flow with awaitComplete() / cancelAndIgnoreRemainingEvents().
  • Compose UI: locate by testTag / contentDescription (semantics), never visible localized text. Use waitForIdle / waitUntil, never Thread.sleep.
  • Hilt tests: @HiltAndroidTest, HiltAndroidRule, @UninstallModules + @BindValue to swap real bindings for fakes.
  • MockK: mockk<T>() / coEvery / coVerify; don't mock data classes — use static factory fixtures.
  • Coverage: JaCoCo with a CI gate (commonly 70–80%); exclude Hilt-generated, KSP outputs, Activities/Application, Compose @Preview, DI modules. A failing gate or it's decorative.

Apple accessibility (apple-accessibility-best-practices.md)

  • Every interactive element needs .accessibilityLabel (and .accessibilityHint where non-obvious).
  • Decorative icons use .accessibilityHidden(true).
  • Section headers use .accessibilityAddTraits(.isHeader).
  • Context menus must mirror their actions in .accessibilityActions (context menus are not in VoiceOver's default rotor).
  • Always check @Environment(\.accessibilityReduceMotion) before animating.
  • Use semantic fonts (.font(.headline)), never .font(.system(size:)).
  • Never hardcode English in accessibility strings — localize everything.
  • Bluetooth assistive tech: custom tap-targets get .focusable() (Full Keyboard Access), gesture affordances mirror into .accessibilityActions (Switch Control), labels stay short/front-loaded/no-emoji (braille displays).
  • Announce via AccessibilityNotification.Announcement (iOS 17+), sparingly; no sound-only cues; App Store Accessibility Nutrition Label claims must be re-audited per release.

Android accessibility (android-accessibility-best-practices.md)

Scoped to **/*.{kt,kts}. Encodes:

  • Every meaningful Image/Icon sets contentDescription via stringResource(); decorative ones pass null.
  • Compose semantics: Modifier.semantics(mergeDescendants = true) for compound rows, heading() for section titles, explicit Role.Button/Checkbox/Switch for custom controls, stateDescription for changing values.
  • Touch targets ≥ 48dp via Modifier.minimumInteractiveComponentSize().
  • Text sizes in sp (not dp); never truncate critical content without fallback in semantics.
  • Custom actions mirror gesture affordances via CustomAccessibilityAction.
  • Respect LocalAccessibilityManager.current?.isReduceMotionEnabled in animations.
  • WCAG AA contrast (4.5:1 body / 3:1 large text); never convey state by color alone.
  • All user-facing strings via stringResource(R.string.…) — including a11y attributes.
  • Bluetooth keyboards/switch access: everything interactive is focusable with visible focus; braille displays (HID, Android 15+) read your contentDescription — keep it short and emoji-free.
  • announceForAccessibility() is deprecated (Android 16) — use liveRegion / paneTitle / stateDescription semantics instead.

Guidance for adopting teams

When you copy this into a new app, also think about adding:

  1. Project-specific CLAUDE.md at the repo root. Describe the module graph, build commands per platform, localization module, and any non-obvious gotchas. Claude reads it first.
  2. A .swiftlint.yml with your line-length, identifier, and file-length rules. Run it as an Xcode Build Phase and in CI.
  3. A settings.local.json (git-ignored) for per-developer permission overrides — never check it in.
  4. Domain-specific rules in .claude/rules/ as you discover patterns. Each rule file should have frontmatter with description: and a paths: list (plus globs: for Cursor) so Claude applies it only where relevant.
  5. Project-specific skills in .claude/skills/ for review workflows unique to your app (e.g., core-data-migration-pro, localization-pro).
  6. Cross-tool rule sync if your team uses Kiro / Gemini CLI / Cursor / Copilot alongside Claude Code. AppBootstrapAI stays Claude-native; point ruler or block/ai-rules at .claude/ to fan the rules out to every other agent. Per-tool path conventions shift faster than this bundle ships — better to let a dedicated sync tool track them.

Writing your own rules

Each rule file in .claude/rules/ should be a short, enforceable list of dos and don'ts:

---
description: One-line summary of what this rule enforces
globs: "**/*.swift"
paths:
  - "**/*.swift"
must:
  - "The 2-5 mistakes that cause real bugs or rejections, one short line each."
  - "Gemini and Codex always load these; the full rule only when they read it."
---

# Rule Name

Short intro: why this rule exists.

## Core Rules
- Bullet points with concrete, enforceable guidance.

## Patterns to Follow
- Code snippets showing the correct form.

Keep rules prescriptive, not descriptive. "Use @MainActor at the type level" is actionable; "Think about isolation" is not.

Keep each rule under 12 KB (validate-frontmatter.py enforces it): a rule loads every time a matching file is open. When a topic needs more, keep the rule as a checklist and move the full text into the matching skill's references/, as apple-adaptive-layout.md does.

After adding, renaming, or re-describing a rule or skill, run python3 .github/scripts/generate-catalog.py to refresh docs/catalog.md (the README links it for the full list and counts). CI fails when the catalog is stale.

Writing your own skills

Skills live in .claude/skills/<skill-name>/ and must contain a SKILL.md with YAML frontmatter:

---
name: your-skill-name
description: When to invoke this skill. First-person summary of what it does.
license: MIT
---

<Procedural instructions for Claude>

Split deep context into references/<topic>.md files the skill loads on demand — keeps the main skill compact and avoids blowing context on tangential material. See swift-concurrency-pro for a mature example.

Used by

AppBootstrapAI is the canonical source of AI rules and skills for downstream Kozinga projects:

  • KozBon — multi-platform Bonjour service discovery app. Consumes the Apple rules + skills.
  • BasicSwiftUtilities — foundational Swift 6 utilities package. Consumes the Apple rules + skills.

The bundled skills were originally authored by Paul Hudson and remain MIT-licensed with author attribution in each SKILL.md. The App Intents, Siri, Xcode security, and profiling material (and parts of accessibility, adaptive layout, and testing) is rewritten from the agent skills Apple ships with Xcode 27, as extracted and published by Artem Novichkov in artemnovichkov/xcode-skills; each such file credits it in a Sources note. That repository has no license and its content is Apple's, so nothing is copied verbatim.

License

MIT. See LICENSE. The bundled skills under .claude/skills/ retain their original MIT license and author attribution in their frontmatter.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.