@afterxleep/doc-bot 1.15.0 → 1.16.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.
@@ -67,8 +67,9 @@ Are you about to:
67
67
 
68
68
  If doc_bot is unavailable:
69
69
  1. STOP
70
- 2. Tell user: "doc_bot MCP server is required but not available"
71
- 3. DO NOT attempt to help without it
70
+ 2. Tell user: "The doc_bot Rules and Documentation server is not available"
71
+ 3. Ask the user if they want to continue without any rulesets applied.
72
+ 4. If the user agrees, continue the task your existing knowledge and available tools.
72
73
 
73
74
  ---
74
75
  Remember: You're not here to be creative. You're here to be CORRECT.
package/README.md CHANGED
@@ -60,6 +60,9 @@ Add doc-bot to your AI assistant's configuration:
60
60
  - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
61
61
  - Linux: `~/.config/Claude/claude_desktop_config.json`
62
62
 
63
+ **For Cursor:**
64
+ - Add an `mcp.json` file with the contents above to your `.cursor` folder
65
+
63
66
  ### 2. Create Your Documentation
64
67
 
65
68
  Create a `doc-bot` folder in your project root and add markdown files:
@@ -75,7 +78,11 @@ your-project/
75
78
  └── package.json
76
79
  ```
77
80
 
78
- ### 3. Test It
81
+ ### 3. Add the custom Agent Rule
82
+
83
+ Replace all rules and instructions for your Agent (cursor.mdc, CLAUDE.md, etc) with Doc Bot Core Rule [AGENT INTEGRATION RULE](https://github.com/afterxleep/doc-bot/blob/main/AGENT_INTEGRATION_RULE.txt).
84
+
85
+ ### 4. Test it!
79
86
 
80
87
  Ask your AI assistant: "What are the coding standards for this project?"
81
88
 
@@ -326,4 +333,4 @@ MIT - See [LICENSE](LICENSE) for details.
326
333
 
327
334
  ---
328
335
 
329
- Built with ❤️ in Spain
336
+ Built with ❤️ in Spain
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterxleep/doc-bot",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Generic MCP server for intelligent documentation access in any project",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -1062,7 +1062,65 @@ Try:
1062
1062
  let guidance = `# 🤖 DOC-BOT INTELLIGENT ASSISTANT\n\n`;
1063
1063
  guidance += `**Your Request**: ${task}\n\n`;
1064
1064
 
1065
- // Analyze the task and provide intelligent routing
1065
+ // Check for administrative/management tasks first
1066
+ const isDocsetManagement = /add.*docset|remove.*docset|list.*docset|install.*docset/i.test(task);
1067
+ const isRuleManagement = /add.*rule|create.*rule|update.*rule|document.*pattern|capture.*pattern/i.test(task);
1068
+ const isDocumentManagement = /refresh.*doc|reload.*doc|index.*doc|get.*index/i.test(task);
1069
+
1070
+ // Handle administrative tasks directly
1071
+ if (isDocsetManagement) {
1072
+ guidance += `## 📦 DOCSET MANAGEMENT TASK DETECTED\n\n`;
1073
+ guidance += `**Direct Actions Required**:\n`;
1074
+
1075
+ if (/list/i.test(task)) {
1076
+ guidance += `1. \`list_docsets()\` - Show all installed documentation sets\n\n`;
1077
+ } else if (/add|install/i.test(task)) {
1078
+ guidance += `1. \`add_docset(source: "path/to/docset or URL")\` - Install new docset\n\n`;
1079
+ guidance += `📝 **Examples**:\n`;
1080
+ guidance += `- Local: \`add_docset(source: "/Downloads/Swift.docset")\`\n`;
1081
+ guidance += `- URL: \`add_docset(source: "https://example.com/React.docset.tgz")\`\n\n`;
1082
+ } else if (/remove/i.test(task)) {
1083
+ guidance += `1. \`list_docsets()\` - First, get the docset ID\n`;
1084
+ guidance += `2. \`remove_docset(docsetId: "the-id-from-step-1")\` - Remove the docset\n\n`;
1085
+ }
1086
+
1087
+ guidance += `💡 **Note**: This is an administrative task - no documentation search needed.\n`;
1088
+ return guidance;
1089
+ }
1090
+
1091
+ if (isRuleManagement) {
1092
+ guidance += `## 📝 RULE/PATTERN MANAGEMENT TASK DETECTED\n\n`;
1093
+ guidance += `**Direct Action Required**:\n`;
1094
+ guidance += `1. \`create_or_update_rule(...)\` with these parameters:\n\n`;
1095
+ guidance += `\`\`\`javascript\n`;
1096
+ guidance += `{\n`;
1097
+ guidance += ` fileName: "descriptive-name.md",\n`;
1098
+ guidance += ` title: "Clear title for the rule/pattern",\n`;
1099
+ guidance += ` content: "Full markdown documentation",\n`;
1100
+ guidance += ` alwaysApply: true/false, // true = global, false = contextual\n`;
1101
+ guidance += ` keywords: ["relevant", "search", "terms"],\n`;
1102
+ guidance += ` description: "Brief summary" // optional\n`;
1103
+ guidance += `}\n`;
1104
+ guidance += `\`\`\`\n\n`;
1105
+ guidance += `💡 **Note**: This captures project knowledge permanently - no search needed.\n`;
1106
+ return guidance;
1107
+ }
1108
+
1109
+ if (isDocumentManagement) {
1110
+ guidance += `## 🔄 DOCUMENTATION MANAGEMENT TASK DETECTED\n\n`;
1111
+ guidance += `**Direct Action Required**:\n`;
1112
+
1113
+ if (/refresh|reload/i.test(task)) {
1114
+ guidance += `1. \`refresh_documentation()\` - Reload all docs from disk\n\n`;
1115
+ } else {
1116
+ guidance += `1. \`get_document_index()\` - List all available documentation\n\n`;
1117
+ }
1118
+
1119
+ guidance += `💡 **Note**: This is an administrative task - direct execution only.\n`;
1120
+ return guidance;
1121
+ }
1122
+
1123
+ // Analyze the task and provide intelligent routing for non-administrative tasks
1066
1124
  if (taskLower.includes('create') || taskLower.includes('implement') || taskLower.includes('build') ||
1067
1125
  taskLower.includes('write') || taskLower.includes('add') || taskLower.includes('code') ||
1068
1126
  taskLower.includes('function') || taskLower.includes('class') || taskLower.includes('component')) {