Skip to main content
The RepoContext model contains all the information about a repository that Beacon uses to generate an AGENTS.md file. It includes metadata, source code, documentation, and API specifications.

Fields

name
string
required
The name of the repository or project.
readme
string | null
The contents of the repository’s README file, if present.
source_files
array
required
An array of source code files analyzed from the repository.
openapi_spec
string | null
The OpenAPI specification file contents, if the repository has one (typically openapi.json or openapi.yaml).
package_manifest
string | null
The package manifest file contents (e.g., Cargo.toml, package.json, requirements.txt) that describes dependencies and project metadata.
existing_agents_md
string | null
The contents of an existing AGENTS.md file, if present. Used to preserve or update existing agent documentation.

Example

{
  "name": "my-awesome-api",
  "readme": "# My Awesome API\n\nA REST API for managing tasks...",
  "source_files": [
    {
      "path": "src/main.rs",
      "language": "Rust",
      "content": "fn main() {\n    println!(\"Hello, world!\");\n}"
    },
    {
      "path": "src/api/tasks.rs",
      "language": "Rust",
      "content": "pub async fn create_task() -> Result<Task> { ... }"
    }
  ],
  "openapi_spec": "{\"openapi\": \"3.0.0\", \"info\": {...}}",
  "package_manifest": "[package]\nname = \"my-awesome-api\"\nversion = \"0.1.0\"",
  "existing_agents_md": null
}

Usage

The RepoContext is constructed internally by Beacon when scanning a repository:
  1. Repository metadata is extracted (name, README)
  2. Source files are discovered and categorized by language
  3. API specifications and package manifests are located
  4. Any existing AGENTS.md is read for reference
This context is then passed to the AI provider to generate a comprehensive AGENTS.md file.

Build docs developers (and LLMs) love