Repo Boilerplate Collector
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.
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.
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.
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.
gitignore
Detects .gitignore in the repository root. Extracts line count and
number of active patterns (non-comment, non-empty lines).
Writes to .repo.gitignore.
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.
security
Detects SECURITY.md in the repository root or .github/ directory.
Extracts line count and section headings. Writes to .repo.security.
contributing
Detects CONTRIBUTING.md in the repository root or .github/ directory.
Extracts line count and section headings. Writes to .repo.contributing.
editorconfig
Detects .editorconfig in the repository root. Extracts the number of
section blocks defined. Writes to .repo.editorconfig.
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 →Example Collected Data
This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:
{
"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 GitHubRepo 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.
Common Use Cases
Explore guardrails that use data from Repo Boilerplate Collector.
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.