gleam

Guide Gleam development with type-driven design and TDD.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/anntnzrb/.claude --skill gleam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gleam
Source: https://github.com/anntnzrb/.claude/tree/main/skills/gleam
Command: npx skills add https://github.com/anntnzrb/.claude --skill gleam

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Develop with Gleam using idiomatic patterns, TDD, and type-driven design. Activate when working with .gleam files, gleam.toml, or user mentions Gleam, BEAM, or Erlang.

Core Features & Use Cases

  • Type-driven Design: Build domain models with strong type guarantees.
  • TDD Cycle: Define tests first, then implement to pass.
  • Patterns: Embrace functional patterns and BEAM-friendly designs.

Quick Start

Define domain types, write a failing Gleam test, implement to green, then refactor.

Frequently Asked Questions about gleam

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

FAQPage Schema
How do I write Gleam code with type-driven design?

Type-driven design in Gleam starts by defining domain types that make illegal states unrepresentable, then implementing functions that respect those types. Build your domain model first, write tests that verify type safety and error handling, then implement to pass. This approach catches bugs at compile time and ensures strict type guarantees throughout your codebase.

Can I use TDD with Gleam projects?

Yes, TDD works well with Gleam. Write a failing test first, then implement code to pass it. Gleam's strong type system integrates naturally with TDD: your tests define expected types and behavior, and the compiler enforces correctness before runtime. This cycle ensures safe error propagation and idiomatic patterns.

What's the best way to handle errors in Gleam?

Gleam enforces explicit error propagation through its type system. Use Result and Option types to represent success and failure cases, making error handling unambiguous. Pipeline-based refactoring keeps error paths visible and manageable, preventing silent failures and ensuring all error cases are handled at compile time.

How do I structure a Gleam project with BEAM compatibility?

Structure Gleam projects using idiomatic functional patterns that align with BEAM's actor model and message-passing concurrency. Use gleam.toml to configure dependencies, organize code into focused modules, and leverage Erlang interop when needed. Type-driven design ensures your pipelines integrate safely with the BEAM runtime.

Does Gleam work with Erlang code?

Yes, Gleam runs on the BEAM virtual machine and interoperates with Erlang. You can call Erlang functions from Gleam and vice versa. However, Gleam's type system wraps external calls, so you define types that match Erlang's behavior and ensure safe error handling at the boundary.