Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By modaal-agentApache-2.0
Generates Swift protocol mocks for tests, with call counting and handler closures, using Sourcery templates. Mocks are claimed to compile with zero diagnostics under strict concurrency and Swift 6 mode.
swift-sourcery-mocks@swift-sourcery-templates, from the skills/ folder. Claude Code treats the two as separate plugins. View the author's build →Claude loads one when your task matches it, or you run it by name.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Advanced Protocol Mock, Type Erasure and dependency-forwarding Code-generation templates for Swift (using Sourcery).
Three templates:
Mocks.swifttemplate — generates protocol mock classes for test doubles with call counting, handler closures, and smart defaultsTypeErase.swifttemplate — generates type erasure wrappersComponent.swifttemplate — generates the forwarding class that satisfies a dependency-injection protocol, for trees where each level declares what it consumes. See ComponentsThe first two support protocols with associated types, generic functions with constraints, @escaping closure parameters,
and provide smart defaults for RxSwift and Combine types. Compatible with RIBs architecture patterns.
Generated mocks compile with zero diagnostics under -strict-concurrency=complete and in the
Swift 6 language mode: async and nonisolated are carried through to the mock, a protocol's
global actor is declared on the mock class, and a Sendable protocol gets an @unchecked
conformance. See Concurrency.
swift-sourcery-templates is open source under the Apache License 2.0 and works in any SwiftPM package or Xcode project on its own. Modaal.dev supports this repository and also makes code and design authoring tools for native iOS and Android apps: the tools give an agent the project's context and the commands to build, check and run the app, and let a person design the screens and edit the code beside the agent.
skills/swift-sourcery-mocks/ is an agent skill: the
setup below, written for a coding agent working in a repository that adopts these templates. It
picks the lane, writes the config, prints the mocks a target generates without building it, and
names the cause when generation produces a mock that does not conform.
Four channels install it, over one tree.
1. Any of ~75 agents, through the cross-agent CLI. -g installs for every project on the
machine instead of this one; --list lists without installing.
npx skills add modaal-agent/swift-sourcery-templates
2. As a Claude Code plugin. The repository root is the marketplace, and skills/ is the
plugin's root:
/plugin marketplace add modaal-agent/swift-sourcery-templates
/plugin install swift-sourcery-mocks@swift-sourcery-templates
/plugin update swift-sourcery-mocks@swift-sourcery-templates installs a new version.
3. By hand.
git clone https://github.com/modaal-agent/swift-sourcery-templates
cp -r swift-sourcery-templates/skills/* ~/.claude/skills/
.claude/skills/ inside a project installs it for that project alone.
4. claude.ai and the Skills API. The frontmatter carries only the Agent Skills standard's keys,
so skills/swift-sourcery-mocks/ packages and uploads unedited.
A prompt to try in a Swift package:
The
Paymentspackage's tests use a hand-writtenFakeRefundService. Generate mocks for the protocols inSources/Paymentsinto thePaymentsTeststarget, and rewriteRefundFlowTeststo useRefundServiceMock.
For a protocol method:
/// sourcery: ProtocolMock
protocol DataService {
func fetchData(id: String, completion: @escaping (String?, Error?) -> Void)
}
The template generates:
final class DataServiceMock: DataService {
func fetchData(id: String, completion: @escaping (String?, Error?) -> Void) {
fetchDataCallCount += 1
fetchDataArgs.append(id)
if let __fetchDataHandler = self.fetchDataHandler {
__fetchDataHandler(id, completion)
}
}
var fetchDataCallCount: Int = 0
var fetchDataArgs: [String] = []
var fetchDataHandler: ((_ id: String, _ completion: @escaping (String?, Error?) -> Void) -> ())? = nil
}
Plugins from other owners that cover similar ground
Generated from the plugin's indexed repository (modaal-agent/swift-sourcery-templates) — no native marketplace selected
npx claudepluginhub p/modaal-agent-swift-sourcery-mocksBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.