@afterxleep/doc-bot 1.0.0 โ†’ 1.0.1

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 (3) hide show
  1. package/README.md +80 -275
  2. package/bin/doc-bot.js +9 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,89 +1,72 @@
1
- # docbot
1
+ # doc-bot
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/docbot)](https://www.npmjs.com/package/docbot)
3
+ [![npm version](https://img.shields.io/npm/v/@afterxleep/doc-bot)](https://www.npmjs.com/package/@afterxleep/doc-bot)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- A generic, open-source MCP (Model Context Protocol) server that provides intelligent documentation access for any project. Works with AI agents like Claude Code, Cursor, and any other MCP-compatible tools.
6
+ A generic MCP (Model Context Protocol) server that provides intelligent documentation access for any project. Works with AI agents like Claude Code, Cursor, and any other MCP-compatible tools.
7
7
 
8
- ## ๐Ÿš€ Features
8
+ ## What is doc-bot?
9
9
 
10
- - **๐Ÿ” Smart Documentation Search**: Full-text search across all documentation
11
- - **๐Ÿง  Intelligent Inference**: Context-aware documentation suggestions based on your current work
12
- - **๐Ÿ“‹ Global Rules**: Always-apply documentation that's relevant to every interaction
13
- - **๐ŸŽฏ Contextual Docs**: File-specific documentation based on patterns and file types
14
- - **๐Ÿ“ฆ Zero Config**: Works out of the box with a simple `docbot/` folder
15
- - **๐Ÿ”„ Hot Reload**: Automatically updates when documentation changes
16
- - **๐Ÿ› ๏ธ Universal**: Works with any project, any language, any framework
10
+ doc-bot is an intelligent documentation server that:
11
+ - ๐Ÿ” **Searches** your project documentation instantly
12
+ - ๐Ÿง  **Infers** relevant docs based on your current work
13
+ - ๐Ÿ“‹ **Applies** global rules to every AI interaction
14
+ - ๐ŸŽฏ **Suggests** contextual documentation based on file patterns
15
+ - ๐Ÿ”„ **Updates** automatically when docs change
17
16
 
18
- ## ๐Ÿ“ฆ Installation & Usage
17
+ ## Installation
19
18
 
20
- ### Quick Start
19
+ Add doc-bot to your Claude Code MCP configuration:
21
20
 
22
- 1. **Install and run in your project:**
23
- ```bash
24
- # Navigate to your project directory
25
- cd your-project
26
-
27
- # Run the server (installs automatically)
28
- npx docbot
29
- ```
30
-
31
- 2. **Create your documentation structure:**
32
- ```bash
33
- mkdir docbot
34
- echo '{"name": "My Project Documentation", "globalRules": []}' > docbot/manifest.json
35
- echo "# Getting Started" > docbot/README.md
36
- ```
37
-
38
- 3. **Add to your Claude Code configuration:**
21
+ 1. **Add to Claude Code configuration** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
39
22
  ```json
40
23
  {
41
24
  "mcpServers": {
42
25
  "docs": {
43
26
  "command": "npx",
44
- "args": ["docbot"]
27
+ "args": ["@afterxleep/doc-bot"]
45
28
  }
46
29
  }
47
30
  }
48
31
  ```
49
32
 
50
- 4. **Restart Claude Code and start using intelligent documentation!**
33
+ 2. **Restart Claude Code**
51
34
 
52
- ### Global Installation
35
+ 3. **Create your documentation folder** (if it doesn't exist, doc-bot will show you how when you first use it)
53
36
 
54
- ```bash
55
- # Install globally
56
- npm install -g docbot
37
+ ## How to organize your documentation
57
38
 
58
- # Run in any project
59
- docbot
60
- ```
61
-
62
- ## ๐Ÿ“ Project Structure
63
-
64
- Create a `docbot/` folder in your project root:
39
+ Create a `doc-bot/` folder in your project root:
65
40
 
66
41
  ```
67
42
  your-project/
68
- โ”œโ”€โ”€ docbot/
69
- โ”‚ โ”œโ”€โ”€ manifest.json # Configuration and rules
43
+ โ”œโ”€โ”€ doc-bot/
44
+ โ”‚ โ”œโ”€โ”€ manifest.json # Configuration file
70
45
  โ”‚ โ”œโ”€โ”€ core/
71
- โ”‚ โ”‚ โ”œโ”€โ”€ architecture.md # Always-apply architecture guidelines
72
- โ”‚ โ”‚ โ”œโ”€โ”€ coding-standards.md # Coding standards for all files
73
- โ”‚ โ”‚ โ””โ”€โ”€ security.md # Security guidelines
46
+ โ”‚ โ”‚ โ”œโ”€โ”€ coding-standards.md # Always-apply coding standards
47
+ โ”‚ โ”‚ โ””โ”€โ”€ security.md # Security guidelines
74
48
  โ”‚ โ”œโ”€โ”€ guides/
75
- โ”‚ โ”‚ โ”œโ”€โ”€ testing.md # Testing strategies
76
- โ”‚ โ”‚ โ”œโ”€โ”€ deployment.md # Deployment procedures
77
- โ”‚ โ”‚ โ””โ”€โ”€ api-development.md # API development guide
49
+ โ”‚ โ”‚ โ”œโ”€โ”€ testing.md # Testing strategies
50
+ โ”‚ โ”‚ โ””โ”€โ”€ api-development.md # API development guide
78
51
  โ”‚ โ””โ”€โ”€ reference/
79
- โ”‚ โ”œโ”€โ”€ troubleshooting.md # Common issues and solutions
80
- โ”‚ โ””โ”€โ”€ best-practices.md # Best practices by topic
52
+ โ”‚ โ””โ”€โ”€ troubleshooting.md # Common issues and solutions
81
53
  โ””โ”€โ”€ package.json
82
54
  ```
83
55
 
84
- ## โš™๏ธ Configuration
56
+ **Note:** You can use a different folder name by passing the `--docs` parameter:
57
+ ```bash
58
+ npx @afterxleep/doc-bot --docs ./my-custom-docs
59
+ ```
60
+
61
+ ### Documentation types:
62
+
63
+ - **Core docs** (`core/`): Critical guidelines that should always be considered
64
+ - **Guides** (`guides/`): Step-by-step instructions for specific tasks
65
+ - **Reference** (`reference/`): Quick lookups and troubleshooting
66
+
67
+ ## The manifest file
85
68
 
86
- ### Manifest File (`docbot/manifest.json`)
69
+ The `doc-bot/manifest.json` file controls how your documentation works:
87
70
 
88
71
  ```json
89
72
  {
@@ -98,262 +81,84 @@ your-project/
98
81
  "*.test.js": ["guides/testing.md"],
99
82
  "*.spec.js": ["guides/testing.md"],
100
83
  "src/components/*": ["guides/react-components.md"],
101
- "src/api/*": ["guides/api-development.md"],
102
- "*.md": ["guides/documentation.md"],
103
- "package.json": ["guides/dependencies.md"]
84
+ "src/api/*": ["guides/api-development.md"]
104
85
  },
105
86
  "inference": {
106
87
  "keywords": {
107
88
  "testing": ["guides/testing.md"],
108
89
  "deployment": ["guides/deployment.md"],
109
- "api": ["guides/api-development.md"],
110
- "security": ["core/security.md"],
111
- "performance": ["guides/performance.md"]
90
+ "api": ["guides/api-development.md"]
112
91
  },
113
92
  "patterns": {
114
93
  "describe(": ["guides/testing.md"],
115
94
  "it(": ["guides/testing.md"],
116
- "fetch(": ["guides/api-development.md"],
117
- "console.error": ["reference/troubleshooting.md"],
118
- "try {": ["reference/error-handling.md"]
95
+ "fetch(": ["guides/api-development.md"]
119
96
  }
120
97
  }
121
98
  }
122
99
  ```
123
100
 
124
- ### Configuration Options
125
-
126
- - **`globalRules`**: Documentation that applies to all interactions
127
- - **`contextualRules`**: Documentation triggered by specific file patterns
128
- - **`inference.keywords`**: Documentation triggered by keywords in queries
129
- - **`inference.patterns`**: Documentation triggered by code patterns
130
-
131
- ## ๐Ÿ”ง CLI Options
132
-
133
- ```bash
134
- docbot [options]
135
-
136
- Options:
137
- -p, --port <port> Port to run server on (default: 3000)
138
- -d, --docs <path> Path to docs folder (default: ./docbot)
139
- -c, --config <path> Path to manifest file (default: ./docbot/manifest.json)
140
- -v, --verbose Enable verbose logging
141
- -w, --watch Watch for file changes
142
- -h, --help Show help
143
- ```
144
-
145
- ## ๐ŸŽฏ How It Works
146
-
147
- ### 1. Global Rules (Always Apply)
148
- Documents listed in `globalRules` are automatically included in every AI interaction:
149
-
150
- ```json
151
- {
152
- "globalRules": [
153
- "core/coding-standards.md",
154
- "core/security.md"
155
- ]
156
- }
157
- ```
158
-
159
- ### 2. Contextual Rules (File-Based)
160
- When you're working on specific files, relevant documentation is automatically suggested:
161
-
162
- ```json
163
- {
164
- "contextualRules": {
165
- "*.test.js": ["guides/testing.md"],
166
- "src/components/*": ["guides/react-components.md"]
167
- }
168
- }
169
- ```
170
-
171
- ### 3. Smart Inference
172
- The server analyzes your queries and code to suggest relevant documentation:
173
-
174
- - **Keywords**: "testing" โ†’ `guides/testing.md`
175
- - **Code Patterns**: `describe(` โ†’ `guides/testing.md`
176
- - **File Extensions**: `.py` โ†’ Python-related docs
177
-
178
- ## ๐Ÿ“– Documentation Format
179
-
180
- ### Frontmatter Support
181
- Add metadata to your documentation:
182
-
183
- ```markdown
184
- ---
185
- title: Testing Guide
186
- description: Comprehensive testing strategies
187
- category: guides
188
- tags: [testing, jest, react]
189
- alwaysApply: false
190
- ---
191
-
192
- # Testing Guide
193
-
194
- Your documentation content here...
195
- ```
196
-
197
- ### Supported Formats
198
- - **Markdown** (`.md`)
199
- - **MDX** (`.mdx`)
200
- - **Cursor Rules** (`.mdc`)
101
+ ### Configuration explained:
201
102
 
202
- ## ๐Ÿ› ๏ธ Available Tools
103
+ - **`globalRules`**: Documents that apply to every AI interaction
104
+ - **`contextualRules`**: Documents triggered by specific file patterns (e.g., test files โ†’ testing guide)
105
+ - **`inference.keywords`**: Documents suggested when certain words appear in queries
106
+ - **`inference.patterns`**: Documents suggested when certain code patterns are detected
203
107
 
204
- When using with Claude Code or other MCP clients:
108
+ ## Development setup
205
109
 
206
- ### `search_documentation`
207
- ```javascript
208
- // Search all documentation
209
- search_documentation({ query: "testing best practices" })
210
- ```
211
-
212
- ### `get_relevant_docs`
213
- ```javascript
214
- // Get context-aware suggestions
215
- get_relevant_docs({
216
- context: {
217
- query: "How to test React components",
218
- filePath: "src/components/UserProfile.test.tsx",
219
- codeSnippet: "describe('UserProfile', () => {"
220
- }
221
- })
222
- ```
110
+ ### Running locally
223
111
 
224
- ### `get_global_rules`
225
- ```javascript
226
- // Get always-apply documentation
227
- get_global_rules()
228
- ```
229
-
230
- ### `get_file_docs`
231
- ```javascript
232
- // Get file-specific documentation
233
- get_file_docs({ filePath: "src/api/users.js" })
234
- ```
235
-
236
- ## ๐ŸŒŸ Examples
237
-
238
- ### React Project
239
- ```json
240
- {
241
- "globalRules": ["core/react-standards.md"],
242
- "contextualRules": {
243
- "src/components/*": ["guides/components.md"],
244
- "*.test.tsx": ["guides/testing.md"]
245
- },
246
- "inference": {
247
- "keywords": {
248
- "hook": ["guides/hooks.md"],
249
- "state": ["guides/state-management.md"]
250
- },
251
- "patterns": {
252
- "useState": ["guides/hooks.md"],
253
- "useEffect": ["guides/hooks.md"]
254
- }
255
- }
256
- }
257
- ```
258
-
259
- ### Node.js API Project
260
- ```json
261
- {
262
- "globalRules": ["core/api-standards.md", "core/security.md"],
263
- "contextualRules": {
264
- "routes/*": ["guides/routing.md"],
265
- "middleware/*": ["guides/middleware.md"],
266
- "*.test.js": ["guides/testing.md"]
267
- },
268
- "inference": {
269
- "keywords": {
270
- "authentication": ["guides/auth.md"],
271
- "database": ["guides/database.md"]
272
- },
273
- "patterns": {
274
- "app.get": ["guides/routing.md"],
275
- "app.post": ["guides/routing.md"]
276
- }
277
- }
278
- }
279
- ```
280
-
281
- ## ๐Ÿ”„ Integration with IDEs
282
-
283
- ### Claude Code
284
- 1. Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
285
- ```json
286
- {
287
- "mcpServers": {
288
- "docs": {
289
- "command": "npx",
290
- "args": ["docbot"]
291
- }
292
- }
293
- }
112
+ 1. **Clone the repository:**
113
+ ```bash
114
+ git clone https://github.com/afterxleep/doc-bot.git
115
+ cd doc-bot
294
116
  ```
295
117
 
296
- ### Cursor
297
- Configure MCP server integration (coming soon)
298
-
299
- ### VS Code
300
- Use with Claude Code extension or MCP-compatible extensions
118
+ 2. **Install dependencies:**
119
+ ```bash
120
+ npm install
121
+ ```
301
122
 
302
- ## ๐Ÿงช Testing Your Setup
123
+ 3. **Run the server:**
124
+ ```bash
125
+ npm start
126
+ ```
303
127
 
304
- 1. **Create test documentation:**
128
+ 4. **Run tests:**
305
129
  ```bash
306
- mkdir docbot
307
- echo '{"name": "Test Docs", "globalRules": ["test.md"]}' > docbot/manifest.json
308
- echo "# Test Document\nThis is a test." > docbot/test.md
130
+ npm test
309
131
  ```
310
132
 
311
- 2. **Run the server:**
133
+ 5. **Run with file watching:**
312
134
  ```bash
313
- npx docbot --verbose
135
+ npm start -- --watch
314
136
  ```
315
137
 
316
- 3. **Test with Claude Code:**
317
- - Ask: "What documentation is available?"
318
- - Try: "Show me the global rules"
138
+ ### Testing your setup
319
139
 
320
- ## ๐Ÿค Contributing
140
+ Ask Claude something like "What documentation is available?" to test that doc-bot is working.
321
141
 
322
- We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
142
+ ### CLI Options
323
143
 
324
- ### Development Setup
325
144
  ```bash
326
- # Clone the repository
327
- git clone https://github.com/yourusername/docbot.git
328
- cd docbot
329
-
330
- # Install dependencies
331
- npm install
145
+ doc-bot [options]
332
146
 
333
- # Run tests
334
- npm test
335
-
336
- # Run in development mode
337
- npm run dev
147
+ Options:
148
+ -p, --port <port> Port to run server on (default: 3000)
149
+ -d, --docs <path> Path to docs folder (default: ./doc-bot)
150
+ -c, --config <path> Path to manifest file (default: ./doc-bot/manifest.json)
151
+ -v, --verbose Enable verbose logging
152
+ -w, --watch Watch for file changes
153
+ -h, --help Show help
338
154
  ```
339
155
 
340
- ## ๐Ÿ“„ License
156
+ ## License
341
157
 
342
158
  MIT License - see the [LICENSE](LICENSE) file for details.
343
159
 
344
- ## ๐Ÿ™ Acknowledgments
345
-
346
- - Built on the [Model Context Protocol](https://github.com/modelcontextprotocol/specification)
347
- - Inspired by the need for intelligent, context-aware documentation
348
- - Thanks to the Claude Code and Cursor teams for MCP support
349
-
350
- ## ๐Ÿ”— Links
351
-
352
- - [npm package](https://www.npmjs.com/package/docbot)
353
- - [GitHub repository](https://github.com/yourusername/docbot)
354
- - [Model Context Protocol](https://github.com/modelcontextprotocol/specification)
355
- - [Claude Code documentation](https://docs.anthropic.com/claude/docs/claude-code)
356
-
357
- ---
160
+ ## Links
358
161
 
359
- **Made with โค๏ธ for developers who want intelligent documentation at their fingertips.**
162
+ - [npm package](https://www.npmjs.com/package/@afterxleep/doc-bot)
163
+ - [GitHub repository](https://github.com/afterxleep/doc-bot)
164
+ - [Model Context Protocol](https://github.com/modelcontextprotocol/specification)
package/bin/doc-bot.js CHANGED
@@ -8,10 +8,10 @@ const { DocsServer } = require('../src/index.js');
8
8
  program
9
9
  .name('doc-bot')
10
10
  .description('Generic MCP server for intelligent documentation access')
11
- .version('1.0.0')
11
+ .version('1.0.1')
12
12
  .option('-p, --port <port>', 'Port to run server on', '3000')
13
- .option('-d, --docs <path>', 'Path to docs folder', './docs.ai')
14
- .option('-c, --config <path>', 'Path to manifest file', './docs.ai/manifest.json')
13
+ .option('-d, --docs <path>', 'Path to docs folder', './doc-bot')
14
+ .option('-c, --config <path>', 'Path to manifest file', './doc-bot/manifest.json')
15
15
  .option('-v, --verbose', 'Enable verbose logging')
16
16
  .option('-w, --watch', 'Watch for file changes')
17
17
  .parse();
@@ -22,17 +22,17 @@ async function main() {
22
22
  const docsPath = path.resolve(options.docs);
23
23
  const configPath = path.resolve(options.config);
24
24
 
25
- // Check if docs.ai folder exists
25
+ // Check if doc-bot folder exists
26
26
  if (!await fs.pathExists(docsPath)) {
27
27
  console.error(`โŒ Documentation folder not found: ${docsPath}`);
28
28
  console.log('');
29
- console.log('๐Ÿ“– To get started, create a docs.ai folder in your project:');
29
+ console.log('๐Ÿ“– To get started, create a doc-bot folder in your project:');
30
30
  console.log('');
31
- console.log(' mkdir docs.ai');
32
- console.log(' echo \'{"name": "My Project Documentation", "globalRules": []}\' > docs.ai/manifest.json');
33
- console.log(' echo "# Getting Started" > docs.ai/README.md');
31
+ console.log(' mkdir doc-bot');
32
+ console.log(' echo \'{"name": "My Project Documentation", "globalRules": []}\' > doc-bot/manifest.json');
33
+ console.log(' echo "# Getting Started" > doc-bot/README.md');
34
34
  console.log('');
35
- console.log('Then run: npx doc-bot');
35
+ console.log('Then run: npx @afterxleep/doc-bot');
36
36
  process.exit(1);
37
37
  }
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterxleep/doc-bot",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Generic MCP server for intelligent documentation access in any project",
5
5
  "main": "src/index.js",
6
6
  "bin": {