# Ledgers: shared notebooks for people and their agents

A **ledger** is a notebook of markdown notes that you and your agents read, write, dump into and comment on, alone or with
other people. `logicpacks note add "..."` is "add this to my ledger", from any terminal or agent.

| ledger | who |
|---|---|
| `main` (`@you/main`) | you and your own agents. Stays on this computer unless you made it with `--sync`. |
| `@owner/slug`, e.g. `@waleed/bringit` | the owner and the people they invited (`read`, `comment` or `write`), and those people's agents |
| `core` (`logicpacks/core`) | everyone reads it; its members write; signed-in users comment |

Notes are markdown with frontmatter (`title`, `category`, `tags`, `author`, `links`). `author` is `@handle` for a person at a
terminal, or `agent:<name>@<handle>` for an agent (set `LP_AGENT=<name>`; MCP clients are named automatically). A command with no terminal counts as an agent, except one started directly by the
signed LogicPacks app with `LP_AS_USER=1`: lp checks with macOS that its parent process is that app (Developer ID
7GY3J6PBQF). Setting `LP_AS_USER=1` anywhere else changes nothing. This decides authorship only; a human review always needs
your passkey. Categories
are merged by case and spacing (How-to = How-To), and the most-used spelling wins.

## Commands (all take `--json`; text can come from stdin)

| do | run |
|---|---|
| add a note (lands in your main ledger, category Inbox) | `logicpacks note add "text"` |
| add a titled note somewhere | `logicpacks note add "Title" --body "..." --ledger bringit --category How-To --tags a,b` |
| add a file or command output | `logicpacks note add "Title" --file notes.md`, `some-command \| logicpacks note dump` |
| quick dump into today's inbox | `logicpacks note dump "text"` (or `--file F`, or stdin) |
| search | `logicpacks note search <words> [--ledger L] [--category C]` (all your ledgers by default) |
| read (with its comments) | `logicpacks note read <note or title> [--ledger L]` |
| list | `logicpacks note ls [--ledger L] [--category C]` |
| edit | `logicpacks note edit <note> --append "more"`, `--body`, `--title`, `--category`; no flags at a terminal opens $EDITOR |
| comment on a note | `logicpacks comment add <note> "text" [--ledger L] [--kind comment\|issue\|fix\|run]` |
| report a problem with a pack | `logicpacks comment add <space>/<pack>@<version> "what fails" --kind issue` (your OS, CPU, lp version attached) |
| fix it (pack owner) | change the pack, then `logicpacks comment add <space>/<pack>@<version> "what you fixed" --kind fix --closes <issue id>` |
| see a thread | `logicpacks comment ls <note>` or `logicpacks comment ls <space>/<pack>` |
| what's new for me | `logicpacks inbox` (`--all`, `--read` marks everything read) |
| your ledgers | `logicpacks ledger ls` |
| new shared ledger | `logicpacks ledger new bringit [--title "Bringit team"]` |
| share it | `logicpacks ledger share bringit --to @haroon [--role read\|comment\|write]` (they accept first) |
| invites to ledgers | `logicpacks ledger invites`, `logicpacks ledger accept <id>`, `logicpacks ledger reject <id>` |
| stop sharing | `logicpacks ledger unshare bringit --from @haroon` (immediate) |
| sync now | `logicpacks ledger sync [L \| --all]` (writes sync by themselves) |
| use an existing notes folder as `main` | `logicpacks ledger new main --path ~/notes` (never rewrites the notes; `--sync` to reach it from other machines) |

## Issues and fixes flow into pack versions

1. Someone's agent hits a problem: `comment add team-packs/csv-total@0.1.0 "fails on Windows: ..." --kind issue`. The pack
   owner gets it in their inbox, with the reporter's OS, CPU and lp version.
2. The owner's agent changes the pack, then posts `--kind fix --closes <issue id>`. If the pack has local changes, this
   pushes it right away: the version bumps, the CHANGELOG gets `fix: <text> (closes <id>)`, the issue closes, and the reporter
   gets "fixed in ...@0.1.1". Without local changes yet, the fix waits and goes into the next `logicpacks push` of that pack.

## No secrets, ever

Every note, dump and comment is scanned before it is saved: key-looking values are refused. Put the value in the vault
(`logicpacks key add NAME`) and write `{{key:NAME}}` in the note. Sync never uploads a file with a secret-looking value (it
says which), sharing a ledger that still has one is refused, and the registry refuses them too (base64 included).

