hypomnema 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.ko.md +257 -78
  4. package/README.md +256 -77
  5. package/commands/audit.md +46 -0
  6. package/docs/ARCHITECTURE.md +383 -89
  7. package/docs/CONTRIBUTING.md +175 -44
  8. package/docs/assets/logo/apple-touch-icon.png +0 -0
  9. package/docs/assets/logo/cover-devto.png +0 -0
  10. package/docs/assets/logo/cover-devto.svg +70 -0
  11. package/docs/assets/logo/favicon-16.png +0 -0
  12. package/docs/assets/logo/favicon-32.png +0 -0
  13. package/docs/assets/logo/favicon-64.png +0 -0
  14. package/docs/assets/logo/icon-192.png +0 -0
  15. package/docs/assets/logo/icon-512.png +0 -0
  16. package/docs/assets/logo/logo.svg +60 -0
  17. package/docs/assets/logo/social-card.png +0 -0
  18. package/docs/assets/logo/social-card.svg +78 -0
  19. package/docs/assets/logo/wordmark.png +0 -0
  20. package/docs/assets/logo/wordmark.svg +47 -0
  21. package/hooks/hooks.json +9 -0
  22. package/hooks/hypo-auto-commit.mjs +15 -2
  23. package/hooks/hypo-auto-stage.mjs +5 -2
  24. package/hooks/hypo-hot-rebuild.mjs +17 -6
  25. package/hooks/hypo-session-record.mjs +54 -0
  26. package/hooks/hypo-session-start.mjs +28 -6
  27. package/hooks/hypo-shared.mjs +96 -0
  28. package/package.json +1 -1
  29. package/scripts/bump-version.mjs +4 -0
  30. package/scripts/doctor.mjs +10 -0
  31. package/scripts/ingest.mjs +9 -4
  32. package/scripts/init.mjs +197 -12
  33. package/scripts/lib/pkg-json.mjs +59 -0
  34. package/scripts/lint.mjs +21 -1
  35. package/scripts/session-audit.mjs +267 -0
  36. package/scripts/uninstall.mjs +70 -3
  37. package/scripts/upgrade.mjs +278 -16
  38. package/scripts/weekly-report.mjs +177 -0
  39. package/skills/crystallize/SKILL.md +4 -0
  40. package/skills/graph/SKILL.md +4 -0
  41. package/skills/ingest/SKILL.md +4 -0
  42. package/skills/lint/SKILL.md +4 -0
  43. package/skills/query/SKILL.md +4 -0
  44. package/skills/verify/SKILL.md +4 -0
  45. package/templates/.hypoignore +3 -0
  46. package/templates/hypo-config.md +1 -1
  47. package/templates/hypo-guide.md +22 -0
  48. package/templates/projects/_template/index.md +3 -0
  49. package/docs/TEST-CASES.md +0 -580
package/README.md CHANGED
@@ -1,93 +1,248 @@
1
1
  English | [한국어](README.ko.md)
2
2
 
3
- ---
3
+ <p align="center">
4
+ <img src="docs/assets/logo/wordmark.svg" alt="Hypomnema" width="520">
5
+ </p>
4
6
 
5
7
  # Hypomnema
6
8
 
