# Project rules for agents (read first) This repository is building `beelloo`, a cli tool to build an invoice from a markdown file. ## General description of the project Beelloo provides a way to generate simple invoices from a markdown file with a defined structure. The markdown is converted to an HTML file styled in CSS. The CSS rules make the generated file fit to be printed on A4 documents. ## Usage - The invoices are emitted for French buyers. No need to care for translation and foreign law for now. - The design must match the one of the current LaTeX template (provided in the sample `.tex` invoice and `.input` folder) - The tool is to be used like this: - Optionally, calling `beelloo new document.md` generates a new "scaffold" document the user can fill in with the right information - The user writes the information in the structured markdown file. - `beelloo build document.md` validates the document and either: - return an error if something is missing or wrongly structured - generate an HTML file - `beelloo serve document.md` renders the document and serves it on an HTTP endpoint for live preview - The user visits the endpoint and "prints" the document from their web browser into a PDF. ## Document format Generated invoices have the following sections: A header with: - Seller identity and address (Name, address) - Buyer identity address (Name, address, SIRET if needed) - Invoice ID - Invoice object (ex: Facture pour prestation de service) A main body with: - List of "Billable" tasks with: - Designation - Unit price - quantity - Amount - Total Without VAT - A mention regarding VAT: "TVA non applicable, art 293 B du CGI" A footer with: - The mention: "Paiement souhaité par virement bancaire" - Name of the bank account holder - IBAN ## Choice of technology - Plain HTML/CSS for the generated document - The cli tool must be using Go - Markdown to HTML conversion should use the `blackfriday` library unless something else is required ## Core Constraints - Support: Linux and FreeBSD (shouldn't be a problem with Go cross-compilation) - UX: Comprehensive verb and command line parameters - Testing: develop via **TDD** (tests drive design; behavior changes require tests) - Unit and functional tests: fast, hermetic, run via `go test ./...` - Use golden files when needed ## What to do when unsure - Ask for clarification before adding major dependencies or widening scope.