Close Menu
geekfence.comgeekfence.com
    What's Hot

    Hacks season 5 review: Acclaimed comedy gets last laugh in final season

    April 7, 2026

    Iran War: How far will Trump go after war crime threats?

    April 7, 2026

    OnePlus Nord 6 5G Launched in India: Price and Specifications

    April 7, 2026
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    Facebook Instagram
    geekfence.comgeekfence.com
    • Home
    • UK Tech News
    • AI
    • Big Data
    • Cyber Security
      • Cloud Computing
      • iOS Development
    • IoT
    • Mobile
    • Software
      • Software Development
      • Software Engineering
    • Technology
      • Green Technology
      • Nanotechnology
    • Telecom
    geekfence.comgeekfence.com
    Home»iOS Development»SwiftButler | Cocoanetics
    iOS Development

    SwiftButler | Cocoanetics

    AdminBy AdminApril 4, 2026No Comments4 Mins Read0 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    SwiftButler | Cocoanetics
    Share
    Facebook Twitter LinkedIn Pinterest Email


    SwiftButler | Cocoanetics

    Before I figured out how to use macros to enable SwiftMCP, I experimented a lot with SwiftSyntax and built a project that I called SAAE – Swift AST Abstractor & Editor. Such it lay forgotten on a public GitHub repo. So I figured, it would deserve a new coat of paint and a better name.

    The CLI of the project has four main functions at this time:

    • analyze – Makes you are cut down interface description for any number of files. This way you can hand the public interface for a framework to your LLM without it having to read lots of superfluous text.
    • check – Does a super-fast local syntax check within the scope of one file. This way you can catch “obvious” syntax error in generated code before you waste time on a long build.
    • reindent – Generated code usually doesn’t care about how you like your code reindented. This function essentially what CMD+I does in Xcode.
    • distribute – Generated code tends to want to put all new code into a single file resulting an tons of declarations in huge files. This function splits all declarations into separate files. If protocol extensions it puts them parallel to the declaration file with +Protocol added to the name.

    This is all some kind of housekeeping work, so at first I wanted to go with maid. But my AI convinced me that this is a bad name for many reasons, including the fact that the term “maid” is supposedly sexist. So I let myself be convinced that butler is way better. So we went with that.

    SAAE becomes SwiftButler

    So for version 1, I polished up the CLI a bit, gave it a --version command, and renamed it to butler. I added a SKILL.md file to aid with it being used as an OpenClaw skill and also added it to my homebrew tap so that you can easily install it.

    brew install cocoanetics/tap/swiftbutler

    Then to use it just do something like:

    butler analyze Sources/MyModule --visibility public

    The complete documentation for the CLI can be found on GitHub. Or just install it from ClawHub.

    Granted, you could also ask your coding agent to do this kind of refactoring. But coding agents would do that by generating all the extracted code from scratch and also to generated the code to be deleted as well. With this tool it’s essentially free.

    This was the main realization why I felt that butler would be quite useful in any Swift developer’s tool belt.

    And while watching my coding agents at work I keep seeing that they still have occasional trouble with syntax or even get tripped up by their own file editing tools. Cursor (and by extension VS Code) has an advantage over Codex and Claude by having access to a Swift Linter which tells the LLM right then and there that there’s some syntax problem.

    I have yet to try it in practice, but I think the butler check function should be able to act as a first line of defence linter for Codex or Claude Code. This emits all the kinds of syntax errors you’d get from the syntax checker of the Swift compiler. It won’t be able to tell you if you are calling a non-existing function from another file, but there are many syntax problems it CAN tell you about. To a degree there are even fix its provided.

    Conclusion

    LLMs might be getting better and better at writing correct code from the start, but even if they write perfect code there remain some refactoring operations that you’d be better off doing deterministically by employing tools that can help you verify and modify the abstract syntax tree of your source code.

    When building SwiftButler I had a few more ideas for what it could/should do:

    • make sure all public functions have DocC comments
    • make sure all file headers adhere to a certain standard
    • more ambitious: have some sort of lookup function that allows finding declarations or functions by name or semantically
    • most ambitious: emulate cross-file syntax checking by verifying that declarations or functions exist in the local project

    What do you think? What should be add next?

    Like this:

    Like Loading…

    Related


    Categories: Updates



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    Deep dive into Swift frameworks

    April 3, 2026

    swift – How to conditionally set tint color on interactive glass in SwiftUI iOS 26?

    April 2, 2026

    How to parse JSON in Swift using Codable protocol?

    March 29, 2026

    ios – What is the correct way to initialize a Data property in a model object in SwiftData / CloudKit?

    March 28, 2026

    Ultimate UICollectionView guide with iOS examples written in Swift

    March 24, 2026

    app store – Guideline 3.1.1 – Business – Payments – In-App Purchase in ios reject

    March 23, 2026
    Top Posts

    Understanding U-Net Architecture in Deep Learning

    November 25, 202527 Views

    Hard-braking events as indicators of road segment crash risk

    January 14, 202624 Views

    Redefining AI efficiency with extreme compression

    March 25, 202622 Views
    Don't Miss

    Hacks season 5 review: Acclaimed comedy gets last laugh in final season

    April 7, 2026

    At a glanceExpert’s Rating Our Verdict In a season that contends with legacy and what…

    Iran War: How far will Trump go after war crime threats?

    April 7, 2026

    OnePlus Nord 6 5G Launched in India: Price and Specifications

    April 7, 2026

    Enabling agent-first process redesign | MIT Technology Review

    April 7, 2026
    Stay In Touch
    • Facebook
    • Instagram
    About Us

    At GeekFence, we are a team of tech-enthusiasts, industry watchers and content creators who believe that technology isn’t just about gadgets—it’s about how innovation transforms our lives, work and society. We’ve come together to build a place where readers, thinkers and industry insiders can converge to explore what’s next in tech.

    Our Picks

    Hacks season 5 review: Acclaimed comedy gets last laugh in final season

    April 7, 2026

    Iran War: How far will Trump go after war crime threats?

    April 7, 2026

    Subscribe to Updates

    Please enable JavaScript in your browser to complete this form.
    Loading
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions
    © 2026 Geekfence.All Rigt Reserved.

    Type above and press Enter to search. Press Esc to cancel.