bluera-knowledge 0.16.5 → 0.17.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/CHANGELOG.md +12 -0
- package/dist/mcp/bootstrap.js +19 -2
- package/dist/mcp/bootstrap.js.map +1 -1
- package/package.json +1 -5
- package/.claude-plugin/plugin.json +0 -9
- package/commands/add-folder.md +0 -48
- package/commands/add-repo.md +0 -50
- package/commands/cancel.md +0 -63
- package/commands/check-status.md +0 -78
- package/commands/crawl.md +0 -54
- package/commands/index.md +0 -48
- package/commands/remove-store.md +0 -52
- package/commands/search.md +0 -86
- package/commands/search.sh +0 -63
- package/commands/skill-activation.md +0 -130
- package/commands/stores.md +0 -54
- package/commands/suggest.md +0 -82
- package/commands/sync.md +0 -96
- package/commands/test-plugin.md +0 -408
- package/commands/uninstall.md +0 -65
- package/hooks/check-dependencies.sh +0 -145
- package/hooks/format-search-results.py +0 -132
- package/hooks/hooks.json +0 -54
- package/hooks/job-status-hook.sh +0 -51
- package/hooks/posttooluse-bk-reminder.py +0 -166
- package/hooks/skill-activation.py +0 -194
- package/hooks/skill-rules.json +0 -122
- package/skills/advanced-workflows/SKILL.md +0 -273
- package/skills/knowledge-search/SKILL.md +0 -110
- package/skills/search-optimization/SKILL.md +0 -396
- package/skills/store-lifecycle/SKILL.md +0 -470
- package/skills/when-to-query/SKILL.md +0 -160
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: store-lifecycle
|
|
3
|
-
description: Best practices for creating, indexing, and managing Bluera Knowledge stores. Covers when to use clone vs crawl vs folder, naming conventions, indexing strategies, storage management, background job monitoring, and handling indexing failures.
|
|
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.
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: when-to-query
|
|
3
|
-
description: Decision guide for when to query Bluera Knowledge stores vs using Grep/Read on current project. Query BK for library/dependency questions and reference material. Use Grep/Read for current project code, debugging, and implementation details. Includes setup instructions and mental model.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# When to Query Bluera Knowledge
|
|
7
|
-
|
|
8
|
-
## The Rule: BK First for External Code
|
|
9
|
-
|
|
10
|
-
**When the question involves libraries, dependencies, or reference material, query BK first.**
|
|
11
|
-
|
|
12
|
-
BK provides authoritative source code from the actual libraries. This is:
|
|
13
|
-
- **More accurate** than training data (which may be outdated)
|
|
14
|
-
- **Faster** than web search (~100ms vs 2-5 seconds)
|
|
15
|
-
- **More complete** than documentation sites (includes tests, examples, internal APIs)
|
|
16
|
-
- **Zero rate limits** (local, unlimited queries)
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## ALWAYS Query BK For:
|
|
21
|
-
|
|
22
|
-
### Library Implementation Questions
|
|
23
|
-
- "How does Express handle middleware errors?"
|
|
24
|
-
- "What does `useEffect` cleanup actually do internally?"
|
|
25
|
-
- "How is Pydantic validation implemented?"
|
|
26
|
-
- "What happens when lodash `debounce` is called?"
|
|
27
|
-
- "How does React's reconciliation work?"
|
|
28
|
-
|
|
29
|
-
### API and Method Questions
|
|
30
|
-
- "What parameters does `axios.create()` accept?"
|
|
31
|
-
- "What's the signature of `zod.object()`?"
|
|
32
|
-
- "What options can I pass to `hono.use()`?"
|
|
33
|
-
- "What events does EventEmitter emit?"
|
|
34
|
-
- "What methods are available on `prisma.client`?"
|
|
35
|
-
|
|
36
|
-
### Error and Exception Handling
|
|
37
|
-
- "What errors can this library throw?"
|
|
38
|
-
- "How do I catch validation errors in Zod?"
|
|
39
|
-
- "What does this error code mean in library X?"
|
|
40
|
-
- "Why might this function return undefined?"
|
|
41
|
-
- "What validation does this library perform?"
|
|
42
|
-
|
|
43
|
-
### Version-Specific Behavior
|
|
44
|
-
- "What changed in React 18's concurrent mode?"
|
|
45
|
-
- "How does this work in Express 4 vs 5?"
|
|
46
|
-
- "Is this method deprecated in the latest version?"
|
|
47
|
-
- "What's the migration path from v2 to v3?"
|
|
48
|
-
- "Does my version support this feature?"
|
|
49
|
-
|
|
50
|
-
### Configuration and Options
|
|
51
|
-
- "What configuration options exist for Vite?"
|
|
52
|
-
- "What are the default values for these options?"
|
|
53
|
-
- "How do I customize the behavior of X?"
|
|
54
|
-
- "What environment variables does this library use?"
|
|
55
|
-
- "What's the full schema for this config?"
|
|
56
|
-
|
|
57
|
-
### Testing Patterns
|
|
58
|
-
- "How do the library authors test this feature?"
|
|
59
|
-
- "How should I mock this library in tests?"
|
|
60
|
-
- "What fixtures do I need for testing this integration?"
|
|
61
|
-
- "What edge cases does the library's test suite cover?"
|
|
62
|
-
|
|
63
|
-
### Performance and Internals
|
|
64
|
-
- "Is this operation cached internally?"
|
|
65
|
-
- "What's the time complexity of this method?"
|
|
66
|
-
- "How is this optimized in the library?"
|
|
67
|
-
- "Does this run synchronously or asynchronously?"
|
|
68
|
-
- "What's the memory footprint of this?"
|
|
69
|
-
|
|
70
|
-
### Security and Validation
|
|
71
|
-
- "How does this library validate input?"
|
|
72
|
-
- "What sanitization is applied?"
|
|
73
|
-
- "How are credentials handled internally?"
|
|
74
|
-
- "Is this safe against injection attacks?"
|
|
75
|
-
|
|
76
|
-
### Integration and Patterns
|
|
77
|
-
- "How do I integrate library X with library Y?"
|
|
78
|
-
- "What's the idiomatic way to use this API?"
|
|
79
|
-
- "How do examples in the library do this?"
|
|
80
|
-
- "What patterns does this library use?"
|
|
81
|
-
- "What's the recommended project structure?"
|
|
82
|
-
|
|
83
|
-
### Reference Material
|
|
84
|
-
- "What does the API spec say about X?"
|
|
85
|
-
- "What are the project requirements for Y?"
|
|
86
|
-
- "How does the architecture doc describe Z?"
|
|
87
|
-
- "What coding standards apply here?"
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## DO NOT Query BK For:
|
|
92
|
-
|
|
93
|
-
### Current Project Code
|
|
94
|
-
Use Grep/Read directly:
|
|
95
|
-
- "Where is the authentication middleware in THIS project?"
|
|
96
|
-
- "Show me OUR database models"
|
|
97
|
-
- "Find all API endpoints WE defined"
|
|
98
|
-
|
|
99
|
-
### General Concepts
|
|
100
|
-
Use training data (no tool needed):
|
|
101
|
-
- "What is a closure in JavaScript?"
|
|
102
|
-
- "Explain dependency injection"
|
|
103
|
-
- "What is REST?"
|
|
104
|
-
|
|
105
|
-
### Current Events
|
|
106
|
-
Use web search:
|
|
107
|
-
- "What's new in Next.js 15?"
|
|
108
|
-
- "Latest release notes for TypeScript"
|
|
109
|
-
- "Security advisory for npm packages"
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## Setup: Index Your Dependencies
|
|
114
|
-
|
|
115
|
-
BK only knows what you've indexed. Add your key dependencies:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
# Get suggestions based on package.json
|
|
119
|
-
/bluera-knowledge:suggest
|
|
120
|
-
|
|
121
|
-
# Add important libraries
|
|
122
|
-
/bluera-knowledge:add-repo https://github.com/expressjs/express
|
|
123
|
-
/bluera-knowledge:add-repo https://github.com/honojs/hono
|
|
124
|
-
|
|
125
|
-
# Index local docs
|
|
126
|
-
/bluera-knowledge:add-folder ./docs --name=project-docs
|
|
127
|
-
|
|
128
|
-
# Verify what's indexed
|
|
129
|
-
/bluera-knowledge:stores
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Quick Reference
|
|
135
|
-
|
|
136
|
-
| Question Pattern | Use |
|
|
137
|
-
|-----------------|-----|
|
|
138
|
-
| "How does [library] work..." | BK |
|
|
139
|
-
| "What does [library function] do..." | BK |
|
|
140
|
-
| "What options/params does [library] accept..." | BK |
|
|
141
|
-
| "What errors can [library] throw..." | BK |
|
|
142
|
-
| "How should I use [library API]..." | BK |
|
|
143
|
-
| "What changed in [library version]..." | BK |
|
|
144
|
-
| "How do I integrate [library]..." | BK |
|
|
145
|
-
| "Where is [thing] in OUR code..." | Grep/Read |
|
|
146
|
-
| "What is [general concept]..." | Training data |
|
|
147
|
-
| "What's new in [library] today..." | Web search |
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Mental Model
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
External Code (libraries, deps, specs) → Query BK
|
|
155
|
-
Your Project Code → Grep/Read directly
|
|
156
|
-
General Knowledge → Use training data
|
|
157
|
-
Breaking News → Web search
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
BK is cheap, fast, and authoritative. When in doubt about a library, query BK.
|