{"id":46278103,"url":"https://github.com/chris-c-thomas/lexbuild","last_synced_at":"2026-04-09T03:04:47.585Z","repository":{"id":341953696,"uuid":"1168136027","full_name":"chris-c-thomas/LexBuild","owner":"chris-c-thomas","description":"LexBuild provides an open-source CLI toolchain and searchable web resource for official U.S. federal and state legal texts. The CLI transforms official source data into metadata-rich Markdown optimized for LLMs and RAG, while the dedicated web hub allows developers to directly browse, copy, and bulk-download the structured legal corpus","archived":false,"fork":false,"pushed_at":"2026-03-31T06:43:25.000Z","size":2528,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-31T06:57:52.750Z","etag":null,"topics":["ai","ast","astro","cfr","cli","converter","ecfr","json","law","legal-tech","markdown","metadata","monorepo","nlp","rag","typescript","us-code","uslm","xml","yaml"],"latest_commit_sha":null,"homepage":"https://lexbuild.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-c-thomas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T03:41:09.000Z","updated_at":"2026-03-31T04:25:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chris-c-thomas/LexBuild","commit_stats":null,"previous_names":["chris-c-thomas/lexbuild"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/chris-c-thomas/LexBuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-c-thomas%2FLexBuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-c-thomas%2FLexBuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-c-thomas%2FLexBuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-c-thomas%2FLexBuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-c-thomas","download_url":"https://codeload.github.com/chris-c-thomas/LexBuild/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-c-thomas%2FLexBuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31341839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T06:57:30.245Z","status":"ssl_error","status_checked_at":"2026-04-03T06:57:29.849Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ast","astro","cfr","cli","converter","ecfr","json","law","legal-tech","markdown","metadata","monorepo","nlp","rag","typescript","us-code","uslm","xml","yaml"],"created_at":"2026-03-04T05:03:58.343Z","updated_at":"2026-04-03T07:01:25.716Z","avatar_url":"https://github.com/chris-c-thomas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LexBuild\n\n[![npm](https://img.shields.io/npm/v/%40lexbuild%2Fcli?style=for-the-badge)](https://www.npmjs.com/package/@lexbuild/cli)\n[![CI](https://img.shields.io/github/actions/workflow/status/chris-c-thomas/LexBuild/ci.yml?style=for-the-badge\u0026label=CI)](https://github.com/chris-c-thomas/LexBuild/actions/workflows/ci.yml)\n[![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue?style=for-the-badge)](https://www.typescriptlang.org/)\n[![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen?style=for-the-badge)](https://nodejs.org/)\n[![license](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](LICENSE)\n\n[LexBuild](https://lexbuild.dev) is an open-source toolchain for U.S. legal texts. It transforms official source XML into structured Markdown with rich metadata, optimized for LLMs, RAG pipelines, and semantic search.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Sources](#sources)\n- [Install](#install)\n- [Quick Start](#quick-start)\n- [Commands](#commands)\n- [Output](#output)\n- [Monorepo](#monorepo)\n- [Development](#development)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## Overview\n\nThe full text of U.S. law is publicly available from official government sources at the federal, state, and local level. At the federal level, the [U.S. Code](https://uscode.house.gov/) contains 54 titles of statutory law published by the [Office of the Law Revision Counsel](https://uscode.house.gov/about_office.xhtml). The [Electronic Code of Federal Regulations](https://www.ecfr.gov/) (eCFR) contains 50 titles of federal regulations updated daily. The [Federal Register](https://www.federalregister.gov/) publishes roughly 30,000 new documents each year including rules, proposed rules, notices, and presidential documents.\n\nThese sources are available in structured formats but they are complex, dense and deeply nested, and vary significantly from one source to the next. Working with them directly takes real effort.\n\nLexBuild handles the downloading and conversion. It produces per-section Markdown files with YAML frontmatter, predictable file paths, and content sized for typical AI context windows. The goal is to make U.S. law accessible to LLMs, agentic workflows, RAG pipelines, vector databases, and other legal research tools.\n\n---\n\n## Sources\n\n| Source | Package | Type | Format | Updates | Notes |\n|--------|---------|------|--------|---------|-------|\n| [U.S. Code](https://uscode.house.gov/download/download.shtml) | [@lexbuild/usc](packages/usc/) | Bulk | USLM 1.0 XML | Irregular | Release point auto-detected from OLRC |\n| [eCFR](https://www.ecfr.gov/api/versioner/v1/titles) | [@lexbuild/ecfr](packages/ecfr/) | API | eCFR XML | Daily | Default source. Supports `--date` for historical queries |\n| [eCFR](https://www.govinfo.gov/bulkdata/ECFR)  | [@lexbuild/ecfr](packages/ecfr/) | Bulk | eCFR XML | Irregular | Fallback source. Updates per title as regulations change |\n| [Federal Register](https://www.federalregister.gov/developers/documentation/api/v1) | [@lexbuild/fr](packages/fr/) | API | FR XML + JSON | Daily | Per document XML full text with JSON metadata sidecar |\n| [Federal Register](https://www.govinfo.gov/bulkdata/FR)  | [@lexbuild/fr](packages/fr/) | Bulk | FR XML | Daily | Complete daily issue XML. Faster for historical backfill |\n\n---\n\n## Install\n\n### Run Directly (no install)\n\n```bash\nnpx @lexbuild/cli download-usc --all\nnpx @lexbuild/cli convert-usc --all\n```\n\n### Global Install\n\n```bash\nnpm install -g @lexbuild/cli\n# or\npnpm add -g @lexbuild/cli\n```\n\n### Build From Source\n\nRequires [Node.js](https://nodejs.org/) \u003e= 22 and [pnpm](https://pnpm.io/) \u003e= 10.\n\n```bash\ngit clone https://github.com/chris-c-thomas/LexBuild.git\ncd LexBuild\npnpm install \u0026\u0026 pnpm turbo build\n```\n\n---\n\n## Quick Start\n\n### U.S. Code\n\n```bash\n# Download and convert all 54 titles\nlexbuild download-usc --all \u0026\u0026 lexbuild convert-usc --all\n\n# Start small — a single title\nlexbuild download-usc --titles 1 \u0026\u0026 lexbuild convert-usc --titles 1\n\n# A range of titles\nlexbuild download-usc --titles 1-5 \u0026\u0026 lexbuild convert-usc --titles 1-5\n```\n\n### eCFR\n\n```bash\n# Download and convert all 50 titles\nlexbuild download-ecfr --all \u0026\u0026 lexbuild convert-ecfr --all\n\n# A single title\nlexbuild download-ecfr --titles 17 \u0026\u0026 lexbuild convert-ecfr --titles 17\n\n# Point-in-time download (CFR as of a specific date)\nlexbuild download-ecfr --all --date 2025-01-01\n```\n\n### Federal Register\n\n```bash\n# Download and convert recent documents\nlexbuild download-fr --recent 30 \u0026\u0026 lexbuild convert-fr --all\n\n# Download a specific date range\nlexbuild download-fr --from 2026-01-01 --to 2026-03-31\nlexbuild convert-fr --all\n\n# Download only rules\nlexbuild download-fr --from 2026-01-01 --types rule\n\n# Download a single document\nlexbuild download-fr --document 2026-06029\n\n# Enrich govinfo-backfilled files with API metadata\nlexbuild enrich-fr --from 2000-01-01\n```\n\n---\n\n## Commands\n\n### `download-usc`\n\nFetch U.S. Code XML from the OLRC. Auto-detects the latest release point.\n\n```bash\nlexbuild download-usc --all                                  # All 54 titles\nlexbuild download-usc --titles 1-5,8,11                      # Specific titles\nlexbuild download-usc --all --release-point 119-73not60      # Pin a release\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--titles \u003cspec\u003e` | — | Title(s): `1`, `1-5`, `1-5,8,11` |\n| `--all` | — | Download all 54 titles (single bulk zip) |\n| `-o, --output \u003cdir\u003e` | `./downloads/usc/xml` | Output directory |\n| `--release-point \u003cid\u003e` | auto-detected | Pin a specific OLRC release point |\n\n### `convert-usc`\n\nConvert downloaded USC XML to Markdown.\n\n```bash\nlexbuild convert-usc --all                                   # All downloaded titles\nlexbuild convert-usc --titles 1 -g chapter                   # Chapter-level output\nlexbuild convert-usc --titles 26 --dry-run                   # Preview without writing\nlexbuild convert-usc ./downloads/usc/xml/usc01.xml           # Direct file path\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--titles \u003cspec\u003e` | — | Title(s) to convert |\n| `--all` | — | Convert all titles in input directory |\n| `-i, --input-dir \u003cdir\u003e` | `./downloads/usc/xml` | Input XML directory |\n| `-o, --output \u003cdir\u003e` | `./output` | Output directory |\n| `-g, --granularity` | `section` | `section`, `chapter`, or `title` |\n| `--link-style` | `plaintext` | `plaintext`, `canonical`, or `relative` |\n| `--no-include-source-credits` | — | Exclude source credits |\n| `--no-include-notes` | — | Exclude all notes |\n| `--include-editorial-notes` | — | Include editorial notes only |\n| `--include-statutory-notes` | — | Include statutory notes only |\n| `--include-amendments` | — | Include amendment notes only |\n| `--dry-run` | — | Parse and report without writing |\n| `-v, --verbose` | — | Verbose output |\n\n### `list-release-points`\n\nBrowse available OLRC release points for the U.S. Code. Useful for discovering prior versions to download.\n\n```bash\nlexbuild list-release-points                     # 20 most recent\nlexbuild list-release-points -n 5                # 5 most recent\nlexbuild list-release-points -n 0                # All available release points\n```\n\nUse a release point ID from the output to pin a specific version:\n\n```bash\nlexbuild download-usc --all --release-point 119-72not60\n```\n\n### `download-ecfr`\n\nFetch eCFR XML. Defaults to the ecfr.gov API (daily-updated); govinfo bulk data available as fallback.\n\n```bash\nlexbuild download-ecfr --all                                 # All 50 titles (eCFR API)\nlexbuild download-ecfr --titles 1-5,17                       # Specific titles\nlexbuild download-ecfr --all --date 2025-01-01               # Point-in-time download\nlexbuild download-ecfr --all --source govinfo                # Govinfo bulk fallback\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--titles \u003cspec\u003e` | — | Title(s): `1`, `1-5`, `1-5,17` |\n| `--all` | — | Download all 50 titles |\n| `-o, --output \u003cdir\u003e` | `./downloads/ecfr/xml` | Output directory |\n| `--source` | `ecfr-api` | `ecfr-api` (daily-updated) or `govinfo` (bulk) |\n| `--date \u003cYYYY-MM-DD\u003e` | current | Point-in-time date (ecfr-api only) |\n\n### `convert-ecfr`\n\nConvert downloaded eCFR XML to Markdown.\n\n```bash\nlexbuild convert-ecfr --all                                  # All downloaded titles\nlexbuild convert-ecfr --titles 17 -g part                    # Part-level output\nlexbuild convert-ecfr --all --dry-run                        # Preview without writing\nlexbuild convert-ecfr ./downloads/ecfr/xml/ECFR-title17.xml  # Direct file path\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--titles \u003cspec\u003e` | — | Title(s) to convert |\n| `--all` | — | Convert all titles in input directory |\n| `-i, --input-dir \u003cdir\u003e` | `./downloads/ecfr/xml` | Input XML directory |\n| `-o, --output \u003cdir\u003e` | `./output` | Output directory |\n| `-g, --granularity` | `section` | `section`, `part`, `chapter`, or `title` |\n| `--link-style` | `plaintext` | `plaintext`, `canonical`, or `relative` |\n| `--no-include-source-credits` | — | Exclude source credits |\n| `--no-include-notes` | — | Exclude all notes |\n| `--include-editorial-notes` | — | Include editorial/regulatory notes only |\n| `--include-statutory-notes` | — | Include statutory notes only |\n| `--include-amendments` | — | Include amendment notes only |\n| `--dry-run` | — | Parse and report without writing |\n| `-v, --verbose` | — | Verbose output |\n\n### `download-fr`\n\nFetch Federal Register XML and metadata from the FederalRegister.gov API.\n\n```bash\nlexbuild download-fr --recent 30                                    # Last 30 days\nlexbuild download-fr --from 2026-01-01 --to 2026-03-31              # Date range\nlexbuild download-fr --from 2026-01-01 --types rule                 # Only rules\nlexbuild download-fr --document 2026-06029                          # Single document\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--from \u003cYYYY-MM-DD\u003e` | — | Start date (inclusive) |\n| `--to \u003cYYYY-MM-DD\u003e` | today | End date (inclusive) |\n| `--recent \u003cdays\u003e` | — | Download last N days |\n| `--document \u003cnumber\u003e` | — | Single document by number |\n| `-o, --output \u003cdir\u003e` | `./downloads/fr` | Output directory |\n| `--types` | all | `rule`, `proposed_rule`, `notice`, `presidential_document` |\n| `--limit \u003cn\u003e` | — | Max documents (for testing) |\n\n### `convert-fr`\n\nConvert downloaded FR XML to Markdown.\n\n```bash\nlexbuild convert-fr --all                                           # All downloaded documents\nlexbuild convert-fr --from 2026-01-01 --to 2026-03-31               # Filter by date range\nlexbuild convert-fr --all --types rule                               # Only rules\nlexbuild convert-fr ./downloads/fr/2026/03/2026-06029.xml           # Single file\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--all` | — | Convert all documents in input directory |\n| `--from \u003cYYYY-MM-DD\u003e` | — | Filter start date |\n| `--to \u003cYYYY-MM-DD\u003e` | — | Filter end date |\n| `-i, --input-dir \u003cdir\u003e` | `./downloads/fr` | Input directory |\n| `-o, --output \u003cdir\u003e` | `./output` | Output directory |\n| `--types` | all | Filter by document type |\n| `--link-style` | `plaintext` | `plaintext`, `canonical`, or `relative` |\n| `--dry-run` | — | Parse and report without writing |\n| `-v, --verbose` | — | Verbose output |\n\n### `enrich-fr`\n\nEnrich existing FR Markdown frontmatter with metadata from the FederalRegister.gov API. Useful for backfilling rich metadata (agencies, CFR references, docket IDs, citations, etc.) into files originally converted from govinfo bulk XML.\n\n```bash\nlexbuild enrich-fr --from 2000-01-01                         # Enrich all from 2000 onward\nlexbuild enrich-fr --from 2020-01-01 --to 2025-12-31         # Specific date range\nlexbuild enrich-fr --recent 30                                # Last 30 days\nlexbuild enrich-fr --from 2000-01-01 --force                 # Overwrite already-enriched files\n```\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--from \u003cYYYY-MM-DD\u003e` | — | Start date (inclusive) |\n| `--to \u003cYYYY-MM-DD\u003e` | today | End date (inclusive) |\n| `--recent \u003cdays\u003e` | — | Enrich last N days |\n| `-o, --output \u003cdir\u003e` | `./output` | Output directory containing FR `.md` files |\n| `--force` | — | Overwrite files that already have `fr_citation` |\n\nFiles that already have `fr_citation` in their frontmatter are skipped unless `--force` is used. Only YAML frontmatter is updated — the Markdown body is preserved as-is.\n\n---\n\n## Output\n\n### File Structure\n\n**U.S. Code** (`-g section`, default):\n```\noutput/usc/\n  title-01/\n    README.md\n    _meta.json\n    chapter-01/\n      _meta.json\n      section-1.md\n      section-2.md\n```\n\n**eCFR** (`-g section`, default):\n```\noutput/ecfr/\n  title-17/\n    README.md\n    _meta.json\n    chapter-IV/\n      part-240/\n        _meta.json\n        section-240.10b-5.md\n```\n\n**Federal Register**:\n```\noutput/fr/\n  2026/\n    03/\n      2026-06029.md\n      _meta.json\n```\n\nAll granularity levels:\n\n| Source | section | chapter/part | title |\n|--------|---------|-------------|-------|\n| USC | `title-01/chapter-01/section-1.md` | `title-01/chapter-01/chapter-01.md` | `title-01.md` |\n| eCFR | `title-17/chapter-IV/part-240/section-240.10b-5.md` | `title-17/chapter-IV/part-240.md` | `title-17.md` |\n| FR | `2026/03/2026-06029.md` | — | — |\n\n### Frontmatter\n\nEvery Markdown file includes YAML frontmatter with source-specific metadata:\n\n**U.S. Code:**\n```yaml\n---\nidentifier: \"/us/usc/t1/s7\"\nsource: \"usc\"\nlegal_status: \"official_legal_evidence\"\ntitle: \"1 USC § 7 - Marriage\"\ntitle_number: 1\ntitle_name: \"GENERAL PROVISIONS\"\nsection_number: \"7\"\nsection_name: \"Marriage\"\nchapter_number: 1\nchapter_name: \"RULES OF CONSTRUCTION\"\npositive_law: true\ncurrency: \"119-73\"\nlast_updated: \"2025-12-03\"\nformat_version: \"1.1.0\"\ngenerator: \"lexbuild@1.9.3\"\nsource_credit: \"(Added Pub. L. 104-199, § 3(a), Sept. 21, 1996, ...)\"\n---\n```\n\n**eCFR:**\n```yaml\n---\nidentifier: \"/us/cfr/t17/s240.10b-5\"\nsource: \"ecfr\"\nlegal_status: \"authoritative_unofficial\"\ntitle: \"17 CFR § 240.10b-5 - Employment of manipulative and deceptive devices\"\ntitle_number: 17\nsection_number: \"240.10b-5\"\npositive_law: false\nauthority: \"15 U.S.C. 78a et seq., ...\"\ncfr_part: \"240\"\n---\n```\n\n**Federal Register:**\n```yaml\n---\nidentifier: \"/us/fr/2026-06029\"\nsource: \"fr\"\nlegal_status: \"authoritative_unofficial\"\ntitle: \"Meeting of the Advisory Board on Radiation and Worker Health\"\ndocument_number: \"2026-06029\"\ndocument_type: \"notice\"\nfr_citation: \"91 FR 15619\"\npublication_date: \"2026-03-30\"\nagencies:\n  - \"Health and Human Services Department\"\n  - \"Centers for Disease Control and Prevention\"\n---\n```\n\nThe `source` field discriminates content origin. The `legal_status` field indicates provenance: `\"official_legal_evidence\"` (positive law USC titles), `\"official_prima_facie\"` (non-positive law USC titles), or `\"authoritative_unofficial\"` (eCFR, FR).\n\n### Metadata Indexes\n\nEach directory includes a `_meta.json` sidecar file for programmatic access without parsing Markdown:\n\n```json\n{\n  \"format_version\": \"1.1.0\",\n  \"identifier\": \"/us/usc/t5\",\n  \"title_number\": 5,\n  \"title_name\": \"Government Organization and Employees\",\n  \"stats\": {\n    \"chapter_count\": 63,\n    \"section_count\": 1162,\n    \"total_tokens_estimate\": 2207855\n  },\n  \"chapters\": [\n    {\n      \"identifier\": \"/us/usc/t5/ptI/ch1\",\n      \"number\": 1,\n      \"name\": \"Organization\",\n      \"directory\": \"chapter-01\",\n      \"sections\": [\n        {\n          \"identifier\": \"/us/usc/t5/s101\",\n          \"number\": \"101\",\n          \"name\": \"Executive departments\",\n          \"file\": \"section-101.md\",\n          \"token_estimate\": 4200,\n          \"has_notes\": true,\n          \"status\": \"current\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n### Performance\n\n| Corpus | Titles / Volume | Sections / Documents | Est. Tokens | Conversion Time |\n|--------|-----------------|----------------------|-------------|-----------------|\n| U.S. Code | 54 titles | ~60,000 sections | ~85M | ~20–30s |\n| eCFR | 50 titles | ~227,000 sections | ~350M | ~60–90s |\n| Federal Register | ~28–31k docs/year | ~750k+ docs (2000–present) | varies | ~1–2s per 1k docs |\n\nSAX streaming keeps memory usage low, even when processing very large titles—some over 100MB of XML. The conversion step itself doesn’t involve any network I/O, so it’s entirely CPU-bound.\n\nFederal Register documents are self-contained and handled one file at a time, and in practice, fetching them from the API usually takes longer than converting them\n\n---\n\n## Monorepo\n\nLexBuild is a monorepo managed with [pnpm](https://pnpm.io/) workspaces and [Turborepo](https://turbo.build/).\n\n```\nlexbuild/\n├── README.md          \n├── CLAUDE.md          \n├── package.json       \n├── pnpm-workspace.yaml\n├── pnpm-lock.yaml\n├── turbo.json         \n├── tsconfig.base.json \n├── eslint.config.js   \n├── knip.jsonc         \n├── CHANGELOG.md\n├── CONTRIBUTING.md\n├── ARCHITECTURE.md\n├── packages/\n│   ├── core/          # @lexbuild/core — XML parsing, AST, Markdown rendering\n│   ├── usc/           # @lexbuild/usc  — U.S. Code converter and downloader\n│   ├── ecfr/          # @lexbuild/ecfr — eCFR converter and downloader\n│   ├── fr/            # @lexbuild/fr   — Federal Register converter and downloader\n│   └── cli/           # @lexbuild/cli  — CLI binary\n├── apps/\n│   └── astro/         # LexBuild web app (https://lexbuild.dev)\n├── docs/              \n├── fixtures/          \n├── downloads/         # Downloaded source data (gitignored)\n├── output/            # Generated Markdown output (gitignored)\n└── scripts/           \n```\n\n### Dependency Graph\n\n```\n@lexbuild/cli\n  ├── @lexbuild/usc\n  │     └── @lexbuild/core\n  ├── @lexbuild/ecfr\n  │     └── @lexbuild/core\n  ├── @lexbuild/fr\n  │     └── @lexbuild/core\n  └── @lexbuild/core\n\n@lexbuild/astro (No direct dependency on packages. Consumes converted output only.)\n```\n\nSource packages are independent — `@lexbuild/usc`, `@lexbuild/ecfr`, and `@lexbuild/fr` never import from each other. Future source packages follow the same pattern.\n\nAll internal dependencies use pnpm's `workspace:*` protocol. [Changesets](https://github.com/changesets/changesets) manages lockstep versioning across all published packages.\n\n---\n\n## Packages\n\n| Package | npm | Description |\n|---------|-----|-------------|\n| [`@lexbuild/cli`](packages/cli/) | [![npm](https://img.shields.io/npm/v/%40lexbuild%2Fcli)](https://www.npmjs.com/package/@lexbuild/cli) | CLI binary |\n| [`@lexbuild/core`](packages/core/) | [![npm](https://img.shields.io/npm/v/%40lexbuild%2Fcore)](https://www.npmjs.com/package/@lexbuild/core) | Shared XML parsing, AST, Markdown rendering |\n| [`@lexbuild/usc`](packages/usc/) | [![npm](https://img.shields.io/npm/v/%40lexbuild%2Fusc)](https://www.npmjs.com/package/@lexbuild/usc) | United States Code |\n| [`@lexbuild/ecfr`](packages/ecfr/) | [![npm](https://img.shields.io/npm/v/%40lexbuild%2Fecfr)](https://www.npmjs.com/package/@lexbuild/ecfr) | Code of Federal Regulations |\n| [`@lexbuild/fr`](packages/fr/) | [![npm](https://img.shields.io/npm/v/%40lexbuild%2Ffr)](https://www.npmjs.com/package/@lexbuild/fr) | Federal Register |\n\nEach package has its own README with full API documentation.\n\n## Apps\n\n| Package | Description |\n|---------|-------------|\n| [`@lexbuild/astro`](apps/astro/) | LexBuild web application |\n\n[LexBuild](https://lexbuild.dev) is a server-rendered legal web resource and content browser built with Astro 6, React 19, Tailwind CSS 4, and shadcn/ui.\n\n- **260,000+ section pages** across the U.S. Code and eCFR\n- **Four granularity levels** — titles, chapters, parts (eCFR only), sections\n- **Syntax-highlighted source** and rendered HTML preview\n- **Sidebar navigation** with virtualized section lists\n- **Full-text search** via Meilisearch\n- **Dark mode** with system preference detection\n- **Zero client JS by default** — interactive React islands only where needed\n\nThe web app consumes LexBuild's output (`.md` files and `_meta.json` sidecars) and has no code dependency on the conversion packages.\n\nSee [`apps/astro/README.md`](apps/astro/README.md) for setup and development instructions.\n\n---\n\n## Development\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) \u003e= 22\n- [pnpm](https://pnpm.io/) \u003e= 10\n\n### Getting Started\n\n```bash\ngit clone https://github.com/chris-c-thomas/LexBuild.git\ncd LexBuild\npnpm install\npnpm turbo build\n```\n\n### Common Commands\n\n```bash\npnpm turbo build           # Build all packages\npnpm turbo test            # Run all tests\npnpm turbo lint            # Lint all packages\npnpm turbo typecheck       # Type-check all packages\npnpm turbo dev             # Watch mode\n```\n\n### Working on a Specific Package\n\n```bash\npnpm turbo build --filter=@lexbuild/core\npnpm turbo test --filter=@lexbuild/ecfr\n\n# Run the CLI locally\nnode packages/cli/dist/index.js download-usc --titles 1\nnode packages/cli/dist/index.js convert-usc --titles 1\nnode packages/cli/dist/index.js download-ecfr --titles 17\nnode packages/cli/dist/index.js convert-ecfr --titles 17\nnode packages/cli/dist/index.js download-fr --recent 7\nnode packages/cli/dist/index.js convert-fr --all\nnode packages/cli/dist/index.js enrich-fr --from 2000-01-01\n```\n\n### Web App Development\n\n```bash\n# Build packages first\npnpm turbo build\n\n# Download and convert some content\nnode packages/cli/dist/index.js download-usc --titles 1 \u0026\u0026 node packages/cli/dist/index.js convert-usc --titles 1\nnode packages/cli/dist/index.js download-ecfr --titles 1 \u0026\u0026 node packages/cli/dist/index.js convert-ecfr --titles 1\n\n# Set up the web app\ncd apps/astro\nbash scripts/link-content.sh\nnpx tsx scripts/generate-nav.ts\npnpm dev\n```\n\n---\n\n## Contributing\n\nContributions are welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n---\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-c-thomas%2Flexbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-c-thomas%2Flexbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-c-thomas%2Flexbuild/lists"}