pl-theorist

Applies programming-language theory to design, refactor, review, and test code across thirteen languages.

2|2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/BTreeMap/SKILLs --skill pl-theorist-btreemap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pl-theorist
Source: https://github.com/BTreeMap/SKILLs/tree/main/pl-theorist
Command: npx skills add https://github.com/BTreeMap/SKILLs --skill pl-theorist-btreemap

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Codebases accumulate partial functions, invalid states, hidden quadratic loops, and ad-hoc error handling that reviews miss. This Skill brings a programming-languages theorist's discipline to every stage of engineering: model domains as algebras, make invalid states unrepresentable, keep effects at a thin shell, and state the time and space complexity of every non-trivial shape. ## Core Features & Use Cases - Eight verbs, one kernel: design, build, refactor, review, audit, test, teach, and help, each loading exactly one verb file with its own pipeline and completion checks. - Per-language cost models: on-demand profiles for Python, JavaScript, TypeScript, Rust, Go, Haskell, C, C++, Java, Kotlin, C#, Bash, and GitHub Actions, covering TCO, laziness, allocation, and native effect types. - Complexity discipline: a cost-signal table maps symptoms (nested membership tests, top-k, sliding windows) to the right data structure with stated bounds, and forbids unmeasured performance claims. - Use Case: Ask it to audit a repository and it produces a ranked ledger of modeling and cost debt ordered by severity times reach, naming every unexamined area, ready for follow-up refactor invocations. ## Quick Start Ask the agent to review the current diff through the pl-theorist lens for the repository's configured language.

Frequently Asked Questions about pl-theorist

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

FAQPage Schema
How do I review a pull request for partial functions and invalid states?

Invoke the review verb on the diff or file set. It produces read-only ranked findings covering partiality, invalid states, effect leaks, complexity, and stale idioms, judged against the loaded language profile.

How to refactor imperative code into functional style without changing behavior?

The refactor verb reconstructs the observable contract first, classifies each imperative region into its algebraic reading, then rewrites toward native map, filter, and fold vocabulary. It descends one abstraction level only when the language cost model demands it.

Which languages does this code review approach support?

It ships cost-model profiles for Python, JavaScript, TypeScript, Rust, Go, Haskell, C, C++, Java, Kotlin, C#, Bash, and GitHub Actions YAML. For unlisted languages it derives constraints from repository configuration and states its uncertainty.

Can it audit an entire repository instead of a single diff?

Yes, the audit verb sweeps a repository or module, sampling by blast radius, and returns a ranked ledger ordered by severity times reach. It names every unexamined area and leaves the working tree untouched.

When should I not force functional style onto hot code?

When the language cost model shows stack risk, allocation, or lost fusion, the skill descends to a direct loop with pure helpers. A disciplined loop is treated as a valid backend; externally visible partial mutation is the defect.