@knowledgine/cli 0.6.1 → 0.6.3

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.
Files changed (78) hide show
  1. package/dist/CLAUDE.md +7 -0
  2. package/dist/commands/benchmark.d.ts +6 -0
  3. package/dist/commands/benchmark.d.ts.map +1 -0
  4. package/dist/commands/benchmark.js +136 -0
  5. package/dist/commands/benchmark.js.map +1 -0
  6. package/dist/commands/deprecation-check.d.ts +1 -0
  7. package/dist/commands/deprecation-check.d.ts.map +1 -1
  8. package/dist/commands/deprecation-check.js +23 -5
  9. package/dist/commands/deprecation-check.js.map +1 -1
  10. package/dist/commands/doctor.d.ts +23 -0
  11. package/dist/commands/doctor.d.ts.map +1 -0
  12. package/dist/commands/doctor.js +600 -0
  13. package/dist/commands/doctor.js.map +1 -0
  14. package/dist/commands/explain.d.ts.map +1 -1
  15. package/dist/commands/explain.js +4 -1
  16. package/dist/commands/explain.js.map +1 -1
  17. package/dist/commands/ingest.d.ts +1 -0
  18. package/dist/commands/ingest.d.ts.map +1 -1
  19. package/dist/commands/ingest.js +142 -2
  20. package/dist/commands/ingest.js.map +1 -1
  21. package/dist/commands/init.d.ts.map +1 -1
  22. package/dist/commands/init.js +2 -0
  23. package/dist/commands/init.js.map +1 -1
  24. package/dist/commands/search.d.ts +2 -1
  25. package/dist/commands/search.d.ts.map +1 -1
  26. package/dist/commands/search.js +54 -14
  27. package/dist/commands/search.js.map +1 -1
  28. package/dist/commands/serve.d.ts +1 -0
  29. package/dist/commands/serve.d.ts.map +1 -1
  30. package/dist/commands/serve.js +16 -1
  31. package/dist/commands/serve.js.map +1 -1
  32. package/dist/commands/setup.d.ts.map +1 -1
  33. package/dist/commands/setup.js +8 -0
  34. package/dist/commands/setup.js.map +1 -1
  35. package/dist/commands/status.d.ts.map +1 -1
  36. package/dist/commands/status.js +5 -2
  37. package/dist/commands/status.js.map +1 -1
  38. package/dist/commands/suggest.d.ts.map +1 -1
  39. package/dist/commands/suggest.js +12 -0
  40. package/dist/commands/suggest.js.map +1 -1
  41. package/dist/commands/upgrade.d.ts +1 -0
  42. package/dist/commands/upgrade.d.ts.map +1 -1
  43. package/dist/commands/upgrade.js +99 -2
  44. package/dist/commands/upgrade.js.map +1 -1
  45. package/dist/index.js +45 -10
  46. package/dist/index.js.map +1 -1
  47. package/dist/lib/entity-extractor.d.ts +17 -0
  48. package/dist/lib/entity-extractor.d.ts.map +1 -0
  49. package/dist/lib/entity-extractor.js +22 -0
  50. package/dist/lib/entity-extractor.js.map +1 -0
  51. package/dist/lib/formatter.d.ts.map +1 -1
  52. package/dist/lib/formatter.js +13 -8
  53. package/dist/lib/formatter.js.map +1 -1
  54. package/dist/templates/skills/knowledgine-explain/references.d.ts +2 -0
  55. package/dist/templates/skills/knowledgine-explain/references.d.ts.map +1 -0
  56. package/dist/templates/skills/knowledgine-explain/references.js +183 -0
  57. package/dist/templates/skills/knowledgine-explain/references.js.map +1 -0
  58. package/dist/templates/skills/knowledgine-explain/skill-md.d.ts +2 -0
  59. package/dist/templates/skills/knowledgine-explain/skill-md.d.ts.map +1 -0
  60. package/dist/templates/skills/knowledgine-explain/skill-md.js +89 -0
  61. package/dist/templates/skills/knowledgine-explain/skill-md.js.map +1 -0
  62. package/dist/templates/skills/knowledgine-recall/references.d.ts +2 -0
  63. package/dist/templates/skills/knowledgine-recall/references.d.ts.map +1 -0
  64. package/dist/templates/skills/knowledgine-recall/references.js +207 -0
  65. package/dist/templates/skills/knowledgine-recall/references.js.map +1 -0
  66. package/dist/templates/skills/knowledgine-recall/skill-md.d.ts +2 -0
  67. package/dist/templates/skills/knowledgine-recall/skill-md.d.ts.map +1 -0
  68. package/dist/templates/skills/knowledgine-recall/skill-md.js +86 -0
  69. package/dist/templates/skills/knowledgine-recall/skill-md.js.map +1 -0
  70. package/dist/templates/skills/knowledgine-suggest/references.d.ts +2 -0
  71. package/dist/templates/skills/knowledgine-suggest/references.d.ts.map +1 -0
  72. package/dist/templates/skills/knowledgine-suggest/references.js +121 -0
  73. package/dist/templates/skills/knowledgine-suggest/references.js.map +1 -0
  74. package/dist/templates/skills/knowledgine-suggest/skill-md.d.ts +2 -0
  75. package/dist/templates/skills/knowledgine-suggest/skill-md.d.ts.map +1 -0
  76. package/dist/templates/skills/knowledgine-suggest/skill-md.js +94 -0
  77. package/dist/templates/skills/knowledgine-suggest/skill-md.js.map +1 -0
  78. package/package.json +4 -4
