# Documentation Pipeline

Documentation lives in three places. They stay in sync through the installer. This is not optional.

## The Three Levels

### 1. Repo Docs (source of truth)

Every repo has documentation at its root and in `docs/` for features:

```
repo/
├── README.md              What this repo is
├── TECHNICAL.md           How it works
├── SKILL.md               Agent instructions
├── CLAUDE.md              Agent context for Claude Code
├── docs/
│   └── <feature>/
│       ├── README.md      What this feature is
│       └── TECHNICAL.md   How this feature works
```

When a feature gets absorbed into a repo, its README and TECHNICAL move into `docs/<feature>/`.

Repo docs are the source of truth. Everything else is derived from them.

### 2. Home Docs (human readable, personalized)

Location: `~/wipcomputerinc/library/documentation/`

These are personalized for YOUR system. "Here's how releases work on YOUR machine." Generated by the installer from repo doc templates + your `~/.ldm/config.json`.

The human reads these. They describe how the system is set up on this specific machine, with this specific configuration.

### 3. Agent Docs (OS reference)

Location: `~/.ldm/shared/`

```
~/.ldm/shared/
├── rules/               Thin rules deployed to ~/.claude/rules/
├── dev-guide-*.md       Org-specific dev conventions
├── boot/                Boot sequence config
└── prompts/             Cron prompts
```

These are what agents reference. Rules, dev guide, boot config. The installer deploys them so agents always have current instructions.

### 4. ai/ (development process)

Location: `<repo>/ai/`

Plans, bugs, research, dev updates. Private repo only. Never ships to public. Updated by the dev team (humans + AI agents) during development.

## The Update Flow

### On merge to private main

1. **Repo docs** updated. README, TECHNICAL, docs/<feature>/, SKILL.md, CLAUDE.md. Part of the PR. Code and docs ship together.
2. **ai/** updated. Plan archived, bugs closed, dev update written. Notes the version is on alpha.

### On `ldm install`

3. **Home docs** regenerated. Installer reads repo doc templates + config.json, generates personalized `library/documentation/` files.
4. **Agent docs** deployed. Installer copies rules, dev guide, boot config from the installed package to `~/.ldm/shared/` and `~/.claude/rules/`.

### On deploy to public

5. **Public repo** updated. `deploy-public.sh` syncs everything except `ai/`.
6. **ai/** dev update notes the version moved from alpha to release.

## The Rule

Three places, one update, never out of sync. The installer is the bridge between "code landed" and "docs are current everywhere." Developers write repo docs. The installer propagates them. Nobody manually updates home docs or agent docs.
