@afterxleep/doc-bot 1.10.0 → 1.13.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.
- package/README.md +223 -321
- package/bin/doc-bot.js +2 -8
- package/package.json +7 -11
- package/src/__tests__/docset-integration.test.js +4 -4
- package/src/__tests__/temp-docs-1752689978225/test.md +5 -0
- package/src/__tests__/temp-docs-1752689978235/test.md +5 -0
- package/src/__tests__/temp-docs-1752689978241/test.md +5 -0
- package/src/__tests__/temp-docs-1752689978243/test.md +5 -0
- package/src/__tests__/temp-docs-1752689978244/test.md +5 -0
- package/src/__tests__/temp-docsets-1752689978244/7e2cbc65/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1752689978244/7e2cbc65/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1752689978244/Mock.docset/Contents/Info.plist +10 -0
- package/src/__tests__/temp-docsets-1752689978244/Mock.docset/Contents/Resources/docSet.dsidx +0 -0
- package/src/__tests__/temp-docsets-1752689978244/docsets.json +10 -0
- package/src/index.js +411 -210
- package/src/services/DocumentationService.js +131 -2
- package/src/services/UnifiedSearchService.js +214 -0
- package/src/services/__tests__/DocumentationService.test.js +318 -0
- package/src/services/__tests__/UnifiedSearchService.test.js +302 -0
- package/src/services/docset/ParallelSearchManager.js +158 -0
- package/src/services/docset/__tests__/EnhancedDocsetDatabase.test.js +324 -0
- package/src/services/docset/database.js +271 -0
package/README.md
CHANGED
|
@@ -3,319 +3,233 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@afterxleep/doc-bot)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
It's platform agnostic and designed to replace and extend the rule systems provided by different IDEs, such as Cursor (Cursor Rules) or Claude (CLAUDE.md). Instead of relying on separate rule-sets for each tool, you can use doc-bot to provide unified documentation for agentic coding across all your AI assistants.
|
|
6
|
+
An intelligent MCP (Model Context Protocol) server that gives AI assistants like Claude and Cursor deep understanding of your project through smart documentation management.
|
|
9
7
|
|
|
10
8
|
## What is doc-bot?
|
|
11
9
|
|
|
12
|
-
doc-bot is
|
|
13
|
-
- 🧠 **
|
|
14
|
-
-
|
|
15
|
-
- 🔄 **
|
|
16
|
-
- 📚 **
|
|
17
|
-
|
|
18
|
-
## Why MCP Instead of Static Rules?
|
|
19
|
-
|
|
20
|
-
IDE's use static rule files (like Cursor Rules or Copilot's .github/copilot-instructions.md), and each one has their own format, metadata and approach.
|
|
21
|
-
|
|
22
|
-
### 🚀 Dynamic Search vs Static Rules
|
|
23
|
-
|
|
24
|
-
**Static Systems:**
|
|
25
|
-
- All rules must fit in a single file or limited token window
|
|
26
|
-
- AI reads everything, even irrelevant rules
|
|
27
|
-
- No way to search or filter documentation (besides plain 'grep')
|
|
28
|
-
- Rules compete for context space
|
|
29
|
-
|
|
30
|
-
**MCP with doc-bot:**
|
|
31
|
-
- AI searches for exactly what it needs
|
|
32
|
-
- Unlimited documentation size - only relevant parts are retrieved
|
|
33
|
-
- Smart keyword and pattern matching
|
|
34
|
-
- Context window used efficiently
|
|
35
|
-
|
|
36
|
-
### 🧠 Contextual Intelligence
|
|
37
|
-
|
|
38
|
-
**Static Systems:**
|
|
39
|
-
- Duplicate or symlinked rules to work with multiple agents
|
|
40
|
-
- Agents use `grep` for basic text-base searching
|
|
41
|
-
|
|
42
|
-
**MCP with doc-bot:**
|
|
43
|
-
- AI searches for relevant documentation based on your query
|
|
44
|
-
- Context-aware suggestions from your actual questions
|
|
45
|
-
- Different documentation retrieved for different tasks
|
|
46
|
-
- Intelligent inference from keywords and search terms
|
|
10
|
+
doc-bot is a documentation server that enhances AI coding assistants by providing:
|
|
11
|
+
- 🧠 **Smart search** through your project documentation
|
|
12
|
+
- 📖 **Contextual rules** that apply based on what you're working on
|
|
13
|
+
- 🔄 **Live updates** as your documentation changes
|
|
14
|
+
- 📚 **API references** from official documentation (via Docsets)
|
|
15
|
+
- 🤖 **MCP tools** for AI agents to query and understand your project
|
|
47
16
|
|
|
48
|
-
|
|
17
|
+
## Why doc-bot?
|
|
49
18
|
|
|
50
|
-
|
|
51
|
-
- Limited by token count
|
|
52
|
-
- Adding more rules has impact in your context window
|
|
53
|
-
- Documentation competes with your actual code for context
|
|
19
|
+
Traditional AI assistants have limited context windows and no understanding of your specific project. doc-bot solves this by:
|
|
54
20
|
|
|
55
|
-
**
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
- AI
|
|
59
|
-
- Your context window stays free for actual work
|
|
21
|
+
1. **Providing project-specific knowledge** - Your conventions, patterns, and rules
|
|
22
|
+
2. **Searching intelligently** - AI finds exactly what it needs without cluttering context
|
|
23
|
+
3. **Scaling infinitely** - Thousands of docs without token limits
|
|
24
|
+
4. **Staying current** - Live reload ensures AI always has latest information
|
|
60
25
|
|
|
61
|
-
|
|
26
|
+
## How It Works
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
- Changes require restarting your AI/IDE
|
|
65
|
-
- No way to know if rules are current
|
|
66
|
-
- Manual synchronization across tools and AI agents
|
|
67
|
-
|
|
68
|
-
**MCP with doc-bot:**
|
|
69
|
-
- Hot reload on documentation changes
|
|
70
|
-
- Always serves the latest version
|
|
71
|
-
- Single source of truth for all AI tools
|
|
72
|
-
|
|
73
|
-
### 🎯 Smart Discovery
|
|
74
|
-
|
|
75
|
-
**Static Systems:**
|
|
76
|
-
- AI doesn't know what documentation exists
|
|
77
|
-
- Users must know to ask specific questions
|
|
78
|
-
- No exploration or discovery capabilities
|
|
79
|
-
- AI agents rely on basic grep searches through codebases to infer project patterns
|
|
80
|
-
|
|
81
|
-
**MCP with doc-bot:**
|
|
82
|
-
- AI can list all available documentation
|
|
83
|
-
- Discovers relevant docs automatically
|
|
84
|
-
- Suggests documentation based on relevance
|
|
85
|
-
- Searchable knowledge base with intelligent ranking
|
|
86
|
-
- No need for AI to grep through your codebase - dedicated search engine
|
|
87
|
-
|
|
88
|
-
## Installation
|
|
89
|
-
|
|
90
|
-
1. **Create your documentation folder** in your project root (see organization section below)
|
|
91
|
-
|
|
92
|
-
2. **Add doc-bot to your MCP-compatible AI tool configuration**:
|
|
93
|
-
|
|
94
|
-
```json
|
|
95
|
-
{
|
|
96
|
-
"mcpServers": {
|
|
97
|
-
"doc-bot": {
|
|
98
|
-
"command": "npx",
|
|
99
|
-
"args": ["@afterxleep/doc-bot@latest"]
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**Custom docs folder:**
|
|
106
|
-
```json
|
|
107
|
-
{
|
|
108
|
-
"mcpServers": {
|
|
109
|
-
"doc-bot": {
|
|
110
|
-
"command": "npx",
|
|
111
|
-
"args": ["@afterxleep/doc-bot@latest", "--docs", "./my-custom-docs"]
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**With Docsets support (for official API documentation):**
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"mcpServers": {
|
|
121
|
-
"doc-bot": {
|
|
122
|
-
"command": "npx",
|
|
123
|
-
"args": ["@afterxleep/doc-bot@latest", "--docs", "./docs", "--docsets", "~/MyDocSets"]
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
Note: If a relative path does not work, you can use VSCode `${workspaceFolder}`environment variable `${workspaceFolder}/my-custom-docs`
|
|
28
|
+
doc-bot acts as a bridge between your documentation and AI assistants:
|
|
129
29
|
|
|
30
|
+
```
|
|
31
|
+
Your Project Documentation → doc-bot → MCP Protocol → AI Assistant (Claude, Cursor, etc.)
|
|
32
|
+
```
|
|
130
33
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"command": "npx",
|
|
137
|
-
"args": ["@afterxleep/doc-bot@latest", "--verbose"]
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
34
|
+
When you ask your AI assistant to write code, it can:
|
|
35
|
+
1. Check your project's coding standards
|
|
36
|
+
2. Search for relevant documentation
|
|
37
|
+
3. Find API references and examples
|
|
38
|
+
4. Follow your team's specific patterns
|
|
142
39
|
|
|
143
|
-
|
|
40
|
+
## Quick Start
|
|
144
41
|
|
|
145
|
-
|
|
42
|
+
### 1. Install doc-bot
|
|
146
43
|
|
|
147
|
-
|
|
148
|
-
**🎯 Why This Matters**: Without this rule, agents may default to general knowledge instead of your doc-bot documentation.
|
|
44
|
+
Add doc-bot to your AI assistant's configuration:
|
|
149
45
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
46
|
+
**For Claude Desktop or Claude Code:**
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"doc-bot": {
|
|
51
|
+
"command": "npx",
|
|
52
|
+
"args": ["@afterxleep/doc-bot@latest"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
155
57
|
|
|
156
|
-
|
|
58
|
+
**Location of config file:**
|
|
59
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
60
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
61
|
+
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
157
62
|
|
|
158
|
-
|
|
63
|
+
### 2. Create Your Documentation
|
|
159
64
|
|
|
160
|
-
Create a `doc-bot
|
|
65
|
+
Create a `doc-bot` folder in your project root and add markdown files:
|
|
161
66
|
|
|
162
67
|
```
|
|
163
68
|
your-project/
|
|
164
69
|
├── doc-bot/
|
|
165
|
-
│ ├── coding-standards.md
|
|
166
|
-
│ ├──
|
|
167
|
-
│ ├── testing.md
|
|
168
|
-
│
|
|
169
|
-
|
|
70
|
+
│ ├── coding-standards.md
|
|
71
|
+
│ ├── api-patterns.md
|
|
72
|
+
│ ├── testing-guide.md
|
|
73
|
+
│ └── architecture.md
|
|
74
|
+
├── src/
|
|
170
75
|
└── package.json
|
|
171
76
|
```
|
|
172
77
|
|
|
173
|
-
|
|
78
|
+
### 3. Test It
|
|
174
79
|
|
|
175
|
-
|
|
80
|
+
Ask your AI assistant: "What are the coding standards for this project?"
|
|
176
81
|
|
|
177
|
-
|
|
178
|
-
- **Contextual Rules** (`alwaysApply: false`): Rules applied based on file patterns and context
|
|
82
|
+
## Project Documentation
|
|
179
83
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
**Global Rule Example** (`doc-bot/coding-standards.md`):
|
|
183
|
-
```markdown
|
|
184
|
-
---
|
|
185
|
-
alwaysApply: true
|
|
186
|
-
title: "Coding Standards"
|
|
187
|
-
description: "Core coding standards that apply to all code"
|
|
188
|
-
keywords: ["code-quality", "standards", "best-practices"]
|
|
189
|
-
---
|
|
84
|
+
doc-bot treats your project documentation as a searchable knowledge base for AI assistants.
|
|
190
85
|
|
|
191
|
-
|
|
86
|
+
### Documentation Format
|
|
192
87
|
|
|
193
|
-
|
|
194
|
-
- Maximum line length: 100 characters
|
|
195
|
-
- Always use const/let, never var
|
|
196
|
-
- Prefer async/await over promises
|
|
197
|
-
- Write descriptive variable names
|
|
198
|
-
```
|
|
88
|
+
Create markdown files with frontmatter metadata:
|
|
199
89
|
|
|
200
|
-
**Contextual Rule Example** (`doc-bot/testing.md`):
|
|
201
90
|
```markdown
|
|
202
91
|
---
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
keywords: ["testing", "jest", "tdd", "unit-tests"]
|
|
207
|
-
filePatterns: ["*.test.js", "*.spec.js", "__tests__/**/*"]
|
|
92
|
+
title: "React Component Guidelines"
|
|
93
|
+
description: "Standards for building React components"
|
|
94
|
+
keywords: ["react", "components", "frontend", "jsx"]
|
|
208
95
|
---
|
|
209
96
|
|
|
210
|
-
#
|
|
211
|
-
|
|
212
|
-
All test files should:
|
|
213
|
-
- Use describe/it blocks for organization
|
|
214
|
-
- Include both positive and negative test cases
|
|
215
|
-
- Mock external dependencies
|
|
216
|
-
- Aim for 80%+ code coverage
|
|
97
|
+
# React Component Guidelines
|
|
217
98
|
|
|
218
|
-
|
|
99
|
+
- Use functional components with hooks
|
|
100
|
+
- Follow PascalCase naming
|
|
101
|
+
- Keep components under 200 lines
|
|
102
|
+
- Write tests for all components
|
|
219
103
|
```
|
|
220
104
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
doc-bot uses frontmatter in your markdown files to automatically detect and categorize rules.
|
|
224
|
-
|
|
225
|
-
### Frontmatter Fields:
|
|
226
|
-
|
|
227
|
-
- **`alwaysApply: true`** - Global rules applied to every AI interaction
|
|
228
|
-
- **`alwaysApply: false`** - Contextual rules searched and applied based on relevance
|
|
229
|
-
- **`keywords: ["list", "of", "keywords"]`** - For smart indexing and search
|
|
230
|
-
- **`filePatterns: ["*.js", "src/**/*.ts"]`** - Apply docs to specific files (see below)
|
|
231
|
-
- **`title`** and **`description`** - Standard metadata
|
|
232
|
-
- **`confidence: 0.9`** - Relevance confidence score (0-1)
|
|
233
|
-
|
|
234
|
-
### 🎯 Automatic Intelligence
|
|
105
|
+
### Frontmatter Options
|
|
235
106
|
|
|
236
|
-
|
|
107
|
+
| Field | Type | Description | Example |
|
|
108
|
+
|-------|------|-------------|---------|
|
|
109
|
+
| `title` | string | Document title (required) | "API Guidelines" |
|
|
110
|
+
| `description` | string | Brief description | "REST API design patterns" |
|
|
111
|
+
| `keywords` | array | Search keywords | ["api", "rest", "http"] |
|
|
112
|
+
| `alwaysApply` | boolean | Apply to all queries | true/false |
|
|
113
|
+
| `filePatterns` | array | Apply to specific files | ["*.test.js", "**/*.spec.ts"] |
|
|
237
114
|
|
|
238
|
-
|
|
239
|
-
- **Multi-term search** with fuzzy matching capabilities
|
|
240
|
-
- **Smart inference** from documentation content
|
|
241
|
-
- **Automatic indexing** - no manual configuration needed
|
|
115
|
+
### How Search Works
|
|
242
116
|
|
|
243
|
-
|
|
117
|
+
1. **Intelligent Parsing** - Queries are parsed, stop words removed
|
|
118
|
+
2. **Multi-field Matching** - Searches title, description, keywords, and content
|
|
119
|
+
3. **Relevance Scoring** - Results ranked by relevance (exact matches score highest)
|
|
120
|
+
4. **Context Extraction** - Returns snippets showing matched content
|
|
244
121
|
|
|
245
|
-
|
|
122
|
+
### Types of Documentation
|
|
246
123
|
|
|
124
|
+
#### Global Rules (Always Apply)
|
|
247
125
|
```markdown
|
|
248
126
|
---
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
description: "Best practices for building React components"
|
|
252
|
-
keywords: ["react", "components", "hooks", "jsx"]
|
|
127
|
+
title: "Coding Standards"
|
|
128
|
+
alwaysApply: true
|
|
253
129
|
---
|
|
254
|
-
|
|
255
|
-
# React Component Guidelines
|
|
256
|
-
|
|
257
|
-
Your documentation content here...
|
|
130
|
+
Rules that apply to every file in your project
|
|
258
131
|
```
|
|
259
132
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
133
|
+
#### Contextual Documentation
|
|
134
|
+
```markdown
|
|
135
|
+
---
|
|
136
|
+
title: "Testing Guide"
|
|
137
|
+
filePatterns: ["*.test.js", "*.spec.ts"]
|
|
138
|
+
---
|
|
139
|
+
Documentation that only applies to test files
|
|
140
|
+
```
|
|
263
141
|
|
|
142
|
+
#### Searchable References
|
|
264
143
|
```markdown
|
|
265
144
|
---
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
keywords: ["testing", "jest", "react"]
|
|
269
|
-
filePatterns: ["*.test.jsx", "*.test.tsx", "__tests__/**/*"]
|
|
145
|
+
title: "Database Schema"
|
|
146
|
+
keywords: ["database", "postgres", "schema", "migrations"]
|
|
270
147
|
---
|
|
148
|
+
Documentation found through search queries
|
|
149
|
+
```
|
|
271
150
|
|
|
272
|
-
# React Testing Guide
|
|
273
151
|
|
|
274
|
-
|
|
275
|
-
```
|
|
152
|
+
## Docsets (API Documentation)
|
|
276
153
|
|
|
277
|
-
|
|
278
|
-
- `*.js` - All JavaScript files
|
|
279
|
-
- `src/**/*.ts` - TypeScript files in src directory
|
|
280
|
-
- `[Tt]est.js` - Test.js or test.js
|
|
281
|
-
- `*.{jsx,tsx}` - React component files
|
|
154
|
+
doc-bot can also search official API documentation from Docsets, giving your AI assistant access to comprehensive framework and library references.
|
|
282
155
|
|
|
283
|
-
|
|
156
|
+
### What are Docsets?
|
|
284
157
|
|
|
285
|
-
|
|
158
|
+
Docsets are pre-built documentation databases containing official docs for:
|
|
159
|
+
- Programming languages (Python, JavaScript, Go, etc.)
|
|
160
|
+
- Frameworks (React, Vue, Django, Rails, etc.)
|
|
161
|
+
- Libraries (NumPy, Express, jQuery, etc.)
|
|
162
|
+
- Platforms (iOS, Android, AWS, etc.)
|
|
286
163
|
|
|
287
|
-
###
|
|
164
|
+
### Setting Up Docsets
|
|
288
165
|
|
|
289
|
-
1. **
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
cd doc-bot
|
|
166
|
+
1. **Option A: Ask your AI assistant to install directly**:
|
|
167
|
+
|
|
168
|
+
From a URL:
|
|
293
169
|
```
|
|
294
|
-
|
|
295
|
-
2. **Install dependencies:**
|
|
296
|
-
```bash
|
|
297
|
-
npm install
|
|
170
|
+
Use the add_docset tool to install Swift documentation from https://kapeli.com/feeds/Swift.tgz
|
|
298
171
|
```
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
|
|
172
|
+
|
|
173
|
+
From a local file:
|
|
174
|
+
```
|
|
175
|
+
Use the add_docset tool to install the docset at /Users/me/Downloads/React.docset
|
|
303
176
|
```
|
|
304
177
|
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
npm run dev
|
|
178
|
+
2. **Manage your docsets**:
|
|
308
179
|
```
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
npm test
|
|
180
|
+
List all installed docsets
|
|
181
|
+
Remove docset with ID abc123
|
|
312
182
|
```
|
|
313
183
|
|
|
314
|
-
|
|
184
|
+
Docsets are automatically stored in `~/Developer/DocSets` by default.
|
|
185
|
+
|
|
186
|
+
### Docset Sources
|
|
315
187
|
|
|
316
|
-
|
|
188
|
+
- **User Contributed Docsets**: https://github.com/Kapeli/Dash-User-Contributions
|
|
189
|
+
- **Docset Generation Tools**: https://github.com/Kapeli/docset-generator
|
|
317
190
|
|
|
318
|
-
|
|
191
|
+
Popular docsets available:
|
|
192
|
+
- Programming Languages: Python, JavaScript, Go, Rust, Swift
|
|
193
|
+
- Web Frameworks: React, Vue, Angular, Django, Rails
|
|
194
|
+
- Mobile: iOS, Android, React Native, Flutter
|
|
195
|
+
- Databases: PostgreSQL, MySQL, MongoDB, Redis
|
|
196
|
+
- Cloud: AWS, Google Cloud, Azure
|
|
197
|
+
|
|
198
|
+
3. **Configure custom path** (optional):
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"mcpServers": {
|
|
202
|
+
"doc-bot": {
|
|
203
|
+
"command": "npx",
|
|
204
|
+
"args": ["@afterxleep/doc-bot@latest", "--docsets", "/path/to/docsets"]
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### How Docset Search Works
|
|
211
|
+
|
|
212
|
+
- **Unified Search**: One query searches both your docs and API docs
|
|
213
|
+
- **Smart Prioritization**: Your project docs are boosted 5x in relevance
|
|
214
|
+
- **API Exploration**: Use `explore_api` tool to discover related classes, methods
|
|
215
|
+
- **Performance**: Parallel search across multiple docsets with caching
|
|
216
|
+
|
|
217
|
+
## Available Tools
|
|
218
|
+
|
|
219
|
+
doc-bot provides these tools to AI assistants:
|
|
220
|
+
|
|
221
|
+
| Tool | Purpose | Example Use |
|
|
222
|
+
|------|---------|-------------|
|
|
223
|
+
| `check_project_rules` | Get rules before writing code | "What patterns should I follow?" |
|
|
224
|
+
| `search_documentation` | Search all documentation | "How do I implement auth?" |
|
|
225
|
+
| `get_global_rules` | Get always-apply rules | "What are the coding standards?" |
|
|
226
|
+
| `get_file_docs` | Get file-specific docs | "Rules for Button.test.jsx" |
|
|
227
|
+
| `explore_api` | Explore API documentation | "Show me URLSession methods" |
|
|
228
|
+
| `add_docset` | Install new docset | "Add Swift docs from URL" |
|
|
229
|
+
| `remove_docset` | Remove installed docset | "Remove docset abc123" |
|
|
230
|
+
| `list_docsets` | List all docsets | "Show installed docsets" |
|
|
231
|
+
|
|
232
|
+
## Configuration Options
|
|
319
233
|
|
|
320
234
|
### CLI Options
|
|
321
235
|
|
|
@@ -323,105 +237,93 @@ Ask your AI assistant something like "What documentation is available?" to test
|
|
|
323
237
|
doc-bot [options]
|
|
324
238
|
|
|
325
239
|
Options:
|
|
326
|
-
-d, --docs <path> Path to docs folder (default: doc-bot)
|
|
240
|
+
-d, --docs <path> Path to docs folder (default: ./doc-bot)
|
|
241
|
+
-s, --docsets <path> Path to docsets folder (default: ~/Developer/DocSets)
|
|
327
242
|
-v, --verbose Enable verbose logging
|
|
328
243
|
-w, --watch Watch for file changes
|
|
329
|
-
-h, --help
|
|
244
|
+
-h, --help Display help
|
|
330
245
|
```
|
|
331
246
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
247
|
+
### Advanced Configuration
|
|
248
|
+
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"mcpServers": {
|
|
252
|
+
"doc-bot": {
|
|
253
|
+
"command": "npx",
|
|
254
|
+
"args": [
|
|
255
|
+
"@afterxleep/doc-bot@latest",
|
|
256
|
+
"--docs", "./documentation",
|
|
257
|
+
"--docsets", "/Library/Application Support/Dash/DocSets",
|
|
258
|
+
"--verbose",
|
|
259
|
+
"--watch"
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
342
264
|
```
|
|
343
265
|
|
|
344
|
-
##
|
|
266
|
+
## Documentation
|
|
345
267
|
|
|
346
|
-
|
|
268
|
+
- **[API Reference](doc-bot/api-reference.md)** - Complete reference for all MCP tools
|
|
269
|
+
- **[Architecture Guide](doc-bot/architecture.md)** - Technical architecture and components
|
|
270
|
+
- **[Configuration Guide](doc-bot/configuration-guide.md)** - All configuration options
|
|
271
|
+
- **[Troubleshooting Guide](doc-bot/troubleshooting.md)** - Common issues and solutions
|
|
272
|
+
- **[Examples & Best Practices](doc-bot/examples-and-best-practices.md)** - Real-world usage examples
|
|
273
|
+
- **[Contributing Guide](doc-bot/contributing.md)** - How to contribute to doc-bot
|
|
347
274
|
|
|
348
|
-
|
|
349
|
-
```bash
|
|
350
|
-
git clone https://github.com/afterxleep/doc-bot.git
|
|
351
|
-
cd doc-bot
|
|
352
|
-
npm install
|
|
353
|
-
```
|
|
275
|
+
## Best Practices
|
|
354
276
|
|
|
355
|
-
|
|
356
|
-
```bash
|
|
357
|
-
npm run dev # With file watching
|
|
358
|
-
npm start # Basic run
|
|
359
|
-
npm test # Run tests
|
|
360
|
-
```
|
|
277
|
+
### Writing Effective Documentation
|
|
361
278
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
"command": "node",
|
|
369
|
-
"args": ["/path/to/doc-bot/bin/doc-bot.js", "--verbose", "--watch"]
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}
|
|
279
|
+
1. **Use descriptive titles and keywords**
|
|
280
|
+
```markdown
|
|
281
|
+
---
|
|
282
|
+
title: "Authentication Flow"
|
|
283
|
+
keywords: ["auth", "login", "jwt", "security", "authentication"]
|
|
284
|
+
---
|
|
373
285
|
```
|
|
374
286
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
npm run lint
|
|
287
|
+
2. **Apply rules contextually**
|
|
288
|
+
```markdown
|
|
289
|
+
---
|
|
290
|
+
filePatterns: ["**/auth/**", "*.auth.js"]
|
|
291
|
+
---
|
|
381
292
|
```
|
|
382
293
|
|
|
383
|
-
|
|
384
|
-
```bash
|
|
385
|
-
npm version patch|minor|major
|
|
386
|
-
```
|
|
294
|
+
3. **Keep docs focused** - One topic per file
|
|
387
295
|
|
|
388
|
-
|
|
389
|
-
```bash
|
|
390
|
-
npm publish
|
|
391
|
-
```
|
|
296
|
+
4. **Include examples** - Show, don't just tell
|
|
392
297
|
|
|
393
|
-
###
|
|
298
|
+
### Optimizing Search
|
|
394
299
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
git push origin main
|
|
399
|
-
git push --tags # Push version tags
|
|
400
|
-
```
|
|
300
|
+
- Include synonyms in keywords: `["test", "testing", "spec", "jest"]`
|
|
301
|
+
- Use clear section headers for better snippet extraction
|
|
302
|
+
- Add descriptions to improve search relevance
|
|
401
303
|
|
|
402
|
-
##
|
|
304
|
+
## Why MCP over Static Rules?
|
|
403
305
|
|
|
404
|
-
|
|
306
|
+
Unlike static `.cursorrules` or `.github/copilot-instructions.md` files:
|
|
405
307
|
|
|
406
|
-
|
|
407
|
-
-
|
|
408
|
-
-
|
|
409
|
-
- Unified
|
|
410
|
-
-
|
|
308
|
+
- **Dynamic**: AI searches for what it needs instead of reading everything
|
|
309
|
+
- **Scalable**: Unlimited docs without token limits
|
|
310
|
+
- **Intelligent**: Context-aware documentation based on current file
|
|
311
|
+
- **Unified**: Works with any MCP-compatible AI tool
|
|
312
|
+
- **Live**: Hot reload on documentation changes
|
|
411
313
|
|
|
412
|
-
|
|
413
|
-
1. **Install a docset**: Use the `add_docset` tool with a URL or local path
|
|
414
|
-
2. **Search documentation**: Use `search_docsets` for docsets only, or `search_all` for unified results
|
|
415
|
-
3. **Manage docsets**: List installed docsets with `list_docsets`, remove with `remove_docset`
|
|
314
|
+
## Contributing
|
|
416
315
|
|
|
417
|
-
See [
|
|
316
|
+
See our [Contributing Guide](doc-bot/contributing.md) for development setup and guidelines.
|
|
418
317
|
|
|
419
318
|
## License
|
|
420
319
|
|
|
421
|
-
MIT
|
|
320
|
+
MIT - See [LICENSE](LICENSE) for details.
|
|
321
|
+
|
|
322
|
+
## Support
|
|
422
323
|
|
|
423
|
-
|
|
324
|
+
- **Issues**: [GitHub Issues](https://github.com/afterxleep/doc-bot/issues)
|
|
325
|
+
- **Discussions**: [GitHub Discussions](https://github.com/afterxleep/doc-bot/discussions)
|
|
326
|
+
|
|
327
|
+
---
|
|
424
328
|
|
|
425
|
-
|
|
426
|
-
- [GitHub repository](https://github.com/afterxleep/doc-bot)
|
|
427
|
-
- [Model Context Protocol](https://github.com/modelcontextprotocol/specification)
|
|
329
|
+
Built with ❤️ in Spain
|