@@ -0,0 +1,207 @@
1
+ export const REFERENCES = {
2
+ "search-strategy.md": `# Search Strategy
3
+
4
+ How to choose the right search mode and build an effective recall workflow.
5
+
6
+ ---
7
+
8
+ ## Mode Selection
9
+
10
+ ### Keyword Mode
11
+
12
+ Uses SQLite FTS5 full-text search. Matches documents containing the exact words.
13
+
14
+ **Best for**:
15
+ - Exact error messages (e.g., \`"SQLITE_ERROR: no such module: vec0"\`)
16
+ - Function or variable names (e.g., \`"capture_knowledge"\`, \`"KnowledgeRepository"\`)
17
+ - File paths (e.g., \`"packages/core/src"\`)
18
+ - Version strings or identifiers
19
+
20
+ **Limitations**:
21
+ - Does not match synonyms ("fix" will not match "resolve")
22
+ - Case-insensitive but word-boundary sensitive
23
+ - Phrase order matters in multi-word queries
24
+
25
+ **Example**:
26
+ \`\`\`
27
+ search_knowledge(query: "ENOENT no such file or directory", mode: "keyword")
28
+ \`\`\`
29
+
30
+ ### Semantic Mode
31
+
32
+ Uses vector embeddings to match by meaning. Finds related content even without shared words.
33
+
34
+ **Best for**:
35
+ - Conceptual queries (e.g., "how to handle authentication errors")
36
+ - When you know what you want but not the exact terms
37
+ - Exploring a topic without a specific error message
38
+ - Cross-language or paraphrase matching
39
+
40
+ **Requirements**:
41
+ - Knowledge base must have been initialized with \`--semantic\` flag
42
+ - Falls back to keyword if embeddings are unavailable
43
+
44
+ **Example**:
45
+ \`\`\`
46
+ search_knowledge(query: "user authentication token expiry", mode: "semantic")
47
+ \`\`\`
48
+
49
+ ### Hybrid Mode
50
+
51
+ Combines keyword and semantic scores. Returns the best of both modes.
52
+
53
+ **Best for**:
54
+ - Most general-purpose searches
55
+ - When you are unsure which mode is better
56
+ - Complex queries mixing exact terms and concepts
57
+
58
+ **Example**:
59
+ \`\`\`
60
+ search_knowledge(query: "TypeScript null safety database repository", mode: "hybrid")
61
+ \`\`\`
62
+
63
+ ---
64
+
65
+ ## Workflow Patterns
66
+
67
+ ### Pattern 1: Error-first Search
68
+
69
+ When encountering an error:
70
+
71
+ 1. Copy the exact error message
72
+ 2. Run keyword search with the error message
73
+ 3. If no results, extract the key noun from the error and try again
74
+ 4. If still no results, try semantic search with the symptom description
75
+
76
+ \`\`\`
77
+ Error: "Cannot find module '@knowledgine/core'"
78
+ → keyword: "Cannot find module @knowledgine/core"
79
+ → keyword: "module resolution"
80
+ → semantic: "TypeScript module not found build error"
81
+ \`\`\`
82
+
83
+ ### Pattern 2: Context Discovery
84
+
85
+ When starting work on an unfamiliar area:
86
+
87
+ 1. Search by file path: \`keyword: "src/commands/setup.ts"\`
88
+ 2. Search by component name: \`keyword: "setupCommand"\`
89
+ 3. Search by topic: \`semantic: "MCP configuration setup"\`
90
+
91
+ ### Pattern 3: Decision Lookup
92
+
93
+ Before making an architectural choice:
94
+
95
+ 1. Search for past decisions: \`keyword: "design-decision <topic>"\`
96
+ 2. Search for related patterns: \`semantic: "<concept> pattern implementation"\`
97
+ 3. Check entity connections: use \`get_entity_graph\` for related components
98
+
99
+ ---
100
+
101
+ ## Result Interpretation
102
+
103
+ | Score | Meaning |
104
+ |-------|---------|
105
+ | > 0.9 | Very strong match — highly likely relevant |
106
+ | 0.7–0.9 | Good match — review for applicability |
107
+ | 0.5–0.7 | Weak match — may or may not be relevant |
108
+ | < 0.5 | Marginal — usually skip unless no better results |
109
+
110
+ For keyword mode, results are ranked by BM25 relevance score (FTS5).
111
+ For semantic mode, results are ranked by cosine similarity of embeddings.
112
+ `,
113
+ "query-tips.md": `# Query Tips
114
+
115
+ How to formulate effective search queries for different situations.
116
+
117
+ ---
118
+
119
+ ## General Principles
120
+
121
+ 1. **Specificity wins** — Specific queries outperform vague ones
122
+ - Bad: \`"error"\`
123
+ - Good: \`"TypeError cannot read properties of undefined"\`
124
+
125
+ 2. **Use nouns and identifiers** — Verbs and adjectives add noise
126
+ - Bad: \`"how to fix the broken thing when null"\`
127
+ - Good: \`"null check repository getById"\`
128
+
129
+ 3. **Error messages are gold** — Paste them verbatim for keyword mode
130
+
131
+ 4. **Concepts use natural language** — For semantic mode, describe the situation
132
+ - \`"what approach did we use for caching database results"\`
133
+
134
+ ---
135
+
136
+ ## Query Templates by Situation
137
+
138
+ ### Error Message
139
+ \`\`\`
140
+ // Paste the exact error message
141
+ keyword: "<exact error text>"
142
+
143
+ // If too long, use the unique part
144
+ keyword: "SQLITE_CONSTRAINT UNIQUE"
145
+ \`\`\`
146
+
147
+ ### File or Component
148
+ \`\`\`
149
+ keyword: "<filename without extension>"
150
+ keyword: "<ClassName> OR <functionName>"
151
+ \`\`\`
152
+
153
+ ### Design Topic
154
+ \`\`\`
155
+ semantic: "<component> architecture decision"
156
+ keyword: "design-decision <topic>"
157
+ \`\`\`
158
+
159
+ ### Past Problem
160
+ \`\`\`
161
+ semantic: "<symptom description in plain language>"
162
+ hybrid: "<technology> <problem noun>"
163
+ \`\`\`
164
+
165
+ ### Pattern Search
166
+ \`\`\`
167
+ keyword: "pattern <concept>"
168
+ semantic: "reusable pattern for <problem type>"
169
+ \`\`\`
170
+
171
+ ---
172
+
173
+ ## When First Query Returns Nothing
174
+
175
+ Try these fallback strategies in order:
176
+
177
+ 1. **Broaden the query** — Remove specific identifiers, keep nouns
178
+ - \`"SQLITE_ERROR: table notes has no column 'embedding'"\`
179
+ - → \`"sqlite migration column"\`
180
+
181
+ 2. **Switch modes** — If keyword failed, try semantic and vice versa
182
+
183
+ 3. **Synonym query** — Use related terms
184
+ - \`"authentication"\` → \`"auth session token login"\`
185
+
186
+ 4. **Tag-based query** — Search by tag category
187
+ - \`"bug-fix typescript"\`
188
+ - \`"design-decision database"\`
189
+
190
+ 5. **Accept no results** — Not every problem has been captured before.
191
+ After solving it, use knowledgine-capture to record the solution.
192
+
193
+ ---
194
+
195
+ ## Limit Guidance
196
+
197
+ | Situation | Recommended limit |
198
+ |-----------|-------------------|
199
+ | Quick lookup (known topic) | 3–5 |
200
+ | General exploration | 10 (default) |
201
+ | Building full context | 15–20 |
202
+ | Finding rare entries | 20+ |
203
+
204
+ Higher limits slow down search marginally; prefer lower limits when query is precise.
205
+ `,
206
+ };
207
+ //# sourceMappingURL=references.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-recall/references.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GvB;IAEC,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FlB;CACA,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SKILL_MD = "---\nname: knowledgine-recall\ndescription: >\n Search the local knowledge base for past solutions, design decisions, and patterns\n before starting work. Invoke when facing an error or exception, when approaching an\n unfamiliar area of the codebase, or when considering implementation approaches.\n Prevents re-solving already-solved problems and surfaces relevant context proactively.\n---\n# knowledgine-recall\n\n## Purpose\n\nSearch accumulated project knowledge before solving problems from scratch. The knowledge\nbase contains past bug fixes, design decisions, troubleshooting records, and patterns\ngathered across all previous sessions. Searching first avoids duplicate work and surfaces\nwarnings about known pitfalls.\n\n## When to Use\n\n- **Error or exception encountered** \u2014 Search for the exact error message or key terms\n- **Unfamiliar code area** \u2014 Search for context about the component or module\n- **Implementation choice** \u2014 Search for past decisions on the same topic\n- **Considering a library or approach** \u2014 Search for known gotchas or prior art\n- **Starting work on a file** \u2014 Search for related notes about that file path\n\n## When NOT to Use\n\n- Purely mechanical tasks with no ambiguity (renaming a variable, formatting)\n- When you have already searched and found no relevant results within this session\n- Do not call recall on every single action \u2014 use judgment\n\n## How to Search (MCP Tool)\n\nUse the `search_knowledge` MCP tool:\n\n```\nsearch_knowledge(\n query: string, // Search query \u2014 see query tips below\n mode: \"keyword\" // \"keyword\" | \"semantic\" | \"hybrid\"\n | \"semantic\" // keyword: exact text match (fast, precise)\n | \"hybrid\", // semantic: meaning-based (requires embeddings)\n // hybrid: combines both (best results)\n limit?: number // Max results (default 10)\n)\n```\n\n## How to Search (CLI Alternative)\n\n```bash\nknowledgine recall \"<query>\" # keyword search\nknowledgine recall \"<query>\" --mode semantic # semantic search\nknowledgine recall \"<query>\" --mode hybrid # hybrid search\n```\n\n## Choosing Search Mode\n\n| Situation | Mode |\n|-----------|------|\n| You have an exact error message | `keyword` |\n| You remember specific function or variable names | `keyword` |\n| You know the concept but not the exact wording | `semantic` |\n| General exploration of a topic | `hybrid` |\n| Embeddings not available (FTS5-only setup) | `keyword` (only option) |\n\n## Step-by-Step Instructions\n\n1. **Identify the query** \u2014 Extract the key terms from the problem (see search-strategy.md)\n2. **Choose mode** \u2014 keyword for precise terms, semantic or hybrid for concepts\n3. **Call search_knowledge** \u2014 Pass query, mode, limit (5\u201310 is usually sufficient)\n4. **Evaluate results** \u2014 Read the returned notes for relevance\n5. **Apply findings** \u2014 Use relevant past solutions or decisions to inform your work\n6. **Capture if new** \u2014 If you discover a new solution, use knowledgine-capture to save it\n\n## Best Practices\n\n- Search before proposing a solution, not after\n- Use the actual error message text as a query \u2014 it is the most targeted search\n- Try multiple queries if the first returns no results\n- Combine recall + suggest at session start for comprehensive context\n\n## Reference Files\n\n- See `search-strategy.md` for when to use keyword vs semantic vs hybrid\n- See `query-tips.md` for how to formulate effective queries\n";
2
+ //# sourceMappingURL=skill-md.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-md.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-recall/skill-md.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,kiHAoFpB,CAAC"}
@@ -0,0 +1,86 @@
1
+ export const SKILL_MD = `---
2
+ name: knowledgine-recall
3
+ description: >
4
+ Search the local knowledge base for past solutions, design decisions, and patterns
5
+ before starting work. Invoke when facing an error or exception, when approaching an
6
+ unfamiliar area of the codebase, or when considering implementation approaches.
7
+ Prevents re-solving already-solved problems and surfaces relevant context proactively.
8
+ ---
9
+ # knowledgine-recall
10
+
11
+ ## Purpose
12
+
13
+ Search accumulated project knowledge before solving problems from scratch. The knowledge
14
+ base contains past bug fixes, design decisions, troubleshooting records, and patterns
15
+ gathered across all previous sessions. Searching first avoids duplicate work and surfaces
16
+ warnings about known pitfalls.
17
+
18
+ ## When to Use
19
+
20
+ - **Error or exception encountered** — Search for the exact error message or key terms
21
+ - **Unfamiliar code area** — Search for context about the component or module
22
+ - **Implementation choice** — Search for past decisions on the same topic
23
+ - **Considering a library or approach** — Search for known gotchas or prior art
24
+ - **Starting work on a file** — Search for related notes about that file path
25
+
26
+ ## When NOT to Use
27
+
28
+ - Purely mechanical tasks with no ambiguity (renaming a variable, formatting)
29
+ - When you have already searched and found no relevant results within this session
30
+ - Do not call recall on every single action — use judgment
31
+
32
+ ## How to Search (MCP Tool)
33
+
34
+ Use the \`search_knowledge\` MCP tool:
35
+
36
+ \`\`\`
37
+ search_knowledge(
38
+ query: string, // Search query — see query tips below
39
+ mode: "keyword" // "keyword" | "semantic" | "hybrid"
40
+ | "semantic" // keyword: exact text match (fast, precise)
41
+ | "hybrid", // semantic: meaning-based (requires embeddings)
42
+ // hybrid: combines both (best results)
43
+ limit?: number // Max results (default 10)
44
+ )
45
+ \`\`\`
46
+
47
+ ## How to Search (CLI Alternative)
48
+
49
+ \`\`\`bash
50
+ knowledgine recall "<query>" # keyword search
51
+ knowledgine recall "<query>" --mode semantic # semantic search
52
+ knowledgine recall "<query>" --mode hybrid # hybrid search
53
+ \`\`\`
54
+
55
+ ## Choosing Search Mode
56
+
57
+ | Situation | Mode |
58
+ |-----------|------|
59
+ | You have an exact error message | \`keyword\` |
60
+ | You remember specific function or variable names | \`keyword\` |
61
+ | You know the concept but not the exact wording | \`semantic\` |
62
+ | General exploration of a topic | \`hybrid\` |
63
+ | Embeddings not available (FTS5-only setup) | \`keyword\` (only option) |
64
+
65
+ ## Step-by-Step Instructions
66
+
67
+ 1. **Identify the query** — Extract the key terms from the problem (see search-strategy.md)
68
+ 2. **Choose mode** — keyword for precise terms, semantic or hybrid for concepts
69
+ 3. **Call search_knowledge** — Pass query, mode, limit (5–10 is usually sufficient)
70
+ 4. **Evaluate results** — Read the returned notes for relevance
71
+ 5. **Apply findings** — Use relevant past solutions or decisions to inform your work
72
+ 6. **Capture if new** — If you discover a new solution, use knowledgine-capture to save it
73
+
74
+ ## Best Practices
75
+
76
+ - Search before proposing a solution, not after
77
+ - Use the actual error message text as a query — it is the most targeted search
78
+ - Try multiple queries if the first returns no results
79
+ - Combine recall + suggest at session start for comprehensive context
80
+
81
+ ## Reference Files
82
+
83
+ - See \`search-strategy.md\` for when to use keyword vs semantic vs hybrid
84
+ - See \`query-tips.md\` for how to formulate effective queries
85
+ `;
86
+ //# sourceMappingURL=skill-md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-md.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-recall/skill-md.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const REFERENCES: Record<string, string>;
2
+ //# sourceMappingURL=references.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-suggest/references.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuH7C,CAAC"}
@@ -0,0 +1,121 @@
1
+ export const REFERENCES = {
2
+ "context-patterns.md": `# Context Patterns
3
+
4
+ How to extract effective context signals from your current work to generate meaningful
5
+ knowledge suggestions.
6
+
7
+ ---
8
+
9
+ ## Context Signal Types
10
+
11
+ ### 1. File Path Context
12
+
13
+ The file path is often the most precise context signal. It encodes module, feature area,
14
+ and component type simultaneously.
15
+
16
+ **How to use**:
17
+ - Pass the file path to \`find_related(filePath: "<path>")\` directly
18
+ - Extract path segments for search queries
19
+
20
+ **Examples**:
21
+ | File Path | Extracted Query |
22
+ |-----------|-----------------|
23
+ | \`src/commands/setup.ts\` | \`"setup command configuration"\` |
24
+ | \`packages/core/src/config/config-loader.ts\` | \`"config loader configuration"\` |
25
+ | \`packages/ingest/src/plugins/github.ts\` | \`"github ingest plugin"\` |
26
+
27
+ ### 2. Task Description Context
28
+
29
+ Transform the task description into a knowledge query by extracting nouns and
30
+ technical terms.
31
+
32
+ **Pattern**:
33
+ \`\`\`
34
+ Task: "Add support for TOML config files in the setup command"
35
+ Query: "TOML configuration setup"
36
+ Query: "config file format"
37
+ \`\`\`
38
+
39
+ **Pattern**:
40
+ \`\`\`
41
+ Task: "Fix the entity extraction pipeline to handle empty documents"
42
+ Query: "entity extraction empty document"
43
+ Query: "edge case null handling entity"
44
+ \`\`\`
45
+
46
+ ### 3. Error Message Context
47
+
48
+ When starting work to fix a specific error, use the error as the primary signal.
49
+
50
+ **Pattern**:
51
+ \`\`\`
52
+ Error: "SQLITE_ERROR: table entities has no column 'confidence'"
53
+ Query keyword: "SQLITE_ERROR entities column"
54
+ Query keyword: "migration entities table"
55
+ \`\`\`
56
+
57
+ ### 4. Feature Area Context
58
+
59
+ When working on a broad feature, search for the feature domain.
60
+
61
+ **Examples**:
62
+ | Feature Area | Context Query |
63
+ |-------------|---------------|
64
+ | Authentication | \`"authentication session token"\` |
65
+ | Search | \`"search_knowledge FTS5 semantic"\` |
66
+ | Ingest pipeline | \`"ingest plugin markdown"\` |
67
+ | MCP server | \`"MCP server start file watcher"\` |
68
+
69
+ ---
70
+
71
+ ## Multi-Signal Queries
72
+
73
+ Combine 2–3 signals for more targeted results:
74
+
75
+ \`\`\`
76
+ // File + task
77
+ query: "config-loader TOML parsing"
78
+
79
+ // Component + problem type
80
+ query: "KnowledgeRepository null safety"
81
+
82
+ // Technology + pattern
83
+ query: "sqlite migration schema change"
84
+ \`\`\`
85
+
86
+ ---
87
+
88
+ ## Using find_related for Graph Traversal
89
+
90
+ After finding an initial relevant note, use \`find_related\` to discover connected notes:
91
+
92
+ \`\`\`
93
+ // Found note ID "abc123" about config loading
94
+ find_related(noteId: "abc123", limit: 10, maxHops: 2)
95
+
96
+ // Or search by the current file path directly
97
+ find_related(filePath: "packages/core/src/config/config-loader.ts", limit: 10)
98
+ \`\`\`
99
+
100
+ **maxHops guidance**:
101
+ | maxHops | Effect |
102
+ |---------|--------|
103
+ | 1 | Direct references only — fast, focused |
104
+ | 2 | One degree of separation — good default |
105
+ | 3 | Broader graph — use for open-ended exploration |
106
+
107
+ ---
108
+
109
+ ## Suggest vs Recall Decision Guide
110
+
111
+ | Situation | Use |
112
+ |-----------|-----|
113
+ | You have a specific error message | knowledgine-recall |
114
+ | You know exactly what to search for | knowledgine-recall |
115
+ | You are starting work, unsure what is relevant | knowledgine-suggest |
116
+ | You want to discover what you don't know | knowledgine-suggest |
117
+ | You have a file path but no specific query | knowledgine-suggest |
118
+ | You want both targeted + exploratory | suggest first, then recall |
119
+ `,
120
+ };
121
+ //# sourceMappingURL=references.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-suggest/references.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqHxB;CACA,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const SKILL_MD = "---\nname: knowledgine-suggest\ndescription: >\n Get contextual knowledge suggestions based on the current work context \u2014 the file\n being edited, the task being performed, or the error being investigated. Invoke at\n the start of a work session, when opening a new file, or when beginning a feature.\n Surfaces relevant past knowledge proactively without requiring a specific query.\n---\n# knowledgine-suggest\n\n## Purpose\n\nSurface relevant knowledge from the knowledge base based on contextual signals extracted\nfrom the current work, rather than a specific search query. Suggest combines search and\ngraph traversal to bring forward knowledge you might not know to search for.\n\n## When to Use\n\n- **Starting a session** \u2014 Get context about the area you will work in\n- **Opening a new file** \u2014 Discover past knowledge about that component\n- **Beginning a feature** \u2014 Find related patterns and past decisions\n- **Before making changes** \u2014 Check for warnings or prior art on the topic\n- **Exploring an unfamiliar module** \u2014 Find related entities and notes\n\n## When NOT to Use\n\n- When you already have a specific query in mind (use knowledgine-recall instead)\n- When working on trivial mechanical tasks with no design ambiguity\n- After already calling suggest for the same file in the same session\n\n## How to Get Suggestions (MCP Tools)\n\n### Step 1: Search by context\n\n```\nsearch_knowledge(\n query: string, // Derived from file path, task description, or component name\n mode: \"hybrid\", // Hybrid gives best results for context-based queries\n limit: 10\n)\n```\n\n### Step 2: Find related notes (if you have a note ID or file path)\n\n```\nfind_related(\n noteId?: string, // ID of a relevant note found in step 1\n filePath?: string, // Current file path being worked on\n limit?: number, // Max results (default 10)\n maxHops?: number // Graph traversal depth (default 2)\n)\n```\n\n## How to Get Suggestions (CLI Alternative)\n\n```bash\nknowledgine suggest \"<context description>\"\nknowledgine suggest --file src/commands/setup.ts\n```\n\n## Extracting Context\n\nThe quality of suggestions depends on the context you provide. Extract signals from:\n\n| Signal | Example |\n|--------|---------|\n| Current file path | `src/commands/setup.ts` |\n| Component or class name | `SetupCommand`, `KnowledgeRepository` |\n| Task description | `\"add TOML config support to setup command\"` |\n| Feature area | `\"MCP configuration\", \"entity extraction\"` |\n| Error message | `\"TypeError: Cannot set properties of undefined\"` |\n\n## Step-by-Step Instructions\n\n1. **Extract context signals** from the current task (see context-patterns.md)\n2. **Build a query** \u2014 Combine the most specific signals into a search query\n3. **Call search_knowledge** with mode: \"hybrid\" and the derived query\n4. **Review results** \u2014 Read the top 3\u20135 most relevant notes\n5. **Traverse related notes** \u2014 Call find_related with a relevant noteId or the current filePath\n6. **Summarize findings** \u2014 Note any relevant warnings, patterns, or decisions found\n7. **Proceed informed** \u2014 Use the discovered context to guide your implementation\n\n## Best Practices\n\n- Run suggest once at session start for the primary area of work\n- Combine with knowledgine-recall for targeted queries as specific issues arise\n- Prioritize notes tagged with `bug-fix` or `troubleshooting` \u2014 they contain warnings\n- Notes tagged `design-decision` are especially valuable before making changes\n\n## Reference Files\n\n- See `context-patterns.md` for how to extract effective context from your current work\n";
2
+ //# sourceMappingURL=skill-md.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-md.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-suggest/skill-md.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,onHA4FpB,CAAC"}
@@ -0,0 +1,94 @@
1
+ export const SKILL_MD = `---
2
+ name: knowledgine-suggest
3
+ description: >
4
+ Get contextual knowledge suggestions based on the current work context — the file
5
+ being edited, the task being performed, or the error being investigated. Invoke at
6
+ the start of a work session, when opening a new file, or when beginning a feature.
7
+ Surfaces relevant past knowledge proactively without requiring a specific query.
8
+ ---
9
+ # knowledgine-suggest
10
+
11
+ ## Purpose
12
+
13
+ Surface relevant knowledge from the knowledge base based on contextual signals extracted
14
+ from the current work, rather than a specific search query. Suggest combines search and
15
+ graph traversal to bring forward knowledge you might not know to search for.
16
+
17
+ ## When to Use
18
+
19
+ - **Starting a session** — Get context about the area you will work in
20
+ - **Opening a new file** — Discover past knowledge about that component
21
+ - **Beginning a feature** — Find related patterns and past decisions
22
+ - **Before making changes** — Check for warnings or prior art on the topic
23
+ - **Exploring an unfamiliar module** — Find related entities and notes
24
+
25
+ ## When NOT to Use
26
+
27
+ - When you already have a specific query in mind (use knowledgine-recall instead)
28
+ - When working on trivial mechanical tasks with no design ambiguity
29
+ - After already calling suggest for the same file in the same session
30
+
31
+ ## How to Get Suggestions (MCP Tools)
32
+
33
+ ### Step 1: Search by context
34
+
35
+ \`\`\`
36
+ search_knowledge(
37
+ query: string, // Derived from file path, task description, or component name
38
+ mode: "hybrid", // Hybrid gives best results for context-based queries
39
+ limit: 10
40
+ )
41
+ \`\`\`
42
+
43
+ ### Step 2: Find related notes (if you have a note ID or file path)
44
+
45
+ \`\`\`
46
+ find_related(
47
+ noteId?: string, // ID of a relevant note found in step 1
48
+ filePath?: string, // Current file path being worked on
49
+ limit?: number, // Max results (default 10)
50
+ maxHops?: number // Graph traversal depth (default 2)
51
+ )
52
+ \`\`\`
53
+
54
+ ## How to Get Suggestions (CLI Alternative)
55
+
56
+ \`\`\`bash
57
+ knowledgine suggest "<context description>"
58
+ knowledgine suggest --file src/commands/setup.ts
59
+ \`\`\`
60
+
61
+ ## Extracting Context
62
+
63
+ The quality of suggestions depends on the context you provide. Extract signals from:
64
+
65
+ | Signal | Example |
66
+ |--------|---------|
67
+ | Current file path | \`src/commands/setup.ts\` |
68
+ | Component or class name | \`SetupCommand\`, \`KnowledgeRepository\` |
69
+ | Task description | \`"add TOML config support to setup command"\` |
70
+ | Feature area | \`"MCP configuration", "entity extraction"\` |
71
+ | Error message | \`"TypeError: Cannot set properties of undefined"\` |
72
+
73
+ ## Step-by-Step Instructions
74
+
75
+ 1. **Extract context signals** from the current task (see context-patterns.md)
76
+ 2. **Build a query** — Combine the most specific signals into a search query
77
+ 3. **Call search_knowledge** with mode: "hybrid" and the derived query
78
+ 4. **Review results** — Read the top 3–5 most relevant notes
79
+ 5. **Traverse related notes** — Call find_related with a relevant noteId or the current filePath
80
+ 6. **Summarize findings** — Note any relevant warnings, patterns, or decisions found
81
+ 7. **Proceed informed** — Use the discovered context to guide your implementation
82
+
83
+ ## Best Practices
84
+
85
+ - Run suggest once at session start for the primary area of work
86
+ - Combine with knowledgine-recall for targeted queries as specific issues arise
87
+ - Prioritize notes tagged with \`bug-fix\` or \`troubleshooting\` — they contain warnings
88
+ - Notes tagged \`design-decision\` are especially valuable before making changes
89
+
90
+ ## Reference Files
91
+
92
+ - See \`context-patterns.md\` for how to extract effective context from your current work
93
+ `;
94
+ //# sourceMappingURL=skill-md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-md.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-suggest/skill-md.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledgine/cli",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -25,9 +25,9 @@
25
25
  "log-symbols": "^7.0.1",
26
26
  "ora": "^9.3.0",
27
27
  "smol-toml": "^1.6.1",
28
- "@knowledgine/core": "0.6.1",
29
- "@knowledgine/mcp-server": "0.6.1",
30
- "@knowledgine/ingest": "0.6.1"
28
+ "@knowledgine/core": "0.6.3",
29
+ "@knowledgine/mcp-server": "0.6.3",
30
+ "@knowledgine/ingest": "0.6.3"
31
31
  },
32
32
  "files": [
33
33
  "dist",