返回 Skill 列表
extension
分类: 开发与工程无需 API Key

gleam

使用惯用模式、TDD和类型驱动设计来开发Gleam。在处理.gleam文件、gleam.toml或用户提及Gleam、BEAM或Erlang时激活。

person作者: jakexiaohubgithub

Gleam Development

Idiomatic Gleam with type-driven design and TDD.

Workflow

1. MODEL    → Define domain types first (make illegal states unrepresentable)
2. RED      → Write failing test
3. GREEN    → Minimal implementation
4. REFACTOR → Clean up, use pipelines
5. RUN      → gleam test && gleam run

Research

Use context7 docs first, then gh as fallback.

Engineering checks

  • Decode external data at the boundary into domain types; model distinct concepts separately when mixing them is a bug
  • Represent expected failures with explicit Result error types and exhaustively handle variants; do not use panic as normal control flow
  • Keep effects at module boundaries and resource lifetimes explicit; keep domain logic pure where practical
  • Test observable success and error behavior with deterministic values, not private function structure
  • Add a type, helper, dependency, or abstraction only for a concrete caller or failure mode

Required follow-up reads

|Need|Read|When| |---|---|---| |Research routing and code patterns|references/guide.md|API research or implementation guidance|

CLI

gleam check                    # Fast type feedback (use often)
gleam test                     # Run tests
gleam run                      # Execute main
gleam format                   # Format all
gleam add pkg --dev            # Dev dependency