Hamburger Cross Icon
README Collector - Lunar Collector

README Collector

Collector Stable Documentation

Verify README files exist and analyze their structure including line count and section headings. Enforce documentation standards across your repositories.

Add readme to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/readme@v1.0.0

What This Integration Collects

This integration includes 1 collector that gather metadata from your systems.

Collector code

readme

Scans repository root for README files (README.md, README, README.txt, README.rst) in order, taking the first match. Extracts line count and section headings by parsing markdown headers. Writes exists, path, lines, and sections to .repo.readme.

readme documentation repository docs markdown
Book a demo

How Collectors Fit into Lunar

Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.

Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.

Learn How Lunar Works
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "repo": {
    "readme": {
      "exists": true,
      "path": "README.md",
      "lines": 150,
      "sections": [
        "Installation",
        "Usage",
        "API",
        "Contributing",
        "License"
      ]
    }
  }
}

Configuration

Configure this collector in your lunar-config.yml.

Inputs

Input Required Default Description
path Optional README.md,README,README.txt,README.rst Comma-separated list of README paths to check (first match wins)

Documentation

View on GitHub

README Collector

Collects README file information including existence, line count, and section headings.

Overview

This collector scans the repository root for a README file and extracts metadata about its contents, including existence, line count, and section headings. It runs on code changes and checks for common README variants (README.md, README, README.txt, README.rst) in order, which can be customized via the path input.

Collected Data

This collector writes to the following Component JSON paths:

Path Type Description
.repo.readme.exists boolean Whether a README file exists in the repository root
.repo.readme.path string The path of the README file found (only present if file exists)
.repo.readme.lines number Number of lines in the README file (only present if file exists)
.repo.readme.sections[] array List of section headings extracted from the README file (only present if file exists)

Installation

Add to your lunar-config.yml:

collectors:
  - uses: github://earthly/lunar-lib/collectors/readme@v1.0.0
    on: ["domain:your-domain"]  # Or use tags like [backend, go]
    # with:
    #   path: "README.md,docs/README.md"  # Customize which files to check

Open Source

This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.

View Repository

Ready to Automate Your Standards?

See how Lunar can turn your engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.

Works with any process
check Infrastructure conventions
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Book a Demo
See it work with your own use cases
See How It Works