Skip to main content
Glama
README.md
<div align="center">

**English** · [简体中文](docs/readme/README_zh.md) · [日本語](docs/readme/README_ja.md) · [한국어](docs/readme/README_ko.md)

# LORE: Living Operational Records & Evidence

### Maintainer docs your coding agent writes from source, with the evidence behind every line

**Ask your agent to document a screen, an API or a whole module. LORE makes it write the same kind of doc every time, keeps the proof for each claim, and links everything into a wiki you can browse.**

[![MCP](https://img.shields.io/badge/MCP-stdio-blue?style=flat-square)](https://modelcontextprotocol.io)
[![Node.js](https://img.shields.io/badge/node-%E2%89%A522.13-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org)
[![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](LICENSE)

[Quick start](#quick-start) · [How LORE works](#how-lore-works) · [What you can document](#what-you-can-document) · [The wiki](#the-wiki) · [FAQ](#faq) · [Documentation](#documentation)

<code>npm install --global github:GNh0/lore</code>

</div>

> [!IMPORTANT]
> The only official source is [github.com/GNh0/lore](https://github.com/GNh0/lore). LORE is in 0.x: formats and tools may still change. It is not on the npm registry yet; install it from GitHub as shown above. Doc bodies, templates and CLI messages are in Korean for now; the skill the agent reads is in English.

Docs for an old system are usually missing, out of date, or written in a different style by each person. Coding agents can read the source, but left alone they describe the same kind of screen differently every time, and they write guesses as facts.

LORE is a local MCP server and CLI that your agent works through. A profile tells the agent what a doc must cover; a checklist and a ledger make it record where each statement comes from and mark what it only inferred or could not confirm. LORE checks every draft before saving it, keeps the change history, and exports a linked Markdown wiki: project, modules, components, tables and external connections.

Setup registers LORE with your agent. After that you ask in plain words, for example "document the order entry screen", and the agent follows the bundled LORE skill.

## Quick start

### Set up your agent

You need Node.js 22.13 or newer, and Git: the GitHub install clones the repository and builds it.

```sh
npm install --global github:GNh0/lore
lore --version
```

| Agent | Setup |
| --- | --- |
| Claude Code | `lore setup` previews the MCP server and skill it adds; `lore setup --yes` applies them. `lore uninstall` previews removal. |
| Codex, Antigravity and other MCP clients | Add a stdio MCP server that runs `lore mcp`, and give the agent the skill folder `.agents/skills/lore` from this repository. |

Use `npm.cmd` if Windows PowerShell blocks `npm`. Plugin marketplace installs (`.claude-plugin`, `.codex-plugin`) will work once LORE is published to npm.

### Register a project

From the project's folder, or with a folder map when you do not want any file inside the project:

```sh
lore init order-catalog --here --profile generic
# or, keeping the project folder untouched:
mkdir -p ~/lore-markers/order-catalog
lore init order-catalog --folder ~/lore-markers/order-catalog --profile generic
lore map /path/to/order-catalog order-catalog
```

### Ask your agent

- "Write the project overview with LORE."
- "Document the order entry screen and its save routine."
- "Document every screen in the sales module." (a full-scope run; the agent asks for the scope when you give none)
- "I changed the discount rule in the order routine. Record it in LORE."

### Use the terminal

```sh
lore list --project order-catalog            # docs, status and open questions
lore stale /path/to/order-catalog --project order-catalog   # docs whose source changed
lore export --project order-catalog --wiki ./wiki            # linked wiki
```

### Update LORE

Run the install command again. Stored docs and settings in `~/.lore` are kept.

## How LORE works

```mermaid
flowchart LR
  A[Agent reads source] --> B[docs_checklist: questions, template, terms]
  B --> C[Draft + ledger: evidence per claim]
  C --> D{docs_check}
  D -- errors --> C
  D -- ok --> E[docs_save: version, history]
  E --> F[Review loop: re-read source, fix, max 2 rounds]
  F --> G[lore export: linked wiki]
```

- **Kinds first.** The agent decides what starts a unit (a page, an HTTP route, a job, a CLI command, a window, a library call, a DB routine) and that decides the doc type, the unit and the order of reading. Per-language notes cover C#, PowerBuilder, Python, JavaScript/TypeScript, Java, Go, Rust, SQL and declaration files.
- **Same facts, every time.** A 14-item processing contract lists what to extract from every unit: inputs, conditions, calculations, value lists, reads, writes, transactions, outputs, errors, outside calls, settings and gaps.
- **Evidence or a marker.** A claim is confirmed only when the declaration and its use were read. Anything else ends with `(추정)` (inferred), `(확인 필요)` (needs checking) or `(실행 확인 필요)` (needs a run), and the ledger says what to check.
- **LORE decides names.** Keys, modules (from the nearest package manifest) and connection names are resolved by code, so different agents produce the same doc identities.
- **Checks catch shortcuts.** `docs_check` blocks structural errors and warns on style problems, including sentences copied across many docs and error rows written as code.

## What you can document

| Doc | What it holds |
| --- | --- |
| Project overview | Purpose, configuration, shared components, how settings are read, modules, third-party libraries, build and deploy, code value rules |
| Component | A screen, page, route, job, command or window: inputs, behavior, results, limits and errors, with views for tabs and steps |
| Routine | A procedure, handler or shared function that two or more documented components call, or whose body you pass in as text |
| Connection | A database, API, process or file location the program reaches, with its operations and who uses them |
| Database pages | Tables a doc uses, with all columns, keys and indexes from a schema you supply, column meanings per screen and code values |
| History | Each real change, linked to the docs it touched |

Profiles shape the template per stack: `generic` (any language), `web-app` (pages, components, stores, API clients, server routes and actions) and `winforms-erp` (business screens and stored procedures). For PowerBuilder, LORE ships a reader that takes source straight out of `.pbl` libraries without a PowerBuilder runtime, and pulls each DataWindow's columns, database columns, keys, update table and SQL.

## The wiki

`lore export --wiki <folder>` writes plain Markdown that GitHub, VS Code and note apps such as Obsidian can read.

- The folders follow the source: project → module → doc, and project → database → tables. With `lore project set <id> --tree source`, a library or file that holds several units adds its own level: project → module → library → doc. Every page starts with a path line to its ancestors.
- Doc, connection and table pages carry properties (`type`, `key`, `module`, `aliases`, `tags`) so a note app can search by program name; project, module and library pages carry a tag, so a graph can be colored by kind.
- In a graph view, only the tree (parent and child) and direct relations (a doc and the tables, routines and windows it uses) are drawn as edges. Other links still work when clicked but stay out of the graph.
- Tables a doc uses but no imported schema holds are listed with the reason: not looked up, lookup failed (with the recorded cause), or not in the catalog.
- The wiki folder holds pages and images only. LORE keeps its own records in its data folder (`~/.lore`).

## FAQ

**Does LORE touch my project or database?** No. LORE never connects to a database and never writes into your source. Schema, code-master and aggregate data reach LORE only as metadata your agent exports with a read-only tool.

**What about credentials?** Docs, ledgers and captures name settings only. LORE rejects recognized secrets and connection strings in text and metadata, and addresses in connection docs. It does not inspect images.

**How do I know a doc is current?** Each doc records hashes of the files it was written from. `lore stale` lists docs whose sources changed, and a full-scope run updates them.

**Which agents work?** Any MCP client that can run a stdio server and read a skill folder. LORE is tested with Claude Code, Codex and Antigravity.

**Where is my data?** In SQLite under `LORE_HOME` (default `~/.lore`), on your machine.

## Documentation

- [Design](docs/design.md) (Korean): data model, profiles, checks, wiki layout
- [Tool design](docs/tool-design.md): MCP tool contracts
- [Testing](docs/testing.md) and [roadmap](docs/roadmap.md)
- [Profiles](profiles/) and the [walkthrough with test data](examples/README.md)
- [Skill](.agents/skills/lore/SKILL.md) the agent follows

## Contributing

Issues and pull requests are open, and forks are welcome under the MIT license. This is a personal project with no support commitment: reports may not get an answer, a fix or a merge. When you file a bug, include the LORE version, the command or tool call, and what you expected.

## License

[MIT](LICENSE). See [third-party notices](THIRD_PARTY_NOTICES.md) and the [changelog](CHANGELOG.md).