Use when writing or refactoring code, before creating files - enforces separation of pure business logic (Functional Core) from side effects (Imperative Shell) using FCIS pattern with mandatory file classification
View on GitHubed3dai/ed3d-plugins
ed3d-house-style
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/ed3dai/ed3d-plugins/blob/main/plugins/ed3d-house-style/skills/howto-functional-vs-imperative/SKILL.md -a claude-code --skill functional-core-imperative-shellInstallation paths:
.claude/skills/functional-core-imperative-shell/# 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 you create or modify:** ``` // pattern: Functional Core // pattern: Imperative Shell // pattern: Mixed (needs refactoring) ``` **If file genuinely cannot be separated (rare), document why:** ``` // pattern: Mixed (unavoidable) // Reason: [specific technical justification] // Example: Performance-critical path where separating I/O causes unacceptable overhead ``` **No file without classification.** If you create code without this comment, you have violated the requirement. ### Exceptions: Files That Don't Need Classification **DO NOT add pattern comments to:** - Bash/shell scripts (.sh, .bash) - inherently imperative - Configuration files (eslint.config.js, tsconfig.json, .env, etc.) - Markdown documentation (.md) - HTML files (.html) - Task runner files (justfile, Makefile, etc.) - Package manifests (package.json, pyproject.toml, etc.) - Data files (JSON, YAML, CSV, etc.) **Classification applies ONLY to application code** (source files containing business logic or I/O orchestration). ## File Type Definitions ### Functional Core Files **Contains ONLY:** - Pure functions (same input -> same output, always) - Business logic,
Issues Found: