Back to directory

swift-mod

A command-line tool that sits between code generation and formatting for Swift, applying rules such as adding access modifiers or memberwise initializers based on the parsed syntax tree.

swift-mod

swift-mod is built on Apple's SwiftSyntax and modifies Swift source in place according to configurable rules, for example inserting an explicit access-control keyword or generating a memberwise initializer for a struct, taking the surrounding code's actual structure into account rather than only its text. Rules and formatting options are set in a YAML configuration file, which the tool can generate for a project and which a developer then edits by hand.

Commands include generating the initial configuration file, listing all available rules with detailed descriptions of each one, and running the modifications against the project; every command supports a help flag.

It is written in Swift and licensed under Apache-2.0.

More in Code quality

See all 94
  • Critic

    critic.run

    A code-change viewer, backed by Y Combinator, built for reviewing work written by coding agents, presenting a plain-language narrative of each change alongside the diff and a running conversation with the agent.

  • GitIntel

    hoangsonww.github.io

    An MCP server that computes git repository analytics such as hotspots, churn, temporal coupling, knowledge maps and risk scoring entirely from local commit history, for AI coding agents like Claude Code and Codex.

  • Axint

    axint.ai

    A verification layer for AI coding agents working on Apple projects: it runs real Xcode builds and tests against the Swift an agent wrote, reconciles static analysis findings against that evidence, and returns a signed proof with the exact repairs still needed.