// the take
Sourcery is a Swift code generator that walks your source via SwiftSyntax and runs Stencil/Swift/JS templates against it, producing boilerplate like Equatable, Codable, enum helpers, and protocol mocks. It's for iOS/macOS teams tired of hand-writing hundreds of lines of mock or conformance code per protocol and willing to add a code-gen step to their build.
Parses with SwiftSyntax directly instead of a bespoke parser, so it tracks language changes reasonably well. Ships a solid set of ready-made templates (Equatable, Hashable, Codable, Diffable, AutoMockable) that cover the most common boilerplate-generation needs out of the box. Supports three ways to write templates (Stencil, raw Swift, JS/EJS) and three ways to run it (standalone binary, SwiftPM plugin, pre-commit hook), so it fits into different team workflows without forcing one toolchain.
The maintainer is steering advanced functionality (live AST editing, a proper Stencil editor) into a paid Mac App Store product, 'Sourcery Pro', so the free CLI's authoring experience for custom templates stays comparatively rough. SwiftTemplate (.swifttemplate) mode actually compiles each template at build time into a temp directory, which adds real latency to builds and isn't supported at all when building via Swift Package Manager. It depends on a custom build phase or `--watch` process to stay in sync with source changes; skip that step and generated files silently go stale relative to the protocols/types they're supposed to mirror. Linux support is maintained as a separate, explicitly called-out doc page rather than a first-class target, which usually means it lags macOS in practice.
We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →