$ show giacomocavalieri/birdie
Birdie is a snapshot testing library for the Gleam programming language. It provides a `snap` function to capture and compare test outputs against stored snapshots, and a CLI interface to review, accept, reject, and manage snapshots. The architecture separates concerns into modules for snapshot handling, CLI parsing, diagnostic formatting, diff computation, and project metadata. Key entry points are the `snap` function for writing tests and the `main` function for the CLI tool. The system relies on Gleam standard library and several community packages for argument parsing, file operations, ANSI styling, and source code analysis via the `glance` library. Data flows involve test execution creating `.new` snapshot files, CLI review moving them to `.accepted` or deleting them, and stale snapshot detection via a reference file tracking which snapshots were used during test runs.
The LLM identified 3 files worth highlighting for reuse:
Implements a diff algorithm using longest common subsequence to compare snapshot contents. Self-contained with no internal dependencies, using only Gleam standard library. Demonstrates non-obvious skill in efficiently computing and presenting line-by-line differences with change indicators (added/removed/shared). Could be extracted as a standalone diff library for any text comparison needs.
Provides a structured command-line interface with subcommands, options, automatic help text, and intelligent error messages suggesting similar commands via edit distance. Zero internal dependencies, relying only on standard library and edit_distance package. Exhibits strong command pattern design with clear separation of concerns, making it reusable as a CLI foundation for other Gleam applications.
Formats error messages with source code highlighting, inline annotations, and secondary labels similar to modern compilers. No internal dependencies beyond standard library and glance for span tracking. Shows expertise in handling multi-line diagnostics, cursor positioning, and visual formatting. Could be extracted as a diagnostic utility for any Gleam tool needing clear error presentation.