bluera-knowledge 0.11.13 → 0.11.15

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.
@@ -0,0 +1,148 @@
1
+ # Test Plugin
2
+
3
+ Comprehensive test of all Bluera Knowledge plugin functionality (MCP tools + slash commands).
4
+
5
+ ## Context
6
+
7
+ !`echo "=== BK Plugin Test ===" && ls -la .bluera/bluera-knowledge/ 2>/dev/null || echo "No BK data dir yet (will be created)"`
8
+
9
+ ## Test Content Setup
10
+
11
+ First, create test content for indexing:
12
+
13
+ ```bash
14
+ mkdir -p .bluera/bluera-knowledge/test-content
15
+ cat > .bluera/bluera-knowledge/test-content/test-file.md << 'EOF'
16
+ # BK Plugin Test File
17
+
18
+ This file contains unique test content for validating the Bluera Knowledge plugin.
19
+
20
+ ## Test Function
21
+
22
+ The `validateBKPlugin` function performs comprehensive testing of all plugin features.
23
+ It checks MCP connectivity, store operations, search functionality, and cleanup.
24
+
25
+ Keywords: bluera-knowledge-test, plugin-validation, mcp-test
26
+ EOF
27
+ ```
28
+
29
+ ## Workflow
30
+
31
+ Execute each test in order. Mark each as PASS or FAIL.
32
+
33
+ ### Part 1: MCP Tools
34
+
35
+ 1. **MCP Connection**: Call MCP tool `execute` with `{ command: "help" }`
36
+ - Expected: Returns list of available commands
37
+ - PASS if response contains "Available commands"
38
+
39
+ 2. **List Stores (MCP)**: Call MCP tool `execute` with `{ command: "stores" }`
40
+ - Expected: Returns store list (may be empty initially)
41
+ - PASS if no error
42
+
43
+ 3. **Create Store**: Call MCP tool `execute` with:
44
+ ```json
45
+ { "command": "store:create", "args": { "name": "bk-test-store", "type": "file", "path": ".bluera/bluera-knowledge/test-content" } }
46
+ ```
47
+ - Expected: Store created successfully
48
+ - PASS if response indicates success
49
+
50
+ 4. **Store Info**: Call MCP tool `execute` with:
51
+ ```json
52
+ { "command": "store:info", "args": { "store": "bk-test-store" } }
53
+ ```
54
+ - Expected: Returns store metadata including name, type, path
55
+ - PASS if response contains store details
56
+
57
+ 5. **Index Store**: Call MCP tool `execute` with:
58
+ ```json
59
+ { "command": "store:index", "args": { "store": "bk-test-store" } }
60
+ ```
61
+ - Expected: Indexing completes (may take a few seconds)
62
+ - PASS if response indicates indexing succeeded
63
+
64
+ 6. **Search (MCP)**: Call MCP tool `search` with:
65
+ ```json
66
+ { "query": "validateBKPlugin", "stores": ["bk-test-store"] }
67
+ ```
68
+ - Expected: Returns results containing test content
69
+ - PASS if results array is non-empty and contains test file
70
+
71
+ 7. **Get Full Context**: If search returned results, call MCP tool `get_full_context` with:
72
+ ```json
73
+ { "resultId": "<id from search result>" }
74
+ ```
75
+ - Expected: Returns full file content
76
+ - PASS if response contains "BK Plugin Test File"
77
+
78
+ ### Part 2: Slash Commands
79
+
80
+ 8. **Stores Command**: Run `/bluera-knowledge:stores`
81
+ - Expected: Shows bk-test-store in output
82
+ - PASS if store is listed
83
+
84
+ 9. **Search Command**: Run `/bluera-knowledge:search "bluera-knowledge-test"`
85
+ - Expected: Returns results from test store
86
+ - PASS if results are shown
87
+
88
+ 10. **Suggest Command**: Run `/bluera-knowledge:suggest`
89
+ - Expected: Runs without error (may show no suggestions if no package.json)
90
+ - PASS if no error thrown
91
+
92
+ ### Part 3: Cleanup
93
+
94
+ 11. **Delete Store**: Call MCP tool `execute` with:
95
+ ```json
96
+ { "command": "store:delete", "args": { "store": "bk-test-store" } }
97
+ ```
98
+ - Expected: Store deleted
99
+ - PASS if deletion succeeds
100
+
101
+ 12. **Remove Test Content**: Run bash command:
102
+ ```bash
103
+ rm -rf .bluera/bluera-knowledge/test-content
104
+ ```
105
+ - Expected: Directory removed
106
+ - PASS if command succeeds
107
+
108
+ 13. **Verify Cleanup**: Call MCP tool `execute` with `{ command: "stores" }`
109
+ - Expected: bk-test-store is NOT in the list
110
+ - PASS if test store is gone
111
+
112
+ ## Output Format
113
+
114
+ After running all tests, report results in this format:
115
+
116
+ ### Plugin Test Results
117
+
118
+ | # | Test | Status |
119
+ |---|------|--------|
120
+ | 1 | MCP Connection (help) | ? |
121
+ | 2 | List Stores (MCP) | ? |
122
+ | 3 | Create Store | ? |
123
+ | 4 | Store Info | ? |
124
+ | 5 | Index Store | ? |
125
+ | 6 | Search (MCP) | ? |
126
+ | 7 | Get Full Context | ? |
127
+ | 8 | /stores Command | ? |
128
+ | 9 | /search Command | ? |
129
+ | 10 | /suggest Command | ? |
130
+ | 11 | Delete Store | ? |
131
+ | 12 | Remove Test Content | ? |
132
+ | 13 | Verify Cleanup | ? |
133
+
134
+ **Result: X/13 tests passed**
135
+
136
+ ## Error Recovery
137
+
138
+ If tests fail partway through, clean up manually:
139
+
140
+ 1. Delete test store (if exists):
141
+ ```
142
+ execute → { command: "store:delete", args: { store: "bk-test-store" } }
143
+ ```
144
+
145
+ 2. Remove test content directory:
146
+ ```bash
147
+ rm -rf .bluera/bluera-knowledge/test-content
148
+ ```
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.11.13",
3
+ "version": "0.11.15",
4
4
  "description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents.",
