doing-a-simple-two-sta…
Use when analyzing a large corpus of text, code, or data that exceeds a single agent's effective context - orchestrates parallel…
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
Claude Code
$ npx -y skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative --agent claude-code
Codex
$ npx skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative -a codex -y
Cursor
$ npx skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative -a cursor -y
Gemini CLI
$ npx skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative -a gemini-cli -y
GitHub Copilot
$ npx skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative -a github-copilot -y
OpenCode
$ npx skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative -a opencode -y
Windsurf
$ npx skills add ed3dai/ed3d-plugins --skill howto-functional-vs-imperative -a windsurf -y
name: functional-core-imperative-shell description: 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 user-invocable: false
**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.
**Use FCIS when:**
**Trigger symptoms:**
**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:**
// pattern: Mixed (unavoidable) // Reason: [specific technical justification] // Example: Performance-critical path where separating I/O causes unacceptable overhead
**No file with runtime behavior without classification.** If you create a file that contains functions, classes with methods, or orchestration logic without this comment, you have violated the requirement.
**DO NOT add pattern comments to:**
**Note:** If an exempt file grows to include runtime logic (e.g., a "types" file gains helper functions, or a constants file gains factory functions), it crosses the threshold and MUST be classified.
**Classification applies to application source files containing runtime behavior** (functions with logic, classes with methods, I/O orchestration).
**Contains ONLY:**
**NEVER contains:**
**Logging exception:** Functions MAY accept and use loggers. For unit tests, pass no-op loggers. This is the ONLY permitted side effect in Functional Core.
**Test signature:** Simple assertions, no mocks except logger (if used).
**Contains ONLY:**
**NEVER contains:**
**Test signature:** Integration tests with real dependencies or test doubles.
1. GATHER (Shell): Collect data from external sources 2. PROCESS (Core): Transform input to output (pure) 3. PERSIST (Shell): Save results externally
**Every operation follows this sequence.** No exceptions.
Before writing a function, ask:
digraph fcis_decision {
"Writing a function" [shape=ellipse];
"Can run without external dependencies?" [shape=diamond];
"Does it coordinate I/O?" [shape=diamond];
"Functional Core" [shape=box, style=filled, fillcolor=lightblue];
"Imperative Shell" [shape=box, style=filled, fillcolor=lightgreen];
"STOP: Refactor or escalate" [shape=octagon, style=filled, fillcolor=red, fontcolor=white];
"Writing a function" -> "Can run without external dependencies?";
"Can run without external dependencies?" -> "Functional Core" [label="yes"];
"Can run without external dependencies?" -> "Does it coordinate I/O?" [label="no"];
"Does it coordinate I/O?" -> "Imperative Shell" [label="yes"];
"Does it coordinate I/O?" -> "STOP: Refactor or escalate" [label="no"];
}**Questions to ask:**
| Excuse/Thought Pattern | Reality | What To Do | |------------------------|---------|------------| | "Just one file read in this calculation" | File I/O = side effect. Not Functional Core. | Extract to Shell. Pass data as parameter. | | "Database is passed as parameter, so it's pure" | Database operations are I/O. Not pure. | Move to Shell. Core receives data, not DB connection. | | "This validation needs to check if file exists" | File s
Ed's repo of Claude Code plugins, centered around a research-plan-implement workflow. Only a tiny bit cursed. If you're lucky.
Use when analyzing a large corpus of text, code, or data that exceeds a single agent's effective context - orchestrates parallel…
Use when creating a new Claude Code plugin or setting up plugin structure - provides complete file organization, manifest format,…
Use when creating specialized subagents for Claude Code plugins or the Task tool - covers description writing for…
Use when creating, releasing, or maintaining a Claude Code Plugin Marketplace - covers marketplace.json schema, version…
Use when completing development phases or branches to identify and update CLAUDE.md or AGENTS.md files that may have become stale…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.