Hamburger Cross Icon
Repo Boilerplate Collector - Lunar Collector

Repo Boilerplate Collector

Collector Beta DocumentationVcs

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.

Add repo-boilerplate to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/repo-boilerplate@v1.0.5

What This Integration Collects

This integration includes 7 collectors 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 to .repo.readme.

readme documentation repository docs markdown
Book a demo
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.

codeowners code ownership repository ownership team ownership
Book a demo
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.

gitignore ignore patterns repository hygiene
Book a demo
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.

license open source spdx repository hygiene
Book a demo
Collector code

security

Detects SECURITY.md in the repository root or .github/ directory. Extracts line count and section headings. Writes to .repo.security.

security vulnerability disclosure security policy
Book a demo
Collector code

contributing

Detects CONTRIBUTING.md in the repository root or .github/ directory. Extracts line count and section headings. Writes to .repo.contributing.

contributing contribution guide developer onboarding
Book a demo
Collector code

editorconfig

Detects .editorconfig in the repository root. Extracts the number of section blocks defined. Writes to .repo.editorconfig.

editorconfig code style editor settings
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"
      ]
    },
    "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

Configure this collector in your lunar-config.yml.

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)

Documentation

View on GitHub

Repo Boilerplate Collector

Collect standard repository boilerplate metadata including README, CODEOWNERS, and common configuration files.

Overview

Aggregates repository boilerplate data by scanning for README files, CODEOWNERS ownership rules, and standard configuration files. Each file type has its own subcollector that extracts rich metadata (line counts, sections, patterns) for in-depth policy checks. Consolidates the existing readme and codeowners collectors into a single top-level plugin.

Collected Data

This collector writes to the following Component JSON paths:

Path Type Description
.repo.readme object README metadata (exists, path, lines, sections)
.repo.gitignore object .gitignore metadata (exists, path, lines, patterns)
.repo.license object LICENSE metadata (exists, path, spdx_id)
.repo.security object SECURITY.md metadata (exists, path, lines, sections)
.repo.contributing object CONTRIBUTING.md metadata (exists, path, lines, sections)
.repo.editorconfig object .editorconfig metadata (exists, path, sections)
.ownership.codeowners object Parsed CODEOWNERS data (exists, valid, owners, rules)

Collectors

This integration provides the following collectors (use include to select a subset):

Collector Description
readme Detects README files, extracts line count and section headings
codeowners Parses CODEOWNERS file, extracts ownership rules, validates syntax
gitignore Detects .gitignore, counts lines and active patterns
license Detects LICENSE file, identifies SPDX license type
security Detects SECURITY.md, extracts line count and sections
contributing Detects CONTRIBUTING.md, extracts line count and sections
editorconfig Detects .editorconfig, counts section blocks

Installation

Add to your lunar-config.yml:

collectors:
  - uses: github://earthly/lunar-lib/collectors/repo-boilerplate@main
    on: ["domain:your-domain"]
    # with:
    #   readme_paths: "README.md,README,README.txt,README.rst"
    #   codeowners_paths: "CODEOWNERS,.github/CODEOWNERS,docs/CODEOWNERS"

Open Source

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

View Repository

Common Use Cases

Explore guardrails that use data from Repo Boilerplate Collector.

+
Readme Exists + Repo Boilerplate Collector Verifies that a README file exists in the repository root. Every repository...
+
Readme Min Line Count + Repo Boilerplate Collector Requires the README to have a minimum number of lines (default 25). Prevents...
+
Readme Required Sections + Repo Boilerplate Collector Ensures the README contains required section headings (e.g., Installation,...
+
Codeowners Exists + Repo Boilerplate Collector Requires a CODEOWNERS file to be present in the repository. Checks standard...
+
Codeowners Valid + Repo Boilerplate Collector Validates that the CODEOWNERS file has correct syntax. Checks that all owner...
+
Codeowners Catchall + Repo Boilerplate Collector Requires a default catch-all rule (*) in CODEOWNERS so that every file in the...
+
Codeowners Min Owners + Repo Boilerplate Collector Ensures each CODEOWNERS rule has a minimum number of owners for...
+
Codeowners Team Owners + Repo Boilerplate Collector Requires at least one team-based owner (@org/team) in the CODEOWNERS file for...
+
Codeowners No Individuals Only + Repo Boilerplate Collector Ensures each CODEOWNERS rule includes at least one team owner, not...
+
Codeowners No Empty Rules + Repo Boilerplate Collector Flags CODEOWNERS rules that have no owners assigned, which...
+
Codeowners Max Owners + Repo Boilerplate Collector Flags CODEOWNERS rules with too many owners. Excessive owners often...
+
Gitignore Exists + Repo Boilerplate Collector Verifies that a .gitignore file exists in the repository root....
+
License Exists + Repo Boilerplate Collector Verifies that a LICENSE file exists in the repository root. Checks common...
+
Security Exists + Repo Boilerplate Collector Verifies that a SECURITY.md file exists in the repository root or...
+
Contributing Exists + Repo Boilerplate Collector Verifies that a CONTRIBUTING.md file exists in the repository root or...
+
Editorconfig Exists + Repo Boilerplate Collector Verifies that an .editorconfig file exists in the repository root....

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