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
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- android-accessibility-proSkill
- android-adaptive-layout-proSkill
- android-compose-proSkill
- android-coroutines-proSkill
- android-design-system-proSkill
- android-gradle-architecture-proSkill
- android-library-proSkill
- android-memory-storage-proSkill
- android-modularization-proSkill
- app-intents-proSkill
- beta-deployment-proSkill
- coredata-swift6-proSkill
- cross-platform-parity-proSkill
- flaky-tests-proSkill
- foundation-models-proSkill
- instruments-profiling-proSkill
- linting-proSkill
- localization-proSkill
- motion-design-proSkill
- r8-shrink-proSkill
- store-compliance-proSkill
- swift-accessibility-proSkill
- swift-adaptive-layout-proSkill
- swift-concurrency-proSkill
- swiftdata-proSkill
- swift-design-system-proSkill
- swift-docc-proSkill
- swift-error-handling-proSkill
- swift-library-proSkill
- swift-logging-proSkill
- swift-memory-storage-proSkill
- swift-modularization-proSkill
- swift-package-proSkill
- swift-testing-proSkill
- swiftui-proSkill
- visionos-proSkill
- xcode-security-proSkill
- xml-to-compose-migration-proSkill
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
- Very specific: line 133
Use the installer from the target repo.
- Very specific: line 258
Prefer @MainActor at the type level over per-method annotations.
- Very specific: line 259
Never use @unchecked Sendable — redesign instead.
- Very specific: line 260
Avoid DispatchQueue.main.async.
- Very specific: line 261
Avoid global mutable static var state.
- Very specific: line 276
Keep one LanguageModelSession alive per conversation.
- Very specific: line 383
Reduced motion: every spatial, scaling, or looping animation has a crossfade-or-nothing alternative (accessibilityReduceMotion.
- Very specific: line 460
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 …
- Very specific: line 465
Every facade entry has a comment: for translators.
- Very specific: line 471
Every user-facing string in res/values/strings.xml.
- Very specific: line 561
Document every public / open symbol — summary line + - Parameter / - Returns / - Throws / complexity / concurrency / side effects / …
- Very specific: line 563
Use double-backticks for symbol links ( User.ID ).
- Very specific: line 565
Use // MARK: - for source navigation.
- Distinctive: line 566
Prefer DocC Articles over multi-paragraph doc comments.
- Distinctive: line 584
Keep it true: every path and command exists, placeholders filled, minimal committed permissions.
- Distinctive: line 601
Test pyramid: bulk unit tests, fewer integration, fewest UI (XCUITest, on schedule).
- Distinctive: line 602
Test the *behavior* through public API.
- Very specific: line 605
Default to Swift Testing for new tests, including UI tests on Xcode 27 (XCUIAutomation in @MainActor suites).
- Very specific: line 626
ARC only: No manual retain/release/autorelease.
- Very specific: line 629
Properties: Prefer over ivars; explicit ownership (copy for strings/arrays/blocks).
- Distinctive: line 636
When a project mixes Swift and Objective-C (or has any sizable ObjC surface area), a few workflow disciplines keep AI agents from making …
- Distinctive: line 638
Refactor in small scopes: Ask Claude to refactor a single method or a single file at a time, not "modernize the whole module." Large, …
- Very specific: line 640
Be explicit about bridging-header changes: When adding a new ObjC class that Swift needs to call, say so: *"Add MyService.h to …
- Very specific: line 652
Safety: never hardcode secrets; all UI text in strings.xml.
- Very specific: line 660
Always collectAsStateWithLifecycle() in Compose — never raw collectAsState().
- Very specific: line 671
Always collectAsStateWithLifecycle() for Flow/StateFlow.
- Very specific: line 685
Every interactive element needs .accessibilityLabel (and .accessibilityHint where non-obvious).
- Very specific: line 689
Always check @Environment(\.accessibilityReduceMotion) before animating.
- Very specific: line 690
Use semantic fonts (.font(.headline)), never .font(.system(size:)).
- Distinctive: line 691
Never hardcode English in accessibility strings — localize everything.
- Very specific: line 699
Every meaningful Image/Icon sets contentDescription via stringResource().
- Very specific: line 706
All user-facing strings via stringResource(R.string.…) — including a11y attributes.
- Distinctive: line 712
When you copy this into a new app, also think about adding:
- Very specific: line 747
Keep rules prescriptive, not descriptive.
- Very specific: line 749
Keep each rule under 12 KB (validate-frontmatter.py enforces it): a rule loads every time a matching file is open.
- Very specific: line 751
After adding, renaming, or re-describing a rule or skill, run python3 .github/scripts/generate-catalog.py to refresh docs/catalog.md (the …
≈ “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.
Files
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-studiowrites theAGENTS.mdindex, 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 targetkind: package|app; libraries skip store-only checks and getswift-package-pro/android-gradle-architecture-proreviews. It also reviews the target's own AI steering files (steeringJSON block,steering-*findings fromlib/steering.py) againstai-steering-files.mdand recommends improvements without editing them;--steering-onlyaudits just those files.playbooks/sync-and-audit.md— vendor-neutral agent workflow: sync a repo to the latest bundle, runinstall.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 fromtemplates/commands/alongside/appbootstrap-audit <topic>(a read-only audit of one area,install.sh audit --topic, topics inlib/topics.json); the manifest'sbundle.path/bundle.repotell 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— starterCLAUDE.mdfor Apple-only projects.templates/CLAUDE.template.android.md— starterCLAUDE.mdfor Android-only projects.templates/CLAUDE.template.md— starterCLAUDE.mdfor cross-platform projects.templates/Package.template.swift— starterPackage.swiftwith amakeTargets()helper that collapses per-module boilerplate; adding a new module is a two-line change (one inproducts:, one+ makeTargets(...)block).scripts/scaffold-spm-package.sh— generates a KozBon-style local SPM package (<App>Packages/) from--modules Core,…,AppCore: amakeTargets()-basedPackage.swiftplus a compiling source + passing test placeholder per module, with anAppCoreumbrella (the only product, with anAppRootView) the app target links.--main-actor <csv|all>switches to tools 6.2 with.defaultIsolation(MainActor.self)on those modules..github/workflows/swift.ymlbuilds and tests the output in aswift:6.2container. Non-destructive (--dry-run/--force, never overwrites). Run from the bundle against a target repo; it's not copied in. Pairs with theapple-modular-architecture.mdrule.
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 --helpThe --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-proto review the changes inNetworkClient.swift." - "Use
swiftui-proto reviewSettingsView.swiftfor modern API and a11y." - "Use
swift-design-system-proto set up a DesignSystem module with an icon facade and button styles." - "Use
swift-design-system-proto audit hardcoded colors, fonts, and SF Symbol strings across the app." - "Use
swift-accessibility-proto audit the scan screens for VoiceOver and keyboard access." - "Use
swift-adaptive-layout-proto get this app ready for iPhone Duo." - "Use
swift-testing-proto write tests forUserSession." - "Use
flaky-tests-proto find out whyFeedViewModelTestsfails one run in twenty on CI." - "Use
coredata-swift6-proto review the persistence layer." - "Use
swift-docc-proto review documentation in this package." - "Use
swift-error-handling-proto review error types and throwing functions." - "Use
swift-logging-proto audit Logger usage." - "Use
swift-memory-storage-proto find why the photo grid gets killed on older iPhones." - "Use
android-memory-storage-proto audit leaks and what the app writes to disk and backs up." - "Use
app-intents-proto review our App Intents and make the shopping-list actions work with Siri." - "Use
xcode-security-proto audit build settings and plan turning on Enhanced Security." - "Use
instruments-profiling-proto find out why the feed hangs on first launch." - "Use
motion-design-proto define our motion tokens and write the motion spec with our designer." - "Use
motion-design-proto review the onboarding animations for timing, consistency, and Reduce Motion." - "Use
swift-package-proto reviewPackage.swiftand the public API." - "Use
swift-library-proto check whether this PR needs a major version bump." - "Use
swift-library-proto ship our SDK as a signed XCFramework binary target." - "Use
android-library-proto set up explicit API, an ABI dump, and Maven Central publishing for:widgets." - "Use
swift-modularization-proto plan moving this app's code into a local Swift package." - "Use
swift-modularization-proto audit the module graph inMyAppPackages." - "Use
swiftdata-proto review the SwiftData models and queries." - "Use
android-accessibility-proto auditFeedScreen.ktfor TalkBack and contrast." - "Use
android-adaptive-layout-proto make the app tablet- and foldable-ready." - "Use
android-compose-proto reviewFeedScreen.ktfor recomposition and effect bugs." - "Use
android-design-system-proto scaffold:core:designsystemwith an AppTheme, AppIcons, and core components." - "Use
android-design-system-proto audit launcher, notification, and in-app icons." - "Use
android-coroutines-proto review cancellation and Flow usage in the data layer." - "Use
android-gradle-architecture-proto review my multi-module Gradle setup." - "Use
android-modularization-proto split this single-module app into feature and core modules." - "Use
xml-to-compose-migration-proto migrateSettingsFragmentto Compose." - "Use
r8-shrink-proto audit my ProGuard rules before release." - "Use
cross-platform-parity-proto port the iOS task list to Android." - "Use
cross-platform-parity-proto audit the two apps for drift in strings, icons, and analytics events." - "Use
store-compliance-proto check the app and its App Store metadata before shipping to China." - "Use
store-compliance-proto 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
originwithout 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, interactivegit 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/mastereven 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 logfirst), stage specific files rather thangit 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
@MainActorat the type level over per-method annotations. - Never use
@unchecked Sendable— redesign instead. - Avoid
DispatchQueue.main.async; prefer structured concurrency. - Avoid global mutable
static varstate. - ObjC delegate conformances use
@preconcurrency, notnonisolatedmethods.
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 classwith 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
@EnvironmentandBinding<T>. Pass environment values into methods as parameters. - View keeps
@FocusState,@Environmentreads, pure UI flags, and SwiftUI-specific bindings; the view model holds everything else. - Split large VMs into
+Send.swift/+Scroll.swift/+Intents.swiftextension files; useinternalfor cross-file helpers,privateonly 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
LanguageModelSessionalive 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.isCancelledinside 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
@Environmentwith lazy fallback. Real impl is the only file that touchesimport 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)) /ImmersiveSpacearen't interchangeable; only one ImmersiveSpace can open system-wide. Use@Environment(\.openImmersiveSpace)+dismissImmersiveSpace; always checkOpenImmersiveSpaceAction.Result(user can cancel the consent dialog); tear down onscenePhasebackground. - Immersion styles — default
.mixed. Use.progressivefor opt-in environmental separation;.fullonly 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.
.headanchor only for HUD;.planefor world-locked default. CachefindEntity(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 —
.usdasource,.usdzship. Reality Composer Pro is the authoring tool. Load viaEntity(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) vsCFBundleVersion(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 usemethod: app-store-connect(Xcode 15+),signingStyle: manual(for CI), explicitprovisioningProfileskeyed by bundle ID. - Code signing:
match(fastlane) for shared certs across a team, or direct keychain import for solo teams. Never check.p12certs 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: truein 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) vsversionName(string, user-visible). ComputeversionCodefrom 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
.aabsince August 2021../gradlew bundleRelease(notassembleRelease).bundletoolto 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 fastlanesupply(consistent CLI with the iOS side). - ProGuard / R8:
isMinifyEnabled = trueon Release.mapping.txtauto-uploads to Play Console with the AAB; verify Crashlytics/Sentry plugins also upload (or release crashes show asa.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
RegionPolicybuilt fromStorefront.countryCode(alpha-3) or Play'sBillingConfig.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 anNSControlsubclass forces a tracking-loop fallback; useNSControl.Events, delegate drag methods, or a touch-only recognizer (buttonMask = 0). Custom recognizers must reach a terminal state and overridelocation(in:). NSIsTouchNativeis only for apps embedding a non-AppKit UI or game framework. Games follow TN3216.- Test with Sidecar (iPad on iPadOS 27).
install.sh auditflags mouse-method overrides and tracking loops;swiftui-proreviews withreferences/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
AppIconfacade, no rawsystemName:strings — a typo or too-new symbol renders nothing silently. Cases named by meaning; aCaseIterabletest proves every case resolves on the minimum deployment target..forward/.backwardnames so glyphs mirror in RTL. - Size via font (
.font,.imageScale,@ScaledMetricslots), 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
Labelwith.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: .modulefor packaged assets.
Apple design system (apple-design-system.md)
In recommended (ui). Fires on .swift. Encodes:
- One
DesignSystemmodule (tokens, icons, styles, components, gallery) depending onCoreat 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));UIDesignRequiresCompatibilityis temporary. - Styles before wrappers (
ButtonStyle,LabelStyle, …); composite components use@ViewBuilderslots; check system components (ContentUnavailableView,LabeledContent) first. - Theming via
@Entryenvironment 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
AppIconsobject; avoidmaterial-icons-extendedin new code. - 24dp icons, 48dp targets via
IconButton; tint fromLocalContentColor/ theme roles, never literals;android:autoMirrored="true"on directional glyphs. contentDescriptionfrom 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; ComposeMaterialTheme.motionSchemeor 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, ComposegraphicsLayer), 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:designsystemmodule (Now in Android shape) depending on Compose/M3 only; components take primitives, state, and lambdas. AppThemeoverMaterialTheme— 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 matchingon*pairs, M3 type and shape scales,sptext; extended colors + spacing viastaticCompositionLocalOfwith a fail-loud default. - Thin, stateless wrappers over M3 components —
modifieras first optional param applied to the root, slot APIs,XxxDefaultsobjects; 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/andandroid/each with their ownCLAUDE.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@MainActorexplicitly; never@MainActoron the intent type.- Restarts rerun
perform()from the top (needsValueError,restartPerform): side effects last,requestConfirmationright before them, nevertry?. - Persisted contracts: entity ids stable across launches and devices,
AppEnumraw values explicit and append-only with a display entry per case, intent type names and phrases never renamed. - Queries: one batched
entities(for:), a boundedsuggestedEntities();@Dependencyregistered inApp.init(),Sendable, only on intents and queries. - Errors conform to
CustomLocalizedStringResourceConvertible(aLocalizedErrorshows a generic failure); strings are source literals. - App Shortcuts:
shortTitle+systemImageName,\(.applicationName)in every phrase, at most 10. - iOS 26 / 27:
supportedModesoveropenAppWhenRun,@AppIntent(schema:)over@Assistant*, interactive snippets with pure-readperform(); Siri 27.3 tools (@AppIntent(.tool)), described metadata, no search tools,sirimetadataanalyzerafter 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 = YESat project level on eligible targets, withcom.apple.security.hardened-processand 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 analyzein CI. Pure Swift skips them. - Phased rollout: compile-time → runtime restrictions → pointer auth / C++ hardening → MTE (soft mode first) and checked pointer arithmetic.
-fbounds-safetyfile 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:
internalby default,packageaccess 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 KGPabiValidation) on Android. Deprecate before removing. - Binary compatibility: library evolution only for XCFrameworks;
@frozen/@inlinableare 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, KotlinapiVersion/coreLibrariesVersion, and Java target chosen for consumers; raising one is a major change. - Android modules: no
targetSdk,resourcePrefix, not self-minified, reflection keeps inconsumer-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/.stringsdictstays 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 callsString(localized:)/NSLocalizedStringdirectly. Text(_:)/.accessibilityLabel(_:)acceptLocalizedStringResourcedirectly — 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:)). NeverString(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_buttonoversave).
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 invalues-<locale>/, region overrides invalues-<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 isone/other. Pass count twice to get it formatted in.- Locale-aware
NumberFormat/java.time.DateTimeFormatter; neverString.format("%.2f", ...)orSimpleDateFormat. - RTL:
<application android:supportsRtl="true">; usestart/endmodifiers, neverleft/right.android:autoMirrored="true"on directional drawables. - Comment blocks in
strings.xmldescribe where strings appear and what each%1$smeans.
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_rulesis where the value is — SwiftLint ships ~200 rules with the best ones OFF by default. Enableforce_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 regiondisable/enableform; never blanketdisable all(move toexcluded:instead); every suppression gets a why-comment. - Analyzer rules (
unused_import,unused_declaration) needswiftlint 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, addopt_in_rulesa few at a time; no giantdisabled_rulesshortcut.
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).ktlintFormatlocally,ktlintCheckin CI. Disablefunction-namingso Compose@ComposablePascalCase doesn't fight it. - detekt — static analysis (complexity, bugs, smells).
buildUponDefaultConfig = trueand override thresholds; don't enable detekt'sformattingruleset 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 }. UselintDebug, not justlintRelease. - 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/@SuppressLintscoped to the smallest element with a reason; never@file:Suppressas 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), neverprint/NSLogin shipping code.printis unstructured/unfilterable/no-privacy; acceptable only in tests/scripts/CLIs.- Subsystem = reverse-DNS bundle id (app-wide constant); category per area (
Networking,Auth). OneLoggerper category, held as astatic let. - Privacy markers — the part people get wrong. Interpolated values are
<private>by default; mark.publicfor 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/.faultfor real problems. - Lazy
@autoclosureinterpolation — 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 /
logCLI / in-appOSLogStore.
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 withcombine+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…Routecollects, stateless…Screenrenders; noContext/NavControllerin 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 assuspend/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 statelessSendableclass) implementation, never@MainActor;Sendablevalue types, neverNSManagedObject/@Modelacross the boundary; typed throws; wired at theAppCorecomposition root. A plain@QuerySwiftData app may skip repositories. - Android specifics — Hilt
@Binds@Singletonimplementations 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,AppCoreumbrella). The app target keeps only@main(returningAppCoreScene()), Info.plist, entitlements, assets, the privacy manifest,InfoPlist.xcstrings, and theAppShortcutsProviderwith its main-bundle catalogs. Interface / implementation / umbrella modules for interchangeable backends;@_exportedused sparingly; every module tested underswift test. - Android: a thin
:appover:feature:*(with anapi/implsplit when another feature navigates in),:core:data, optional:core:domain, pure-Kotlin:core:model, data-source modules,:core:designsystem,:core:testing. Only:appseesimplmodules and owns theNavHost; features take navigation as lambdas. Hilt bindingsinternalper 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.mdholds 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 inApplication.onCreate():DebugTreein debug, aCrashReportingTreein release. DirectLogcan't be redirected/stripped/routed. - Levels V/D/I/W/E/WTF; pass the
Throwableas 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
-assumenosideeffectsonLog.v/Log.d(never onLog.e/Log.w). Seer8-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 andWARN/ERRORThrowables 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 atself; 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 (
NSCachewith a cost limit,LruCachefrommemoryClass), release caches on memory warnings /onTrimMemory, lazy lists and paging, nolargeHeap. 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/getExternalFilesDiron 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-cryptois deprecated. - Shared storage on Android: MediaStore, the Photo Picker, and SAF instead of broad storage permissions;
MANAGE_EXTERNAL_STORAGEandREAD_MEDIA_IMAGES/VIDEOneed 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/opensymbol — 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:andrenamed:(when applicable) — no rotting deprecations; escalate toobsoleted:over releases. - Use
// MARK: -for source navigation; use DocC## Topicsfor 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 =andreplaceWith = ReplaceWith(...). EscalateWARNING→ERROR→HIDDENover releases. - Wire Dokka
externalDocumentationLinkto 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, Kiroinclusion), long procedures become skills. - One source across agents (
AGENTS.mdimported byCLAUDE.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
@MainActorsuites); 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 viaNSLocalizedString),accessibilityHintonly when label is ambiguous,accessibilityValuefor stateful controls,accessibilityTraitsfor semantic role. accessibilityIdentifieris for UI tests and never localized;accessibilityLabelis user-facing and always localized. Don't confuse them.- Dynamic Type:
[UIFont preferredFontForTextStyle:]+adjustsFontForContentSizeCategory = YES. NeversystemFontOfSize:for user-visible text. - Reduce Motion:
UIAccessibilityIsReduceMotionEnabled()before animating; observeUIAccessibilityReduceMotionStatusDidChangeNotificationfor runtime toggles. - VoiceOver announcements via
UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, ...); use sparingly. - Modal overlays:
accessibilityViewIsModal = YESso VoiceOver focus doesn't escape. - Custom long-press / swipe actions: expose via
accessibilityCustomActionsso they're reachable from the VoiceOver rotor. - Bluetooth assistive tech: custom actionable views override
canBecomeFocused(Full Keyboard Access) andaccessibilityRespondsToUserInteraction(Switch Control); braille-friendly short labels; announcement priority viaUIAccessibilitySpeechAttributeAnnouncementPriority.
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/__strongdance for blocks.@autoreleasepool { }in long allocating loops. - Nullability everywhere.
NS_ASSUME_NONNULL_BEGIN/ENDwrapping every header; explicitnullableannotations;NS_NOESCAPEon non-escaping block parameters. - Type system.
instancetypenotid; lightweight generics on collections; forward-declare with@class/@protocolin headers. - Properties. Prefer over ivars; explicit ownership (
copyfor strings/arrays/blocks);nonatomicdefault; class extensions for private API. - Initializers.
NS_DESIGNATED_INITIALIZER+NS_UNAVAILABLEon inherited inits. Never call subclassable methods inside-init/-dealloc. - Modern syntax. Literal/subscript syntax;
typedef'd block types;-isEqualToString:not==;#pragma mark - Sectionfor organization. - Swift interop. Bridging-header discipline;
NS_SWIFT_NAME(...)to control names;NS_REFINED_FOR_SWIFTto 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.hto<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
MyViewControllerin 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:
XcodeBuildMCPis 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,
PascalCaseComposables,camelCasemembers, 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:
viewModelScopefor VMs,lifecycleScopefor UI,WorkManagerfor process-death-surviving work. NeverGlobalScope. NeverrunBlockingin app code. - Dispatchers:
Mainfor UI,IOfor blocking I/O,Defaultfor CPU. Inject dispatchers so tests can substitute. - Cancellation is cooperative — never catch
CancellationException; usetry { } 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 rawcollectAsState(). supervisorScope/SupervisorJobfor sibling-failure isolation.CoroutineExceptionHandlerfor top-level uncaught.
Jetpack Compose (android-compose-best-practices.md)
- State hoisting: stateless Composables receive
value+onValueChange; stateful wrappers read from VMs. rememberfor in-composition state;rememberSaveablefor config-change survivable state. Business state lives in VMs, never inremember.- Side effects in their proper wrappers:
LaunchedEffect,DisposableEffect,SideEffect,rememberCoroutineScope,produceState. Never start work directly in the Composable body. @Stable/@Immutableon data flowing into Composables to enable skippable composition.kotlin.collections.Listis not stable by default — useImmutableListor annotate the holder.Modifierorder matters: layout → drawing → input..padding().background()≠.background().padding().derivedStateOfto filter recomposition noise; stablekeylambdas onLazyColumn/LazyRow.- Always
collectAsStateWithLifecycle()forFlow/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,StandardTestDispatcherfor virtual time,UnconfinedTestDispatcherfor eager. Inject dispatchers; install/resetDispatchers.Mainvia aMainDispatcherRule. NeverrunBlockingorThread.sleep. Flow/StateFlowtesting: Turbine.test { awaitItem(); awaitComplete() }; close every flow withawaitComplete()/cancelAndIgnoreRemainingEvents().- Compose UI: locate by
testTag/contentDescription(semantics), never visible localized text. UsewaitForIdle/waitUntil, neverThread.sleep. - Hilt tests:
@HiltAndroidTest,HiltAndroidRule,@UninstallModules+@BindValueto 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.accessibilityHintwhere 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/IconsetscontentDescriptionviastringResource(); decorative ones passnull. - Compose semantics:
Modifier.semantics(mergeDescendants = true)for compound rows,heading()for section titles, explicitRole.Button/Checkbox/Switchfor custom controls,stateDescriptionfor changing values. - Touch targets ≥ 48dp via
Modifier.minimumInteractiveComponentSize(). - Text sizes in
sp(notdp); never truncate critical content without fallback in semantics. - Custom actions mirror gesture affordances via
CustomAccessibilityAction. - Respect
LocalAccessibilityManager.current?.isReduceMotionEnabledin 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) — useliveRegion/paneTitle/stateDescriptionsemantics instead.
Guidance for adopting teams
When you copy this into a new app, also think about adding:
- Project-specific
CLAUDE.mdat the repo root. Describe the module graph, build commands per platform, localization module, and any non-obvious gotchas. Claude reads it first. - A
.swiftlint.ymlwith your line-length, identifier, and file-length rules. Run it as an Xcode Build Phase and in CI. - A
settings.local.json(git-ignored) for per-developer permission overrides — never check it in. - Domain-specific rules in
.claude/rules/as you discover patterns. Each rule file should have frontmatter withdescription:and apaths:list (plusglobs:for Cursor) so Claude applies it only where relevant. - Project-specific skills in
.claude/skills/for review workflows unique to your app (e.g.,core-data-migration-pro,localization-pro). - Cross-tool rule sync if your team uses Kiro / Gemini CLI / Cursor / Copilot alongside Claude Code. AppBootstrapAI stays Claude-native; point
rulerorblock/ai-rulesat.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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

