@knowledgine/cli 0.2.1 → 0.3.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/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +11 -15
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/deprecation-check.d.ts +7 -0
- package/dist/commands/deprecation-check.d.ts.map +1 -0
- package/dist/commands/deprecation-check.js +75 -0
- package/dist/commands/deprecation-check.js.map +1 -0
- package/dist/commands/explain.d.ts +10 -0
- package/dist/commands/explain.d.ts.map +1 -0
- package/dist/commands/explain.js +252 -0
- package/dist/commands/explain.js.map +1 -0
- package/dist/commands/feedback-suggest.d.ts +8 -0
- package/dist/commands/feedback-suggest.d.ts.map +1 -0
- package/dist/commands/feedback-suggest.js +43 -0
- package/dist/commands/feedback-suggest.js.map +1 -0
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +1 -6
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +15 -2
- package/dist/commands/ingest.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +42 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +1 -1
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/recall.d.ts +10 -0
- package/dist/commands/recall.d.ts.map +1 -0
- package/dist/commands/recall.js +199 -0
- package/dist/commands/recall.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +22 -3
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/serve.d.ts +8 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +60 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/setup-rules.d.ts +27 -0
- package/dist/commands/setup-rules.d.ts.map +1 -0
- package/dist/commands/setup-rules.js +309 -0
- package/dist/commands/setup-rules.js.map +1 -0
- package/dist/commands/setup-skills.d.ts +55 -0
- package/dist/commands/setup-skills.d.ts.map +1 -0
- package/dist/commands/setup-skills.js +356 -0
- package/dist/commands/setup-skills.js.map +1 -0
- package/dist/commands/setup.d.ts +14 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +103 -13
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/suggest.d.ts +11 -0
- package/dist/commands/suggest.d.ts.map +1 -0
- package/dist/commands/suggest.js +255 -0
- package/dist/commands/suggest.js.map +1 -0
- package/dist/commands/undeprecate.d.ts +5 -0
- package/dist/commands/undeprecate.d.ts.map +1 -0
- package/dist/commands/undeprecate.js +27 -0
- package/dist/commands/undeprecate.js.map +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/index.js +44 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/content-extractor.d.ts +8 -0
- package/dist/lib/content-extractor.d.ts.map +1 -0
- package/dist/lib/content-extractor.js +50 -0
- package/dist/lib/content-extractor.js.map +1 -0
- package/dist/lib/diff-parser.d.ts +14 -0
- package/dist/lib/diff-parser.d.ts.map +1 -0
- package/dist/lib/diff-parser.js +108 -0
- package/dist/lib/diff-parser.js.map +1 -0
- package/dist/lib/entity-extractor.d.ts +2 -0
- package/dist/lib/entity-extractor.d.ts.map +1 -1
- package/dist/lib/entity-extractor.js +13 -76
- package/dist/lib/entity-extractor.js.map +1 -1
- package/dist/lib/formatter.d.ts.map +1 -1
- package/dist/lib/formatter.js +1 -5
- package/dist/lib/formatter.js.map +1 -1
- package/dist/lib/ingest-watcher.d.ts.map +1 -1
- package/dist/lib/ingest-watcher.js +1 -0
- package/dist/lib/ingest-watcher.js.map +1 -1
- package/dist/lib/plugin-loader.d.ts.map +1 -1
- package/dist/lib/plugin-loader.js +3 -1
- package/dist/lib/plugin-loader.js.map +1 -1
- package/dist/lib/progress.d.ts +2 -0
- package/dist/lib/progress.d.ts.map +1 -1
- package/dist/lib/progress.js +4 -2
- package/dist/lib/progress.js.map +1 -1
- package/dist/lib/ui/box.d.ts.map +1 -1
- package/dist/lib/ui/box.js.map +1 -1
- package/dist/lib/ui/error-formatter.d.ts.map +1 -1
- package/dist/lib/ui/error-formatter.js +1 -3
- package/dist/lib/ui/error-formatter.js.map +1 -1
- package/dist/lib/ui/table.js +1 -1
- package/dist/lib/ui/table.js.map +1 -1
- package/dist/templates/rules/antigravity.d.ts +6 -0
- package/dist/templates/rules/antigravity.d.ts.map +1 -0
- package/dist/templates/rules/antigravity.js +30 -0
- package/dist/templates/rules/antigravity.js.map +1 -0
- package/dist/templates/rules/claude-code.d.ts +6 -0
- package/dist/templates/rules/claude-code.d.ts.map +1 -0
- package/dist/templates/rules/claude-code.js +32 -0
- package/dist/templates/rules/claude-code.js.map +1 -0
- package/dist/templates/rules/cline.d.ts +6 -0
- package/dist/templates/rules/cline.d.ts.map +1 -0
- package/dist/templates/rules/cline.js +35 -0
- package/dist/templates/rules/cline.js.map +1 -0
- package/dist/templates/rules/codex.d.ts +6 -0
- package/dist/templates/rules/codex.d.ts.map +1 -0
- package/dist/templates/rules/codex.js +37 -0
- package/dist/templates/rules/codex.js.map +1 -0
- package/dist/templates/rules/continue.d.ts +6 -0
- package/dist/templates/rules/continue.d.ts.map +1 -0
- package/dist/templates/rules/continue.js +31 -0
- package/dist/templates/rules/continue.js.map +1 -0
- package/dist/templates/rules/core-rules.d.ts +6 -0
- package/dist/templates/rules/core-rules.d.ts.map +1 -0
- package/dist/templates/rules/core-rules.js +33 -0
- package/dist/templates/rules/core-rules.js.map +1 -0
- package/dist/templates/rules/cursor.d.ts +6 -0
- package/dist/templates/rules/cursor.d.ts.map +1 -0
- package/dist/templates/rules/cursor.js +29 -0
- package/dist/templates/rules/cursor.js.map +1 -0
- package/dist/templates/rules/gemini.d.ts +6 -0
- package/dist/templates/rules/gemini.d.ts.map +1 -0
- package/dist/templates/rules/gemini.js +30 -0
- package/dist/templates/rules/gemini.js.map +1 -0
- package/dist/templates/rules/github-copilot.d.ts +6 -0
- package/dist/templates/rules/github-copilot.d.ts.map +1 -0
- package/dist/templates/rules/github-copilot.js +42 -0
- package/dist/templates/rules/github-copilot.js.map +1 -0
- package/dist/templates/rules/index.d.ts +13 -0
- package/dist/templates/rules/index.d.ts.map +1 -0
- package/dist/templates/rules/index.js +13 -0
- package/dist/templates/rules/index.js.map +1 -0
- package/dist/templates/rules/opencode.d.ts +6 -0
- package/dist/templates/rules/opencode.d.ts.map +1 -0
- package/dist/templates/rules/opencode.js +30 -0
- package/dist/templates/rules/opencode.js.map +1 -0
- package/dist/templates/rules/windsurf.d.ts +6 -0
- package/dist/templates/rules/windsurf.d.ts.map +1 -0
- package/dist/templates/rules/windsurf.js +24 -0
- package/dist/templates/rules/windsurf.js.map +1 -0
- package/dist/templates/rules/zed.d.ts +6 -0
- package/dist/templates/rules/zed.d.ts.map +1 -0
- package/dist/templates/rules/zed.js +34 -0
- package/dist/templates/rules/zed.js.map +1 -0
- package/dist/templates/skills/index.d.ts +26 -0
- package/dist/templates/skills/index.d.ts.map +1 -0
- package/dist/templates/skills/index.js +75 -0
- package/dist/templates/skills/index.js.map +1 -0
- package/dist/templates/skills/knowledgine-capture/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-capture/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-capture/references.js +414 -0
- package/dist/templates/skills/knowledgine-capture/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-capture/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-capture/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-capture/skill-md.js +97 -0
- package/dist/templates/skills/knowledgine-capture/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-debrief/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-debrief/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-debrief/references.js +140 -0
- package/dist/templates/skills/knowledgine-debrief/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-debrief/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-debrief/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-debrief/skill-md.js +74 -0
- package/dist/templates/skills/knowledgine-debrief/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-explain/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-explain/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-explain/references.js +183 -0
- package/dist/templates/skills/knowledgine-explain/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.js +89 -0
- package/dist/templates/skills/knowledgine-explain/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-feedback/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-feedback/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-feedback/references.js +214 -0
- package/dist/templates/skills/knowledgine-feedback/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-feedback/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-feedback/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-feedback/skill-md.js +107 -0
- package/dist/templates/skills/knowledgine-feedback/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-ingest/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-ingest/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-ingest/references.js +243 -0
- package/dist/templates/skills/knowledgine-ingest/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-ingest/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-ingest/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-ingest/skill-md.js +80 -0
- package/dist/templates/skills/knowledgine-ingest/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-recall/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-recall/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-recall/references.js +207 -0
- package/dist/templates/skills/knowledgine-recall/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.js +86 -0
- package/dist/templates/skills/knowledgine-recall/skill-md.js.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/references.d.ts +2 -0
- package/dist/templates/skills/knowledgine-suggest/references.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/references.js +121 -0
- package/dist/templates/skills/knowledgine-suggest/references.js.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.d.ts +2 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.d.ts.map +1 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.js +94 -0
- package/dist/templates/skills/knowledgine-suggest/skill-md.js.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const SKILL_MD = `---
|
|
2
|
+
name: knowledgine-ingest
|
|
3
|
+
description: >
|
|
4
|
+
Import knowledge from external sources into the local knowledge base. Invoke when
|
|
5
|
+
the user wants to import from Git commit history, GitHub PRs and issues, Obsidian
|
|
6
|
+
vaults, Claude or Cursor session histories, or CI/CD pipelines. Each source requires
|
|
7
|
+
a specific plugin and configuration.
|
|
8
|
+
---
|
|
9
|
+
# knowledgine-ingest
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
Populate the knowledge base from external knowledge repositories — version control
|
|
14
|
+
history, issue trackers, personal note systems, AI session logs — without manual
|
|
15
|
+
capture. Ingestion enriches the knowledge base with historical context that predates
|
|
16
|
+
the current session.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- **Onboarding to a codebase** — Ingest Git history to capture past decisions
|
|
21
|
+
- **Integrating GitHub knowledge** — Import PRs and issues for context
|
|
22
|
+
- **Importing Obsidian notes** — Bring personal or team notes into the knowledge base
|
|
23
|
+
- **Capturing AI session history** — Import Claude or Cursor session logs
|
|
24
|
+
- **Building CI knowledge** — Import CI/CD pipeline outcomes and patterns
|
|
25
|
+
- **User explicitly requests import** — "Load my notes from Obsidian"
|
|
26
|
+
|
|
27
|
+
## When NOT to Use
|
|
28
|
+
|
|
29
|
+
- When the source has already been fully ingested in this session (check cursor state)
|
|
30
|
+
- When the user has not configured the required credentials (e.g., GITHUB_TOKEN)
|
|
31
|
+
|
|
32
|
+
## How to Ingest (CLI)
|
|
33
|
+
|
|
34
|
+
\`\`\`bash
|
|
35
|
+
# Run a specific plugin
|
|
36
|
+
knowledgine ingest --source <plugin-id> --path <knowledge-base-path>
|
|
37
|
+
|
|
38
|
+
# Run all registered plugins
|
|
39
|
+
knowledgine ingest --all --path <knowledge-base-path>
|
|
40
|
+
|
|
41
|
+
# Force full re-ingest (ignore stored cursor)
|
|
42
|
+
knowledgine ingest --source <plugin-id> --full --path <knowledge-base-path>
|
|
43
|
+
|
|
44
|
+
# GitHub-specific (requires GITHUB_TOKEN env var)
|
|
45
|
+
knowledgine ingest --source github --repo owner/repo --path <path>
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
## Available Source Plugins
|
|
49
|
+
|
|
50
|
+
| Plugin ID | Source | Notes |
|
|
51
|
+
|-----------|--------|-------|
|
|
52
|
+
| \`markdown\` | Local markdown files | Default; used by \`knowledgine init\` |
|
|
53
|
+
| \`git-history\` | Git commit messages and diffs | Extracts decisions from commit history |
|
|
54
|
+
| \`github\` | GitHub PRs and issues | Requires \`GITHUB_TOKEN\` env var |
|
|
55
|
+
| \`obsidian\` | Obsidian vault notes | Reads from configured vault path |
|
|
56
|
+
| \`claude-sessions\` | Claude Code session logs | Imports past AI session context |
|
|
57
|
+
| \`cursor-sessions\` | Cursor IDE session history | Imports Cursor session context |
|
|
58
|
+
| \`cicd\` | CI/CD pipeline results | GitHub Actions, build outcomes |
|
|
59
|
+
|
|
60
|
+
## Step-by-Step Instructions
|
|
61
|
+
|
|
62
|
+
1. **Identify the source** — Which external system contains the knowledge to import?
|
|
63
|
+
2. **Check prerequisites** — Does the plugin need credentials or configuration? (see plugin-guide.md)
|
|
64
|
+
3. **Run the ingest command** — Use the appropriate plugin ID and options
|
|
65
|
+
4. **Verify results** — Run \`knowledgine status\` or search to confirm notes were imported
|
|
66
|
+
5. **Re-ingest if needed** — Use \`--full\` flag to re-process already-seen content
|
|
67
|
+
|
|
68
|
+
## Best Practices
|
|
69
|
+
|
|
70
|
+
- Run \`git-history\` ingest when starting work on a new repository
|
|
71
|
+
- Set \`GITHUB_TOKEN\` before ingesting GitHub content to avoid rate limiting
|
|
72
|
+
- Use \`--full\` flag after changing ingest configuration
|
|
73
|
+
- Check \`knowledgine plugins status\` to see the last ingest cursor for each plugin
|
|
74
|
+
|
|
75
|
+
## Reference Files
|
|
76
|
+
|
|
77
|
+
- See \`plugin-guide.md\` for detailed documentation on each plugin
|
|
78
|
+
- See \`source-types.md\` for configuration requirements for each source type
|
|
79
|
+
`;
|
|
80
|
+
//# sourceMappingURL=skill-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-md.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-ingest/skill-md.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-recall/references.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8M7C,CAAC"}
|
|
@@ -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 @@
|
|
|
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"}
|