7
- LLM-native personal wiki system for Claude Code.
9
+ [![npm version](https://img.shields.io/npm/v/hypomnema?color=cb3837)](https://www.npmjs.com/package/hypomnema)
10
+ [![npm downloads](https://img.shields.io/npm/dm/hypomnema?color=blue)](https://www.npmjs.com/package/hypomnema)
11
+ [![Node.js](https://img.shields.io/node/v/hypomnema?color=43853d&logo=node.js&logoColor=white)](https://nodejs.org)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
13
+ [![CI](https://github.com/sk-lim19f/Hypomnema/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sk-lim19f/Hypomnema/actions/workflows/ci.yml)
14
+ [![GitHub stars](https://img.shields.io/github/stars/sk-lim19f/Hypomnema?style=flat&color=yellow)](https://github.com/sk-lim19f/Hypomnema/stargazers)
15
+
16
+ **LLM-native personal wiki for Claude Code. Knowledge that compounds.**
17
+
18
+ _Make Claude take notes — and measure whether it actually does._
19
+
20
+ [Quick Start](#quick-start) • [How It Compares](#how-it-compares) • [Design Decisions](#design-decisions) • [Features](#features) • [Architecture](docs/ARCHITECTURE.md) • [Contributing](docs/CONTRIBUTING.md)
21
+
22
+ > Inspired by Andrej Karpathy's "LLM-native wiki" sketch and shaped by ten months of personal use, Hypomnema ships the full lifecycle — capture, synthesis, retrieval, session-resume — as Claude Code commands and lifecycle hooks.
8
23
 
9
- Hypomnema turns Claude Code into a compounding knowledge base. Instead of chunking sources as-is, an LLM reads each source, synthesizes it, and updates existing pages so new sources update knowledge more than they create it.
24
+ > **Current state vs. v2 vision.** v1.0.1 (today) is honest about its trigger model: most wiki behavior — ingest, query, session-close — fires on **explicit `/hypo:*` commands**, with a handful of hooks providing auto-staging, session-state injection, and lookup signals. The v2 thesis is *fully autonomous* — Claude reading, writing, and synthesizing the wiki without being asked. **v1.1.0** is the first step on that ramp: instead of claiming auto-behavior, it ships an **observability score** that measures how often the wiki is actually used per session (ingest count, query count, session-close rate, citation rate) so you can see the auto-vs-manual ratio with your own eyes before the v2 work lands.
10
25
 
11
26
  ---
12
27
 
13
- ## Quick start
28
+ ## Quick Start
14
29
 
15
- ```bash
16
- npm install -g hypomnema # or: npx hypomnema
17
- ```
30
+ Hypomnema ships **two install paths**. Pick one — both end up with the same wiki, hooks, and `/hypo:*` slash commands.
31
+
32
+ ### Path A — Claude Code plugin (recommended)
18
33
 
19
- In Claude Code, run:
34
+ Inside Claude Code:
20
35
 
21
36
  ```
37
+ /plugin marketplace add sk-lim19f/Hypomnema
38
+ /plugin install hypomnema@hypomnema
22
39
  /hypo:init
23
40
  ```
24
41
 
25
- This sets up your wiki directory, installs hooks, and merges them into `~/.claude/settings.json`.
26
-
27
- ---
42
+ The plugin install registers `/hypo:*` commands from the package's `commands/` directory; `/hypo:init` then scaffolds the wiki and merges hooks into `~/.claude/settings.json`.
28
43
 
29
- ## Git sync
44
+ ### Path B — npm CLI
30
45
 
31
- After `/hypo:init`, your wiki directory is already a local git repository. To sync it across machines, add a remote and push:
46
+ In your shell:
32
47
 
33
48
  ```bash
34
- git -C ~/hypomnema remote add origin <your-repo-url>
35
- git -C ~/hypomnema push -u origin HEAD
49
+ npm install -g hypomnema
50
+ hypomnema
36
51
  ```
37
52
 
38
- The Stop hook then auto-commits and pushes your wiki at the end of every session no manual sync needed.
53
+ `hypomnema` (or `hypomnema --help` for flags) scaffolds the wiki, installs hooks, **and** copies the slash command files to `~/.claude/commands/hypo/` so `/hypo:*` works inside Claude Code afterwards. Subsequent `hypomnema upgrade` runs use per-file SHA tracking to avoid clobbering anything you have hand-edited.
54
+
55
+ > Either path: restart Claude Code (or open a new session) after the first run so the new hooks and slash commands are picked up.
56
+
57
+ ### Step 2: use it
58
+
59
+ ```
60
+ /hypo:ingest https://example.com/some-article-or-paper.pdf
61
+ /hypo:query "summarize what I know about X"
62
+ /hypo:feedback "always include test commands when explaining a fix"
63
+ ```
64
+
65
+ Hooks handle the rest — auto-staging, auto-commit/push, session-state injection, lookup signals.
66
+
67
+ > **Sync across machines:** the wiki is already a git repo. Add a remote, push once, and the `Stop` hook will keep every machine in sync afterwards.
39
68
 
40
69
  ---
41
70
 
42
71
  ## Why Hypomnema
43
72
 
44
- | | Hypomnema | Plain Obsidian / Notion | RAG / vector search |
45
- |---|---|---|---|
46
- | **Capture effort** | Paste a URL → done | Manual note-taking | Upload + embed pipeline |
47
- | **Knowledge growth** | New sources update existing pages | Each note is independent | Chunks multiply indefinitely |
48
- | **Retrieval** | LLM synthesizes a grounded answer | Full-text search | Nearest-neighbour chunks |
49
- | **Workflow integration** | Lives inside Claude Code | Separate app / browser tab | Separate service |
73
+ Personal knowledge tools fall into four buckets, and each one breaks at a different place:
74
+
75
+ | | Pain | Why it doesn't compound |
76
+ |---|---|---|
77
+ | **Note vaults** (markdown-based, local-first) | Manual capture, manual linking, manual rereading | Each note stays independent; no synthesis |
78
+ | **Cloud knowledge platforms** (page/database hybrids) | Fast capture, slow retrieval | Search is keyword-first; LLM has no native access |
79
+ | **RAG / vector-search stacks** | Pipelines, embeddings, chunking | Returns chunks, not synthesized knowledge; chunks multiply forever |
80
+ | **AI-native notebooks** (proprietary "second brain" apps) | Feels magical at first | Closed format, no git, retrieval logic is opaque, vendor lock-in |
81
+ | **Code-only wikis** (auto-generated from a repo) | Zero manual effort | Limited to code; can't capture decisions, research, AI behavior corrections |
82
+
83
+ Hypomnema lives in the gap between them: **structured synthesis on top of plain markdown, driven by Claude Code's lifecycle, version-controlled by git, and local-first by default.**
50
84
 
51
- Four things that set it apart:
85
+ ```
86
+ Note vaults ───► store everything, synthesize nothing
87
+ Cloud platforms ───► capture fast, retrieve slow
88
+ RAG / vector DBs ───► retrieve chunks, never pages
89
+ AI notebooks ───► black box, no git, no portability
90
+ Code wikis ───► code only, no decisions / research / feedback
52
91
 
53
- 1. **Synthesis over storage.** Claude reads each source and synthesizes it into a structured page — not a copy-paste dump. You get a knowledge base you can reason over, not a pile of bookmarks.
54
- 2. **Compounding pages.** When a new source overlaps an existing page, Claude updates that page. The wiki gets denser and more connected over time rather than just bigger.
55
- 3. **Zero-friction hooks.** Session start, session close, auto-staging, and auto-commit happen automatically through Claude Code lifecycle hooks. You never context-switch to manage the wiki.
56
- 4. **Native to your workflow.** No separate app, no export/import, no third-party sync service. Hypomnema runs inside the Claude Code session you already have open.
92
+ Hypomnema ───► synthesis · markdown · git · hooks · local
93
+ ```
57
94
 
58
95
  ---
59
96
 
60
- ## Scenarios
97
+ ## How It Compares
98
+
99
+ | | **Hypomnema** | Note vault | Cloud platform | RAG / vector DB | AI notebook | Code wiki |
100
+ |---|---|---|---|---|---|---|
101
+ | **Capture effort** | Paste a URL → done | Manual typing | Manual typing | Upload + embed pipeline | Paste / chat | Auto from repo |
102
+ | **Storage unit** | Synthesized **page** | Note | Page / block | Vector chunk | Opaque memory | Code symbol |
103
+ | **Knowledge growth** | New sources **update** existing pages | Each note stays independent | Each page stays independent | Chunks multiply forever | Black box | Fixed by repo |
104
+ | **Retrieval** | LLM synthesizes a grounded answer | Full-text / backlinks | Keyword search | Nearest-neighbour chunks | Opaque | Code search |
105
+ | **Session continuity** | Auto-resume via `hot.md` + `session-state.md` | None | None | None | Sometimes | None |
106
+ | **Workflow integration** | Native to Claude Code | Separate app | Separate app / browser tab | Separate service | Separate app | Separate site |
107
+ | **Format** | Plain markdown + frontmatter | Markdown | Proprietary | Vector store | Proprietary | HTML |
108
+ | **Backend** | Local file + git | Local file | SaaS | Service / DB | SaaS | Service |
109
+ | **Behavior tuning** | `/hypo:feedback` → permanent rules | None | None | None | Sometimes | None |
110
+ | **Auto-behavior** | Explicit `/hypo:*` triggers today; **v1.1 ships an observability score**, v2 target = fully autonomous | None | None | None | Black box | None |
111
+ | **Setup cost** | One command | One install | Sign-up | Pipeline build | Sign-up | Repo connect |
112
+ | **Lock-in** | Zero (markdown + git) | Low | High | Medium | High | Medium |
113
+
114
+ ### What this trade-off buys you
115
+
116
+ - **Synthesis, not storage.** You don't end up with a graveyard of half-read articles. Each `/hypo:ingest` produces a structured page; subsequent ingests on the same topic *update* that page.
117
+ - **Compounding density.** A wiki with 100 sources should not have 100 disconnected pages. After three months of real use, page count grows sub-linearly while cross-links grow super-linearly.
118
+ - **Zero context switch.** You're already in Claude Code. The wiki is one slash command away — not another tab, another app, another login.
119
+ - **Future-proof storage.** Plain markdown + git means: you can read it in 20 years, you can grep it offline, you can move providers anytime, and AI assistants you haven't met yet will still understand it.
61
120
 
62
- **A — Learning a new technology**
63
- You're reading Kubernetes docs and blog posts. Drop each URL into `/hypo:ingest`. By the third article, Claude is updating your existing `kubernetes-networking.md` page rather than creating another one. A week later, `/hypo:query "how does pod CIDR allocation work?"` returns a synthesized answer citing your own notes.
121
+ ---
64
122
 
65
- **B Tracking engineering decisions**
66
- Before merging a significant change, run `/hypo:ingest` on the design doc or PR description. Claude creates an ADR-style page with context, tradeoffs, and the decision. Future `[[wikilink]]` references pull the rationale directly into any prompt that asks about it.
123
+ ## Design Decisions
67
124
 
68
- **C Research accumulation**
69
- You're working through papers on a topic over several weeks. Each `/hypo:ingest` run synthesizes the paper and cross-links it to related pages you already have. At any point, `/hypo:query` gives you a literature-review-style summary grounded in your own notes.
125
+ Why each choice looks the way it does:
70
126
 
71
- **D Tuning AI behavior**
72
- Run `/hypo:feedback` whenever Claude does something wrong or exactly right. The correction is stored in `pages/feedback/` and injected at session start, so the same mistake doesn't happen twice — across sessions, not just within one conversation.
127
+ ### 1. Why **synthesis** instead of RAG over chunks
128
+
129
+ RAG is excellent for *unfamiliar* corpora — give it a million-page legal archive and it will find relevant fragments. For *personal* knowledge, the failure mode is the opposite:
130
+
131
+ - The corpus is small but **highly redundant** (3 articles on the same topic).
132
+ - The user wants a **point of view**, not a passage.
133
+ - Chunk count grows linearly with capture, even when knowledge doesn't.
134
+
135
+ Hypomnema treats the page — not the chunk — as the unit of knowledge. New sources reconcile against the page. The result reads like a wiki article, because that's what it is.
136
+
137
+ ### 2. Why **markdown + git** instead of a proprietary store
138
+
139
+ A personal knowledge base must outlive any single tool. Markdown survives. Git survives. Both are LLM-native (every model can read them). Both run offline. Both have 30 years of tooling behind them. We deliberately picked the boring stack because the interesting part is *what Claude does with it*.
140
+
141
+ ### 3. Why **lifecycle hooks** instead of manual commands
142
+
143
+ Friction is the silent killer of personal knowledge systems. If saving a thought requires three clicks, you stop. Hypomnema piggybacks on events Claude Code already emits:
144
+
145
+ | Event | What you'd otherwise do manually |
146
+ |---|---|
147
+ | `SessionStart` | "Where did I leave off?" — read `hot.md` / `session-state.md` |
148
+ | `UserPromptSubmit` | "Do I already know this?" — BM25 lookup, top-3 inject |
149
+ | `PreCompact` | "Did I forget to write a session log?" — checklist guard |
150
+ | `PostToolUse` (Write/Edit) | `git add` |
151
+ | `Stop` | `git pull --rebase && git commit && git push` |
152
+
153
+ Once installed, you stop *managing* the wiki. It just accumulates.
154
+
155
+ ### 4. Why a **`hot.md` cache** for resume
156
+
157
+ The most expensive operation in a paused project isn't doing the work — it's **rebuilding context**. Reading `session-log/` from scratch costs minutes and tokens; reading a one-page `hot.md` costs neither. So we cache the most recent state explicitly, rebuild it on `Stop`, and inject it on `SessionStart`. Resume is O(1).
158
+
159
+ ### 5. Why a **feedback → behavior** pipeline
160
+
161
+ Most AI tools accept corrections *for the current conversation*. They never persist. Hypomnema funnels every `/hypo:feedback` into `pages/feedback/`, and durable rules are promoted into `CLAUDE.md`'s `<learned_behaviors>` block — where they survive every future session, on every machine that pulls the wiki.
73
162
 
74
- **E Resuming a paused project**
75
- You put a project down for three weeks. At the next session start, the hook reads `projects/<name>/session-state.md` and injects "next tasks" and recent decisions directly into context. You're back up to speed before you type the first prompt.
163
+ ### 6. Why **no API keys, no vector DB, no service**
164
+
165
+ Every external dependency is a future-failure mode: it breaks, it's bought, it's deprecated, it leaks credentials. Hypomnema is a Node.js script + markdown files + git. That is the entire stack. The only "AI" piece is Claude itself, which you're running anyway.
166
+
167
+ ### 7. Why **`.hypoignore`** instead of a privacy mode flag
168
+
169
+ We tried a `personal / shared / public` mode matrix in v1.0. It didn't survive contact with reality — every privacy decision was a per-path question, and a single file (`.hypoignore`) handles per-path decisions natively. v1.1 deletes the mode concept entirely. One file, one source of truth.
76
170
 
77
171
  ---
78
172
 
79
- ## How it works
173
+ ## Features
174
+
175
+ ### Synthesis primitives
176
+
177
+ Eight commands cover the full capture → retrieval → consolidation cycle.
178
+
179
+ | Command | What it does | When to reach for it |
180
+ |---|---|---|
181
+ | `/hypo:ingest` | Saves the raw source under `sources/`; Claude synthesizes a structured page under `pages/`. The shell helper (`scripts/ingest.mjs`) is read-only — it only *lists* pending sources so you know what still needs ingesting | Anytime you read something worth keeping |
182
+ | `/hypo:query` | BM25 retrieval + LLM synthesis with `[[wikilink]]` citations | When you need an answer grounded in your own notes |
183
+ | `/hypo:crystallize` | Synthesizes drafts and runs the 11-step session-close checklist | End of a non-trivial session |
184
+ | `/hypo:resume` | Loads the most recent session state for an active project | Coming back to a paused project |
185
+ | `/hypo:feedback` | Records an AI behavior correction; eligible for promotion to permanent rules | Right when Claude does something wrong (or exactly right) |
186
+ | `/hypo:verify` | Audits pages with `verify_by` frontmatter | When time-bound knowledge might have aged out |
187
+ | `/hypo:lint` | Validates frontmatter, wikilinks, schema | Before commits, in CI |
188
+ | `/hypo:graph` | Generates a wikilink dependency graph | When you want to see structural growth |
189
+
190
+ ### Lifecycle hooks (10)
191
+
192
+ | Hook | Event | Role |
193
+ |---|---|---|
194
+ | `hypo-session-start.mjs` | `SessionStart` | Inject `hot.md` / `session-state.md` + `git pull --ff-only` |
195
+ | `hypo-first-prompt.mjs` | `UserPromptSubmit` | Marker-based one-shot `hot.md` injection (10-min TTL) |
196
+ | `hypo-lookup.mjs` | `UserPromptSubmit` | BM25 top-3 HIT inject / MISS → closest-slug signal |
197
+ | `hypo-compact-guard.mjs` | `UserPromptSubmit` | Detect `/compact` → enforce session-close checklist |
198
+ | `hypo-cwd-change.mjs` | `CwdChanged` | Inject the matching project's `hot.md` |
199
+ | `hypo-file-watch.mjs` | `FileChanged` | Notify on wiki-file changes |
200
+ | `hypo-auto-stage.mjs` | `PostToolUse(Write/Edit)` | Auto-stage wiki-file edits |
201
+ | `hypo-auto-commit.mjs` | `Stop` | Auto commit + pull + push |
202
+ | `hypo-hot-rebuild.mjs` | `Stop` | Rebuild `hot.md` |
203
+ | `hypo-personal-check.mjs` | `PreCompact` | Block compact on lint failures or unfinished session-close |
204
+
205
+ All hooks resolve the wiki root via `HYPO_DIR` env → `hypo-config.md` scan → `~/hypomnema` default, and share `hypo-shared.mjs` (declared via `hooks.json`'s `shared` field).
206
+
207
+ ### Setup & maintenance
208
+
209
+ | Command | Purpose |
210
+ |---|---|
211
+ | `/hypo:init` | First-time install (dirs, hooks, settings.json merge, first commit/push) |
212
+ | `/hypo:doctor` | Health check (hooks, paths, frontmatter, git) |
213
+ | `/hypo:upgrade` | Migrate hooks/config to the latest version |
214
+ | `/hypo:uninstall` | Remove hooks and registrations |
215
+ | `/hypo:stats` | Wiki statistics |
216
+
217
+ ### Claude Agent Skills
80
218
 
81
- 1. **Ingest** drop a document, URL, or paste text into `/hypo:ingest`. Claude saves the raw source and synthesizes it into a structured page.
82
- 2. **Query** — ask `/hypo:query` anything. Claude searches your pages and synthesizes a grounded answer with `[[wikilink]]` citations.
83
- 3. **Session close** — on session end, Claude updates `session-state.md` (next tasks) and `hot.md` (what was done) so the next session resumes seamlessly.
84
- 4. **Compound value** — over time, new sources update existing pages rather than creating new ones. The wiki gets denser and more useful.
219
+ The synthesis-heavy commands (`ingest`, `query`, `crystallize`, `lint`, `verify`, `graph`) are also exposed as **Claude Agent Skills** in `skills/<name>/SKILL.md`, so they auto-trigger when the conversation matches their description no slash command required.
220
+
221
+ ---
222
+
223
+ ## Scenarios
224
+
225
+ **A — Learning a new technology.**
226
+ You're reading Kubernetes docs and blog posts. Drop each URL into `/hypo:ingest`. By the third article, Claude is updating your existing `kubernetes-networking.md` rather than creating another page. A week later, `/hypo:query "how does pod CIDR allocation work?"` returns a synthesized answer citing your own notes.
227
+
228
+ **B — Tracking engineering decisions.**
229
+ Before merging a significant change, run `/hypo:ingest` on the design doc or PR description. Claude creates an ADR-style page with context, tradeoffs, and the decision. Future `[[wikilink]]` references pull the rationale directly into any prompt that asks about it.
230
+
231
+ **C — Research accumulation.**
232
+ You're working through papers on a topic over several weeks. Each `/hypo:ingest` synthesizes the paper and cross-links it. At any point, `/hypo:query` returns a literature-review-style summary grounded in your own notes.
233
+
234
+ **D — Tuning AI behavior.**
235
+ Run `/hypo:feedback` whenever Claude does something wrong or exactly right. The correction is stored in `pages/feedback/` and injected at session start, so the same mistake doesn't happen twice — across sessions, not just within one conversation.
236
+
237
+ **E — Resuming a paused project.**
238
+ You put a project down for three weeks. At the next session start, `hypo-session-start.mjs` reads `projects/<name>/session-state.md` and injects "next tasks" and recent decisions directly into context. You're back up to speed before you type the first prompt.
85
239
 
86
240
  ---
87
241
 
88
242
  ## What goes in your wiki
89
243
 
90
244
  **Store here:**
245
+
91
246
  - Synthesized knowledge from external sources (docs, papers, talks)
92
247
  - Architecture decisions and their rationale
93
248
  - AI behavior corrections and preferences
@@ -95,31 +250,12 @@ You put a project down for three weeks. At the next session start, the hook read
95
250
  - Research findings and cross-source comparisons
96
251
 
97
252
  **Do not store here:**
253
+
98
254
  - Raw source material — that goes in `sources/` automatically, unedited
99
255
  - Credentials, tokens, or secrets — use `.hypoignore` to exclude sensitive paths
100
- - Transient task lists for the current session — use the task list in the conversation
256
+ - Transient task lists for the current session — use the conversation's task list
101
257
  - Code patterns derivable from the repo itself — `git log` and `grep` are already authoritative
102
- - Information that has a canonical owner elsewhere (Jira tickets, Confluence pages, API docs) — ingest a *synthesis*, not a mirror
103
-
104
- ---
105
-
106
- ## Commands
107
-
108
- | Command | Description |
109
- |---------|-------------|
110
- | `/hypo:init` | Set up a new wiki |
111
- | `/hypo:doctor` | Health check |
112
- | `/hypo:upgrade` | Upgrade hooks to latest version |
113
- | `/hypo:uninstall` | Remove hooks and registrations |
114
- | `/hypo:ingest` | Ingest an external source into the wiki |
115
- | `/hypo:query` | Search and synthesize an answer from wiki pages |
116
- | `/hypo:crystallize` | Consolidate drafts and related pages into stable knowledge |
117
- | `/hypo:resume` | Resume the most recent session for an active project |
118
- | `/hypo:feedback` | Record an AI behavior correction |
119
- | `/hypo:verify` | Audit pages for overdue or missing `verify_by` fields |
120
- | `/hypo:stats` | Show wiki statistics |
121
- | `/hypo:graph` | Generate a wikilink dependency graph |
122
- | `/hypo:lint` | Validate frontmatter and wikilinks |
258
+ - Information with a canonical owner elsewhere (Jira, Confluence, API docs) — ingest a *synthesis*, not a mirror
123
259
 
124
260
  ---
125
261
 
@@ -127,24 +263,66 @@ You put a project down for three weeks. At the next session start, the hook read
127
263
 
128
264
  ```
129
265
  <wiki-root>/
130
- ├── hypo-config.md ← root marker + settings
131
- ├── index.md ← searchable page catalog
132
- ├── hot.md ← active project pointers
133
- ├── log.md ← append-only activity log
134
- ├── SCHEMA.md ← type system reference
135
- ├── hypo-guide.md ← operations guide
136
- ├── .hypoignore ← glob patterns excluded from hooks
137
- ├── pages/ ← permanent knowledge pages
138
- ├── projects/ project artifacts and session logs
139
- └── sources/ ← raw ingested sources (never edit)
266
+ ├── hypo-config.md ← root marker + settings
267
+ ├── index.md ← searchable page catalog
268
+ ├── hot.md ← active project pointers
269
+ ├── log.md ← append-only activity log
270
+ ├── SCHEMA.md ← type system reference
271
+ ├── hypo-guide.md ← operations guide
272
+ ├── .hypoignore ← glob patterns excluded from hooks
273
+ ├── pages/ ← permanent knowledge pages
274
+ │ └── feedback/ AI behavior corrections
275
+ ├── projects/ ← project artifacts and session logs
276
+ │ └── <name>/
277
+ │ ├── hot.md
278
+ │ ├── session-state.md
279
+ │ └── session-log/
280
+ ├── journal/ ← daily / weekly / monthly entries
281
+ └── sources/ ← raw ingested sources (never edit)
140
282
  ```
141
283
 
142
284
  ---
143
285
 
286
+ ## Configuration
287
+
288
+ The wiki path is resolved in this order (see `scripts/lib/hypo-root.mjs`):
289
+
290
+ | Priority | Source |
291
+ |---|---|
292
+ | 1 | `--hypo-dir=<path>` CLI flag (per-script override; only honored by scripts that accept it) |
293
+ | 2 | `HYPO_DIR` environment variable |
294
+ | 3 | `hypo-config.md` marker discovered in a fixed list of home-relative candidates (`~/hypomnema`, `~/wiki`, `~/notes`, `~/knowledge`, `~/Documents/{hypomnema,wiki,notes}`) |
295
+ | 4 | Default: `~/hypomnema` |
296
+
297
+ Place a `hypo-config.md` at the wiki root to make it portable across machines without setting environment variables.
298
+
299
+ `.hypoignore` controls which paths the hooks ignore (default: `*.pdf`, `*.zip`, `*.pem`, `*.env`, …). Edit it directly — there is no privacy mode flag; one file, one source of truth.
300
+
301
+ > **Scope of git sync.** Hypomnema git-syncs only the `~/hypomnema/` wiki itself. Your Claude Code configuration (`~/.claude/`) is intentionally **not** managed by Hypomnema — for cross-machine sync of agents, skills, and settings, the recommended pattern is a separate dotfiles manager such as [chezmoi](https://www.chezmoi.io/).
302
+
303
+ ### Where do `/hypo:*` commands live?
304
+
305
+ | Install path | Slash commands served from |
306
+ |---|---|
307
+ | Plugin (Path A) | Claude Code's plugin cache; updated via `/plugin update` |
308
+ | npm CLI (Path B) | `~/.claude/commands/hypo/`; updated via `hypomnema upgrade --apply` with per-file SHA tracking. Pass `--force-commands` to overwrite hand-edits (creates `.bak`). |
309
+
310
+ ---
311
+
144
312
  ## Requirements
145
313
 
146
- - Node.js ≥ 18
147
- - Claude Code CLI
314
+ - **Node.js ≥ 18** (tested on 18 / 20 / 22)
315
+ - **Claude Code CLI**
316
+
317
+ No external services. No API keys. No vector databases.
318
+
319
+ ---
320
+
321
+ ## Status
322
+
323
+ - **Tests:** see `npm test` — exact totals shift as lanes ship, so the runner is the source of truth
324
+ - **CI:** 7 independent jobs (test matrix, lint, init/upgrade snapshots, replay, hypo-absent, uninstall-smoke)
325
+ - **Release:** `npm publish --provenance` on `v*` tag push
148
326
 
149
327
  ---
150
328
 
@@ -152,6 +330,7 @@ You put a project down for three weeks. At the next session start, the hook read
152
330
 
153
331
  - [ARCHITECTURE.md](docs/ARCHITECTURE.md) — internals, component map, data flows
154
332
  - [CONTRIBUTING.md](docs/CONTRIBUTING.md) — development setup, conventions, PR process
333
+ - [CHANGELOG.md](CHANGELOG.md) — release history
155
334
 
156
335
  ---
157
336
 
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: Run the observability audit on recent sessions and (optionally) write the weekly report
3
+ ---
4
+
5
+ You are running `/hypo:audit`. Inspect recent Claude Code sessions to see how much of the wiki's value motion is actually happening (search, ingest, citation, feedback), then either show the result inline or write a weekly observability page.
6
+
7
+ ## What this shows
8
+
9
+ - Per-session metrics — search count, ingest count, URL mentions, feedback count
10
+ - Classification — `normal` / `search-0` / `search-many` / `ingest-missed` / `staleness-skip`
11
+ - Optional weekly aggregation with an autonomy score (heuristic v0)
12
+
13
+ Definition: [[pages/observability/_index]].
14
+
15
+ ---
16
+
17
+ ## Step 1 — Locate package root
18
+
19
+ Locate the Hypomnema package root (the directory containing this file's parent `commands/`).
20
+
21
+ If the user specified a Hypomnema directory, pass it as `--hypo-dir="<path>"`. Otherwise omit the flag.
22
+
23
+ ---
24
+
25
+ ## Step 2 — Decide the mode
26
+
27
+ - **Per-session view (default)** — show recent sessions with metrics + classification:
28
+ ```bash
29
+ node <package-root>/scripts/session-audit.mjs [--hypo-dir="<path>"] [--limit=20]
30
+ ```
31
+ - **Weekly report (when the user asks for "weekly", "score", or names a week)** — write the report to `pages/observability/<YYYY-WW>.md`:
32
+ ```bash
33
+ node <package-root>/scripts/weekly-report.mjs [--hypo-dir="<path>"] [--week=YYYY-WW] --write
34
+ ```
35
+ - **JSON for tooling** — append `--json` to either script.
36
+
37
+ ---
38
+
39
+ ## Step 3 — Report results
40
+
41
+ Show the output verbatim. Then add a brief interpretation:
42
+
43
+ - If `staleness-skip` dominates: "Most sessions audited are older than 30 days — score reflects backlog, not current behavior."
44
+ - If `search-0` count is high: "Sessions ran without consulting the wiki — consider whether `/hypo:query` was the right reflex."
45
+ - If `ingest-missed` is non-zero: "Sessions discussed URLs but no `/hypo:ingest` ran — those captures got lost."
46
+ - Otherwise: "Audit window looks healthy; weekly report committed to the wiki for trend tracking."