5
5
  "mcpServers": {
6
6
  "bluera-knowledge": {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,43 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.11.15](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.15) (2026-01-10)
6
+
7
+
8
+ ### Features
9
+
10
+ * **commands:** add test-plugin command for comprehensive plugin testing ([f50c47f](https://github.com/blueraai/bluera-knowledge/commit/f50c47fee74df8c1efbe23481f05dfa33c62911f))
11
+ * **scripts:** add post-release npm validation script ([e4c29a0](https://github.com/blueraai/bluera-knowledge/commit/e4c29a0c83907de4bc293a69a58412629457fb22))
12
+ * **scripts:** add suggest, sync, serve, mcp tests to npm validation ([49d85da](https://github.com/blueraai/bluera-knowledge/commit/49d85dad1a89691060c12f152d644844baf6e6e6))
13
+ * **scripts:** log expected vs installed version in validation script ([c77d039](https://github.com/blueraai/bluera-knowledge/commit/c77d039b27a3ccf54d50006af161ac4dcfea7b21))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **cli:** plugin-api commands now respect global options ([d3cca02](https://github.com/blueraai/bluera-knowledge/commit/d3cca02ffc679ffc187b76c7682f3cc177eabdea))
19
+ * **plugin:** properly close services after command execution ([eeaf743](https://github.com/blueraai/bluera-knowledge/commit/eeaf743750be73fd9c7a9e72440b2fd0fb5a53fa))
20
+ * **scripts:** show real-time output in validation script ([8a4bdec](https://github.com/blueraai/bluera-knowledge/commit/8a4bdec8b63c504d34ba35bfe19da795f7f7fd07))
21
+ * **scripts:** use mktemp for temp directories in validation script ([3107861](https://github.com/blueraai/bluera-knowledge/commit/3107861bd7a966016fde2a121469dd84756f39be))
22
+ * **search:** add defaults for env vars so CLI works standalone ([b2d2ce5](https://github.com/blueraai/bluera-knowledge/commit/b2d2ce534e8cd2ba0fc0abdac505c912a1a76035))
23
+
24
+ ## [0.11.14](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.14) (2026-01-10)
25
+
26
+
27
+ ### Features
28
+
29
+ * **scripts:** add post-release npm validation script ([e4c29a0](https://github.com/blueraai/bluera-knowledge/commit/e4c29a0c83907de4bc293a69a58412629457fb22))
30
+ * **scripts:** add suggest, sync, serve, mcp tests to npm validation ([49d85da](https://github.com/blueraai/bluera-knowledge/commit/49d85dad1a89691060c12f152d644844baf6e6e6))
31
+ * **scripts:** log expected vs installed version in validation script ([c77d039](https://github.com/blueraai/bluera-knowledge/commit/c77d039b27a3ccf54d50006af161ac4dcfea7b21))
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * **cli:** plugin-api commands now respect global options ([d3cca02](https://github.com/blueraai/bluera-knowledge/commit/d3cca02ffc679ffc187b76c7682f3cc177eabdea))
37
+ * **plugin:** properly close services after command execution ([eeaf743](https://github.com/blueraai/bluera-knowledge/commit/eeaf743750be73fd9c7a9e72440b2fd0fb5a53fa))
38
+ * **scripts:** show real-time output in validation script ([8a4bdec](https://github.com/blueraai/bluera-knowledge/commit/8a4bdec8b63c504d34ba35bfe19da795f7f7fd07))
39
+ * **scripts:** use mktemp for temp directories in validation script ([3107861](https://github.com/blueraai/bluera-knowledge/commit/3107861bd7a966016fde2a121469dd84756f39be))
40
+ * **search:** add defaults for env vars so CLI works standalone ([b2d2ce5](https://github.com/blueraai/bluera-knowledge/commit/b2d2ce534e8cd2ba0fc0abdac505c912a1a76035))
41
+
5
42
  ## [0.11.13](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.13) (2026-01-10)
6
43
 
7
44
 
package/README.md CHANGED
@@ -122,6 +122,47 @@ Bluera Knowledge enables option 3 by building a searchable knowledge base from *
122
122
 
123
123
  ---
124
124
 
125
+ ## 🎯 When Claude Code Should Query BK
126
+
127
+ **The simple rule: Query BK for any question about libraries, dependencies, or reference material.**
128
+
129
+ BK is cheap (~100ms, no rate limits), authoritative (actual source code), and complete (includes tests and internal APIs). Claude Code should query it frequently for external code questions.
130
+
131
+ ### Always Query BK For:
132
+
133
+ | Question Type | Examples |
134
+ |--------------|----------|
135
+ | **Library internals** | "How does Express handle middleware errors?", "What does useEffect cleanup do?" |
136
+ | **API signatures** | "What parameters does axios.create() accept?", "What options can I pass to Hono?" |
137
+ | **Error handling** | "What errors can Zod throw?", "Why might this library return undefined?" |
138
+ | **Version behavior** | "What changed in React 18?", "Is this method deprecated?" |
139
+ | **Configuration** | "What config options exist for Vite?", "What are the defaults?" |
140
+ | **Testing patterns** | "How do the library authors test this?", "How should I mock this?" |
141
+ | **Performance/internals** | "Is this cached internally?", "What's the complexity?" |
142
+ | **Security** | "How does this library validate input?", "Is this safe against injection?" |
143
+ | **Integration** | "How do I integrate X with Y?", "What's the idiomatic way to use this?" |
144
+
145
+ ### DO NOT Query BK For:
146
+
147
+ | Question Type | Use Instead |
148
+ |--------------|-------------|
149
+ | **Your project code** | Grep/Read directly ("Where is OUR auth middleware?") |
150
+ | **General concepts** | Training data ("What is a closure?") |
151
+ | **Breaking news** | Web search ("Latest React release notes") |
152
+
153
+ ### Quick Pattern Matching:
154
+
155
+ ```
156
+ "How does [library] work..." → Query BK
157
+ "What does [library function] do..." → Query BK
158
+ "What options does [library] accept..."→ Query BK
159
+ "What errors can [library] throw..." → Query BK
160
+ "Where is [thing] in OUR code..." → Grep/Read directly
161
+ "What is [general concept]..." → Training data
162
+ ```
163
+
164
+ ---
165
+
125
166
  ## 💰 Token Efficiency
126
167
 
127
168
  Beyond speed and accuracy, Bluera Knowledge can **significantly reduce token consumption** for code-related queries—typically saving 60-75% compared to web search approaches.
@@ -196,12 +237,15 @@ Bluera Knowledge isn't always the most token-efficient choice:
196
237
 
197
238
  ### 💡 Best Practice
198
239
 
199
- Let Claude Code decide when to use Bluera Knowledge:
200
- - For **library-specific, version-specific, or implementation questions** → BK saves tokens and increases accuracy
201
- - For **general programming concepts** → Training data is more efficient
202
- - For **current events** → Web search is necessary
240
+ **Default to BK for library questions.** It's cheap, fast, and authoritative:
203
241
 
204
- The plugin's Skills teach Claude Code these patterns, so it automatically uses the most efficient approach for each question.
242
+ | Question Type | Action | Why |
243
+ |--------------|--------|-----|
244
+ | Library internals, APIs, errors, versions, config | **Query BK first** | Source code is definitive, 60-85% token savings |
245
+ | General programming concepts | Skip BK | Training data is sufficient |
246
+ | Breaking news, release notes | Web search | BK only has indexed content |
247
+
248
+ The plugin's Skills teach Claude Code these patterns automatically. When in doubt about a dependency, query BK—it's faster and more accurate than guessing or web searching.
205
249
 
206
250
  ---
207
251
 
@@ -1617,6 +1661,21 @@ This script:
1617
1661
 
1618
1662
  Use this to catch any packaging or runtime issues after npm publish.
1619
1663
 
1664
+ ### 🧪 Plugin Self-Test
1665
+
1666
+ Test all plugin functionality from within Claude Code:
1667
+
1668
+ ```
1669
+ /test-plugin
1670
+ ```
1671
+
1672
+ This command runs 13 tests covering:
1673
+ - **MCP Tools**: execute (help, stores, create, info, index), search, get_full_context
1674
+ - **Slash Commands**: /stores, /search, /suggest
1675
+ - **Cleanup**: Store deletion, artifact removal, verification
1676
+
1677
+ The test creates temporary content, exercises all features, and cleans up automatically. Use this to verify the plugin is working correctly after installation or updates.
1678
+
1620
1679
  ### 🧪 Testing Locally
1621
1680
 
1622
1681
  **Option 1: Development MCP Server (Recommended)**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.11.13",
3
+ "version": "0.11.15",
4
4
  "description": "CLI tool for managing knowledge stores with semantic search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -7,40 +7,85 @@ description: Teaches how to use Bluera Knowledge for accessing library sources a
7
7
 
8
8
  BK provides access to **definitive library sources** for your project dependencies.
9
9
 
10
- ## Purpose: Authoritative References, Not Project Search
10
+ ## The Rule: Query BK for External Code
11
11
 
12
- **CKB is for**: Reference material and external sources
13
- - **Library sources**: Clone Vue.js/Pydantic/Hono for authoritative API reference
14
- - **Specifications**: Add project requirements, API specs, RFCs
15
- - **Documentation**: Add design docs, architecture guides, research papers
16
- - **Reference material**: Best practices, coding standards, examples
12
+ **Any question about libraries, dependencies, or indexed reference material should query BK.**
17
13
 
18
- **CKB is NOT for**: Searching your current project code
19
- - Use Grep/Read directly on project files
20
- - BK stores are for external reference material
14
+ BK is:
15
+ - **Cheap**: ~100ms response, unlimited queries, no rate limits
16
+ - **Authoritative**: Actual source code, not blog posts or training data
17
+ - **Complete**: Includes tests, examples, internal APIs, configuration
18
+
19
+ ## Always Query BK For:
20
+
21
+ **Library implementation:**
22
+ - "How does Express handle middleware errors?"
23
+ - "What does React's useEffect cleanup actually do?"
24
+ - "How is Pydantic validation implemented?"
25
+
26
+ **API signatures and options:**
27
+ - "What parameters does axios.create() accept?"
28
+ - "What options can I pass to hono.use()?"
29
+ - "What's the signature of zod.object()?"
30
+
31
+ **Error handling:**
32
+ - "What errors can this library throw?"
33
+ - "Why might this function return undefined?"
34
+ - "What validation does Zod perform?"
35
+
36
+ **Version-specific behavior:**
37
+ - "What changed in React 18?"
38
+ - "Is this deprecated in Express 5?"
39
+ - "Does my version support this?"
40
+
41
+ **Configuration:**
42
+ - "What config options exist for Vite?"
43
+ - "What are the default values?"
44
+ - "What environment variables does this use?"
45
+
46
+ **Testing:**
47
+ - "How do the library authors test this?"
48
+ - "How should I mock this in tests?"
49
+ - "What edge cases do the tests cover?"
50
+
51
+ **Performance:**
52
+ - "Is this cached internally?"
53
+ - "What's the complexity of this operation?"
54
+ - "Does this run async or sync?"
55
+
56
+ **Security:**
57
+ - "How does this validate input?"
58
+ - "Is this safe against injection?"
59
+ - "How are credentials handled?"
60
+
61
+ **Integration:**
62
+ - "How do I integrate X with Y?"
63
+ - "What's the idiomatic usage pattern?"
64
+ - "How do examples in the library do this?"
21
65
 
22
66
  ## Two Ways to Access Library Sources
23
67
 
24
- ### 1. Vector Search (MCP or slash command)
25
- Find concepts and patterns across library docs:
68
+ ### 1. Vector Search (Discovery)
69
+ Find concepts and patterns across indexed content:
26
70
  ```
27
71
  search("vue reactivity system")
28
72
  /bluera-knowledge:search "pydantic custom validators"
29
73
  ```
30
74
 
31
- ### 2. Direct File Access (Grep/Read)
75
+ ### 2. Direct File Access (Precision)
32
76
  Precise lookups in cloned library source:
33
77
  ```
34
78
  Grep: pattern="defineReactive" path=".bluera/bluera-knowledge/repos/vue/"
35
79
  Read: .bluera/bluera-knowledge/repos/pydantic/pydantic/validators.py
36
80
  ```
37
81
 
38
- ## Both Are Valid!
82
+ Both are valid! Use vector search for discovery, Grep/Read for specific functions.
39
83
 
40
- You can use **either or both** approaches on the same cloned repo:
41
- - Vector search to discover relevant files
42
- - Grep/Read to find specific functions/classes
43
- - Or just Grep/Read if you know what you're looking for
84
+ ## DO NOT Query BK For:
85
+
86
+ - **Your project code** Use Grep/Read directly
87
+ - **General concepts** Use training data ("What is a closure?")
88
+ - **Breaking news** → Use web search ("Latest React release")
44
89
 
45
90
  ## Example Workflow
46
91
 
@@ -52,3 +97,14 @@ Claude:
52
97
  3. Read file: `.bluera/bluera-knowledge/repos/vue/packages/reactivity/src/computed.ts`
53
98
  4. Grep for implementation: pattern="class ComputedRefImpl"
54
99
  5. Explain with authoritative source code examples
100
+
101
+ ## Quick Reference
102
+
103
+ ```
104
+ [library] question → Query BK
105
+ [your code] question → Grep/Read directly
106
+ [concept] question → Training data
107
+ [news/updates] question → Web search
108
+ ```
109
+
110
+ BK is cheap and fast. Query it liberally for library questions.
@@ -3,64 +3,158 @@ name: when-to-query
3
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
4
  ---
5
5
 
6
- # When to Query BK vs Current Project
6
+ # When to Query Bluera Knowledge
7
7
 
8
- ## Query BK When:
8
+ ## The Rule: BK First for External Code
9
9
 
10
- **Questions about libraries/dependencies:**
11
- - "How does Vue's reactivity system work?"
12
- - "What are Pydantic's built-in validators?"
13
- - "How should I use Pino's child loggers?"
14
- - "What middleware does Hono provide?"
10
+ **When the question involves libraries, dependencies, or reference material, query BK first.**
15
11
 
16
- **Reference material questions:**
17
- - "What does the API spec say about authentication?"
18
- - "What are the project requirements for error handling?"
19
- - "How does the architecture doc describe the data flow?"
20
- - "What coding standards apply to this project?"
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)
21
17
 
22
- **Learning library APIs:**
23
- - Discovering available options/configs
24
- - Finding usage examples from library itself
25
- - Understanding internal implementation
18
+ ---
26
19
 
27
- **Verifying specifications:**
28
- - Checking exact requirements
29
- - Finding edge cases in specs
30
- - Understanding design decisions
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?"
31
88
 
32
- ## Query Current Project (Grep/Read) When:
89
+ ---
33
90
 
34
- **Working on YOUR code:**
35
- - "Where is the authentication middleware?"
36
- - "Find all API endpoints"
37
- - "Show me the database models"
91
+ ## DO NOT Query BK For:
38
92
 
39
- **Debugging YOUR code:**
40
- - Reading error traces
41
- - Following call stacks
42
- - Checking variable usage
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"
43
98
 
44
- ## Setup First: Add Important Dependencies
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?"
45
104
 
46
- Before BK is useful, you need to add library sources:
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"
47
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
48
130
  ```
49
- /bk:suggest # Get recommendations
50
- /bk:add-repo <url> --name=<lib> # Add important libs
51
- /bk:stores # Verify what's indexed
52
- ```
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
+ ---
53
150
 
54
151
  ## Mental Model
55
152
 
56
153
  ```
57
- Current Project FilesGrep/Read directly
58
- vs
59
- Library Sources (Vue, Pydantic, etc.) BK (vector search OR Grep/Read)
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
60
158
  ```
61
159
 
62
- BK gives you both ways to access library sources:
63
- 1. Semantic search for discovery
64
- 2. Grep/Read for precision
65
-
66
- Use whichever works best for your question!
160
+ BK is cheap, fast, and authoritative. When in doubt about a library, query BK.