# krzysztofzablocki/Sourcery

Meta-programming for Swift, stop writing boilerplate code.

Repository: https://github.com/krzysztofzablocki/Sourcery
Canonical: https://ross.abutalabs.com/products/sourcery
Homepage: http://merowing.info
Language: Swift
License: MIT
License Family: permissive
Topics: metaprogramming, swift, codegen, codegenerator, ios, templates, code-generation
Last push: 2026-06-11T10:26:55+00:00

## Health v2 (maintenance only)
Score: 68/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 87, release rhythm 24, longevity 100
- inputs: {"age_days": 3552, "days_push": 83, "days_rel": 349, "gap_med": 130.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 8018, forks 634 (observed 2026-08-28T04:10:11.796765+00:00)

## What it is
Sourcery is a code generator for the Swift language built on Apple's SwiftSyntax, using templates (Stencil, Swift templates) to eliminate boilerplate like mock implementations, equality, and Codable conformances. It is widely adopted in iOS and macOS projects and runs as a CLI or build-phase tool.

## Use cases
- generate mock classes for Swift protocols automatically
- remove repetitive boilerplate code in iOS projects
- auto-generate Equatable and Codable conformances
- generate code from Swift type information using Stencil templates
- speed up writing test doubles for unit tests
- automate repetitive Swift code generation in Xcode build phases

## When to choose
- you write lots of repetitive Swift boilerplate like mocks or conformances
- you want template-driven codegen integrated into Xcode or CI
- you need a mature, widely adopted Swift metaprogramming tool

## When to avoid
- your project is not in Swift
- you prefer hand-written explicit code over generated files
- you need runtime metaprogramming rather than build-time generation

## Facets
- artifact type: cli-tool
- maturity: stable
- function: developer-tools, parser, templating
- domain: developer-tools, programming-languages, mobile-development
- platform: cli
- tags: swift, metaprogramming, boilerplate, swiftsyntax, stencil-templates, ios, mock-generation, codable, code-generation, automation, macos, linux

## Member repositories
- krzysztofzablocki/Sourcery (main) score 68

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:11.796765+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:32:05.174808+00:00, confidence not recorded.
  - readme: https://github.com/krzysztofzablocki/Sourcery (fetched 2026-08-28T04:10:11.796765+00:00, sha 6886bf2c4fbd)
  - homepage: http://merowing.info (fetched 2026-08-29T08:29:24.989781+00:00, sha 61f3f84527cc)
  - site_page: https://merowing.info/about (fetched 2026-08-29T08:29:24.998742+00:00, sha 169bfe72ef06)
  - site_page: https://merowing.info/posts/eval-loops-for-llm-features (fetched 2026-08-29T08:29:25.000829+00:00, sha b28398939c2f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
