agentleFS
irtazahashmiirtazahashmi/ironpet/.agents/skills/swift/SKILL.md

swift

Skill9 starsChanged 13 days agoMITView on GitHub

Swift for the ironpet macOS app (AppKit + SwiftUI, macOS 14+, SwiftPM, Swift 5 language mode). Use when writing, reviewing, or structuring Swift in Sources/IronPet, Tests/IronPetTests, or tools/, including concurrency, SwiftUI views, AppKit panels, Codable config and JSON-RPC, Keychain, URLSession, notifications, accessibility, and profiling. Before writing Swift, read the ironpet conventions below, then open the matching guide under skills/.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use cpp, ruby and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • testdino-hqSkill

    cpp

    Google's official C++ style guide. Covers headers, naming conventions, formatting, classes, memory management, RAII, smart pointers, and modern C++ features.

    Also in 4 projects that use this

  • carapace-shSkill

    ruby

    Use when working with Ruby — the dynamic, object-oriented language and its runtime (MRI/CRuby). Covers the object model, metaprogramming, core types, blocks/procs/lambdas, control flow and exceptions, I/O and encoding, the concurrency model (Threads, Fibers, Ractors, GVL), garbage collection and ObjectSpace, the RubyGems/Bundler package system, the interpreter CLI and tooling (irb, erb, rake, rdoc/ri), environment variables, and the standard library. Triggers on: "ruby", "Ruby", "MRI", "CRuby", "YARV", "Ripper", "object model", "method lookup", "eigenclass", "singleton class", "metaprogramming", "define_method", "method_missing", "class_eval", "instance_eval", "Refinements", "Binding", "Proc", "lambda", "block", "yield", "rescue", "ensure", "raise", "begin", "end", "Encoding", "String#encode", "Thread", "Fiber", "Ractor", "GVL", "GIL", "Mutex", "ObjectSpace", "GC", "WeakRef", "gem", "Gemfile", "Bundler", "gemspec", "bundle exec", "irb", "erb", "rake", "Rakefile", "rdoc", "ri", "RUBYOPT", "RUBYLIB", "GEM_HOME", "GEM_PATH", "BUNDLE_GEMFILE", "frozen string literal", "RUBY_VERSION", "RUBY_ENGINE".

    Also in 3 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Only the guides ironpet needs are vendored.

    line 10
  2. Very specific:

    When a guide disagrees with the code, follow the code around your change, as CONTRIBUTING.md asks.

    line 14
  3. Very specific:

    Before writing or reviewing Swift, read the SKILL.md for the topic you are touching and follow it, within the conventions above.

    line 34
  4. Very specific:

    Not vendored because ironpet does not need them: Swift Testing (the tests use XCTest), SwiftLint, navigation stacks, MapKit, PhotoKit, …

    line 52

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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
SKILL.md

Swift for ironpet

Guides from swift-ios-skills, vendored under skills/. Licensed under PolyForm Perimeter 1.0.0 (see LICENSE). The guides are written for iOS first. ironpet is a macOS app, so translate as you read: UIView / UIHostingController become NSView / NSHostingView / NSPanel, and iOS-only APIs (BGTaskScheduler, UIApplication, Dynamic Type sizes, haptics) do not apply.

Only the guides ironpet needs are vendored. If a task needs a framework that is not in the table, add that guide from the upstream repository in the same pull request.

ironpet conventions (these win over the guides)

When a guide disagrees with the code, follow the code around your change, as CONTRIBUTING.md asks. In particular:

TopicWhat ironpet doesDo not
PackageThe SwiftPM executable target IronPet (Sources/IronPet, the UI, the listeners and the Mac adapters), the Foundation-only library IronPetCore (Sources/IronPetCore) and their test targets (Tests/IronPetTests, Tests/IronPetCoreTests), swift-tools-version:5.10, .macOS(.v14). No Xcode project, no third-party Swift dependenciesAdd a package dependency, an Xcode project, or a target beyond these without discussing it first
Language modeSwift 5 mode (from the tools version), so strict concurrency is not enforced by the compilerAssume Swift 6 diagnostics will catch a data race; reason about isolation yourself
ObservationObservableObject with @Published (ConfigStore, BubbleStore, SignalStore, VoiceController, MeetingController), held by AppKit owners and handed to SwiftUIMigrate a store to @Observable as a side effect of a feature. The @Observable advice in swiftui-patterns applies only to brand-new, self-contained state
UIAppKit owns windows, panels, menus, the status item and hotkeys (AppDelegate, IronPetPanel, SettingsWindow, Bubbles, SetupWindow). SwiftUI renders the content inside them through NSHostingViewReplace an NSPanel with a SwiftUI Window / MenuBarExtra; the panels are non-activating, clamped to the pet's screen, and positioned by hand on purpose (SPEC.md › ironpet window)
Main actorUI types and stores are @MainActor. Timers that call back into them use MainActor.assumeIsolated because the run-loop timer already fires on the main threadAdd assumeIsolated on a callback that is not guaranteed to run on the main thread
Escape hatches@unchecked Sendable exists only on audio sources and StatusSnapshot, where a serial queue or lock protects the stateAdd @unchecked Sendable, nonisolated(unsafe) or @preconcurrency without a comment on that line saying what protects the state
Background workAudio capture, chunking and the local server run on their own serial queues (TrackRecorder, SystemAudioSource, EventServer); networking uses async URLSession callsBlock the main thread with file, process or network I/O
ProcessesAgents run as child processes over stdio (ACPClient, newline-delimited JSON-RPC). The agent process stays alive between messagesSpawn a fresh agent per message, or read its stdout on the main thread
ConfigEvery setting lives in Config (Support/Config.swift) with a safe default, decoded by laying ~/.ironpet/config.json over the encoded defaults, and clampedRead a new setting from UserDefaults or an environment variable. UserDefaults is only for UI state (window size, recent folders, chat backend)
SecretsAPI keys and tokens live in the Keychain (ironpet.voice, ironpet.sentry), never in ~/.ironpetWrite a token to config.json, a log or a thread file
TestsXCTest (final class …Tests: XCTestCase, XCTAssert…), with temp directories created in setUpWithError and removed in tearDownWithErrorAdd Swift Testing (import Testing) next to XCTest; keep one framework
LintNo SwiftLint or swift-format is configuredRaise style findings that only a linter config would decide
CommentsExplain why, not what (CONTRIBUTING.md)Narrate the change in a comment

Guides

Before writing or reviewing Swift, read the SKILL.md for the topic you are touching and follow it, within the conventions above. Load one guide at a time, plus its references/ only when that guide points there.

GuideCoversWhere it applies in ironpet
swift-languageModern Swift idioms outside concurrency and SwiftUI: if/switch expressions, result builders, property wrappers, pattern matching, collectionsAny Swift. Skip Swift 6-only features (typed throws, ~Copyable generics) unless the toolchain in CI supports them in Swift 5 mode
swift-api-design-guidelinesNaming, argument labels, mutating pairs, doc commentsAny new type, function or public-to-the-module API
swift-concurrencyActor isolation, Sendable, structured concurrency, TaskGroup, background offloadingChat/ACP/, Meeting/, Voice/, Signals/, Bridge/EventServer.swift, anything with Task {} or a queue
swift-codableJSONDecoder / JSONEncoder, CodingKeys, custom init(from:), heterogeneous payloadsSupport/Config.swift, ACP JSON-RPC messages (ACPClient, ACPToolCall), hook payloads (SessionStore), ThreadStore, transcription responses
swift-securityKeychain SecItem queries, OSStatus errors, credential storageVoice/VoiceKey.swift, Signals/SentryWatcher.swift, the local server token
ios-networkingURLSession with async/await, uploads, retries, error handlingVoice/Transcriber.swift (multipart upload), Signals/SentryWatcher.swift, the Bun download in Chat/ACP/ACPRuntime.swift. GitHubWatcher goes through the gh CLI, not URLSession. Bridge/EventServer.swift uses Network.framework (NWListener); see references/network-framework.md
swiftui-patternsView composition, state ownership, @State / @Binding / @Environment, .taskViews in Chat/ChatView.swift, Pet/, App/SettingsWindow.swift, Meeting/MeetingPanel.swift, Meeting/TranscriptsView.swift, Voice/VoiceBar.swift
swiftui-layout-componentsStacks, grids, ScrollView, List, Form, controlsSettings and setup forms, the agents list, chat transcript layout
swiftui-animationSprings, transitions, PhaseAnimator, TimelineView, reduced motionBubbles, the voice waveform, pet effects. The pet itself is a sprite atlas driven by PetController / Atlas; honour reduced motion (SPEC.md › Pet states)
swiftui-performanceExcess body updates, layout cost, identity churn, InstrumentsThe chat transcript (see the transcript-layout hang fixed in #11), the waveform (LevelBuffer renders on its own timeline so level updates never re-render the chat)
debugging-instrumentsLLDB, Memory Graph, Instruments for CPU, memory, hangsA long-running app that stays open all day: leaks, retain cycles in closures held by panels and timers, main-thread hangs
ios-accessibilitySwiftUI and AppKit accessibility, NSAccessibility, keyboard access, reduced motionPanels, bubbles and Settings. scripts/e2e.py setup and settings drive the real windows through the accessibility tree, so labels and roles are also test surface
push-notificationsUNUserNotificationCenter, categories, actions, permissionApp/Notifier.swift: local notifications only, with Allow / Deny and Done / Snooze actions that resolve the same approval or reminder as the bubble. Ignore APNs and remote-push sections

Not vendored because ironpet does not need them: Swift Testing (the tests use XCTest), SwiftLint, navigation stacks, MapKit, PhotoKit, background tasks, App Store review, the iOS Simulator and Liquid Glass guides. Add one from upstream if that changes.

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.