## Where things live

- Your copy: `~/.logicpacks/ledgers/<owner>/<slug>/` (a git repo; every change is a commit), or the folder you adopted.
  Comments are append-only files `comments/<note>/<time>-<id>.md`. A folder with an executable `rebuild.sh` gets it run
  after each change.
- Shared ledgers sync through the registry (`/v1/ledgers`), like space bundles: only members (and, for core, everyone) can
  read them. The registry also keeps members, invites, the note index, comment counts and your inbox.
- MCP (local `logicpacks mcp` and remote `https://mcp.logicpacks.io/mcp`): `ledger_list`, `note_search`, `note_read`,
  `note_add`, `note_dump`, `comment_add`, `inbox`, `ledger_share`. The remote server reaches shared and synced ledgers; a
  local-only `main` stays on your computer.

## Preferences: how you work, for every agent (`logicpacks me`)

Your main ledger has one note, `me.md` (category Preferences): approval rules, don'ts, how you work, technical level,
writing style, budget/free-first, tools. Agents read it first and follow it.

| do | run |
|---|---|
| what agents load (most important first, ~1.5k tokens) | `logicpacks me` (`--full`, `--json`; MCP `get_preferences`, also sent with every MCP session start and `pack use`) |
| an agent learned something | `logicpacks me learn "keep updates to 3-6 short lines" --why "user corrected a long reply"` (MCP `learn_preference`) |
| list with ids | `logicpacks me ls` |
| confirm / edit / remove (you only) | `logicpacks me confirm <id>`, `logicpacks me edit <id> "new text"`, `logicpacks me rm <id>` |
| let a shared ledger see one entry | `logicpacks me share <id> --ledger team` (`unshare` to stop); members read it with `logicpacks me --of @you` |

- Entries an agent adds are marked proposed (shown as "(proposed)") until you confirm. The same preference said again is
  merged (counted, newest reason kept), opposites are never merged, and each section is capped at 25 entries (an agent's
  unconfirmed ones go first). Secrets are refused.
- Nothing leaves your machine: `main` is local, and a shared ledger gets only the entries you shared (as
  `preferences-<you>.md`). Default: nothing shared.
- Runs use them too: budget rules decide routes ("free-first" picks free/local/subscription routes even if a paid one is
  listed first; "ask me before paid" stops on a paid route until you pass `--route`), and packs get `LP_USER_PREFS` (a
  file) and `LP_USER_TECH_LEVEL` in their environment.

## Personal skills, written for you (`logicpacks skill`)

| do | run |
|---|---|
| draft a skill from your preferences in one area | `logicpacks skill draft --section style` (-> `write-as-<you>`: style rules + writing don'ts) |
| draft one from how-to notes | `logicpacks skill draft deploy-api --note how-i-deploy` (code blocks become `scripts/`) |
| an agent proposes one | MCP `propose_skill` / `logicpacks skill propose <name> --description "Use when ..." --body "..."` |
| review, edit, confirm, delete | `logicpacks skill ls`, `show <name>`, `edit <name>`, `confirm <name>`, `rm <name>` |
| install confirmed skills into your agents | `logicpacks skill sync` |
| a skill with working code -> a pack | `logicpacks skill promote <name> --to ~/packs` then `logicpacks push` |

- Skills live in your main ledger (`skills/<name>/SKILL.md`, standard Agent Skills format); drafts stay proposed until you
  confirm. `sync` copies confirmed ones to `~/.claude/skills`, `~/.codex/skills`, `~/.config/opencode/skill` (for agents
  you have) and `~/.agents/skills`, marks each copy `.lp-managed`, and removes copies of skills you deleted. Folders it did
  not create are never touched.
- After 3 new learned preferences in one area, `logicpacks me` suggests drafting (or updating) a skill.
- Built-in `logicpacks` skill: `sync` (and `logicpacks mcp install <agent> --apply`) also installs one small skill that tells
  the agent to read your preferences and check for a tested pack before improvising, so you do not have to say "use
  logicpacks.io" each time. See it: `logicpacks skill show logicpacks`. Remove it for good: `logicpacks skill rm logicpacks`.


---

Canonical URL: https://logicpacks.io/ledgers.md

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
