--- name: note description: > Explicit notes. Use when user says "note X", "note it". --- # Note Explicit note store backed by SQLite. User says "note X" → extract tags, reformulate content, store via `note.py add`. Delete only on explicit user request. Notes are stored to sqlite db. ## Backend `skills/note/scripts/note.py` — CLI wrapper around `db/note.sqlite`. Operation log: `log/note.log` (append-only, all write operations). ## Tag protocol Tags are the **first token** right after the trigger — comma-separated, no spaces: ``` /note arch explanation of the architecture decision → tags: [arch] /note hw,linux interesting article about kernel → tags: [hw, linux] /note this is a note without tags → tags: [] ``` Rules: - Lowercase only; multi-word tags use `-`: `cli`, `soft-delete`, `task-queue` - If user writes `#tag`, strip `#` before passing to the script - If no tag is given — that is fine, use no tags; never force tags Tags are created automatically on first use — no registration needed. ## Write protocol 1. Extract inline tags from the first token (see Tag protocol above). 2. Reformulate the remaining text into a terse fact. One concept per entry — split if too complex; omit context that is not itself a fact. Preserve input language; never translate. Drop filler. - Input: "poznamenej si, glow zobrazuje markdown v terminálu #cli" - Run: `uv run skills/note/scripts/note.py add "glow displays markdown in terminal" --tags cli` 3. Echo: `Noted [#1]: [#tag1 #tag2]` (tags omitted if none). `#1` is the display ID of the new note — use it to delete immediately if needed. No dedup. No MEMORY.md lookup. Blind append. ## List protocol Trigger: `/note list`, `show notes`, `what notes do you have?` 1. Run: `uv run skills/note/scripts/note.py list [--limit N] [--tag TAG [TAG ...]]` 2. Echo output. If empty → respond "No notes." `--tag` accepts one or more tags; OR logic (notes with at least one matching tag). The number before each note (`1.`, `2.`, …) is the **display ID** — sequential among active notes, newest first. Renumbers after every deletion. ## Delete protocol Trigger: `/note delete`, `delete a note`, `remove a note`. 1. If the user has not specified an ID, run `list` first to show current notes. 2. Run: `uv run skills/note/scripts/note.py delete ` - Exit 0 → confirm deletion. - Exit 1 → display ID out of range; respond accordingly. 3. Nothing is deleted automatically. Only this explicit protocol deletes. Display IDs renumber after every deletion (e.g., after deleting #3, the old #4 becomes #3). Always run `list` first if unsure of current IDs. ## Edge cases - `/note` with no content → ask "What should I note?" - Vague input → ask for the concrete fact; do not store a placeholder. - `/note delete` with no ID → run `list` first, then ask which display ID. - Multi-line input → collapse to one line; one entry = one row. ## Rules - Never store verbatim input. Always reformulate. Preserve input language. - Do not store smalltalk or meta-commentary about the note skill itself. - **No auto-load:** `note.sqlite` is never referenced in bootstrap files. - **No auto-delete / no compaction.** Only explicit delete marks an entry. - **Delete is soft** — the entry is marked with a timestamp, not removed from the database. The operation log (`log/note.log`) is the primary audit trail. - Separate from `/keep`, `MEMORY.md`, Dream — never cross-write or cross-read.