functional-core-imperative-shell

Enforce Functional Core and Imperative Shell boundaries with file classification comments.

13|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/pbdeuchler/llm-plugins --skill functional-core-imperative-shell-pbdeuchler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: functional-core-imperative-shell
Source: https://github.com/pbdeuchler/llm-plugins/tree/main/plugins/house-style/skills/howto-functional-vs-imperative
Command: npx skills add https://github.com/pbdeuchler/llm-plugins --skill functional-core-imperative-shell-pbdeuchler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

FCIS helps separate functional core logic from side effects, improving testability and maintainability by enforcing a clear split between pure computations and I/O orchestration.

Core Features & Use Cases

  • Identify and extract the Functional Core: move pure calculations into pure functions.
  • Isolate I/O in Imperative Shell: orchestrate file, network, and environment interactions in thin shell wrappers.
  • Enforce consistent classification: require pattern comments on modified/created files to document responsibilities.
  • Use cases: new code, refactoring, and architecture decisions across projects.

Quick Start

Identify pure logic, move it to a Functional Core, and wrap all I/O in an Imperative Shell.

Frequently Asked Questions about functional-core-imperative-shell

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I separate business logic from side effects to improve testability?

Apply functional core imperative shell separation by moving pure calculations into a functional core and wrapping file, network, and environment I/O in thin imperative shell wrappers. This architectural pattern enables reliable testing by isolating side effects from computations.

What is the functional core imperative shell pattern in software architecture?

The functional core imperative shell pattern is a software architecture design that splits pure computations from I/O orchestration. It enforces a clear boundary where pure functions handle calculations and thin shells manage file, network, and environment interactions.

Can I use FCIS refactoring on large existing projects?

Yes, FCIS refactoring applies to both small and large existing projects. It guides where to place logic versus I/O across new code, refactors, and architecture decisions, requiring explicit file classification comments to document responsibilities during the transition.

How do I enforce consistent boundaries when refactoring to functional core and imperative shell?

Enforce consistent FCIS boundaries by requiring explicit pattern comments on modified or created files to document their responsibilities. This maintains a clear core of pure functions and thin shells for I/O orchestration across the codebase.

When should I not use functional core imperative shell separation?

FCIS separation is less suited for trivial scripts or prototypes where long-term maintainability and reliable testing are not priorities. It provides the most value during new code creation, refactoring, and architecture decisions across small to large projects.