Skip to content
Skill

l4

by smucclaw

AI Summary

Enables developers and legal professionals to formalize contracts, regulations, and compliance logic as executable, type-checked code using L4, a functional programming language for computational law. Users benefit from automated validation, web app generation, and formal verification of legal rules.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "l4" skill in my project.

Please run this command in my terminal:
# Install skill into the correct directory (11 files)
mkdir -p .claude/skills/skill && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/SKILL.md "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/SKILL.md" && mkdir -p .claude/skills/skill/assets && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/assets/example-parking.l4 "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/assets/example-parking.l4" && mkdir -p .claude/skills/skill/assets && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/assets/template.l4 "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/assets/template.l4" && mkdir -p .claude/skills/skill/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/references/github-resources.md "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/references/github-resources.md" && mkdir -p .claude/skills/skill/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/references/syntax-quick-ref.md "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/references/syntax-quick-ref.md" && mkdir -p .claude/skills/skill/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/references/workflow-guide.md "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/references/workflow-guide.md" && mkdir -p .claude/skills/skill/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/scripts/README.md "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/scripts/README.md" && mkdir -p .claude/skills/skill/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/scripts/package-lock.json "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/scripts/package-lock.json" && mkdir -p .claude/skills/skill/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/scripts/package.json "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/scripts/package.json" && mkdir -p .claude/skills/skill/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/scripts/validate-cloud.mjs "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/scripts/validate-cloud.mjs" && mkdir -p .claude/skills/skill/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/skill/scripts/validate.sh "https://raw.githubusercontent.com/smucclaw/l4-ide/main/skill/scripts/validate.sh"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

Write legal and regulatory rules as executable, type-checked code in L4, a functional programming language for computational law. Use when formalizing contracts, legislation, regulations, policies, or compliance logic into computable form. Triggered when users need to encode legal rules, validate formalized law, generate web apps from legal logic, or translate natural language legal text into formal specifications. The skill covers L4 syntax, type system, pattern matching, validation with jl4-cli, and the complete workflow from analysis to deployment.

Overview

L4 is a statically-typed functional programming language for computational law, inspired by Haskell. It enables legal professionals and developers to encode contracts, regulations, and policies as executable, testable, verifiable programs. L4 bridges the gap between human-readable legal text and machine-executable logic. Cloud Validation Available: This skill includes a cloud-based validator that connects to wss://jl4.legalese.com/lsp, allowing you to validate L4 code without installing the Haskell toolchain locally. See Section 5 for details.

Core Workflow

When working with L4, follow this systematic approach:

1. Analyze Source Material

When given natural language legal text (PDFs, URLs, legislation): • Identify the domain ontology: What entities, statuses, and categories exist? (Often unstated in source documents—use world knowledge) • Extract decision logic: What are the business rules and conditions? • Map state transitions: What obligations, deadlines, and modalities govern parties over time?

2. Model the Domain (Types)

Use DECLARE to define the type system: `l4 -- Enums: Fixed sets of values DECLARE RiskCategory IS ONE OF LowRisk MediumRisk HighRisk Uninsurable -- Records: Types with named fields DECLARE Driver HAS name IS A STRING age IS A NUMBER yearsLicensed IS A NUMBER accidentCount IS A NUMBER hasTickets IS A BOOLEAN ` Isomorphic encoding principle: Match the structure of the source text. If legal text has sections 1.1, 1.2, 1.3, your L4 code should reflect that hierarchy with corresponding logical structure (ANDs/ORs forming the same tree).

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 1mo ago
Active
AdoptionUnder 100 stars
24 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars24
Forks6
Issues92
Updated1mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code