{"passport":{"unfragile":{"@version":"1.0","version":"2026-05","artifact":{"id":"github-krzysztofzablocki--sourcery","slug":"krzysztofzablocki--sourcery","name":"Sourcery","type":"repo","url":"http://merowing.info","page_url":"https://unfragile.ai/krzysztofzablocki--sourcery","categories":["frameworks-sdks"],"tags":["code-generation","codegen","codegenerator","ios","metaprogramming","swift","templates"],"pricing":{"model":"open_source","free":true,"starting_price":null},"status":"active","verified":false},"capabilities":[{"id":"github-krzysztofzablocki--sourcery__cap_0","uri":"capability://code.generation.editing.swiftsyntax.based.ast.parsing.with.intelligent.caching","name":"swiftsyntax-based ast parsing with intelligent caching","description":"Parses Swift source files using Apple's SwiftSyntax framework (since v1.9.0) to build a complete abstract syntax tree, extracting type definitions, methods, variables, and relationships. Implements an intelligent caching system that fingerprints file contents and skips re-parsing unchanged files, dramatically improving performance on large codebases by avoiding redundant syntax analysis.","intents":["Parse a large Swift codebase without re-analyzing unchanged files on every run","Extract complete type information including nested types, generics, and protocol conformance","Understand method signatures, parameter types, and return types for code generation","Build a queryable type model that templates can introspect"],"best_for":["iOS/macOS teams with large codebases (1000+ Swift files)","Developers building custom code generators on top of Sourcery","Teams needing incremental code generation in CI/CD pipelines"],"limitations":["Cache invalidation is file-level only — changes to imported types don't automatically invalidate dependent files","SwiftSyntax parsing adds ~50-200ms per file depending on complexity","No support for parsing Objective-C headers or mixed-language projects","Cache directory must be writable; no in-memory-only mode for sandboxed environments"],"requires":["Swift 5.5+","SwiftSyntax 510.0.0+ (bundled with Sourcery)","Writable filesystem for cache storage (.sourcery-cache)"],"input_types":["Swift source files (.swift)","Swift package directories","Xcode project targets"],"output_types":["Internal type model (Type, Class, Struct, Enum, Protocol, Actor objects)","Queryable AST representation with full type relationships"],"categories":["code-generation-editing","data-processing-analysis"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_1","uri":"capability://code.generation.editing.multi.template.language.support.with.stencil.swift.and.javascript","name":"multi-template language support with stencil, swift, and javascript","description":"Supports three distinct template languages — Stencil (Jinja2-like syntax), native Swift templates, and JavaScript — allowing developers to choose the most ergonomic approach for their code generation needs. Each template language has access to the complete parsed type model through a unified context object, enabling templates to introspect types, iterate over methods/variables, and conditionally generate code based on annotations or type characteristics.","intents":["Write code generation templates in the language most familiar to the team","Generate complex, conditional code based on type annotations and relationships","Reuse existing Stencil templates from other projects or communities","Implement custom logic in Swift or JavaScript for sophisticated code generation"],"best_for":["Teams with diverse template language preferences","Projects requiring complex conditional logic in code generation","Organizations migrating from other code generators with Stencil templates"],"limitations":["Stencil templates have limited performance for very large type models (100+ types with 1000+ methods)","Swift templates require compilation, adding ~2-5 seconds per template change","JavaScript templates require Node.js runtime; no native JS engine in Swift","No template inheritance or composition across multiple template files"],"requires":["Stencil: included in Sourcery","Swift templates: Swift 5.5+ compiler","JavaScript templates: Node.js 12+ installed and in PATH"],"input_types":["Stencil template files (.stencil)","Swift template files (.swift)","JavaScript template files (.js)"],"output_types":["Generated Swift code (.swift files)","Any text-based output format (JSON, YAML, documentation)"],"categories":["code-generation-editing","text-generation-language"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_10","uri":"capability://data.processing.analysis.type.model.introspection.api.for.templates","name":"type model introspection api for templates","description":"Exposes a comprehensive object model (Type, Class, Struct, Enum, Protocol, Method, Variable, Parameter, etc.) to templates, allowing introspection of type characteristics, methods, properties, and relationships. Templates can query type metadata (name, kind, access level, annotations), iterate over methods and variables with full signature information, and traverse type relationships to make generation decisions based on type structure.","intents":["Query type characteristics (is it a class, struct, enum, protocol?) in templates","Iterate over all methods and variables with full signature information","Access method parameter types and return types for generating type-safe code","Filter types by annotations or characteristics for selective code generation"],"best_for":["Template developers writing custom code generators","Teams building sophisticated code generation logic based on type structure","Projects requiring type-aware code generation beyond simple templates"],"limitations":["Type model API is not versioned; breaking changes in Sourcery versions can break templates","No documentation of all available properties on Type objects; requires reading source code","Type model does not include runtime type information; only static analysis results","Complex type queries (e.g., 'find all types conforming to protocol X that have method Y') require manual template logic"],"requires":["Understanding of Sourcery's type model classes (Type, Method, Variable, etc.)","Template language (Stencil, Swift, or JavaScript) to query the model"],"input_types":["Parsed type model objects"],"output_types":["Introspection results (type names, method signatures, annotations, relationships)"],"categories":["data-processing-analysis","code-generation-editing"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_11","uri":"capability://code.generation.editing.multi.platform.swift.code.generation.for.ios.macos.tvos.watchos","name":"multi-platform swift code generation for ios, macos, tvos, watchos","description":"Generates Swift code compatible with multiple Apple platforms (iOS, macOS, tvOS, watchOS) by understanding platform-specific APIs and availability annotations. Templates can query platform availability information and conditionally generate platform-specific code, enabling creation of cross-platform libraries and frameworks that adapt generated code to target platforms.","intents":["Generate code that works across multiple Apple platforms","Conditionally generate platform-specific implementations in templates","Understand API availability for different iOS/macOS versions","Create cross-platform libraries with platform-adapted generated code"],"best_for":["Teams developing cross-platform Apple frameworks","Projects supporting multiple iOS/macOS versions with different APIs","Libraries requiring platform-specific code generation"],"limitations":["Platform availability information is parsed from @available annotations; custom availability logic is not understood","No support for conditional compilation (#if os(iOS)) in generated code; templates must handle conditionals","Platform detection is static; runtime platform checks are not reflected in type model","No built-in templates for common cross-platform patterns; templates must be custom-written"],"requires":["@available annotations in source code for platform-specific APIs","Template logic to query and filter on platform availability"],"input_types":["Type definitions with @available annotations"],"output_types":["Generated Swift code with platform-specific implementations"],"categories":["code-generation-editing"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_12","uri":"capability://automation.workflow.error.reporting.and.diagnostics.with.file.line.information","name":"error reporting and diagnostics with file/line information","description":"Provides detailed error messages and diagnostics that include source file paths and line numbers, helping developers quickly locate and fix issues in source code or templates. Errors during parsing, template processing, or code generation include context about what failed and where, reducing debugging time for code generation issues.","intents":["Quickly identify which source file or template caused a code generation error","Understand what went wrong during parsing or template processing","Debug template logic errors with line number information","Integrate code generation errors into IDE error reporting"],"best_for":["Developers actively debugging code generation issues","Teams integrating Sourcery into CI/CD with error reporting","Projects with complex templates requiring debugging"],"limitations":["Error messages for template syntax errors can be cryptic; line numbers may not match template source","No stack traces for template execution errors; difficult to debug nested template logic","Parse errors from SwiftSyntax are sometimes unclear about the actual syntax issue","No integration with IDE error reporting; errors are printed to console only"],"requires":["Standard error output to capture error messages"],"input_types":["Source files, templates, configuration"],"output_types":["Error messages with file paths and line numbers"],"categories":["automation-workflow"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_2","uri":"capability://code.generation.editing.annotation.driven.code.generation.with.documentation.comments","name":"annotation-driven code generation with documentation comments","description":"Parses documentation comments (/// annotations) embedded in Swift source code to extract metadata that controls code generation behavior. Developers can annotate types, methods, and variables with custom markers (e.g., // sourcery: AutoMockable) that templates can query to conditionally generate code — enabling declarative, in-source configuration of which types receive generated code without separate configuration files.","intents":["Mark specific types for code generation without modifying configuration files","Pass metadata to templates through documentation comments","Enable selective code generation (e.g., only mock types marked with AutoMockable)","Keep code generation intent close to the source code definition"],"best_for":["Teams preferring declarative, in-source configuration over external config files","Projects with selective code generation requirements (not all types need mocks)","Developers wanting to document why code generation is applied to specific types"],"limitations":["Annotations are parsed from comments only; no compile-time validation of annotation syntax","Complex metadata must be encoded as strings in comments; no structured annotation syntax","Annotation changes require re-parsing; no incremental annotation-only updates","No IDE autocomplete or validation for custom annotation names"],"requires":["Swift source files with documentation comments (/// or //)","Template logic to query and filter on annotations"],"input_types":["Swift source files with /// documentation comments","Custom annotation strings embedded in comments"],"output_types":["Filtered type model with annotation metadata","Generated code based on annotation presence/values"],"categories":["code-generation-editing","data-processing-analysis"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_3","uri":"capability://data.processing.analysis.type.relationship.composition.and.inheritance.resolution","name":"type relationship composition and inheritance resolution","description":"Builds a complete type relationship graph by composing parsed types to resolve inheritance chains, protocol conformance, and type dependencies. The Composer component walks the parsed AST to establish parent-child relationships, protocol implementations, and generic type bindings, creating a queryable model where templates can traverse inheritance hierarchies, find all types conforming to a protocol, or identify generic type parameters.","intents":["Generate code that respects inheritance hierarchies (e.g., generate Equatable only for concrete types, not protocols)","Find all types conforming to a specific protocol for bulk code generation","Resolve generic type parameters to generate specialized implementations","Understand type dependencies for generating initializers or factory methods"],"best_for":["Projects with complex type hierarchies (10+ levels of inheritance)","Code generators that need to understand protocol conformance relationships","Teams generating protocol-specific code (e.g., Codable implementations)"],"limitations":["Circular type dependencies are not detected; can cause infinite loops in templates","Generic type resolution is limited to direct type parameters; no complex type algebra","Protocol composition (e.g., P1 & P2) is parsed but not fully resolved in relationship graph","Type relationships are resolved at parse time; runtime type changes are not reflected"],"requires":["Parsed type model from SwiftSyntax parser","All source files in the same compilation unit for relationship resolution"],"input_types":["Parsed Type objects with inheritance and protocol information"],"output_types":["Enriched type model with resolved relationships","Queryable parent/child relationships, protocol conformance lists"],"categories":["data-processing-analysis","code-generation-editing"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_4","uri":"capability://automation.workflow.configuration.driven.file.discovery.and.multi.source.input","name":"configuration-driven file discovery and multi-source input","description":"Supports flexible input configuration through YAML files (.sourcery.yml) and command-line arguments, enabling developers to specify source files, directories, Xcode project targets, and Swift package targets as input sources. The configuration system resolves these diverse input types into a unified list of Swift files to parse, supporting project-level configuration that can be version-controlled and shared across teams.","intents":["Configure code generation inputs via version-controlled YAML files","Generate code from specific Xcode project targets without manual file listing","Process Swift Package Manager targets automatically","Override configuration at runtime via command-line arguments"],"best_for":["Teams using Xcode projects or Swift packages","CI/CD pipelines requiring reproducible, version-controlled configuration","Projects with multiple targets requiring different code generation rules"],"limitations":["YAML configuration is not validated against a schema; typos in config keys are silently ignored","Xcode project parsing is limited to targets; no support for build phases or conditional compilation","Swift package discovery requires Package.swift to be present; no support for local package overrides","Configuration merging (CLI + YAML) is not well-documented; precedence rules are unclear"],"requires":["YAML configuration file (.sourcery.yml) or command-line arguments","For Xcode projects: Xcode 12+ with project file accessible","For Swift packages: Package.swift file in project root"],"input_types":["YAML configuration files (.sourcery.yml)","Command-line arguments (--sources, --templates, --output)","Xcode project files (.xcodeproj)","Swift package manifests (Package.swift)"],"output_types":["Resolved list of Swift source files to parse","Configuration object with sources, templates, output paths"],"categories":["automation-workflow","data-processing-analysis"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_5","uri":"capability://automation.workflow.file.watching.and.continuous.code.generation","name":"file watching and continuous code generation","description":"Implements optional file system watching that monitors source files and templates for changes, automatically re-running the code generation pipeline when modifications are detected. The watcher uses platform-specific file system events (FSEvents on macOS, inotify on Linux) to trigger incremental re-parsing and re-generation, enabling developers to see generated code updates in real-time during development without manual invocation.","intents":["Automatically regenerate code when source files change during development","Watch template files and regenerate when templates are modified","Provide real-time feedback on code generation in development workflow","Reduce manual invocation of code generation commands"],"best_for":["Developers actively working on code generators and templates","Teams using Sourcery in development workflows (not just CI/CD)","Projects with frequent changes to types requiring generated code"],"limitations":["File watching adds continuous background process overhead (~5-10% CPU on large codebases)","Watch mode does not detect changes to imported frameworks or external dependencies","File system events can be delayed by OS buffering; generation may lag file changes by 100-500ms","No built-in debouncing for rapid file changes; can trigger multiple generations in quick succession"],"requires":["File system watching support (available on macOS, Linux; limited on Windows)","--watch flag or watch: true in YAML configuration"],"input_types":["Source file paths to monitor","Template file paths to monitor"],"output_types":["Continuous regeneration of output files as inputs change"],"categories":["automation-workflow"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_6","uri":"capability://code.generation.editing.automockable.protocol.mock.generation","name":"automockable protocol mock generation","description":"Provides a built-in code generator that automatically creates mock implementations of protocols annotated with // sourcery: AutoMockable. The generator introspects protocol method signatures, parameter types, and return types to synthesize mock objects with recording/verification capabilities, eliminating manual mock writing for unit testing. Mocks include call tracking, argument capture, and return value configuration.","intents":["Generate protocol mocks for unit testing without manual implementation","Create mocks that track method calls and capture arguments","Configure return values for mock methods in tests","Reduce boilerplate in test suites for protocols with many methods"],"best_for":["iOS/macOS teams writing unit tests with protocol-based architectures","Projects with many protocols requiring mock implementations","Teams using dependency injection patterns with protocol abstractions"],"limitations":["Only generates mocks for protocols; cannot mock concrete classes or structs","Generic protocol methods with complex type constraints may generate incorrect mocks","Mocks do not support async/await methods (pre-Swift 5.5 limitation in older Sourcery versions)","No support for property getters/setters; only methods are mocked","Generated mocks require manual integration into test targets"],"requires":["Protocol definitions in source code","// sourcery: AutoMockable annotation on protocol","Swift 5.5+ for async/await support"],"input_types":["Protocol definitions with AutoMockable annotation"],"output_types":["Generated Swift mock class implementing the protocol","Mock with call tracking, argument capture, return value configuration"],"categories":["code-generation-editing"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_7","uri":"capability://code.generation.editing.autohashable.and.autoequatable.synthesis","name":"autohashable and autoequatable synthesis","description":"Automatically generates Hashable and Equatable protocol implementations for types annotated with // sourcery: AutoHashable or AutoEquatable. The generator introspects all stored properties of the type and synthesizes hash() and == implementations that include all properties, ensuring consistency between equality and hashing semantics without manual implementation.","intents":["Generate Equatable implementations for types without manual == method writing","Generate Hashable implementations for use in Sets and Dictionary keys","Ensure hash/equality consistency across all properties automatically","Reduce boilerplate for value types that need collection membership"],"best_for":["Projects with many value types (structs) requiring Equatable/Hashable","Teams wanting to avoid manual == implementation bugs","Code bases where types frequently add new properties"],"limitations":["Only works for stored properties; computed properties are ignored","Does not handle custom equality semantics (e.g., case-insensitive string comparison)","Generated hash implementations may not be optimal for performance-critical code","Cannot generate for types with non-Hashable properties when using AutoHashable"],"requires":["Struct or class definition","// sourcery: AutoHashable or AutoEquatable annotation","All properties must conform to Equatable (for AutoEquatable) or Hashable (for AutoHashable)"],"input_types":["Type definitions (struct, class, enum) with AutoHashable/AutoEquatable annotation"],"output_types":["Generated Equatable conformance with == implementation","Generated Hashable conformance with hash(into:) implementation"],"categories":["code-generation-editing"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_8","uri":"capability://code.generation.editing.custom.code.generator.templates.with.full.type.model.access","name":"custom code generator templates with full type model access","description":"Enables developers to write custom code generators by creating templates (in Stencil, Swift, or JavaScript) that have full access to the parsed type model, including types, methods, variables, annotations, and relationships. Templates can iterate over types, filter by annotations or characteristics, and generate arbitrary code based on introspection, allowing creation of domain-specific code generators beyond built-in generators.","intents":["Create custom code generators for project-specific patterns (e.g., API client generation, state machine synthesis)","Generate boilerplate for architectural patterns (e.g., MVVM, Redux, Clean Architecture)","Implement domain-specific code generation logic tailored to team conventions","Extend Sourcery with custom generators without modifying core code"],"best_for":["Teams with custom architectural patterns requiring boilerplate","Projects needing domain-specific code generation beyond standard patterns","Organizations building internal code generation frameworks on top of Sourcery"],"limitations":["Template debugging is difficult; errors in template logic produce cryptic error messages","No built-in template testing framework; templates must be tested by running full generation","Complex template logic can become unmaintainable; no modularization or code reuse within templates","Performance degrades with very large type models (100+ types); templates must manually optimize iteration"],"requires":["Template file in Stencil, Swift, or JavaScript","Understanding of Sourcery's type model API (Type, Method, Variable, etc.)","Configuration pointing to template file"],"input_types":["Parsed type model (Type objects with methods, variables, annotations)"],"output_types":["Generated Swift code or any text-based output format"],"categories":["code-generation-editing","text-generation-language"],"confidence":0.5,"matches":0,"success_rate":0},{"id":"github-krzysztofzablocki--sourcery__cap_9","uri":"capability://automation.workflow.incremental.output.file.generation.with.diff.based.updates","name":"incremental output file generation with diff-based updates","description":"Generates output files with awareness of existing content, using diff-based comparison to determine which files have actually changed. Only modified files are written to disk, reducing unnecessary file system churn and avoiding triggering unnecessary Xcode rebuilds. The system preserves file modification times for unchanged files, enabling build systems to skip recompilation when generated code hasn't changed.","intents":["Avoid triggering unnecessary Xcode rebuilds when generated code hasn't changed","Reduce file system writes in CI/CD pipelines with many code generation runs","Preserve file modification times to enable build system caching","Provide visibility into which files were actually modified by generation"],"best_for":["Large projects where unnecessary rebuilds significantly impact build time","CI/CD pipelines running code generation frequently","Teams using incremental builds and wanting to avoid spurious rebuilds"],"limitations":["Diff comparison adds ~10-50ms per output file; negligible for small projects but noticeable for 100+ generated files","File modification time preservation is OS-dependent; may not work on all file systems","No support for partial file updates; entire file is regenerated or not at all","Diff-based caching is lost if output directory is cleaned"],"requires":["Output directory with write permissions","File system supporting modification time preservation"],"input_types":["Generated code content"],"output_types":["Written Swift files only if content changed","Preserved modification times for unchanged files"],"categories":["automation-workflow","code-generation-editing"],"confidence":0.5,"matches":0,"success_rate":0}],"trust":{"score":46,"verified":false,"data_access_risk":"high","permissions":["Swift 5.5+","SwiftSyntax 510.0.0+ (bundled with Sourcery)","Writable filesystem for cache storage (.sourcery-cache)","Stencil: included in Sourcery","Swift templates: Swift 5.5+ compiler","JavaScript templates: Node.js 12+ installed and in PATH","Understanding of Sourcery's type model classes (Type, Method, Variable, etc.)","Template language (Stencil, Swift, or JavaScript) to query the model","@available annotations in source code for platform-specific APIs","Template logic to query and filter on platform availability"],"failure_modes":["Cache invalidation is file-level only — changes to imported types don't automatically invalidate dependent files","SwiftSyntax parsing adds ~50-200ms per file depending on complexity","No support for parsing Objective-C headers or mixed-language projects","Cache directory must be writable; no in-memory-only mode for sandboxed environments","Stencil templates have limited performance for very large type models (100+ types with 1000+ methods)","Swift templates require compilation, adding ~2-5 seconds per template change","JavaScript templates require Node.js runtime; no native JS engine in Swift","No template inheritance or composition across multiple template files","Type model API is not versioned; breaking changes in Sourcery versions can break templates","No documentation of all available properties on Type objects; requires reading source code","builder identity is not verified yet","no observed match outcomes yet"],"rank_breakdown":{"adoption":0.6301107099039367,"quality":0.35,"ecosystem":0.6000000000000001,"match_graph":0.25,"freshness":0.75,"weights":{"adoption":0.3,"quality":0.2,"ecosystem":0.15,"match_graph":0.3,"freshness":0.05}},"observed_outcomes":{"matches":0,"success_rate":0,"avg_confidence":0,"top_intents":[],"last_matched_at":null},"maintenance":{"status":"active","updated_at":"2026-05-24T12:16:21.550Z","last_scraped_at":"2026-05-03T13:58:37.059Z","last_commit":"2026-04-25T07:14:34Z"},"community":{"stars":7988,"forks":634,"weekly_downloads":null,"model_downloads":null,"model_likes":null}},"distribution":{"claim_url":"https://unfragile.ai/submit?claim=krzysztofzablocki--sourcery","compare_url":"https://unfragile.ai/compare?artifact=krzysztofzablocki--sourcery"}},"signature":"4/AdzgbFt6RrbNAwuw4ajhyO/YEZLlbvr0Y8Qd/t9kSDQ2sWAVCsnx2dFs2h1TfHbdqruRyEBQ9AmMvqezqPAw==","signedAt":"2026-06-22T04:35:34.217Z","signedBy":"unfragile.ai","version":1},"_links":{"self":"https://unfragile.ai/api/v1/passport/krzysztofzablocki--sourcery","artifact":"https://unfragile.ai/krzysztofzablocki--sourcery","verify":"https://unfragile.ai/api/v1/verify?slug=krzysztofzablocki--sourcery","publicKey":"https://unfragile.ai/api/v1/trust-passport-public-key","spec":"https://unfragile.ai/trust","schema":"https://unfragile.ai/schema.json","docs":"https://unfragile.ai/docs"}}