program-transformer

Transform Haskell, OCaml, and Python programs through semantics-preserving optimization passes.

17|2|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/rainoftime/pl-skills --skill program-transformer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: program-transformer
Source: https://github.com/rainoftime/pl-skills/tree/main/program-transformer
Command: npx skills add https://github.com/rainoftime/pl-skills --skill program-transformer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cps-transformer, closure-converter, and includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of program manipulation by providing tools to transform code, enabling optimizations, refactoring, and the implementation of new language features.

Core Features & Use Cases

  • Source-to-Source Transformation: Modify code while preserving its original meaning.
  • Optimization Passes: Apply techniques like desugaring and normalization to improve code efficiency.
  • Use Case: Refactor a large codebase by automatically applying a consistent naming convention or by converting older language constructs to newer, more efficient ones.

Quick Start

Use the program-transformer skill to desugar the provided Haskell code snippet.

Frequently Asked Questions about program-transformer

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

FAQPage Schema
How do I perform source-to-source transformation on Haskell and OCaml codebases?

Source-to-source transformation is achieved through semantics-preserving passes that manipulate the AST while maintaining the original code's meaning. The skill applies desugaring, normalization, and optimization passes to modify Haskell, OCaml, and Python codebases.

What is AST manipulation and how does it handle binding management during program transformation?

AST manipulation involves traversing and modifying the abstract syntax tree of code. It uses specific traversal strategies and binding management to ensure variables and scopes remain valid during semantics-preserving program transformation.

Can I use this to automatically refactor a large Python codebase by converting older language constructs?

Yes, you can refactor a large Python codebase by automatically applying consistent transformations. It converts older language constructs to newer, more efficient ones through optimization passes and normalization.

Does program transformation require closure conversion or CPS transformation before applying optimization passes?

Applying optimization passes may require closure conversion and CPS transformation beforehand. These dependencies prepare the intermediate representation by converting closures and transforming control flow for effective AST manipulation.

What's the best way to apply desugaring and normalization to improve code efficiency?

The best way to improve code efficiency is applying desugaring and normalization passes during program transformation. These optimization passes simplify complex language constructs into core forms, enabling further AST manipulation and performance improvements.