architecture-paradigm-functional-core
FeaturedApplies Functional Core, Imperative Shell to isolate logic from side effects. Use when business logic is entangled with I/O or unit tests are slow and brittle.
Code & Development 339 stars
35 forks Updated 2 days ago MIT
Install
Quality Score: 94/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# The Functional Core, Imperative Shell Paradigm
## When To Use
- Separating pure business logic from side effects
- Improving testability through immutable domain models
## When NOT To Use
- Performance-critical hot paths where immutability overhead matters
- Purely imperative codebases with no plans to adopt functional patterns
## When to Employ This Paradigm
- When business logic is entangled with I/O operations (e.g., database calls, HTTP requests), making tests brittle and slow.
- When significant development time is spent rewriting adapters or dealing with framework churn.
- When you require a suite of fast, deterministic unit tests that operate on plain data, complemented by a thin integration testing layer.
## Adoption Steps
1. **Inventory Side Effects**: Create a map of all side effects in the system, such as database writes, external API calls, UI events, and filesystem access. Explicitly assign these responsibilities to the "shell."
2. **Model the Core Logic**: Represent business rules and policies as pure functions. These functions should take domain data as input and return decisions or commands as output, avoiding shared mutable state.
3. **Design the Command Schema**: Define a small, explicit set of command objects that the core can return and the shell can interpret (e.g., `PersistOrder`, `PublishEvent`, `NotifyUser`).
4. **Refactor Incrementally**: Begin with high-churn or critical modules. Wrap legacy imperative code behind adapters while progressivel...
Details
- Author
- athola
- Repository
- athola/claude-night-market
- Created
- 10 months ago
- Last Updated
- 2 days ago
- Language
- Python
- License
- MIT
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
functional-separating-pure-core-from-shell
Use when business logic cannot be tested without I/O, when one call deep inside forces every caller to become async, or when deciding where a database or HTTP call belongs.
0 Updated yesterday
yutna AI & Automation Listed
separating-pure-core-from-shell
Use when business logic cannot be tested without I/O, when one call deep inside forces every caller to become async, or when deciding where a database or HTTP call belongs.
0 Updated yesterday
yutna AI & Automation Featured
architecture-paradigm-modular-monolith
Applies modular monolith with enforced internal boundaries. Use when teams want service-level autonomy without distributed system overhead.
339 Updated 2 days ago
athola