Hamburger Cross Icon
Readme Min Line Count
+
Repo Boilerplate Collector

Readme Min Line Count + Repo Boilerplate Collector

Guardrail Collector Beta Repository And Ownership

Enforce Readme Min Line Count using data collected by Repo Boilerplate Collector. Automatically check repository and ownership standards on every PR.

Guardrail: Requires the README to have a minimum number of lines (default 25). Prevents placeholder READMEs that lack useful information.
Data Source: Aggregates repository boilerplate metadata by scanning for README files, CODEOWNERS ownership rules, and common configuration files (.gitignore, LICENSE, SECURITY.md, CONTRIBUTING.md, .editorconfig). Consolidates readme and codeowners collectors into a single plugin.

How Repo Boilerplate Collector Powers This Guardrail

The Repo Boilerplate Collector gathers metadata from your documentation, vcs systems. This data flows into Lunar's Component JSON, where the Readme Min Line Count guardrail evaluates it against your standards.

When enabled, this check runs automatically on every PR and in AI coding workflows, providing real-time enforcement with actionable feedback.

1
Repo Boilerplate Collector Gathers Data Collector
Extracts metadata from code, configs, and tool outputs
2
{ } Component JSON
Data centralized in structured format for evaluation
3
Readme Min Line Count Checks Guardrail
Pass/fail result with actionable feedback in PRs

Quick Start Configuration

Add both the collector and policy to your lunar-config.yml to enable this guardrail.

📄 lunar-config.yml
# Step 1: Enable the Repo Boilerplate Collector
collectors:
  - uses: github://earthly/lunar-lib/collectors/repo-boilerplate@v1.0.5
    # with: ...

# Step 2: Enable the Repo Boilerplate Guardrails
policies:
  - uses: github://earthly/lunar-lib/policies/repo-boilerplate@v1.0.5
    include: [readme-min-line-count]
    # with: ...

What Repo Boilerplate Collector Collects

This collector gathers the following data that the Readme Min Line Count guardrail evaluates.

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 to .repo.readme.

Collector code

codeowners

Scans the repository for a CODEOWNERS file in standard locations (CODEOWNERS, .github/CODEOWNERS, docs/CODEOWNERS) and parses its contents. Extracts ownership rules, validates syntax, classifies owners as teams vs individuals, and detects catch-all rules. Writes to .ownership.codeowners.

Collector code

gitignore

Detects .gitignore in the repository root. Extracts line count and number of active patterns (non-comment, non-empty lines). Writes to .repo.gitignore.

Collector code

license

Detects LICENSE files (LICENSE, LICENSE.md, LICENSE.txt, LICENCE and variants). Attempts to identify the SPDX license type from file content. Writes to .repo.license.

Example Data Flow

Here's an example of the data that Repo Boilerplate Collector writes to the Component JSON, which Readme Min Line Count then evaluates.

{ } component.json From Repo Boilerplate Collector
{
  "repo": {
    "readme": {
      "exists": true,
      "path": "README.md",
      "lines": 150,
      "sections": [
        "Installation",
        "Usage",
        "API",
        "Contributing",
        "License"
      ]
    },
    "gitignore": {
      "exists": true,
      "path": ".gitignore",
      "lines": 42,
      "patterns": 35
    },
    "license": {
      "exists": true,
      "path": "LICENSE",
      "spdx_id": "MIT"
    },
    "security": {
      "exists": true,
      "path": "SECURITY.md",
      "lines": 28,
      "sections": [
        "Reporting a Vulnerability",
        "Response Timeline",
        "Scope"
      ]
    },
    "contributing": {
      "exists": true,
      "path": "CONTRIBUTING.md",
      "lines": 55,
      "sections": [
        "Getting Started",
        "Development Setup",
        "Pull Requests",
        "Code of Conduct"
      ]
    },
    "editorconfig": {
      "exists": true,
      "path": ".editorconfig",
      "sections": 4
    }
  },
  "ownership": {
    "codeowners": {
      "exists": true,
      "valid": true,
      "path": ".github/CODEOWNERS",
      "errors": [],
      "owners": ["@acme/backend-team", "@acme/platform-team", "@jdoe"],
      "team_owners": ["@acme/backend-team", "@acme/platform-team"],
      "individual_owners": ["@jdoe"],
      "rules": [
        {
          "pattern": "*",
          "owners": ["@acme/platform-team"],
          "owner_count": 1,
          "line": 3
        },
        {
          "pattern": "/src/backend/",
          "owners": ["@acme/backend-team", "@jdoe"],
          "owner_count": 2,
          "line": 6
        }
      ]
    }
  }
}

Configuration Options

Repo Boilerplate Collector Inputs

Input Required Default Description
readme_paths Optional README.md,README,README.txt,README.rst Comma-separated list of README paths to check (first match wins)
codeowners_paths Optional CODEOWNERS,.github/CODEOWNERS,docs/CODEOWNERS Comma-separated list of CODEOWNERS file paths to check (first match wins)

Repo Boilerplate Guardrails Inputs

Input Required Default Description
min_lines Optional 25 Minimum number of lines required in README file
required_sections Required Comma-separated list of required sections in README file
min_owners_per_rule Optional 2 Minimum number of owners required per CODEOWNERS rule
max_owners_per_rule Optional 10 Maximum number of owners allowed per CODEOWNERS rule

Ready to Automate Your Standards?

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

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo