codealmanac 0.1.1 → 0.1.3
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.
- package/README.md +53 -40
- package/dist/codealmanac.js +2522 -1402
- package/dist/codealmanac.js.map +1 -1
- package/guides/mini.md +223 -0
- package/guides/reference.md +686 -0
- package/package.json +2 -1
- package/prompts/bootstrap.md +55 -10
package/README.md
CHANGED
|
@@ -14,19 +14,30 @@ A single `CLAUDE.md` at the repo root doesn't scale past a few hundred lines, ha
|
|
|
14
14
|
|
|
15
15
|
Each repo gets a committed `.almanac/pages/` directory of markdown files. A SessionEnd hook fires when a Claude Code session ends and runs `almanac capture` in the background. A writer agent reads the session transcript and existing pages, drafts changes, and invokes a reviewer subagent that critiques against the wider graph. The writer applies the final versions. New and updated pages show up in your next `git status`; you review them like any other commit.
|
|
16
16
|
|
|
17
|
-
The CLI never reads or writes page content except in `capture` and `bootstrap`. Every other command (`search`, `show`, `
|
|
17
|
+
The CLI never reads or writes page content except in `capture` and `bootstrap`. Every other command (`search`, `show`, `topics`, `tag`, `health`) operates on a SQLite index that rebuilds silently whenever pages are newer than the index.
|
|
18
18
|
|
|
19
19
|
## Install
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
+
npx codealmanac # installs globally + runs the setup wizard
|
|
23
|
+
# or, if you prefer the explicit two-step:
|
|
22
24
|
npm install -g codealmanac
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
+
codealmanac # interactive wizard
|
|
26
|
+
# or fully unattended:
|
|
27
|
+
codealmanac --yes
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
`codealmanac` (the bare invocation) routes to a setup wizard that:
|
|
31
|
+
- checks Claude auth (subscription via `claude auth login`, or `ANTHROPIC_API_KEY`),
|
|
32
|
+
- installs the SessionEnd hook in `~/.claude/settings.json`,
|
|
33
|
+
- drops two agent guides into `~/.claude/` (`codealmanac.md` mini, `codealmanac-reference.md` full),
|
|
34
|
+
- appends `@~/.claude/codealmanac.md` to `~/.claude/CLAUDE.md` so every Claude Code session loads the mini guide.
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
The setup is idempotent — safe to re-run. Opt out with `--skip-hook` or `--skip-guides`. Later, `almanac uninstall` reverses it.
|
|
37
|
+
|
|
38
|
+
Two binaries ship, both pointing at the same entry: `codealmanac` (install surface) and `almanac` (day-to-day). Requires Node 20 or 22.
|
|
39
|
+
|
|
40
|
+
`bootstrap` and `capture` invoke Claude via the bundled Claude Agent SDK. The query commands (`search`, `show`, `health`, `topics`) need no credentials at all.
|
|
30
41
|
|
|
31
42
|
## Authentication
|
|
32
43
|
|
|
@@ -42,6 +53,8 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
42
53
|
|
|
43
54
|
# Either way, verify with:
|
|
44
55
|
claude auth status
|
|
56
|
+
# or:
|
|
57
|
+
almanac doctor
|
|
45
58
|
```
|
|
46
59
|
|
|
47
60
|
codealmanac itself never sees your credentials — auth is handled by the bundled Claude Agent SDK CLI, which reads the same `~/.claude/credentials/` store Claude Code uses.
|
|
@@ -49,46 +62,47 @@ codealmanac itself never sees your credentials — auth is handled by the bundle
|
|
|
49
62
|
## Quickstart
|
|
50
63
|
|
|
51
64
|
```bash
|
|
52
|
-
|
|
65
|
+
npm install -g codealmanac
|
|
66
|
+
codealmanac # interactive setup wizard
|
|
67
|
+
# (or: codealmanac --yes)
|
|
53
68
|
|
|
54
|
-
|
|
55
|
-
#
|
|
56
|
-
# in ~/.almanac/registry.json, adds .almanac/index.db to .gitignore
|
|
69
|
+
cd your-repo
|
|
70
|
+
almanac bootstrap # agent reads the repo and seeds stub pages + topic DAG
|
|
57
71
|
|
|
58
|
-
almanac
|
|
59
|
-
|
|
60
|
-
# top-level layout, and writes stub entity pages + a topic DAG
|
|
72
|
+
almanac search "auth" # full-text search across pages; prints slugs one per line
|
|
73
|
+
almanac show checkout-flow # read a page
|
|
61
74
|
|
|
62
|
-
|
|
63
|
-
#
|
|
75
|
+
# From here on, just code as usual — the SessionEnd hook invokes
|
|
76
|
+
# `almanac capture` at session end, which writes and updates pages
|
|
77
|
+
# based on what happened in the session.
|
|
78
|
+
```
|
|
64
79
|
|
|
65
|
-
almanac
|
|
66
|
-
# adds the SessionEnd entry to ~/.claude/settings.json so capture
|
|
67
|
-
# runs at the end of every Claude Code session
|
|
80
|
+
No `almanac init`. A wiki is scaffolded two ways: run `almanac bootstrap` yourself, or clone a repo that already has `.almanac/` committed (codealmanac auto-registers it on the first query).
|
|
68
81
|
|
|
69
|
-
|
|
70
|
-
```
|
|
82
|
+
Sanity-check the install with `almanac doctor` — it reports binary location, native SQLite binding, Claude auth, hook status, guides, import line, and current-wiki stats with a one-line fix for each ✗.
|
|
71
83
|
|
|
72
84
|
## Command reference
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
|
77
|
-
|
|
78
|
-
| `almanac
|
|
79
|
-
| `almanac
|
|
80
|
-
| `almanac
|
|
81
|
-
| `almanac
|
|
82
|
-
| `almanac
|
|
83
|
-
|
|
|
84
|
-
| `almanac
|
|
85
|
-
| `almanac
|
|
86
|
-
| `almanac
|
|
87
|
-
| `almanac
|
|
88
|
-
| `almanac
|
|
89
|
-
| `almanac
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
Grouped the same way as `almanac --help`:
|
|
87
|
+
|
|
88
|
+
| Group | Command | What it does |
|
|
89
|
+
|---|---|---|
|
|
90
|
+
| Query | `almanac search [query]` | FTS, `--topic`, `--mentions <path>`, `--since`, `--stale`, `--orphan`, `--archived`, `--limit`, `--json` |
|
|
91
|
+
| Query | `almanac show <slug>` | Read a page. Field flags: `--raw`, `--meta`, `--lead`, `--title`, `--topics`, `--files`, `--links`, `--backlinks`, `--xwiki`, `--lineage`, `--updated`, `--path`, `--json`. Absorbs the old `info` and `path` commands. |
|
|
92
|
+
| Query | `almanac health` | Eight-category graph integrity report (`orphans`, `stale`, `dead-refs`, `broken-links`, `broken-xwiki`, `empty-topics`, `empty-pages`, `slug-collisions`) |
|
|
93
|
+
| Query | `almanac list` | List registered wikis; `--drop <name>` to remove |
|
|
94
|
+
| Edit | `almanac tag <page> <topics...>` | Add topics; auto-creates missing ones; `--stdin` for bulk |
|
|
95
|
+
| Edit | `almanac untag <page> <topic>` | Remove a topic |
|
|
96
|
+
| Edit | `almanac topics ...` | `list`, `show`, `create`, `link`, `unlink`, `rename`, `delete`, `describe` — DAG management |
|
|
97
|
+
| Wiki lifecycle | `almanac bootstrap` | Agent reads the repo and seeds stub entity pages + topic DAG (requires Claude auth) |
|
|
98
|
+
| Wiki lifecycle | `almanac capture [transcript]` | Writer + reviewer on a session transcript (usually invoked by the hook) |
|
|
99
|
+
| Wiki lifecycle | `almanac hook install\|uninstall\|status` | Manage the SessionEnd hook in `~/.claude/settings.json` |
|
|
100
|
+
| Wiki lifecycle | `almanac reindex` | Force rebuild of `.almanac/index.db` |
|
|
101
|
+
| Setup | `almanac setup` | Install hook + guides + CLAUDE.md import (bare `codealmanac` alias) |
|
|
102
|
+
| Setup | `almanac uninstall` | Reverse `setup`: remove hook + guides + import line |
|
|
103
|
+
| Setup | `almanac doctor` | Report on install + current wiki with one-line fixes |
|
|
104
|
+
|
|
105
|
+
Every command that returns pages prints slugs one per line; pass `--json` for structured output; pipe slugs into commands that accept `--stdin` (`show`, `tag`, `health`). Run `almanac <command> --help` for the full flag surface, or import the full reference on demand: `@~/.claude/codealmanac-reference.md`.
|
|
92
106
|
|
|
93
107
|
## Concepts
|
|
94
108
|
|
|
@@ -169,18 +183,17 @@ Each repo has its own sovereign `.almanac/`. The global registry at `~/.almanac/
|
|
|
169
183
|
```bash
|
|
170
184
|
almanac list # all registered wikis
|
|
171
185
|
almanac search --wiki openalmanac "RLS" # specific wiki
|
|
172
|
-
almanac search --all "RLS" # every registered wiki
|
|
173
186
|
```
|
|
174
187
|
|
|
175
188
|
Cross-wiki references use a colon prefix: `[[openalmanac:supabase]]`. The segment before `:` resolves via the registry; unreachable wikis are silently skipped rather than erroring. Cloning a repo with a committed `.almanac/` auto-registers it on the first `almanac` command.
|
|
176
189
|
|
|
177
190
|
## Writing conventions
|
|
178
191
|
|
|
179
|
-
Pages are neutral-tone encyclopedia-style prose — every sentence contains a specific fact, no significance inflation, no hedging, no formulaic conclusions. Prose first, bullets for genuine lists, tables only for structured comparison. The conventions are described in each repo's `.almanac/README.md` (generated by `
|
|
192
|
+
Pages are neutral-tone encyclopedia-style prose — every sentence contains a specific fact, no significance inflation, no hedging, no formulaic conclusions. Prose first, bullets for genuine lists, tables only for structured comparison. The conventions are described in each repo's `.almanac/README.md` (generated by `bootstrap`); the reviewer loads them at runtime and enforces them on every proposal.
|
|
180
193
|
|
|
181
194
|
## Status
|
|
182
195
|
|
|
183
|
-
`v0.1.
|
|
196
|
+
`v0.1.3`, pre-release. Node 20.x or 22.x. Release process is documented in [RELEASE.md](./RELEASE.md). Breaking changes are possible before 1.0; they will be called out in release notes.
|
|
184
197
|
|
|
185
198
|
## Philosophy
|
|
186
199
|
|