fp-refactor
Helps your agent transform TypeScript code. It teaches how to change from one style to another using functional patterns.
What it does
This tool helps transform code written in a more traditional (imperative) style to a functional programming style using the fp-ts library in TypeScript. It provides a comprehensive guide for this migration.
When to use it
- ✓When refactoring existing TypeScript code towards fp-ts functional patterns.
- ✓When needing to convert blocks like `try/catch`, null checks, callbacks, or loops into functional equivalents.
- ✓If you need migration guidance and tradeoffs, not just isolated examples.
Example of what to ask your AI
“How can I refactor my imperative TypeScript code to use fp-ts functional patterns, covering the conversion of try/catch blocks and null checks?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool analyzes your TypeScript code and applies functional programming patterns from the fp-ts library. It guides you in replacing imperative structures with functional approaches, such as using `Either` for error handling and `Option` for optional values.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill fp-refactorOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/fp-refactor/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Refactoring Imperative Code to fp-ts
This skill provides comprehensive patterns and strategies for migrating existing imperative TypeScript code to fp-ts functional programming patterns.
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use
- You are refactoring an existing imperative TypeScript codebase toward fp-ts patterns.
- The task involves converting
try/catch, null checks, callbacks, DI, or loops into functional equivalents. - You need migration guidance and tradeoffs, not just isolated fp-ts examples.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ
What is functional programming?
It's a programming style that treats computation as the evaluation of mathematical functions and avoids changing state and mutable data.
What is fp-ts?
It's a library for TypeScript that brings the benefits of functional programming to the language, offering types and functions to build more robust and expressive code.
What is imperative code?
It's a programming style that describes how a program should change its state, using commands that alter the program's state step by step.
Details
Original description by the author
Comprehensive guide for refactoring imperative TypeScript code to fp-ts functional patterns
Popularity
- GitHub stars
- 48k
- Ranking position
- #3033
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
benchmark-optimization-loop
Has your agent improve something's speed in a measured way. It tests multiple versions and chooses the fastest one that still works correctly.
affaan-m/ECC
change-impact
Helps your agent analyze the impact of code changes before making them. It compares the planned vs. actual results afterward, covering paths, data, tests, and documentation. Useful for risky or system-wide changes.
affaan-m/ECC
click-path-audit
Lets your agent trace all user buttons and interactions to find bugs. It finds issues where functions seem to work alone but fail together. Useful when bugs persist even after debugging.
affaan-m/ECC