# Legends Guides

How to use the Legends tooling: install the CLI, generate documentation for a
legacy repository with GitHub Copilot, review what comes out, publish it to
this portal, and query it conversationally in Legends Chat or from GitHub
Copilot through Holocron.

If you have never run doc gen before, read [Install / update the
CLI](install-cli.md) and then [Quick start](quick-start.md) in order. Everything
else is reference material you come back to.

<div class="feature-cards">
  <a class="feature-card" href="install-cli/">
    <h3>Install / update the CLI</h3>
    <p>Install the <code>legends</code> dotnet tool from the SAIF feed and keep it current with <code>legends update --install</code>.</p>
  </a>
  <a class="feature-card" href="quick-start/">
    <h3>Quick start</h3>
    <p>End-to-end first run: install doc gen tooling into a repo, prompt Copilot to generate documentation, and open a pull request.</p>
  </a>
  <a class="feature-card" href="bugfix-quick-fix/">
    <h3>Bugfix / quick fix</h3>
    <p>Report a defect with <code>/docgen-bugfix</code> or <code>/docgen-quickfix</code> and repair documentation without re-running the whole repository.</p>
  </a>
  <a class="feature-card" href="reviewing-documentation/">
    <h3>Reviewing documentation</h3>
    <p>What to check before approving a doc gen pull request, broken out by documentation type.</p>
  </a>
  <a class="feature-card" href="examples/">
    <h3>Document examples</h3>
    <p>A complete, correct example of every document type, grouped by repository type, to compare a review against.</p>
  </a>
  <a class="feature-card" href="publishing-to-portal/">
    <h3>Publishing to the portal</h3>
    <p>Add a documented repository to the Legends repo list and ship its documentation to production.</p>
  </a>
  <a class="feature-card" href="legends-chat/">
    <h3>Legends Chat</h3>
    <p>Ask questions about the legacy code base in natural language and get answers grounded in this documentation, with citations.</p>
  </a>
  <a class="feature-card" href="holocron-mcp/">
    <h3>Holocron MCP</h3>
    <p>Give GitHub Copilot agents the same documentation through MCP tools: install with <code>legends agent init</code>, sign in, and ask.</p>
  </a>
  <a class="feature-card" href="supported-repo-types/">
    <h3>Supported repository types</h3>
    <p>The repository types doc gen recognizes, how each one is classified, and what documentation you get for it.</p>
  </a>
</div>

## How the pieces fit together

Legends has four moving parts:

| Piece | What it is | Where it lives |
| --- | --- | --- |
| `legends` CLI | A .NET global tool. Installs doc gen tooling into a repo and searches published documentation. | NuGet package `Legends.CLI` |
| Doc gen tooling | Copilot agents, prompts, skills, and templates written into `.github/` and `.saifdocgen/` by `legends init`. | The repository being documented |
| This portal | Aggregates the generated markdown from every documented repository into one searchable site. | `saif-corp/legends` |
| Holocron MCP | A remote MCP server that gives GitHub Copilot agents `holocron_*` tools over the published documentation. | Registered in your Copilot hosts by `legends agent init` |

The normal lifecycle is: install the CLI, run `legends init` in the legacy repo,
run the **SAIF Doc Gen** Copilot agent, review, merge to the repo's default
branch, register the repo here, then publish.

Once documentation is published, [Legends Chat](legends-chat.md) answers
questions from it in natural language — it reads the same corpus this portal
publishes, so a repository has to get through the lifecycle above before the
chat app knows anything about it.

[Holocron MCP](holocron-mcp.md) brings the same corpus into GitHub Copilot, so
agents can search it and answer from it, with citations, without you leaving
the editor.
