bluera-knowledge 0.31.0 → 0.33.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/.claude-plugin/plugin.json +23 -0
- package/.mcp.json +13 -0
- package/CHANGELOG.md +42 -0
- package/NOTICE +47 -0
- package/README.md +2 -2
- package/bun.lock +1978 -0
- package/dist/{chunk-B335UOU7.js → chunk-3TB7TDVF.js} +24 -3
- package/dist/chunk-3TB7TDVF.js.map +1 -0
- package/dist/{chunk-KCI4U6FH.js → chunk-KDZDLJUY.js} +2 -2
- package/dist/{chunk-AEXFPA57.js → chunk-YDTTD53Y.js} +158 -26
- package/dist/chunk-YDTTD53Y.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/mcp/bootstrap.js +10 -0
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/server.d.ts +5 -3
- package/dist/mcp/server.js +2 -2
- package/dist/workers/background-worker-cli.js +2 -2
- package/hooks/check-ready.sh +109 -0
- package/hooks/hooks.json +97 -0
- package/hooks/job-status-hook.sh +51 -0
- package/hooks/posttooluse-bk-reminder.py +126 -0
- package/hooks/posttooluse-web-research.py +209 -0
- package/hooks/posttooluse-websearch-bk.py +158 -0
- package/hooks/pretooluse-bk-suggest.py +296 -0
- package/hooks/skill-activation.py +221 -0
- package/hooks/skill-rules.json +131 -0
- package/package.json +9 -2
- package/scripts/CLAUDE.md +65 -0
- package/scripts/auto-setup.sh +65 -0
- package/scripts/bench-regression.sh +345 -0
- package/scripts/dev.sh +16 -0
- package/scripts/doctor.sh +103 -0
- package/scripts/download-models.ts +188 -0
- package/scripts/export-web-store.ts +142 -0
- package/scripts/lib/mock-server.sh +70 -0
- package/scripts/mcp-wrapper.sh +91 -0
- package/scripts/setup.sh +224 -0
- package/scripts/statusline-module.sh +29 -0
- package/scripts/test-mcp-dev.js +260 -0
- package/scripts/validate-local.sh +412 -0
- package/scripts/validate-npm-release.sh +406 -0
- package/skills/add-folder/SKILL.md +48 -0
- package/skills/add-repo/SKILL.md +50 -0
- package/skills/advanced-workflows/SKILL.md +273 -0
- package/skills/cancel/SKILL.md +63 -0
- package/skills/check-status/SKILL.md +130 -0
- package/skills/crawl/SKILL.md +61 -0
- package/skills/doctor/SKILL.md +27 -0
- package/skills/eval/SKILL.md +222 -0
- package/skills/health/SKILL.md +72 -0
- package/skills/index/SKILL.md +48 -0
- package/skills/knowledge-search/SKILL.md +110 -0
- package/skills/remove-store/SKILL.md +52 -0
- package/skills/search/SKILL.md +80 -0
- package/skills/search/search.sh +63 -0
- package/skills/search-optimization/SKILL.md +199 -0
- package/skills/search-optimization/references/mistakes.md +21 -0
- package/skills/search-optimization/references/strategies.md +80 -0
- package/skills/skill-activation/SKILL.md +131 -0
- package/skills/statusline/SKILL.md +19 -0
- package/skills/store-lifecycle/SKILL.md +470 -0
- package/skills/stores/SKILL.md +54 -0
- package/skills/suggest/SKILL.md +118 -0
- package/skills/sync/SKILL.md +96 -0
- package/skills/test-plugin/SKILL.md +547 -0
- package/skills/uninstall/SKILL.md +65 -0
- package/skills/when-to-query/SKILL.md +160 -0
- package/dist/chunk-AEXFPA57.js.map +0 -1
- package/dist/chunk-B335UOU7.js.map +0 -1
- /package/dist/{chunk-KCI4U6FH.js.map → chunk-KDZDLJUY.js.map} +0 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: store-lifecycle
|
|
3
|
+
description: Create, index, and manage BK stores
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bluera Knowledge Store Lifecycle Management
|
|
7
|
+
|
|
8
|
+
Master the lifecycle of knowledge stores from creation to deletion, including best practices for naming, indexing, and maintenance.
|
|
9
|
+
|
|
10
|
+
## Choosing the Right Source Type
|
|
11
|
+
|
|
12
|
+
Bluera Knowledge supports three source types. Choose based on your content:
|
|
13
|
+
|
|
14
|
+
### Git Repositories (`add-repo` / `create_store` with git URL)
|
|
15
|
+
|
|
16
|
+
**✅ Use for:**
|
|
17
|
+
- Public library source code (React, Vue, Pydantic, etc.)
|
|
18
|
+
- Private repositories with auth
|
|
19
|
+
- Code you want to track and update
|
|
20
|
+
- Multi-file projects with git history
|
|
21
|
+
|
|
22
|
+
**Advantages:**
|
|
23
|
+
- Preserves git history
|
|
24
|
+
- Can pull updates (`git pull` in repo directory)
|
|
25
|
+
- Standard structure recognized by analyzers
|
|
26
|
+
- Automatic language detection
|
|
27
|
+
|
|
28
|
+
**Example:**
|
|
29
|
+
```
|
|
30
|
+
/bluera-knowledge:add-repo https://github.com/vuejs/core --name=vue
|
|
31
|
+
|
|
32
|
+
# Or via MCP:
|
|
33
|
+
create_store(
|
|
34
|
+
source='https://github.com/vuejs/core',
|
|
35
|
+
name='vue',
|
|
36
|
+
type='repo'
|
|
37
|
+
)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Best practices:**
|
|
41
|
+
- Use package/library name for consistency: `vue`, `fastapi`, `pydantic`
|
|
42
|
+
- For monorepos: `org-project` format: `microsoft-typescript`, `vercel-next`
|
|
43
|
+
- Include version if tracking specific release: `vue-3.4`, `python-3.11`
|
|
44
|
+
|
|
45
|
+
### Local Folders (`add-folder`)
|
|
46
|
+
|
|
47
|
+
**✅ Use for:**
|
|
48
|
+
- Private codebases not in git
|
|
49
|
+
- Work-in-progress code
|
|
50
|
+
- Local documentation
|
|
51
|
+
- Specific subdirectories of larger projects
|
|
52
|
+
|
|
53
|
+
**Advantages:**
|
|
54
|
+
- No git required
|
|
55
|
+
- Fast indexing (no clone step)
|
|
56
|
+
- Perfect for proprietary code
|
|
57
|
+
- Can index subset of larger repo
|
|
58
|
+
|
|
59
|
+
**Example:**
|
|
60
|
+
```
|
|
61
|
+
/bluera-knowledge:add-folder /path/to/my-project/api --name=my-api
|
|
62
|
+
|
|
63
|
+
# Or via MCP:
|
|
64
|
+
create_store(
|
|
65
|
+
source='/Users/me/projects/my-app/backend',
|
|
66
|
+
name='my-backend',
|
|
67
|
+
type='folder'
|
|
68
|
+
)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Best practices:**
|
|
72
|
+
- Use descriptive names: `my-api`, `auth-service`, `shared-utils`
|
|
73
|
+
- Index focused directories (not entire ~/ )
|
|
74
|
+
- Update by re-indexing: `/bluera-knowledge:index my-api`
|
|
75
|
+
|
|
76
|
+
### Web Documentation (`crawl`)
|
|
77
|
+
|
|
78
|
+
**✅ Use for:**
|
|
79
|
+
- Official documentation sites
|
|
80
|
+
- API references hosted online
|
|
81
|
+
- Tutorials and guides
|
|
82
|
+
- Content only available via web
|
|
83
|
+
|
|
84
|
+
**Advantages:**
|
|
85
|
+
- Access web-only content
|
|
86
|
+
- Handles JavaScript-rendered sites (headless mode)
|
|
87
|
+
- Follows links automatically
|
|
88
|
+
- Converts HTML to searchable text
|
|
89
|
+
|
|
90
|
+
**Example:**
|
|
91
|
+
```
|
|
92
|
+
/bluera-knowledge:crawl https://fastapi.tiangolo.com --name=fastapi-docs --max-pages=100
|
|
93
|
+
|
|
94
|
+
# Or via MCP:
|
|
95
|
+
create_store(
|
|
96
|
+
source='https://fastapi.tiangolo.com',
|
|
97
|
+
name='fastapi-docs',
|
|
98
|
+
type='web',
|
|
99
|
+
max_pages=100
|
|
100
|
+
)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Best practices:**
|
|
104
|
+
- Append `-docs` to library name: `fastapi-docs`, `vue-docs`
|
|
105
|
+
- Set `max-pages` to avoid crawling entire internet
|
|
106
|
+
- Use `--headless` for JavaScript-heavy sites
|
|
107
|
+
- Crawl specific documentation paths, not marketing pages
|
|
108
|
+
|
|
109
|
+
## Naming Conventions
|
|
110
|
+
|
|
111
|
+
Good names make stores easy to find and filter.
|
|
112
|
+
|
|
113
|
+
### Recommended Patterns
|
|
114
|
+
|
|
115
|
+
**Library source code:**
|
|
116
|
+
```
|
|
117
|
+
vue # Official package name
|
|
118
|
+
react
|
|
119
|
+
fastapi
|
|
120
|
+
pydantic
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Documentation sites:**
|
|
124
|
+
```
|
|
125
|
+
vue-docs
|
|
126
|
+
fastapi-docs
|
|
127
|
+
python-3.11-docs
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Organization/project format:**
|
|
131
|
+
```
|
|
132
|
+
microsoft-typescript
|
|
133
|
+
vercel-next
|
|
134
|
+
acme-payment-api # Your company's code
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Versioned stores:**
|
|
138
|
+
```
|
|
139
|
+
vue-3.4
|
|
140
|
+
python-3.11
|
|
141
|
+
react-18
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Specialized content:**
|
|
145
|
+
```
|
|
146
|
+
coding-standards # Company standards
|
|
147
|
+
api-spec-v2 # API specification
|
|
148
|
+
architecture-docs # Design docs
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Naming Anti-Patterns
|
|
152
|
+
|
|
153
|
+
❌ Avoid:
|
|
154
|
+
- Generic names: `docs`, `code`, `library`
|
|
155
|
+
- Unclear abbreviations: `fp`, `lib1`, `proj`
|
|
156
|
+
- Dates without context: `2024-01-15`
|
|
157
|
+
- Redundant words: `my-project-library-code`
|
|
158
|
+
|
|
159
|
+
✅ Prefer:
|
|
160
|
+
- Specific, descriptive: `fastapi-docs`, `vue-source`
|
|
161
|
+
- Standard package names: `pydantic`, `lodash`
|
|
162
|
+
- Clear context: `api-spec-v2`, `coding-standards`
|
|
163
|
+
|
|
164
|
+
## Indexing Strategies
|
|
165
|
+
|
|
166
|
+
### Initial Indexing
|
|
167
|
+
|
|
168
|
+
When creating a store, indexing happens automatically in the background:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
create_store(url, name)
|
|
172
|
+
→ Returns: job_id
|
|
173
|
+
→ Background: clone/download → analyze → index
|
|
174
|
+
→ Status: pending → running → completed
|
|
175
|
+
|
|
176
|
+
# Monitor progress
|
|
177
|
+
check_job_status(job_id)
|
|
178
|
+
→ Progress: 45% (processing src/core.ts)
|
|
179
|
+
→ Estimated: ~2 minutes remaining
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Indexing time estimates:**
|
|
183
|
+
- Small library (<1k files): 30-60 seconds
|
|
184
|
+
- Medium library (1k-5k files): 1-3 minutes
|
|
185
|
+
- Large library (>5k files): 3-10 minutes
|
|
186
|
+
- Documentation crawl (100 pages): 1-2 minutes
|
|
187
|
+
|
|
188
|
+
### Re-indexing (Updates)
|
|
189
|
+
|
|
190
|
+
When library code changes or you modify indexed content:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
# For git repos: pull latest changes
|
|
194
|
+
cd .bluera/bluera-knowledge/repos/vue
|
|
195
|
+
git pull origin main
|
|
196
|
+
cd -
|
|
197
|
+
|
|
198
|
+
# Re-index
|
|
199
|
+
/bluera-knowledge:index vue
|
|
200
|
+
|
|
201
|
+
# Or via MCP:
|
|
202
|
+
index_store(store='vue')
|
|
203
|
+
→ Re-processes all files
|
|
204
|
+
→ Updates vector embeddings
|
|
205
|
+
→ Rebuilds search index
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**When to re-index:**
|
|
209
|
+
- Library released new version
|
|
210
|
+
- You modified local folder content
|
|
211
|
+
- Search results seem outdated
|
|
212
|
+
- After significant codebase changes
|
|
213
|
+
|
|
214
|
+
**Re-indexing is incremental** - only changed files are re-processed.
|
|
215
|
+
|
|
216
|
+
### Selective Indexing
|
|
217
|
+
|
|
218
|
+
For large repos, you might want to index specific directories:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
# Clone full repo manually
|
|
222
|
+
git clone https://github.com/microsoft/vscode
|
|
223
|
+
cd vscode
|
|
224
|
+
|
|
225
|
+
# Index only specific dirs
|
|
226
|
+
/bluera-knowledge:add-folder ./src/vs/editor --name=vscode-editor
|
|
227
|
+
/bluera-knowledge:add-folder ./src/vs/workbench --name=vscode-workbench
|
|
228
|
+
|
|
229
|
+
# Result: Multiple focused stores instead of one massive store
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Storage Management
|
|
233
|
+
|
|
234
|
+
### Monitoring Storage
|
|
235
|
+
|
|
236
|
+
Check what's using space:
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
list_stores()
|
|
240
|
+
→ vue: 487 files, 2.3 MB
|
|
241
|
+
→ react: 312 files, 1.8 MB
|
|
242
|
+
→ fastapi-docs: 156 pages, 0.9 MB
|
|
243
|
+
→ my-api: 89 files, 0.4 MB
|
|
244
|
+
|
|
245
|
+
Total storage: ~5.4 MB
|
|
246
|
+
|
|
247
|
+
# Detailed info
|
|
248
|
+
get_store_info('vue')
|
|
249
|
+
→ Location: .bluera/bluera-knowledge/repos/vue/
|
|
250
|
+
→ Indexed: 487 files
|
|
251
|
+
→ Size: 2.3 MB (source) + 4.1 MB (vectors)
|
|
252
|
+
→ Last indexed: 2 hours ago
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### When to Delete Stores
|
|
256
|
+
|
|
257
|
+
**✅ Delete when:**
|
|
258
|
+
- Library no longer relevant to your project
|
|
259
|
+
- Documentation outdated (re-crawl instead)
|
|
260
|
+
- Testing/experimental stores no longer needed
|
|
261
|
+
- Running low on disk space
|
|
262
|
+
- Duplicate stores exist
|
|
263
|
+
|
|
264
|
+
**How to delete:**
|
|
265
|
+
```
|
|
266
|
+
/bluera-knowledge:remove-store old-library
|
|
267
|
+
|
|
268
|
+
# Or via MCP:
|
|
269
|
+
delete_store(store='old-library')
|
|
270
|
+
→ Removes: source files, vector index, metadata
|
|
271
|
+
→ Frees: ~6-8 MB per store (varies by size)
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**⚠️ Cannot undo!** Make sure you don't need the store before deleting.
|
|
275
|
+
|
|
276
|
+
## Background Job Monitoring
|
|
277
|
+
|
|
278
|
+
All expensive operations run as background jobs: cloning, indexing, crawling.
|
|
279
|
+
|
|
280
|
+
### Job Lifecycle
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
1. create_store() or index_store() → Returns job_id
|
|
284
|
+
|
|
285
|
+
2. Job states:
|
|
286
|
+
- pending: In queue, not started
|
|
287
|
+
- running: Actively processing
|
|
288
|
+
- completed: Finished successfully
|
|
289
|
+
- failed: Error occurred
|
|
290
|
+
|
|
291
|
+
3. Monitor progress:
|
|
292
|
+
check_job_status(job_id)
|
|
293
|
+
→ Current state, percentage, current file
|
|
294
|
+
|
|
295
|
+
4. List all jobs:
|
|
296
|
+
list_jobs()
|
|
297
|
+
→ See pending, running, completed jobs
|
|
298
|
+
|
|
299
|
+
5. Cancel if needed:
|
|
300
|
+
cancel_job(job_id)
|
|
301
|
+
→ Stops running job, cleans up
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Best Practices for Job Monitoring
|
|
305
|
+
|
|
306
|
+
**Do poll, but not too frequently:**
|
|
307
|
+
```
|
|
308
|
+
# ❌ Too frequent - wastes resources
|
|
309
|
+
while status != 'completed':
|
|
310
|
+
check_job_status(job_id) # Every second!
|
|
311
|
+
sleep(1)
|
|
312
|
+
|
|
313
|
+
# ✅ Reasonable polling interval
|
|
314
|
+
while status != 'completed':
|
|
315
|
+
check_job_status(job_id)
|
|
316
|
+
sleep(15) # Every 15 seconds is fine
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Do handle failures gracefully:**
|
|
320
|
+
```
|
|
321
|
+
status = check_job_status(job_id)
|
|
322
|
+
|
|
323
|
+
if status['state'] == 'failed':
|
|
324
|
+
error = status['error']
|
|
325
|
+
|
|
326
|
+
if 'auth' in error.lower():
|
|
327
|
+
print("Authentication required - try SSH URL or provide credentials")
|
|
328
|
+
elif 'not found' in error.lower():
|
|
329
|
+
print("Repository/URL not found - check the source")
|
|
330
|
+
elif 'disk' in error.lower():
|
|
331
|
+
print("Disk space issue - delete unused stores")
|
|
332
|
+
else:
|
|
333
|
+
print(f"Unexpected error: {error}")
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Do list jobs to avoid duplicates:**
|
|
337
|
+
```
|
|
338
|
+
# Before creating new store
|
|
339
|
+
jobs = list_jobs()
|
|
340
|
+
existing = [j for j in jobs if j['store'] == 'vue' and j['state'] in ['pending', 'running']]
|
|
341
|
+
|
|
342
|
+
if existing:
|
|
343
|
+
print(f"Job already running for 'vue': {existing[0]['id']}")
|
|
344
|
+
# Wait for it instead of creating duplicate
|
|
345
|
+
else:
|
|
346
|
+
create_store(...)
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## Handling Indexing Failures
|
|
350
|
+
|
|
351
|
+
### Common Failure Scenarios
|
|
352
|
+
|
|
353
|
+
**1. Authentication Required (Private Repos)**
|
|
354
|
+
```
|
|
355
|
+
Error: "Authentication required"
|
|
356
|
+
|
|
357
|
+
Fix options:
|
|
358
|
+
- Use SSH URL: git@github.com:org/repo.git
|
|
359
|
+
- Use HTTPS with token: https://token@github.com/org/repo.git
|
|
360
|
+
- Make repo public (if appropriate)
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**2. Invalid URL/Path**
|
|
364
|
+
```
|
|
365
|
+
Error: "Repository not found" or "Path does not exist"
|
|
366
|
+
|
|
367
|
+
Fix:
|
|
368
|
+
- Verify URL is correct (typos common!)
|
|
369
|
+
- Check path exists and is accessible
|
|
370
|
+
- Ensure network connectivity
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**3. Disk Space**
|
|
374
|
+
```
|
|
375
|
+
Error: "No space left on device"
|
|
376
|
+
|
|
377
|
+
Fix:
|
|
378
|
+
- Check available space: df -h
|
|
379
|
+
- Delete unused stores: delete_store(old_store)
|
|
380
|
+
- Clear .bluera/bluera-knowledge/repos/ manually if needed
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**4. Network Timeout**
|
|
384
|
+
```
|
|
385
|
+
Error: "Connection timeout" or "Failed to fetch"
|
|
386
|
+
|
|
387
|
+
Fix:
|
|
388
|
+
- Retry after checking network
|
|
389
|
+
- Use --shallow for large repos
|
|
390
|
+
- Clone manually then add-folder
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**5. Unsupported File Types**
|
|
394
|
+
```
|
|
395
|
+
Warning: "Skipped 45 binary files"
|
|
396
|
+
|
|
397
|
+
This is normal!
|
|
398
|
+
- Binary files (images, compiled code) are skipped
|
|
399
|
+
- Only text files are indexed
|
|
400
|
+
- Check indexed count vs total to see ratio
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Recovery Workflow
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
1. Attempt fails:
|
|
407
|
+
create_store(url, name) → job fails
|
|
408
|
+
|
|
409
|
+
2. Check error:
|
|
410
|
+
job_status = check_job_status(job_id)
|
|
411
|
+
error_msg = job_status['error']
|
|
412
|
+
|
|
413
|
+
3. Determine fix based on error type (see above)
|
|
414
|
+
|
|
415
|
+
4. Retry with fix:
|
|
416
|
+
create_store(corrected_url, name)
|
|
417
|
+
|
|
418
|
+
5. Verify success:
|
|
419
|
+
check_job_status(new_job_id)
|
|
420
|
+
→ Status: completed
|
|
421
|
+
|
|
422
|
+
list_stores()
|
|
423
|
+
→ Store appears in list
|
|
424
|
+
|
|
425
|
+
6. Test search:
|
|
426
|
+
search(test_query, stores=[name], limit=3)
|
|
427
|
+
→ Returns results: ✅ Ready to use!
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
## Store Lifecycle Checklist
|
|
431
|
+
|
|
432
|
+
**Creating a Store:**
|
|
433
|
+
- [ ] Choose appropriate source type (repo/folder/crawl)
|
|
434
|
+
- [ ] Use descriptive, consistent naming
|
|
435
|
+
- [ ] Start indexing job
|
|
436
|
+
- [ ] Monitor job status until complete
|
|
437
|
+
- [ ] Verify with list_stores()
|
|
438
|
+
- [ ] Test with sample search
|
|
439
|
+
|
|
440
|
+
**Maintaining a Store:**
|
|
441
|
+
- [ ] Re-index after significant changes
|
|
442
|
+
- [ ] Pull git updates periodically for repo stores
|
|
443
|
+
- [ ] Monitor storage usage
|
|
444
|
+
- [ ] Check search relevance quality
|
|
445
|
+
|
|
446
|
+
**Deleting a Store:**
|
|
447
|
+
- [ ] Confirm no longer needed
|
|
448
|
+
- [ ] Note storage freed
|
|
449
|
+
- [ ] Remove from any documentation referencing it
|
|
450
|
+
|
|
451
|
+
## Quick Reference Commands
|
|
452
|
+
|
|
453
|
+
```
|
|
454
|
+
# Create
|
|
455
|
+
/bluera-knowledge:add-repo <url> --name=<name>
|
|
456
|
+
/bluera-knowledge:add-folder <path> --name=<name>
|
|
457
|
+
/bluera-knowledge:crawl <url> --name=<name>
|
|
458
|
+
|
|
459
|
+
# Monitor
|
|
460
|
+
/bluera-knowledge:check-status <job-id>
|
|
461
|
+
|
|
462
|
+
# Maintain
|
|
463
|
+
/bluera-knowledge:index <name>
|
|
464
|
+
/bluera-knowledge:stores
|
|
465
|
+
|
|
466
|
+
# Remove
|
|
467
|
+
/bluera-knowledge:remove-store <name>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Master these lifecycle management practices to maintain a clean, efficient, and useful knowledge base.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: List all indexed library stores
|
|
3
|
+
allowed-tools: ["mcp__bluera-knowledge__execute"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# List Knowledge Stores
|
|
7
|
+
|
|
8
|
+
Show all configured knowledge stores in the project.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. Use the mcp__bluera-knowledge__execute tool with command "stores" to retrieve all stores
|
|
13
|
+
|
|
14
|
+
2. Present results in a clean table format:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
| Name | Type | ID | Source |
|
|
18
|
+
|------|------|----|--------------------|
|
|
19
|
+
| react | repo | a1b2c3d4 | https://github.com/facebook/react |
|
|
20
|
+
| lodash | repo | e5f6g7h8 | https://github.com/lodash/lodash |
|
|
21
|
+
| my-docs | file | i9j0k1l2 | ~/docs |
|
|
22
|
+
|
|
23
|
+
**Total**: 3 stores
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. Format each row:
|
|
27
|
+
- **Name**: The store name
|
|
28
|
+
- **Type**: Store type (repo, file, or web)
|
|
29
|
+
- **ID**: First 8 characters of the store ID (no ellipsis)
|
|
30
|
+
- **Source**:
|
|
31
|
+
- For repo stores: The git URL
|
|
32
|
+
- For file stores: The local path (use ~ for home directory to keep it concise)
|
|
33
|
+
- For web stores: The base URL
|
|
34
|
+
|
|
35
|
+
## If No Stores Found
|
|
36
|
+
|
|
37
|
+
If no stores exist, show:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
## No Knowledge Stores Found
|
|
41
|
+
|
|
42
|
+
You haven't created any knowledge stores yet.
|
|
43
|
+
|
|
44
|
+
To get started:
|
|
45
|
+
- `/bluera-knowledge:add-repo <url> --name=<name>` - Clone and index a library repository
|
|
46
|
+
- `/bluera-knowledge:add-folder <path> --name=<name>` - Index a local folder of documentation
|
|
47
|
+
|
|
48
|
+
Example:
|
|
49
|
+
```
|
|
50
|
+
/bluera-knowledge:add-repo https://github.com/facebook/react --name=react
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
After creating stores, they will be searchable via the MCP search tool.
|
|
54
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Suggest important dependencies to add to knowledge stores
|
|
3
|
+
allowed-tools: ["Glob", "Read", "mcp__bluera-knowledge__execute", "WebSearch", "AskUserQuestion", "Skill"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Suggest Dependencies to Index
|
|
7
|
+
|
|
8
|
+
Analyze project dependencies and suggest important libraries to add to knowledge stores.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Find dependency files** using Glob tool:
|
|
13
|
+
- `**/package.json` (JavaScript/TypeScript projects)
|
|
14
|
+
- `**/requirements.txt` (Python projects)
|
|
15
|
+
- `**/go.mod` (Go projects)
|
|
16
|
+
- `**/Cargo.toml` (Rust projects)
|
|
17
|
+
|
|
18
|
+
2. **Read and parse dependencies**:
|
|
19
|
+
- Use Read tool to read each dependency file
|
|
20
|
+
- Extract package names and usage patterns
|
|
21
|
+
- For package.json: dependencies and devDependencies
|
|
22
|
+
- For requirements.txt: all packages
|
|
23
|
+
- For go.mod: require statements
|
|
24
|
+
- For Cargo.toml: dependencies section
|
|
25
|
+
|
|
26
|
+
3. **Scan for import statements** using Glob + Read:
|
|
27
|
+
- Find all source files (*.js, *.ts, *.py, *.go, *.rs)
|
|
28
|
+
- Count imports/requires for each dependency
|
|
29
|
+
- Rank dependencies by frequency of use
|
|
30
|
+
|
|
31
|
+
4. **Get existing stores** using mcp__bluera-knowledge__execute with command "stores":
|
|
32
|
+
- Filter out dependencies already in stores
|
|
33
|
+
- Focus on new suggestions
|
|
34
|
+
|
|
35
|
+
5. **Find repository URLs** using WebSearch:
|
|
36
|
+
- For top 5 most-used dependencies
|
|
37
|
+
- Search for official GitHub/GitLab repositories
|
|
38
|
+
- Prefer official repos over forks
|
|
39
|
+
|
|
40
|
+
6. **Present selectable list** using AskUserQuestion:
|
|
41
|
+
|
|
42
|
+
First, show a summary of what was found:
|
|
43
|
+
```
|
|
44
|
+
## Dependency Analysis
|
|
45
|
+
|
|
46
|
+
Scanned 342 source files and found 24 dependencies.
|
|
47
|
+
Already indexed: typescript, express, jest
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then use AskUserQuestion with multiSelect to let the user choose which to add:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"questions": [{
|
|
55
|
+
"question": "Which dependencies would you like to add to your knowledge stores?",
|
|
56
|
+
"header": "Add deps",
|
|
57
|
+
"multiSelect": true,
|
|
58
|
+
"options": [
|
|
59
|
+
{
|
|
60
|
+
"label": "react (Recommended)",
|
|
61
|
+
"description": "147 imports across 52 files - https://github.com/facebook/react"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"label": "lodash",
|
|
65
|
+
"description": "89 imports across 31 files - https://github.com/lodash/lodash"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"label": "axios",
|
|
69
|
+
"description": "45 imports across 18 files - https://github.com/axios/axios"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"label": "zod",
|
|
73
|
+
"description": "32 imports across 12 files - https://github.com/colinhacks/zod"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}]
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Note:** Maximum 4 options per question (AskUserQuestion limit). If more than 4 dependencies, show top 4 and mention others in summary.
|
|
81
|
+
|
|
82
|
+
7. **Execute selected add-repo commands**:
|
|
83
|
+
|
|
84
|
+
For each selected dependency, invoke the Skill tool:
|
|
85
|
+
```
|
|
86
|
+
Skill(skill="bluera-knowledge:add-repo", args="<repo-url> --name=<package-name>")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Example for react selection:
|
|
90
|
+
```
|
|
91
|
+
Skill(skill="bluera-knowledge:add-repo", args="https://github.com/facebook/react --name=react")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
8. **Show completion summary**:
|
|
95
|
+
```
|
|
96
|
+
## Added to Knowledge Stores
|
|
97
|
+
|
|
98
|
+
✓ react - https://github.com/facebook/react
|
|
99
|
+
✓ lodash - https://github.com/lodash/lodash
|
|
100
|
+
|
|
101
|
+
Indexing started. Check progress with /bluera-knowledge:check-status
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## If No Dependencies Found
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
No external dependencies found in this project.
|
|
108
|
+
|
|
109
|
+
Make sure you have a dependency manifest file:
|
|
110
|
+
- package.json (JavaScript/TypeScript)
|
|
111
|
+
- requirements.txt or pyproject.toml (Python)
|
|
112
|
+
- go.mod (Go)
|
|
113
|
+
- Cargo.toml (Rust)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## If User Selects "Other"
|
|
117
|
+
|
|
118
|
+
If the user types a custom response instead of selecting options, try to parse package names from their input and search for the corresponding repositories.
|