@01b/team-kb 0.2.8 → 0.2.9
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 +153 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# @01b/team-kb
|
|
2
|
+
|
|
3
|
+
CLI tool for building and wiring a Team Knowledge Base (KB) so that LLMs (Claude, Gemini, Codex) can automatically leverage shared team knowledge.
|
|
4
|
+
|
|
5
|
+
## Why
|
|
6
|
+
|
|
7
|
+
- LLM sessions reset every time. Domain knowledge explained yesterday is forgotten today.
|
|
8
|
+
- Knowledge stays siloed — what one developer teaches Claude, another's Gemini doesn't know.
|
|
9
|
+
- LLMs ignore team coding conventions because they don't know they exist.
|
|
10
|
+
|
|
11
|
+
**@01b/team-kb** solves this by creating a shared, git-based knowledge base that automatically loads into any LLM tool across your team.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install -g @01b/team-kb
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
### `kb init`
|
|
22
|
+
|
|
23
|
+
Create a new KB repository. Run once per team.
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
mkdir ~/team-kb && cd ~/team-kb
|
|
27
|
+
kb init
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Generates:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
team-kb/
|
|
34
|
+
├── ai-context/ # Auto-loaded by LLMs
|
|
35
|
+
│ ├── kb-rules.md # Search, record, and reference rules
|
|
36
|
+
│ └── team-focus.md # Team intro and focus areas
|
|
37
|
+
├── rules/ # Verified business rules
|
|
38
|
+
├── analysis/ # Code analysis results
|
|
39
|
+
├── decisions/ # Decision records
|
|
40
|
+
├── troubleshoot/ # Incident responses
|
|
41
|
+
├── drafts/ # Unverified drafts
|
|
42
|
+
├── archive/ # Inactive notes
|
|
43
|
+
├── templates/ # Note templates
|
|
44
|
+
├── .kb/
|
|
45
|
+
│ ├── hooks/pre-commit # Frontmatter validation + index rebuild
|
|
46
|
+
│ └── scripts/ # rebuild-index.sh
|
|
47
|
+
├── .github/workflows/ # CI health checks
|
|
48
|
+
└── kb-index.json # Search index (auto-generated)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### `kb join <url>`
|
|
52
|
+
|
|
53
|
+
Join an existing KB. Run once per team member.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
kb join https://github.com/your-org/team-kb.git
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This will:
|
|
60
|
+
- `git clone` the KB repository
|
|
61
|
+
- Install the pre-commit hook
|
|
62
|
+
- Save the KB path to local config
|
|
63
|
+
|
|
64
|
+
### `kb wire <tool>`
|
|
65
|
+
|
|
66
|
+
Wire a project to the KB. Run once per project per tool.
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
cd ~/repos/my-project
|
|
70
|
+
kb wire claude # Claude Code
|
|
71
|
+
kb wire gemini # Gemini CLI
|
|
72
|
+
kb wire codex # Codex CLI
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Claude
|
|
76
|
+
|
|
77
|
+
Creates symlinks in `.claude/rules/` pointing to KB files. Claude Code auto-scans this directory, so KB rules and knowledge are loaded automatically every session.
|
|
78
|
+
|
|
79
|
+
#### Gemini
|
|
80
|
+
|
|
81
|
+
Creates `GEMINI.md` with `@import` chain via `.gemini/kb-context/` symlink. Gemini loads `GEMINI.md` as a foundational mandate, which imports KB rules and knowledge through the symlink.
|
|
82
|
+
|
|
83
|
+
#### Codex
|
|
84
|
+
|
|
85
|
+
Creates `AGENTS.md` with a directive to read `.codex/kb-directive.md`. Codex reads `AGENTS.md` on session start and follows the instruction to load KB content via tool calls.
|
|
86
|
+
|
|
87
|
+
### How wiring works
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Claude: .claude/rules/ ── auto-scan ──→ symlinks ──→ KB ai-context/
|
|
91
|
+
Gemini: GEMINI.md ──@import──→ kb-import.md ──@import──→ kb-context/ (symlink) ──→ KB ai-context/
|
|
92
|
+
Codex: AGENTS.md ──directive──→ kb-directive.md ──tool call──→ KB ai-context/
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Tracked vs local-only**: Tracked files (git commit) contain only KB entry points. Files with absolute paths are local-only (`.gitignore`) to prevent path conflicts between team members.
|
|
96
|
+
|
|
97
|
+
## Recording Knowledge
|
|
98
|
+
|
|
99
|
+
While working with an LLM, when you discover new domain knowledge:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
"Record this to KB"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The LLM will:
|
|
106
|
+
1. Determine the appropriate folder based on content type
|
|
107
|
+
2. Create a note with proper frontmatter (tags, tldr, created, updated)
|
|
108
|
+
3. The pre-commit hook automatically rebuilds the search index on commit
|
|
109
|
+
|
|
110
|
+
### Tag namespaces
|
|
111
|
+
|
|
112
|
+
Tags use `/` as a namespace separator (Obsidian-compatible):
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
tags: [repo/my-service, domain/coupon, tech/redis]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Folder guide
|
|
119
|
+
|
|
120
|
+
| Folder | Purpose |
|
|
121
|
+
|--------|---------|
|
|
122
|
+
| `rules/` | Team-verified business rules |
|
|
123
|
+
| `analysis/` | Code analysis results |
|
|
124
|
+
| `decisions/` | Decision records |
|
|
125
|
+
| `troubleshoot/` | Incident response records |
|
|
126
|
+
| `drafts/` | Unverified drafts |
|
|
127
|
+
|
|
128
|
+
## KB Search Rules
|
|
129
|
+
|
|
130
|
+
Defined in `ai-context/kb-rules.md` and auto-loaded into every LLM session:
|
|
131
|
+
|
|
132
|
+
- **KB first** — For domain knowledge questions, check KB before searching code
|
|
133
|
+
- **Code is truth** — KB is a guide, code is the source of truth. Lightly verify against code when answering about code behavior
|
|
134
|
+
- **Mismatch handling** — If KB and code disagree, answer based on code + report the mismatch + suggest KB update
|
|
135
|
+
- **Efficient search** — Grep keywords in index for large KBs, full read for small ones (≤50 notes)
|
|
136
|
+
|
|
137
|
+
## Trust Hierarchy
|
|
138
|
+
|
|
139
|
+
| Folder | Trust level |
|
|
140
|
+
|--------|-------------|
|
|
141
|
+
| `global/` | Highest — org-wide rules |
|
|
142
|
+
| `rules/`, `decisions/` | Team-verified |
|
|
143
|
+
| `analysis/`, `troubleshoot/` | Generally reliable — lightly verify |
|
|
144
|
+
| `drafts/` | Unverified — must verify |
|
|
145
|
+
| `archive/` | Inactive — may be outdated |
|
|
146
|
+
|
|
147
|
+
## Works with Obsidian
|
|
148
|
+
|
|
149
|
+
The KB is a plain folder of markdown files with YAML frontmatter — Obsidian reads it natively as a vault. Tags use `/` separator, which Obsidian renders as a navigable tree in the tag panel. Obsidian CLI (v1.12+) can also be used to search and manage KB notes from the terminal.
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT
|