My Code, My Rules

Contents
I suspect many developers who use AI agents to build their projects now rarely review AI-generated code line by line. Instead, their sense of control over a project comes largely from a set of written rules. As the project grows, so does the feeling of detachment from the codebase. When you want to step in and take matters into your own hands, you may find yourself unsure where to begin.
As a developer who wants my code to retain a personal style even when I don’t write it myself, I’ve been looking for a way to leave my own imprint on my projects. This isn’t just about maintaining a sense of involvement. I also believe that, in many scenarios, I still possess capabilities that AI cannot yet replace.
Fortunately, while working on my little app recently, I found a way to weave my personal style and technical ideas more naturally into the project. Judging by the results so far, I’m quite pleased with how it has worked out.
As a blogger, I’ve written hundreds of technical articles over the past few years. As a newsletter editor, I’ve also recommended hundreds of excellent pieces based on my own technical judgment and preferences. During development, whenever AI’s implementation drifts from what I have in mind, I often give it posts I’ve written, libraries I’ve developed, or articles I’ve thoroughly read and recommended, asking it to use the ideas they contain as a reference. Compared with dry sets of rules, complete articles and source code often come with rich context, design motivations, technical trade-offs, and concrete examples. This makes it easier for AI to grasp the intent behind my requests.
As a result, even though the code in my project is now the product of several different AI models, I can still clearly see my own fingerprints throughout the codebase. This doesn’t mean that my ideas are necessarily superior to the solutions AI would come up with on its own, but that sense of familiarity has helped me reconnect with the code. I may not have written it myself, but many of the technical decisions behind it are still mine.
To preserve this sense of control, perhaps one of my goals going forward will be to keep producing content that reflects my personal style, technical judgment, and design philosophy.
For developers more broadly, now that AI has significantly improved coding efficiency, could we use the time saved to broaden our technical horizons, explore alternative approaches, and organize and document our own experiences and ideas? These efforts can help us sharpen our own technical judgment and, in turn, guide AI toward better implementations.
In the future, humans may no longer be the sole audience for technical writing. Beyond helping readers understand an author’s ideas, ensuring that AI can also accurately interpret those ideas and put them into practice will become an important consideration in the writing process.
Recent Recommendations
ActorRPC: An Experiment with Swift Distributed Actors over HTTP
Although Swift’s Distributed Actors have been around for several years, their typical use cases have largely centered on stateful distributed clusters within data centers, making this language feature feel somewhat distant to most Swift developers. Recently, Simon Leeb leveraged the newly added support for Distributed in Embedded Swift on Swift’s main branch to build ActorRPC, an end-to-end RPC proof of concept written entirely in Swift. It demonstrates another possibility for this feature: bringing a type-safe full-stack development experience to Swift, similar to what tRPC offers in the TypeScript ecosystem.
In the author’s online treasure hunt game, the frontend is written in Embedded Swift, compiled to Wasm, and runs in the browser, invoking a distributed actor deployed on AWS Lambda through ordinary JSON POST requests. The frontend and backend share a single @Resolvable protocol as their API contract, without requiring additional schema definitions or code generation. The entire solution requires no cluster management mechanisms, can take full advantage of existing HTTP infrastructure, and can integrate with server-side frameworks such as Vapor and Hummingbird.
What I find most interesting about this project is that the value of Distributed Actors lies not only in enabling actors to operate across process boundaries, but also in the language-level, type-safe remote invocation mechanism already provided by the Swift compiler. Even developers who have no need for a distributed actor system in the traditional sense can take advantage of this capability on its own.
A ‘Weak’ Too Far: Debugging a Swift Miscompilation
When refactoring Swift code, many developers habitually retain [weak self] even after a closure becomes non-escaping, assuming that an extra weak reference can’t hurt. In this article, Matthias Gansrigler-Hrad recounts a frustrating debugging experience: a piece of perfectly valid code, containing an unnecessary [weak self], triggered a compiler bug under Release optimizations in Swift 6.4.2 (Xcode 27.2), causing the app to crash at guard let self. Yet the crash was impossible to reproduce in Debug mode.
With AI-assisted analysis of the disassembly and SIL, Matthias eventually traced the problem to an optimization mechanism in the Swift compiler. To reduce heap allocations, the compiler attempts to move variables captured by closures onto the stack in Release builds. However, when a closure both captures and modifies an external local variable and uses [weak self], this optimization appears to misjudge the lifetime of the weak reference, prematurely releasing its storage before the closure executes and ultimately causing a crash. Since this optimization is not enabled in default Debug builds, the same code runs normally during development and debugging. Removing either [weak self] or the modification of the local variable avoids the issue.
This article offers two practical engineering reminders. First, don’t habitually use
[weak self]in non-escaping closures, as unnecessary code can sometimes introduce unexpected complexity. Second, never rely solely on Xcode’s default Debug builds for testing. Compiler optimizations can cause the same code to exhibit dramatically different runtime behavior, so be sure to thoroughly test Release builds before distributing your app.
Building a zero-wakeup macOS capture app and cutting Core ML OCR memory by 4×
For tools that reside in the menu bar and perform tasks on demand, idle resource consumption is just as important as performance during active use. In this article, Morax Cheng shares a series of performance optimizations implemented in OhMyShot, an open-source native macOS screenshot and screen recording tool. These include deferring camera and microphone authorization checks to avoid implicit AVFoundation initialization, using AppKit for persistent UI components, delegating update checks to the system’s background task scheduler, and using mmap to address the issue of large memory allocations being retained by libmalloc even after they have been freed. The app now achieves zero wakeups and a memory footprint of just 26 MB while idle after launch.
On the OCR side, the author discovered that Core ML continuously accumulates buffers used to transfer data between the Neural Engine and CPU when processing inputs of varying widths. By moving the final layer of the recognition model out of Core ML and performing the corresponding computations on the CPU using the Accelerate framework, Morax successfully reduced peak memory usage from approximately 1.5 GB to under 363 MB in both test cases, while improving recognition speed and largely preserving the original recognition accuracy. The article also explains how multiple recognition passes, pixel scanning, and geometric analysis can compensate for Apple Vision’s limitations when dealing with code indentation, standalone brackets, and editor line numbers.
What makes this article particularly impressive is that it was written by a Chinese high school student. At a time when many desktop applications readily consume hundreds of megabytes of memory in the background, he has not only committed to native development but also established clear performance budgets from the very beginning, continuously validating and refining his work through quantitative testing, and released the entire project under the GPL-3.0 license. A visit to his personal website reveals that, beyond the projects he develops and maintains himself, he has contributed nearly a hundred merged PRs to open-source projects such as Rust Clippy, Apache DataFusion, and Homebrew. To see someone so young demonstrate such engineering rigor, dedication to software quality, and sustained commitment to the open-source community is truly inspiring. The next generation is not to be underestimated.
Distinctive patterns for categorical data in Swift Charts
In data visualization, relying solely on color to distinguish categories is often insufficient for users with color vision deficiencies. In this article, Matthaus Woolard demonstrates how to use SwiftUI’s Image(size:renderer:) and ImagePaint to dynamically generate repeating fill patterns such as diagonal lines, dots, and checkerboards without additional image assets, and how to use chartForegroundStyleScale to automatically apply consistent fill styles to both bars and legends in Swift Charts. More cleverly, the author creates a custom ShapeStyle that responds to the accessibilityDifferentiateWithoutColor environment value in resolve(in:), allowing charts to automatically overlay patterns on their existing colors when users enable the Differentiate Without Color accessibility setting, without requiring any changes to the chart’s declarative code. This approach of encapsulating environment-responsive logic within styles is well worth adopting in other SwiftUI scenarios.
Building apps is a system design exercise
How can a voice message from a friend bypass your iPhone’s silent mode and play directly as a full-screen alarm? In this article, Jacob Bartlett uses his retro iPod-inspired app UltraPing to demonstrate a rather ingenious combination of APIs: a push notification triggers a Notification Service Extension, which downloads the sender’s audio recording in the background and saves it to a shared App Group directory, then invokes AlarmKit to schedule an immediately triggered alarm using the recording as its custom sound.
Building around this core mechanism, Jacob begins by validating the technical assumptions with the greatest uncertainty, then gradually introduces object storage, a database, stateless cloud functions, push notification services, and a user pairing mechanism based on mutual consent, ultimately constructing a complete end-to-end system. Throughout the process, each stage produces a working prototype, while the developer’s focus gradually shifts from implementing individual pieces of code to defining the responsibilities of system components and how they interact.
Had Jacob not written about it, this particular combination of APIs might have remained his personal secret for quite some time. I’m grateful for his generous sharing, but I can’t help admiring his ingenuity in seamlessly connecting the client, cloud services, storage, and underlying system mechanisms into a reliable whole.
Tools
swift-rrule: Parsing and Evaluating iCalendar Recurrence Rules in Swift
swift-rrule is an open-source Swift library by Mattt for parsing iCalendar recurrence rules (RRULE) defined by RFC 5545, calculating occurrence dates for recurring events, and generating localized natural-language descriptions (currently supporting English, German, Spanish, and French). It also provides bidirectional conversion with Foundation’s native Calendar.RecurrenceRule. The library features its own recurrence calculation engine and supports iOS 16 / macOS 13 and later.
In the accompanying article, Mattt introduces the expressive power of iCalendar recurrence rules by exploring the limitations of traditional cron expressions when describing schedules such as “the first Sunday of every month,” alongside the historical evolution of the rules governing the date of Thanksgiving in the United States. He also points out that Calendar.RecurrenceRule, introduced by Apple in iOS 18 / macOS 15, not only lacks string parsing and natural-language formatting capabilities but also produces results inconsistent with the RFC standard when evaluating recurrence rules such as “every Tuesday of each month” and “the last weekday of every month.” These shortcomings were precisely what motivated him to create swift-rrule.
Flocon: Giving AI Assistants a Window into Your App at Runtime
Inspired by Meta’s Flipper and maintained by Florent Champigny, Flocon is an open-source, cross-platform application debugging tool. It brings runtime network requests, logs, analytics events, and crash information together into a unified desktop timeline, exposing these debugging capabilities to AI assistants such as Codex, Claude Code, and Cursor through a built-in local MCP server. Beyond analyzing behavior that has already occurred, AI assistants can actively mock network responses, simulate poor network conditions, trigger deep links, and even capture screenshots, making it easier to identify and verify issues.
Swift developers can integrate the standalone FloconSwift SDK through Swift Package Manager and selectively enable features such as network monitoring (URLSession / gRPC / GraphQL), file browsing, UserDefaults and Keychain inspection, and even direct SQL queries against the SQLite databases underlying Core Data and GRDB. The SDK also leverages SwiftPM’s Package Trait mechanism, allowing developers to cleanly strip debugging functionality from production builds without modifying application code.
Kido: Running macOS Command-Line Tools on ARM64 Linux
Developed by Cocoa, the open-source project Kido brings Docker-like container workflows to Darwin. Developers can launch environments using kido run, package tools and dependencies into images using a Kidofile, and distribute them through standard OCI image registries. Unlike traditional containers, each Kido instance is a micro virtual machine (microVM) with its own independent XNU kernel. It uses Virtualization.framework on Apple silicon Macs and a built-in KVM VMM on ARM64 Linux. The base image is only around 30 MB, boots in approximately one second, and supports on-demand installation of runtimes and system libraries, including the Swift runtime, through its system package manager kl.
Even more interestingly, Kido provides an online playground that uses WebAssembly and WebGPU to run the Darwin kernel directly in the browser, with support for Metal 3 Compute operations. Although the project remains experimental and does not yet support full macOS applications or Apple’s native toolchain, this attempt to make Darwin environments lightweight and standardized opens up new possibilities for future cloud builds, automated testing, and isolated execution environments for coding agents.
In last week’s editorial, macOS for the Masses, or macOS for Developers?, I discussed using virtualization to alleviate the tension between macOS security mechanisms and the autonomous execution requirements of agents. Although Kido was not created to address this particular problem, the direction it explores is thought-provoking: perhaps developers don’t always need a complete macOS installation, but rather a lightweight, isolated Darwin execution environment that can be provisioned on demand. If such solutions mature, they could not only reduce the overhead of managing permissions for local agents but also offer more options for cloud-based development and automated verification within the Apple ecosystem.
SAGA: When AI Makes Cross-Language Porting a New Technical Option
SAGA (Swift Alternative GPU API) is a cross-platform GPU SDK written entirely in Swift, consisting of a standalone shader compiler and a GPU runtime with a WebGPU-style API. The project was initiated by Vladislav Prusakov, the creator of Ada Engine. According to the author’s account, with the help of AI agents, he completed an initial port of the core capabilities of the Rust-based Naga compiler and wgpu graphics framework in just three days, eliminating the complexity of introducing the Rust toolchain and cross-language bridging into Swift graphics projects. SAGA can already run on multiple platforms through backends such as Metal, Vulkan, Direct3D 12, and WebGPU, and supports translation between various shader languages. However, considerable work remains before it achieves full feature parity with the original projects.
More noteworthy than the capabilities SAGA currently offers is perhaps the experiment itself. In the past, when dealing with mature infrastructure written in another language, developers often had little choice but to accept existing dependencies or invest substantial resources in reimplementing them. Today, AI has dramatically reduced the cost of code porting and initial implementation, giving even independent developers the opportunity to rebuild foundational tools according to their own technical preferences. While long-term maintenance, compatibility, and correctness verification remain unavoidable challenges, SAGA demonstrates a new possibility: when implementation costs are no longer an insurmountable barrier, developers may gain greater freedom in their technical choices.