bluera-knowledge 0.31.0 → 0.32.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 +24 -0
- package/.mcp.json +13 -0
- package/CHANGELOG.md +20 -0
- package/NOTICE +47 -0
- package/README.md +2 -2
- package/bun.lock +1978 -0
- package/commands/add-folder.md +48 -0
- package/commands/add-repo.md +50 -0
- package/commands/cancel.md +63 -0
- package/commands/check-status.md +130 -0
- package/commands/crawl.md +61 -0
- package/commands/doctor.md +27 -0
- package/commands/eval.md +222 -0
- package/commands/health.md +72 -0
- package/commands/index.md +48 -0
- package/commands/remove-store.md +52 -0
- package/commands/search.md +80 -0
- package/commands/search.sh +63 -0
- package/commands/skill-activation.md +131 -0
- package/commands/stores.md +54 -0
- package/commands/suggest.md +118 -0
- package/commands/sync.md +96 -0
- package/commands/test-plugin.md +547 -0
- package/commands/uninstall.md +65 -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 +87 -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/pretooluse-bk-suggest.py +296 -0
- package/hooks/skill-activation.py +221 -0
- package/hooks/skill-rules.json +131 -0
- package/package.json +10 -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/test-mcp-dev.js +260 -0
- package/scripts/validate-local.sh +412 -0
- package/scripts/validate-npm-release.sh +406 -0
- package/skills/advanced-workflows/SKILL.md +273 -0
- package/skills/knowledge-search/SKILL.md +110 -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/store-lifecycle/SKILL.md +470 -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,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Re-index a knowledge store
|
|
3
|
+
argument-hint: "[store-name-or-id]"
|
|
4
|
+
allowed-tools: ["mcp__bluera-knowledge__execute"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Re-index Knowledge Store
|
|
8
|
+
|
|
9
|
+
Re-index a knowledge store: **$ARGUMENTS**
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. Parse the store name or ID from $ARGUMENTS (required)
|
|
14
|
+
|
|
15
|
+
2. Use mcp__bluera-knowledge__execute tool with command "store:index":
|
|
16
|
+
- args.store: The store name or ID from $ARGUMENTS
|
|
17
|
+
|
|
18
|
+
3. Display results showing job ID for background indexing:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
✓ Indexing store: react...
|
|
22
|
+
🔄 Indexing started in background
|
|
23
|
+
Job ID: job_def456ghi789
|
|
24
|
+
|
|
25
|
+
Check status with: /bluera-knowledge:check-status job_def456ghi789
|
|
26
|
+
Or view all jobs: /bluera-knowledge:check-status
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## When to Re-index
|
|
30
|
+
|
|
31
|
+
Re-index a store when:
|
|
32
|
+
- The source repository has been updated (for repo stores)
|
|
33
|
+
- Files have been added or modified (for file stores)
|
|
34
|
+
- You want to refresh embeddings with an updated model
|
|
35
|
+
- Search results seem out of date
|
|
36
|
+
|
|
37
|
+
## Error Handling
|
|
38
|
+
|
|
39
|
+
If indexing fails:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
✗ Failed to index store: [error message]
|
|
43
|
+
|
|
44
|
+
Common issues:
|
|
45
|
+
- Store name or ID not found - use /bluera-knowledge:stores to list available stores
|
|
46
|
+
- Source directory no longer exists (for file stores)
|
|
47
|
+
- Network issues pulling latest changes (for repo stores)
|
|
48
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Delete a knowledge store and all associated data
|
|
3
|
+
argument-hint: "[store-name-or-id]"
|
|
4
|
+
allowed-tools: ["mcp__bluera-knowledge__execute"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Remove Knowledge Store
|
|
8
|
+
|
|
9
|
+
Delete a knowledge store and all associated data: **$ARGUMENTS**
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. Parse the store name or ID from $ARGUMENTS (required)
|
|
14
|
+
- If no store provided, show error and suggest using /bluera-knowledge:stores to list available stores
|
|
15
|
+
|
|
16
|
+
2. Use mcp__bluera-knowledge__execute tool with command "store:delete":
|
|
17
|
+
- args.store: The store name or ID from $ARGUMENTS
|
|
18
|
+
|
|
19
|
+
3. Display deletion result:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Store "react" deleted successfully.
|
|
23
|
+
|
|
24
|
+
Removed:
|
|
25
|
+
- Store registry entry
|
|
26
|
+
- LanceDB search index
|
|
27
|
+
- Cloned repository files (for repo stores)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## What Gets Deleted
|
|
31
|
+
|
|
32
|
+
When you remove a store:
|
|
33
|
+
- **Registry entry** - Store is removed from the list
|
|
34
|
+
- **Search index** - LanceDB vector embeddings are dropped
|
|
35
|
+
- **Cloned files** - For repo stores created from URLs, the cloned repository is deleted
|
|
36
|
+
|
|
37
|
+
## Warning
|
|
38
|
+
|
|
39
|
+
This action is **permanent**. The store and all indexed data will be deleted.
|
|
40
|
+
To re-create, you'll need to add and re-index the source again.
|
|
41
|
+
|
|
42
|
+
## Error Handling
|
|
43
|
+
|
|
44
|
+
If store not found:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Store not found: nonexistent-store
|
|
48
|
+
|
|
49
|
+
Available stores:
|
|
50
|
+
- Use /bluera-knowledge:stores to list all stores
|
|
51
|
+
- Check spelling of store name or ID
|
|
52
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search indexed library sources
|
|
3
|
+
argument-hint: "[query] [--stores names] [--limit N] [--mode vector|fts|hybrid] [--detail minimal|contextual|full] [--threshold 0-1] [--min-relevance 0-1]"
|
|
4
|
+
allowed-tools: ["mcp__bluera-knowledge__search"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Search Knowledge Stores
|
|
8
|
+
|
|
9
|
+
Search indexed library sources for: **$ARGUMENTS**
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. Parse the query from $ARGUMENTS:
|
|
14
|
+
- Extract the search query (required)
|
|
15
|
+
- Extract --stores parameter (optional, comma-separated store names)
|
|
16
|
+
- Extract --limit parameter (optional, default 10)
|
|
17
|
+
- Extract --mode parameter (optional: vector, fts, hybrid; default hybrid)
|
|
18
|
+
- Extract --detail parameter (optional: minimal, contextual, full; default minimal)
|
|
19
|
+
- Extract --threshold parameter (optional, 0-1 range for normalized score filtering)
|
|
20
|
+
- Extract --min-relevance parameter (optional, 0-1 range for raw cosine similarity filtering)
|
|
21
|
+
|
|
22
|
+
2. Call mcp__bluera-knowledge__search with:
|
|
23
|
+
- query: The search query string
|
|
24
|
+
- stores: Array of store names (if --stores specified)
|
|
25
|
+
- limit: Number of results (if --limit specified, default 10)
|
|
26
|
+
- mode: Search mode (if --mode specified, default "hybrid")
|
|
27
|
+
- detail: Detail level (if --detail specified, default "minimal")
|
|
28
|
+
- threshold: Minimum normalized score (if --threshold specified)
|
|
29
|
+
- minRelevance: Minimum raw cosine similarity (if --min-relevance specified)
|
|
30
|
+
- intent: "find-implementation"
|
|
31
|
+
|
|
32
|
+
3. Format and display results with rich context:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
## Search Results: "query" (hybrid search)
|
|
36
|
+
|
|
37
|
+
**1. [Score: 0.95] [Vector+FTS]**
|
|
38
|
+
Store: claude-code
|
|
39
|
+
File: 📄 path/to/file.ts
|
|
40
|
+
Purpose: → Purpose description here
|
|
41
|
+
Top Terms: 🔑 (in this chunk): concept1, concept2, concept3
|
|
42
|
+
Imports: 📦 (in this chunk): package1, package2
|
|
43
|
+
|
|
44
|
+
**2. [Score: 0.87] [Vector]**
|
|
45
|
+
Store: another-store
|
|
46
|
+
File: 📄 path/to/file.js
|
|
47
|
+
Purpose: → Another purpose here
|
|
48
|
+
Top Terms: 🔑 (in this chunk): other-concept
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
**Found 10 results in 45ms**
|
|
52
|
+
|
|
53
|
+
💡 **Next Steps:**
|
|
54
|
+
- Read file: `Read /path/to/file.ts`
|
|
55
|
+
- Get full code: `mcp__bluera-knowledge__get_full_context("result-id")`
|
|
56
|
+
- Refine search: Use keywords above
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Formatting rules:**
|
|
60
|
+
- Header: `## Search Results: "query" (mode search)` - Extract mode from response (vector/fts/hybrid)
|
|
61
|
+
- Each result on its own block with blank line between
|
|
62
|
+
- Result header: `**N. [Score: X.XX]**`
|
|
63
|
+
- Store: `Store: storeName`
|
|
64
|
+
- File: `File: 📄 filename` (from summary.location, strip repoRoot prefix)
|
|
65
|
+
- Purpose: `Purpose: → purpose text` (from summary.purpose)
|
|
66
|
+
- Footer: `**Found {{totalResults}} results in {{timeMs}}ms**` with separator line above
|
|
67
|
+
|
|
68
|
+
4. For the footer next steps, include:
|
|
69
|
+
- First result's ID in the get_full_context example
|
|
70
|
+
- First result's actual file path in the Read example
|
|
71
|
+
- Use the actual keywords from top results
|
|
72
|
+
|
|
73
|
+
5. If no results:
|
|
74
|
+
```
|
|
75
|
+
No results found for "query"
|
|
76
|
+
|
|
77
|
+
Try:
|
|
78
|
+
- Broadening your search terms
|
|
79
|
+
- Checking indexed stores: /bluera-knowledge:stores
|
|
80
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Search command that uses Python formatter for deterministic table output
|
|
3
|
+
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
# Parse arguments
|
|
7
|
+
QUERY=""
|
|
8
|
+
STORES=""
|
|
9
|
+
LIMIT=10
|
|
10
|
+
|
|
11
|
+
while [[ $# -gt 0 ]]; do
|
|
12
|
+
case $1 in
|
|
13
|
+
--stores)
|
|
14
|
+
STORES="$2"
|
|
15
|
+
shift 2
|
|
16
|
+
;;
|
|
17
|
+
--limit)
|
|
18
|
+
LIMIT="$2"
|
|
19
|
+
shift 2
|
|
20
|
+
;;
|
|
21
|
+
*)
|
|
22
|
+
# Everything else is the query
|
|
23
|
+
if [ -z "$QUERY" ]; then
|
|
24
|
+
QUERY="$1"
|
|
25
|
+
else
|
|
26
|
+
QUERY="$QUERY $1"
|
|
27
|
+
fi
|
|
28
|
+
shift
|
|
29
|
+
;;
|
|
30
|
+
esac
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
# Remove quotes from query if present
|
|
34
|
+
QUERY=$(echo "$QUERY" | sed 's/^["'\'']*//;s/["'\'']*$//')
|
|
35
|
+
|
|
36
|
+
if [ -z "$QUERY" ]; then
|
|
37
|
+
echo "Error: No search query provided"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Build MCP tool call JSON
|
|
42
|
+
TOOL_INPUT=$(cat <<EOF
|
|
43
|
+
{
|
|
44
|
+
"query": "$QUERY",
|
|
45
|
+
"limit": $LIMIT,
|
|
46
|
+
"detail": "contextual",
|
|
47
|
+
"intent": "find-implementation"
|
|
48
|
+
}
|
|
49
|
+
EOF
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Call MCP tool (this would need to be done via Claude)
|
|
53
|
+
# For now, output instructions for Claude
|
|
54
|
+
cat <<EOF
|
|
55
|
+
Please call mcp__bluera-knowledge__search with these parameters and pipe the results through the formatter:
|
|
56
|
+
|
|
57
|
+
Query: $QUERY
|
|
58
|
+
Limit: $LIMIT
|
|
59
|
+
Detail: contextual
|
|
60
|
+
Intent: find-implementation
|
|
61
|
+
|
|
62
|
+
Then execute: echo '<results_json>' | ${CLAUDE_PLUGIN_ROOT}/hooks/format-search-results.py
|
|
63
|
+
EOF
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Toggle skill auto-activation on/off or configure individual skills
|
|
3
|
+
argument-hint: "[on|off|status|config]"
|
|
4
|
+
allowed-tools: ["Read", "Write", "AskUserQuestion"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Skill Activation Configuration
|
|
8
|
+
|
|
9
|
+
Manage the bluera-knowledge skill auto-activation system.
|
|
10
|
+
|
|
11
|
+
## Configuration File
|
|
12
|
+
|
|
13
|
+
Location: `.bluera/bluera-knowledge/skill-activation.json` (per-repo, in project root)
|
|
14
|
+
|
|
15
|
+
Default configuration (created if missing):
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"threshold": 1,
|
|
20
|
+
"skills": {
|
|
21
|
+
"knowledge-search": true,
|
|
22
|
+
"when-to-query": true,
|
|
23
|
+
"search-optimization": true,
|
|
24
|
+
"advanced-workflows": true,
|
|
25
|
+
"store-lifecycle": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Steps
|
|
31
|
+
|
|
32
|
+
### 1. Parse Arguments
|
|
33
|
+
|
|
34
|
+
Extract the subcommand from $ARGUMENTS:
|
|
35
|
+
- Empty or "status": Show current status
|
|
36
|
+
- "on": Enable skill activation
|
|
37
|
+
- "off": Disable skill activation
|
|
38
|
+
- "config": Interactive skill configuration
|
|
39
|
+
|
|
40
|
+
### 2. Read Current Configuration
|
|
41
|
+
|
|
42
|
+
Read `.bluera/bluera-knowledge/skill-activation.json`
|
|
43
|
+
|
|
44
|
+
If the file doesn't exist, use the default configuration shown above.
|
|
45
|
+
|
|
46
|
+
### 3. Execute Subcommand
|
|
47
|
+
|
|
48
|
+
**For "status" or empty arguments:**
|
|
49
|
+
|
|
50
|
+
Display the current configuration:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
## Skill Activation Status
|
|
54
|
+
|
|
55
|
+
**Status**: [Enabled/Disabled]
|
|
56
|
+
**Threshold**: [threshold value]
|
|
57
|
+
|
|
58
|
+
### Individual Skills
|
|
59
|
+
| Skill | Status |
|
|
60
|
+
|-------|--------|
|
|
61
|
+
| knowledge-search | enabled/disabled |
|
|
62
|
+
| when-to-query | enabled/disabled |
|
|
63
|
+
| search-optimization | enabled/disabled |
|
|
64
|
+
| advanced-workflows | enabled/disabled |
|
|
65
|
+
| store-lifecycle | enabled/disabled |
|
|
66
|
+
|
|
67
|
+
Use `/bluera-knowledge:skill-activation config` to toggle individual skills.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**For "on":**
|
|
71
|
+
|
|
72
|
+
1. Read configuration (or use defaults)
|
|
73
|
+
2. Set `enabled: true`
|
|
74
|
+
3. Ensure directory exists: `.bluera/bluera-knowledge/`
|
|
75
|
+
4. Write updated configuration
|
|
76
|
+
5. Confirm: "Skill activation **enabled**. Skills will be suggested based on your prompts."
|
|
77
|
+
|
|
78
|
+
**For "off":**
|
|
79
|
+
|
|
80
|
+
1. Read configuration (or use defaults)
|
|
81
|
+
2. Set `enabled: false`
|
|
82
|
+
3. Write updated configuration
|
|
83
|
+
4. Confirm: "Skill activation **disabled**. No skill suggestions will appear."
|
|
84
|
+
|
|
85
|
+
**For "config":**
|
|
86
|
+
|
|
87
|
+
1. Read current configuration
|
|
88
|
+
2. Use AskUserQuestion to let user toggle skills:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"questions": [{
|
|
93
|
+
"question": "Which skills should auto-activate when relevant patterns are detected?",
|
|
94
|
+
"header": "Skills",
|
|
95
|
+
"multiSelect": true,
|
|
96
|
+
"options": [
|
|
97
|
+
{
|
|
98
|
+
"label": "knowledge-search",
|
|
99
|
+
"description": "Suggests when to query BK for library questions"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"label": "when-to-query",
|
|
103
|
+
"description": "Guides BK vs Grep/Read decisions"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"label": "search-optimization",
|
|
107
|
+
"description": "Tips for optimizing search parameters"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"label": "advanced-workflows",
|
|
111
|
+
"description": "Multi-tool orchestration patterns"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"label": "store-lifecycle",
|
|
115
|
+
"description": "Managing knowledge stores"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
3. Update skills based on selection (selected = enabled, unselected = disabled)
|
|
123
|
+
4. Write updated configuration
|
|
124
|
+
5. Show updated status table
|
|
125
|
+
|
|
126
|
+
## Notes
|
|
127
|
+
|
|
128
|
+
- Configuration is per-repo (stored in project's `.bluera/bluera-knowledge/` directory)
|
|
129
|
+
- The configuration directory is created automatically if it doesn't exist
|
|
130
|
+
- Changes take effect immediately on the next prompt
|
|
131
|
+
- When disabled globally, no skills are suggested regardless of individual settings
|
|
@@ -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.
|
package/commands/sync.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sync stores from definitions config (bootstrap on fresh clone)
|
|
3
|
+
allowed-tools: ["mcp__bluera-knowledge__execute"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sync Stores from Definitions
|
|
7
|
+
|
|
8
|
+
Sync stores from the git-committable definitions config. This is useful when:
|
|
9
|
+
- You've cloned a repo that has `.bluera/bluera-knowledge/stores.config.json`
|
|
10
|
+
- You want to recreate all stores defined by the team
|
|
11
|
+
- You want to check for orphan stores not in the config
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
1. Use the mcp__bluera-knowledge__execute tool with command "stores:sync" to sync stores from definitions
|
|
16
|
+
|
|
17
|
+
Optional arguments:
|
|
18
|
+
- `dryRun: true` - Show what would happen without making changes
|
|
19
|
+
- `prune: true` - Remove stores not in definitions
|
|
20
|
+
- `reindex: true` - Re-index existing stores after sync
|
|
21
|
+
|
|
22
|
+
2. Present results in a structured format:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
## Sync Results
|
|
26
|
+
|
|
27
|
+
**Created**: 3 stores
|
|
28
|
+
- my-docs (file)
|
|
29
|
+
- react-source (repo)
|
|
30
|
+
- api-docs (web)
|
|
31
|
+
|
|
32
|
+
**Skipped** (already exist): 2 stores
|
|
33
|
+
- lodash
|
|
34
|
+
- typescript-docs
|
|
35
|
+
|
|
36
|
+
**Orphans** (not in definitions): 1 store
|
|
37
|
+
- old-unused-store
|
|
38
|
+
|
|
39
|
+
No errors occurred.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Dry Run Mode
|
|
43
|
+
|
|
44
|
+
When using dry run, show what WOULD happen:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
## Sync Preview (Dry Run)
|
|
48
|
+
|
|
49
|
+
**Would create**: 3 stores
|
|
50
|
+
- my-docs (file)
|
|
51
|
+
- react-source (repo)
|
|
52
|
+
- api-docs (web)
|
|
53
|
+
|
|
54
|
+
**Would skip** (already exist): 2 stores
|
|
55
|
+
- lodash
|
|
56
|
+
- typescript-docs
|
|
57
|
+
|
|
58
|
+
**Orphans** (not in definitions): 1 store
|
|
59
|
+
- old-unused-store
|
|
60
|
+
|
|
61
|
+
To apply these changes, run without --dry-run
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## If No Definitions Found
|
|
65
|
+
|
|
66
|
+
If no store definitions config exists:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
## No Store Definitions Found
|
|
70
|
+
|
|
71
|
+
The config file `.bluera/bluera-knowledge/stores.config.json` doesn't exist yet.
|
|
72
|
+
|
|
73
|
+
Store definitions are automatically created when you:
|
|
74
|
+
- Add a repo: `/bluera-knowledge:add-repo <url>`
|
|
75
|
+
- Add a folder: `/bluera-knowledge:add-folder <path>`
|
|
76
|
+
- Crawl a website: `/bluera-knowledge:crawl <url>`
|
|
77
|
+
|
|
78
|
+
The config file will be created automatically and can be committed to git for team sharing.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Error Handling
|
|
82
|
+
|
|
83
|
+
If some stores fail to sync, report them individually:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
## Sync Results
|
|
87
|
+
|
|
88
|
+
**Created**: 2 stores
|
|
89
|
+
- my-docs
|
|
90
|
+
- api-docs
|
|
91
|
+
|
|
92
|
+
**Failed**: 1 store
|
|
93
|
+
- react-source: Directory does not exist: /path/to/repo
|
|
94
|
+
|
|
95
|
+
Continue to resolve the errors manually.
|
|
96
|
+
```
|