Skip to content

Commit cf1a485

Browse files
committed
web: update docs
1 parent c70b7c6 commit cf1a485

11 files changed

Lines changed: 225 additions & 14 deletions

File tree

docs/chub-vs-context-hub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Chub is a Rust rewrite of [Context Hub](https://github.com/andrewyng/context-hub
44

55
## Performance
66

7-
All benchmarks measured on the production corpus (1,553 docs, 7 skills) on Windows 11, Node.js v22, Rust release build. Median of 5 runs. Reproduce with `./scripts/benchmark.sh`.
7+
All benchmarks measured on the production corpus (1,560 docs, 7 skills) on Windows 11, Node.js v22, Rust release build. Median of 5 runs. Reproduce with `./scripts/benchmark.sh`.
88

99
| Operation | Context Hub (JS) | Chub (Rust) | Speedup |
1010
|---|---|---|---|

docs/chub-vs-context7.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ They solve different problems. Run both.
66

77
| | Context7 | Chub |
88
|---|---|---|
9-
| Public library docs | Auto-crawled, always fresh | 1,558+ curated entries |
9+
| Public library docs | Auto-crawled, always fresh | 1,560+ curated entries |
1010
| Private/internal docs | No | Yes |
1111
| Team annotations | No | Yes (git-tracked) |
1212
| Version pinning | No | Yes (with reasons) |
@@ -62,7 +62,7 @@ The agent calls `chub_get` for your internal API docs, pinned versions, and team
6262

6363
## What Chub deliberately does not try to do
6464

65-
Chub does not crawl upstream library repos. It cannot compete with Context7 on public library freshness, and it does not try to. The curated registry (1,600+ entries) covers the most common libraries at known-good versions — sufficient for most needs, and supplemented by Context7 when currency matters.
65+
Chub does not crawl upstream library repos. It cannot compete with Context7 on public library freshness, and it does not try to. The curated registry (1,560+ entries) covers the most common libraries at known-good versions — sufficient for most needs, and supplemented by Context7 when currency matters.
6666

6767
If you need always-fresh public docs: use Context7.
6868
If you need your team's knowledge in the agent's context: use Chub.

docs/cli-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ chub snapshot restore v1.0 # restore exact pin versions
260260

261261
## chub mcp
262262

263-
Start the MCP stdio server for AI coding agents. See the [MCP integration docs](../website/docs/mcp.md) for setup instructions.
263+
Start the MCP stdio server for AI coding agents. See the [MCP Server reference](../website/docs/reference/mcp-server.md) for setup instructions.
264264

265265
## Piping Patterns
266266

docs/plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
| Capability | Context Hub (JS) | Chub (Rust) |
1111
|---|---|---|
12-
| Public library docs | 1,558+ curated | 1,558+ curated |
12+
| Public library docs | 1,560+ curated | 1,560+ curated |
1313
| Custom/private docs | Yes (build cmd) | Yes (build cmd) |
1414
| Offline mode | Yes (bundle) | Yes (bundle) |
1515
| Team collaboration | No | **Yes** (pins, profiles, annotations) |

npm/chub/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ chub list
2525

2626
## Features
2727

28-
- **1,553+ curated docs** — API references for popular libraries and frameworks
28+
- **1,560+ curated docs** — API references for popular libraries and frameworks
2929
- **~44ms cold start** — native Rust binary, no Node.js runtime needed
3030
- **10 MB binary** — vs ~22 MB node_modules
3131
- **MCP server** — AI agents search and fetch docs automatically

website/docs/.vitepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default defineConfig({
5858
{
5959
text: 'Going Further',
6060
items: [
61+
{ text: 'Content Guide', link: '/guide/content-guide' },
6162
{ text: 'Self-Hosting a Registry', link: '/guide/self-hosting' },
6263
]
6364
},
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# Content Guide
2+
3+
How to author docs and skills for the Chub registry. Whether you're contributing to the public registry or building a private one for your team.
4+
5+
## Directory Structure
6+
7+
Content is organized by author, then by type (`docs` or `skills`), then by entry name:
8+
9+
```
10+
my-content/
11+
acme/
12+
docs/
13+
widgets/
14+
DOC.md # single-language doc
15+
references/
16+
advanced.md # additional reference file
17+
client/
18+
javascript/
19+
DOC.md # multi-language: JS variant
20+
python/
21+
DOC.md # multi-language: Python variant
22+
api/
23+
v1/
24+
DOC.md # multi-version: v1
25+
v2/
26+
DOC.md # multi-version: v2
27+
skills/
28+
deploy/
29+
SKILL.md # a skill
30+
```
31+
32+
### Single-language docs
33+
34+
Place `DOC.md` directly in the entry directory:
35+
36+
```
37+
author/docs/entry-name/DOC.md
38+
```
39+
40+
### Multi-language docs
41+
42+
Create a subdirectory per language:
43+
44+
```
45+
author/docs/entry-name/javascript/DOC.md
46+
author/docs/entry-name/python/DOC.md
47+
```
48+
49+
### Multi-version docs
50+
51+
When an API has breaking changes across major versions, create a subdirectory per version:
52+
53+
```
54+
author/docs/entry-name/
55+
v1/
56+
DOC.md # versions: "1.0.0"
57+
v2/
58+
DOC.md # versions: "2.0.0"
59+
```
60+
61+
Both `DOC.md` files must share the same `name` in frontmatter. The build groups them into a single registry entry with multiple versions. The highest version becomes the `recommendedVersion`.
62+
63+
You can combine multi-version with multi-language:
64+
65+
```
66+
author/docs/entry-name/
67+
v1/
68+
javascript/DOC.md
69+
python/DOC.md
70+
v2/
71+
javascript/DOC.md
72+
python/DOC.md
73+
```
74+
75+
### Skills
76+
77+
Place `SKILL.md` in the entry directory:
78+
79+
```
80+
author/skills/entry-name/SKILL.md
81+
```
82+
83+
### Reference files
84+
85+
Additional files (examples, advanced topics, error references) go alongside the entry file:
86+
87+
```
88+
author/docs/widgets/
89+
DOC.md
90+
references/
91+
advanced.md
92+
errors.md
93+
```
94+
95+
These are discoverable via `chub get` (shown in the footer) and fetchable with `--file` or `--full`.
96+
97+
## Frontmatter
98+
99+
Every `DOC.md` and `SKILL.md` starts with YAML frontmatter between `---` delimiters.
100+
101+
### DOC.md frontmatter
102+
103+
```yaml
104+
---
105+
name: widgets
106+
description: "Acme widget API for creating and managing widgets"
107+
metadata:
108+
languages: "javascript"
109+
versions: "2.0.0"
110+
revision: 1
111+
updated-on: "2026-01-01"
112+
source: maintainer
113+
tags: "acme,widgets,api"
114+
---
115+
```
116+
117+
| Field | Required | Description |
118+
|-------|----------|-------------|
119+
| `name` | Yes | Entry name (used in the ID: `author/name`) |
120+
| `description` | Yes | Short description for search results |
121+
| `metadata.languages` | Yes | Language of this doc variant |
122+
| `metadata.versions` | Yes | Package/SDK version this doc covers |
123+
| `metadata.revision` | Yes | Content revision number (starts at 1, increment on update) |
124+
| `metadata.updated-on` | Yes | Date this content was last revised (`YYYY-MM-DD`) |
125+
| `metadata.source` | Yes | Trust level: `official`, `maintainer`, or `community` |
126+
| `metadata.tags` | No | Comma-separated tags for filtering |
127+
128+
### SKILL.md frontmatter
129+
130+
```yaml
131+
---
132+
name: deploy
133+
description: "Deployment automation skill for CI/CD pipelines"
134+
metadata:
135+
revision: 1
136+
updated-on: "2026-01-01"
137+
source: community
138+
tags: "deploy,ci,automation"
139+
---
140+
```
141+
142+
Skills have the same fields as docs except `languages` and `versions` are not required (skills are language-agnostic).
143+
144+
## Versioning
145+
146+
### Package version vs API version
147+
148+
The `versions` field refers to the **package/SDK version** (the version on npm or pypi). This is what agents detect from `package.json` or `requirements.txt`.
149+
150+
If a library has a separate API versioning scheme (like Stripe's dated API versions), document that within the content body. The frontmatter `versions` stays as the package version.
151+
152+
### Updating content
153+
154+
When you improve content for the same package version (fix examples, add details, clarify wording):
155+
156+
1. Bump `revision` (e.g., 1 → 2)
157+
2. Update `updated-on` to today's date
158+
3. Keep `versions` the same
159+
160+
## Writing Guidelines
161+
162+
Content is markdown, written for LLM consumption:
163+
164+
- **Be direct.** Agents don't need introductions or marketing. Start with what the API does and how to use it.
165+
- **Show code first.** A working example is worth more than a paragraph of explanation.
166+
- **Cover the common case.** Don't exhaustively document every option. Cover what agents need 90% of the time.
167+
- **Use reference files for depth.** Put advanced topics, error handling, and edge cases in separate reference files rather than making the main doc too long.
168+
169+
## Building
170+
171+
```sh
172+
chub build my-content/ # build to my-content/dist/
173+
chub build my-content/ -o dist/ # custom output directory
174+
chub build my-content/ --validate-only # validate without building
175+
chub build my-content/ --base-url https://cdn.example.com/v1 # set CDN URL
176+
```
177+
178+
The build process:
179+
1. Discovers all `DOC.md` and `SKILL.md` files
180+
2. Validates frontmatter (checks required fields)
181+
3. Generates `registry.json` with entry metadata and `search-index.json` for BM25 search
182+
4. Copies content files to the output directory
183+
184+
Builds are incremental by default — a SHA-256 manifest skips unchanged files.
185+
186+
### Validation
187+
188+
Run `--validate-only` to check your content without building:
189+
190+
```sh
191+
chub build my-content/ --validate-only
192+
```
193+
194+
## Using built content
195+
196+
Point your config at the build output to use it alongside the public registry:
197+
198+
```yaml
199+
# ~/.chub/config.yaml
200+
sources:
201+
- name: community
202+
url: https://cdn.aichub.org/v1
203+
- name: my-team
204+
path: /path/to/my-content/dist
205+
```
206+
207+
Now `chub search` and `chub get` cover both public and your local content.
208+
209+
See [Self-Hosting](/guide/self-hosting) for serving your registry over HTTP or deploying to a CDN.

website/docs/guide/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ chub --version
3636

3737
## Search for docs
3838

39-
Chub serves curated API documentation from a public registry of 1,553+ docs. Search for anything:
39+
Chub serves curated API documentation from a public registry of 1,560+ docs. Search for anything:
4040

4141
```sh
4242
chub search "stripe payments"
@@ -183,4 +183,5 @@ Now that you have Chub installed, explore the features that matter to your workf
183183
| See all CLI commands | [CLI Reference](/reference/cli) |
184184
| Configure Chub | [Configuration](/reference/configuration) |
185185
| Connect AI agents via MCP | [MCP Server](/reference/mcp-server) |
186+
| Author docs and skills | [Content Guide](/guide/content-guide) |
186187
| Build a custom private registry | [Self-Hosting](/guide/self-hosting) |

website/docs/guide/showcases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Claude Code now has access to these MCP tools:
155155

156156
| Tool | What it does |
157157
|---|---|
158-
| `chub_search` | Search 1,553+ curated docs |
158+
| `chub_search` | Search 1,560+ curated docs |
159159
| `chub_get` | Fetch a doc by ID with annotations |
160160
| `chub_list` | Browse available docs |
161161
| `chub_context` | Get pinned docs, annotations, and project context |

website/docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ features:
4242

4343
<div class="stats-bar">
4444
<div class="stat">
45-
<div class="stat-num">1,553</div>
45+
<div class="stat-num">1,560</div>
4646
<div class="stat-label">Curated Docs</div>
4747
</div>
4848
<div class="stat">
@@ -102,7 +102,7 @@ chub mcp
102102

103103
## MCP Setup
104104

105-
Add to your MCP config and your AI agent gets instant access to 1,553+ curated docs:
105+
Add to your MCP config and your AI agent gets instant access to 1,560+ curated docs:
106106

107107
```json
108108
{
@@ -117,7 +117,7 @@ Add to your MCP config and your AI agent gets instant access to 1,553+ curated d
117117

118118
## Benchmarks
119119

120-
Measured on the production corpus (1,553 docs, 7 skills). Median of 5 runs. Reproduce with `./scripts/benchmark.sh`.
120+
Measured on the production corpus (1,560 docs, 7 skills). Median of 5 runs. Reproduce with `./scripts/benchmark.sh`.
121121

122122
| Operation | Context Hub (JS) | Chub (Rust) | Speedup |
123123
|---|---|---|---|
@@ -137,7 +137,7 @@ Measured on the production corpus (1,553 docs, 7 skills). Median of 5 runs. Repr
137137

138138
| Capability | Context Hub | Context7 | Chub |
139139
|---|---|---|---|
140-
| Curated docs | 1,600+ | hosted | 1,553+ |
140+
| Curated docs | 1,600+ | hosted | 1,560+ |
141141
| MCP server | 5 tools | 2 tools | **7 tools** |
142142
| CLI commands | 7 || **20** |
143143
| Self-learning agents | No | **No** | **Yes** |
@@ -146,7 +146,7 @@ Measured on the production corpus (1,553 docs, 7 skills). Median of 5 runs. Repr
146146
| Doc pinning | No | No | **Yes** |
147147
| Team annotations | No | No | **Git-tracked** |
148148
| Context profiles | No | No | **With inheritance** |
149-
| Agent config sync | No | No | **5 targets** |
149+
| Agent config sync | No | No | **10 targets** |
150150
| Self-hosted registry | Yes | No | **Yes** |
151151
| Format compatible ||| **Identical to Context Hub** |
152152

0 commit comments

Comments
 (0)