functional-programming-developer
Functional Architecture in Swift
Functional programming first, object-oriented / protocol-oriented programming second.
This skill guides how to design domain and core logic in Swift using immutability, pure functions, and explicit effects.
When to use
- Domain modeling
- Feature / business logic
- Reducers and workflows
- Dependency-injected use cases
- Highly testable code
Architectural patterns
- Functional Core / Imperative Shell
- Feature-oriented design
- Dependency injection via functions
- Mealy & extended state machines
- Effects as data
Functional techniques
- Algebraic Data Types (enum + struct)
- Functional operators (map, flatMap, reduce)
- Partial application & currying
- Optics (Lenses & Prisms with KeyPaths)
Reading order
- references/state-machines.md
- references/functional-operators.md
- references/algebraic-data-types.md
- references/optics.md
- references/dependency-injection-currying.md
- references/dependency-injection-decision-table.md
Dependency injection rules
- Closures first
- Capability structs second
- Protocols last (boundary only)
Testing rules
- Unit tests only in the core
- Fake closures instead of mocks
- No sleeps or timers
Summary
If it’s hard to test, simplify the design.
More from nonameplum/agent-skills
corebluetooth
Apple Core Bluetooth framework for BLE and Bluetooth Classic. Use for central/peripheral workflows, scanning, connecting, advertising, GATT services/characteristics, read/write/notify, L2CAP, background processing or state restoration, and error handling across Apple platforms.
42swift-package-manager
Swift Package Manager documentation - create packages, manage dependencies, build and test Swift code
32swift-health-kit
Apple HealthKit framework for health and fitness data. Use for reading/writing health samples, workout data, authorization flows, observer queries, background delivery, clinical records, activity rings, and integrating with the Health app across iPhone, Apple Watch, iPad, and visionOS.
30swift-composable-architecture
The Composable Architecture (TCA) - A library for building Swift applications with state management, composition, and testability
29swift-dependencies
A dependency management library for Swift with controlled, testable dependencies
26swift-docc
Official Swift DocC documentation markup and syntax reference
23