
Functional Core Imperative Shell
This skill helps you structure code by separating pure business logic from side effects. The core idea is simple: put your pure functions in one file where they're easy to test without mocks, and isolate all I/O operations in a thin shell around them. It's based on the functional core, imperative shell pattern that makes entire classes of bugs structurally impossible. The author suggests using it whenever you're writing new code, refactoring, or deciding where logic belongs. It's a disciplined approach that pays off in testability, though it requires thinking carefully about boundaries from the start.
- skills.sh installs
- 192
- GitHub stars
- 253
- last updated
- Aug 21, 2026
Install
$ npx -y skills add ed3dai/ed3d-plugins --skill functional-core-imperative-shell --agent claude-codeInstalls into .claude/skills of the current project.
Files
Functional Core, Imperative Shell (FCIS)
Overview
Core principle: Separate pure business logic (Functional Core) from side effects (Imperative Shell). Pure functions go in one file, I/O operations in another.
Why this matters: Pure functions are trivial to test (no mocks needed). I/O code is isolated to thin shells. Bugs become structurally impossible when business logic has no side effects.
When to Use
Use FCIS when:
- Writing any new code file
- Refactoring existing code
- Reviewing code for architectural decisions
- Deciding where logic belongs
Trigger symptoms:
- "Where should this function go?"
- Creating a new file
- Adding database calls to logic
- Adding file I/O to calculations
- Writing tests that need complex mocking
MANDATORY: File Classification
YOU MUST add pattern comment to every file containing runtime behavior:
// pattern: Functional Core
// pattern: Imperative Shell
// pattern: Mixed (needs refactoring)
If file genuinely cannot be separated (rare), document why:
Sponsors
Details
- Repository
- github.com/ed3dai/ed3d-plugins
- Categories
- Documentation, Code Review & Quality, CLI & Terminal
- First seen
- Jun 3, 2026