nearly-pure-functional

Enforce purity, immutability, and total functions in code reviews.

Updated May 7, 2026
One-click install
npx skills add https://github.com/TK-Evans01/tk-harness --skill nearly-pure-functional
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nearly-pure-functional
Source: https://github.com/TK-Evans01/tk-harness/tree/main/plugins/tk-house-style/skills/nearly-pure-functional
Command: npx skills add https://github.com/TK-Evans01/tk-harness --skill nearly-pure-functional

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fp-ts, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps enforce nearly-pure functional programming principles during code reviews, ensuring code quality and maintainability.

Core Features & Use Cases

  • Functional Core, Imperative Shell: Ensures pure logic in core code, with effects in thin shells.
  • Error Handling: Utilizes Result and Option to handle errors and absence, avoiding exceptions and null values.
  • Data Structures: Enforces the use of algebraic data types and immutable data structures.
  • Use Case: During a code review, this Skill can help identify and enforce functional programming best practices, such as avoiding mutation, using smart constructors, and employing pattern matching.

Quick Start

Run the near-pure-functional skill to review a pull request and enforce functional programming standards.

Frequently Asked Questions about nearly-pure-functional

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

FAQPage Schema
How do I enforce functional programming principles during code reviews?

You can enforce functional programming during code reviews by checking for purity, immutability, and total functions. This involves ensuring pure logic in core code while isolating effects in thin imperative shells.

What's the best way to handle errors in TypeScript without exceptions or null values?

The best way to handle errors without exceptions or nulls is by using Result and Option types. This approach enforces algebraic data types to manage errors and absence safely within your codebase.

Do I need fp-ts to enforce immutability and pure functions in my TypeScript project?

Yes, you need fp-ts to enforce immutability and pure functions in TypeScript. This Skill requires knowledge of the fp-ts library or an equivalent functional programming library in other languages.

How does a functional core and imperative shell architecture work?

A functional core and imperative shell works by keeping core business logic completely pure, while pushing side effects to the outer edges of your application. This ensures maintainability and simplifies testing.

Can I use this Skill to review pull requests for functional programming best practices?

Yes, you can use this Skill to review pull requests for functional programming best practices. It identifies mutations, enforces smart constructors, and checks for proper pattern matching during the review process.