@knowledgine/cli 0.2.0 → 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 +13 -0
- package/dist/commands/capture.d.ts.map +1 -1
- package/dist/commands/capture.js +113 -12
- package/dist/commands/capture.js.map +1 -1
- package/dist/commands/demo.d.ts.map +1 -1
- package/dist/commands/demo.js +23 -19
- package/dist/commands/demo.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 +9 -0
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +57 -21
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/ingest.d.ts +1 -0
- package/dist/commands/ingest.d.ts.map +1 -1
- package/dist/commands/ingest.js +96 -19
- 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 +126 -61
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +14 -13
- 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 +55 -13
- 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 +62 -5
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +358 -104
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +27 -20
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +81 -53
- 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/tool.d.ts.map +1 -1
- package/dist/commands/tool.js +5 -5
- package/dist/commands/tool.js.map +1 -1
- 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 +64 -18
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/index.js +92 -20
- 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 +17 -0
- package/dist/lib/entity-extractor.d.ts.map +1 -0
- package/dist/lib/entity-extractor.js +23 -0
- package/dist/lib/entity-extractor.js.map +1 -0
- package/dist/lib/formatter.d.ts.map +1 -1
- package/dist/lib/formatter.js +31 -32
- package/dist/lib/formatter.js.map +1 -1
- package/dist/lib/indexer.d.ts +2 -0
- package/dist/lib/indexer.d.ts.map +1 -1
- package/dist/lib/indexer.js +2 -0
- package/dist/lib/indexer.js.map +1 -1
- package/dist/lib/ingest-watcher.d.ts.map +1 -1
- package/dist/lib/ingest-watcher.js +2 -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 +8 -0
- package/dist/lib/progress.d.ts.map +1 -1
- package/dist/lib/progress.js +45 -6
- package/dist/lib/progress.js.map +1 -1
- package/dist/lib/ui/box.d.ts +7 -0
- package/dist/lib/ui/box.d.ts.map +1 -0
- package/dist/lib/ui/box.js +19 -0
- package/dist/lib/ui/box.js.map +1 -0
- package/dist/lib/ui/error-formatter.d.ts +8 -0
- package/dist/lib/ui/error-formatter.d.ts.map +1 -0
- package/dist/lib/ui/error-formatter.js +19 -0
- package/dist/lib/ui/error-formatter.js.map +1 -0
- package/dist/lib/ui/index.d.ts +7 -0
- package/dist/lib/ui/index.d.ts.map +1 -0
- package/dist/lib/ui/index.js +7 -0
- package/dist/lib/ui/index.js.map +1 -0
- package/dist/lib/ui/output.d.ts +2 -0
- package/dist/lib/ui/output.d.ts.map +1 -0
- package/dist/lib/ui/output.js +4 -0
- package/dist/lib/ui/output.js.map +1 -0
- package/dist/lib/ui/spinner.d.ts +4 -0
- package/dist/lib/ui/spinner.d.ts.map +1 -0
- package/dist/lib/ui/spinner.js +5 -0
- package/dist/lib/ui/spinner.js.map +1 -0
- package/dist/lib/ui/table.d.ts +9 -0
- package/dist/lib/ui/table.d.ts.map +1 -0
- package/dist/lib/ui/table.js +28 -0
- package/dist/lib/ui/table.js.map +1 -0
- package/dist/lib/ui/theme.d.ts +21 -0
- package/dist/lib/ui/theme.d.ts.map +1 -0
- package/dist/lib/ui/theme.js +29 -0
- package/dist/lib/ui/theme.js.map +1 -0
- package/dist/lib/unknown-command-handler.d.ts +14 -0
- package/dist/lib/unknown-command-handler.d.ts.map +1 -0
- package/dist/lib/unknown-command-handler.js +25 -0
- package/dist/lib/unknown-command-handler.js.map +1 -0
- package/dist/lib/url-validator.d.ts.map +1 -1
- package/dist/lib/url-validator.js +5 -1
- package/dist/lib/url-validator.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/fixtures/demo/notes/api-design-decisions.md +7 -2
- package/fixtures/demo/notes/auth-debugging.md +8 -0
- package/fixtures/demo/notes/ci-cd-pipeline.md +7 -0
- package/fixtures/demo/notes/code-review-notes.md +7 -0
- package/fixtures/demo/notes/database-optimization.md +8 -0
- package/fixtures/demo/notes/docker-troubleshooting.md +7 -1
- package/fixtures/demo/notes/react-performance.md +7 -6
- package/fixtures/demo/notes/typescript-migration.md +13 -4
- package/package.json +13 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A skill template contains the SKILL.md content and any reference files
|
|
3
|
+
* that should be written alongside it.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkillTemplate {
|
|
6
|
+
/** Content of the SKILL.md file */
|
|
7
|
+
skillMd: string;
|
|
8
|
+
/** Map of filename → content for reference files placed in a references/ subdirectory */
|
|
9
|
+
references: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* All available skill names.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SKILL_NAMES: readonly ["knowledgine-capture", "knowledgine-recall", "knowledgine-suggest", "knowledgine-explain", "knowledgine-debrief", "knowledgine-ingest", "knowledgine-feedback"];
|
|
15
|
+
export type SkillName = (typeof SKILL_NAMES)[number];
|
|
16
|
+
/**
|
|
17
|
+
* Returns the template for a single skill by name.
|
|
18
|
+
*
|
|
19
|
+
* @throws {Error} If the skill name is not recognized.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSkillTemplate(name: SkillName): SkillTemplate;
|
|
22
|
+
/**
|
|
23
|
+
* Returns all skill templates as a record keyed by skill name.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAllSkillTemplates(): Record<SkillName, SkillTemplate>;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/skills/index.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,2KAQd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAiCrD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,CAM/D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAEvE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SKILL_MD as CAPTURE_MD } from "./knowledgine-capture/skill-md.js";
|
|
2
|
+
import { REFERENCES as CAPTURE_REFS } from "./knowledgine-capture/references.js";
|
|
3
|
+
import { SKILL_MD as RECALL_MD } from "./knowledgine-recall/skill-md.js";
|
|
4
|
+
import { REFERENCES as RECALL_REFS } from "./knowledgine-recall/references.js";
|
|
5
|
+
import { SKILL_MD as SUGGEST_MD } from "./knowledgine-suggest/skill-md.js";
|
|
6
|
+
import { REFERENCES as SUGGEST_REFS } from "./knowledgine-suggest/references.js";
|
|
7
|
+
import { SKILL_MD as EXPLAIN_MD } from "./knowledgine-explain/skill-md.js";
|
|
8
|
+
import { REFERENCES as EXPLAIN_REFS } from "./knowledgine-explain/references.js";
|
|
9
|
+
import { SKILL_MD as DEBRIEF_MD } from "./knowledgine-debrief/skill-md.js";
|
|
10
|
+
import { REFERENCES as DEBRIEF_REFS } from "./knowledgine-debrief/references.js";
|
|
11
|
+
import { SKILL_MD as INGEST_MD } from "./knowledgine-ingest/skill-md.js";
|
|
12
|
+
import { REFERENCES as INGEST_REFS } from "./knowledgine-ingest/references.js";
|
|
13
|
+
import { SKILL_MD as FEEDBACK_MD } from "./knowledgine-feedback/skill-md.js";
|
|
14
|
+
import { REFERENCES as FEEDBACK_REFS } from "./knowledgine-feedback/references.js";
|
|
15
|
+
/**
|
|
16
|
+
* All available skill names.
|
|
17
|
+
*/
|
|
18
|
+
export const SKILL_NAMES = [
|
|
19
|
+
"knowledgine-capture",
|
|
20
|
+
"knowledgine-recall",
|
|
21
|
+
"knowledgine-suggest",
|
|
22
|
+
"knowledgine-explain",
|
|
23
|
+
"knowledgine-debrief",
|
|
24
|
+
"knowledgine-ingest",
|
|
25
|
+
"knowledgine-feedback",
|
|
26
|
+
];
|
|
27
|
+
const SKILL_TEMPLATES = {
|
|
28
|
+
"knowledgine-capture": {
|
|
29
|
+
skillMd: CAPTURE_MD,
|
|
30
|
+
references: CAPTURE_REFS,
|
|
31
|
+
},
|
|
32
|
+
"knowledgine-recall": {
|
|
33
|
+
skillMd: RECALL_MD,
|
|
34
|
+
references: RECALL_REFS,
|
|
35
|
+
},
|
|
36
|
+
"knowledgine-suggest": {
|
|
37
|
+
skillMd: SUGGEST_MD,
|
|
38
|
+
references: SUGGEST_REFS,
|
|
39
|
+
},
|
|
40
|
+
"knowledgine-explain": {
|
|
41
|
+
skillMd: EXPLAIN_MD,
|
|
42
|
+
references: EXPLAIN_REFS,
|
|
43
|
+
},
|
|
44
|
+
"knowledgine-debrief": {
|
|
45
|
+
skillMd: DEBRIEF_MD,
|
|
46
|
+
references: DEBRIEF_REFS,
|
|
47
|
+
},
|
|
48
|
+
"knowledgine-ingest": {
|
|
49
|
+
skillMd: INGEST_MD,
|
|
50
|
+
references: INGEST_REFS,
|
|
51
|
+
},
|
|
52
|
+
"knowledgine-feedback": {
|
|
53
|
+
skillMd: FEEDBACK_MD,
|
|
54
|
+
references: FEEDBACK_REFS,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Returns the template for a single skill by name.
|
|
59
|
+
*
|
|
60
|
+
* @throws {Error} If the skill name is not recognized.
|
|
61
|
+
*/
|
|
62
|
+
export function getSkillTemplate(name) {
|
|
63
|
+
const template = SKILL_TEMPLATES[name];
|
|
64
|
+
if (!template) {
|
|
65
|
+
throw new Error(`Unknown skill: ${name}. Available skills: ${SKILL_NAMES.join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
return template;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns all skill templates as a record keyed by skill name.
|
|
71
|
+
*/
|
|
72
|
+
export function getAllSkillTemplates() {
|
|
73
|
+
return { ...SKILL_TEMPLATES };
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/skills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAanF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,sBAAsB;CACd,CAAC;AAIX,MAAM,eAAe,GAAqC;IACxD,qBAAqB,EAAE;QACrB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,YAAY;KACzB;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,WAAW;KACxB;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,YAAY;KACzB;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,YAAY;KACzB;IACD,qBAAqB,EAAE;QACrB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,YAAY;KACzB;IACD,oBAAoB,EAAE;QACpB,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,WAAW;KACxB;IACD,sBAAsB,EAAE;QACtB,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,aAAa;KAC1B;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC9C,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,uBAAuB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,EAAE,GAAG,eAAe,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-capture/references.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8Z7C,CAAC"}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
export const REFERENCES = {
|
|
2
|
+
"capture-guide.md": `# Capture Guide
|
|
3
|
+
|
|
4
|
+
Detailed guidance for each of the six capture trigger types.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Bug Fix
|
|
9
|
+
|
|
10
|
+
**When**: You diagnosed and resolved a defect.
|
|
11
|
+
|
|
12
|
+
**What to include**:
|
|
13
|
+
- Exact error message or symptom
|
|
14
|
+
- Root cause (not just "it was broken")
|
|
15
|
+
- The fix applied
|
|
16
|
+
- How to avoid the bug in future
|
|
17
|
+
|
|
18
|
+
**Example**:
|
|
19
|
+
\`\`\`
|
|
20
|
+
Problem: "Cannot read properties of undefined (reading 'id')" at user.ts:42.
|
|
21
|
+
|
|
22
|
+
Root cause: getUser() returned undefined when the database row did not exist, but the
|
|
23
|
+
caller assumed a non-null return value.
|
|
24
|
+
|
|
25
|
+
Fix: Added null check in getUser() and updated the return type to User | undefined.
|
|
26
|
+
Updated all callers to handle the undefined case.
|
|
27
|
+
|
|
28
|
+
Prevention: Avoid non-null assertions (!). Return undefined explicitly and propagate the
|
|
29
|
+
type to callers.
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
Tags: \`bug-fix\`, \`typescript\`, \`null-safety\`
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 2. Design Decision
|
|
37
|
+
|
|
38
|
+
**When**: You chose one architectural or implementation approach over alternatives.
|
|
39
|
+
|
|
40
|
+
**What to include**:
|
|
41
|
+
- The decision made (concise summary in the title)
|
|
42
|
+
- Options that were considered
|
|
43
|
+
- The chosen approach
|
|
44
|
+
- Reasoning and trade-offs
|
|
45
|
+
- Any constraints that drove the decision
|
|
46
|
+
|
|
47
|
+
**Example**:
|
|
48
|
+
\`\`\`
|
|
49
|
+
Decision: Use Zod for runtime API response validation instead of manual type guards.
|
|
50
|
+
|
|
51
|
+
Options considered:
|
|
52
|
+
A) Manual type guards — verbose, error-prone to maintain
|
|
53
|
+
B) Zod schema validation — declarative, generates TypeScript types automatically
|
|
54
|
+
C) io-ts — functional style, steep learning curve for the team
|
|
55
|
+
|
|
56
|
+
Chosen: Zod (option B). The automatic type inference reduces duplication between
|
|
57
|
+
runtime validation and TypeScript types. Team is already familiar with Zod from
|
|
58
|
+
form validation.
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
Tags: \`design-decision\`, \`typescript\`, \`validation\`
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 3. Pattern Discovery
|
|
66
|
+
|
|
67
|
+
**When**: You identified a reusable code pattern applicable beyond the current file.
|
|
68
|
+
|
|
69
|
+
**What to include**:
|
|
70
|
+
- Pattern name (if it has one)
|
|
71
|
+
- Problem the pattern solves
|
|
72
|
+
- Template/skeleton code
|
|
73
|
+
- Where to apply it
|
|
74
|
+
- Caveats or limitations
|
|
75
|
+
|
|
76
|
+
**Example**:
|
|
77
|
+
\`\`\`
|
|
78
|
+
Pattern: Repository layer with in-memory cache for read-heavy entities.
|
|
79
|
+
|
|
80
|
+
When to use: Entity reads are >10x more frequent than writes and data fits in memory.
|
|
81
|
+
|
|
82
|
+
Template:
|
|
83
|
+
class CachedRepository<T> {
|
|
84
|
+
private cache = new Map<string, T>();
|
|
85
|
+
find(id: string): T | undefined { return this.cache.get(id); }
|
|
86
|
+
store(id: string, entity: T): void { this.cache.set(id, entity); }
|
|
87
|
+
invalidate(id: string): void { this.cache.delete(id); }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
Caveat: Cache must be invalidated on writes; not suitable for distributed deployments
|
|
91
|
+
without a shared cache layer.
|
|
92
|
+
\`\`\`
|
|
93
|
+
|
|
94
|
+
Tags: \`pattern\`, \`caching\`, \`architecture\`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 4. Troubleshooting
|
|
99
|
+
|
|
100
|
+
**When**: You worked through a multi-step diagnostic process to resolve an issue.
|
|
101
|
+
|
|
102
|
+
**What to include**:
|
|
103
|
+
- Initial symptom
|
|
104
|
+
- Hypotheses tested and results
|
|
105
|
+
- False leads (so others don't repeat them)
|
|
106
|
+
- Final diagnosis
|
|
107
|
+
- Resolution steps
|
|
108
|
+
|
|
109
|
+
**Example**:
|
|
110
|
+
\`\`\`
|
|
111
|
+
Symptom: knowledgine start fails with "SQLITE_ERROR: no such module: vec0" after
|
|
112
|
+
upgrading Node.js from 18 to 20.
|
|
113
|
+
|
|
114
|
+
Hypotheses tested:
|
|
115
|
+
- Reinstalled sqlite-vec package — no change
|
|
116
|
+
- Cleared node_modules and reinstalled — no change
|
|
117
|
+
- Downgraded back to Node 18 — resolved the issue
|
|
118
|
+
|
|
119
|
+
Diagnosis: Native module compiled for Node 18 ABI. Node 20 uses a different ABI
|
|
120
|
+
(NODE_MODULE_VERSION 115 vs 108).
|
|
121
|
+
|
|
122
|
+
Resolution: Run "npm rebuild" after upgrading Node.js to recompile native modules.
|
|
123
|
+
\`\`\`
|
|
124
|
+
|
|
125
|
+
Tags: \`troubleshooting\`, \`sqlite\`, \`native-modules\`, \`nodejs\`
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 5. External Knowledge
|
|
130
|
+
|
|
131
|
+
**When**: You applied insights from documentation, articles, blog posts, or Stack Overflow.
|
|
132
|
+
|
|
133
|
+
**What to include**:
|
|
134
|
+
- Source URL or reference
|
|
135
|
+
- Key insight extracted
|
|
136
|
+
- How you applied it to this project
|
|
137
|
+
- Any caveats specific to this codebase
|
|
138
|
+
|
|
139
|
+
**Example**:
|
|
140
|
+
\`\`\`
|
|
141
|
+
Source: https://nodejs.org/api/esm.html#esm_mandatory_file_extensions
|
|
142
|
+
|
|
143
|
+
Insight: In ESM (type: "module" in package.json), import paths MUST include the .js
|
|
144
|
+
extension even for TypeScript files. The TypeScript compiler emits .js extensions in
|
|
145
|
+
output but the source .ts files must reference .js for tsc to resolve them correctly.
|
|
146
|
+
|
|
147
|
+
Applied: Updated all internal imports in packages/cli/src to use .js extension.
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
Tags: \`external-knowledge\`, \`esm\`, \`typescript\`
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 6. Refactoring
|
|
155
|
+
|
|
156
|
+
**When**: You improved the structure or quality of existing code.
|
|
157
|
+
|
|
158
|
+
**What to include**:
|
|
159
|
+
- What was wrong before
|
|
160
|
+
- What you changed
|
|
161
|
+
- The improvement achieved (readability, performance, maintainability)
|
|
162
|
+
- Any risks or trade-offs
|
|
163
|
+
|
|
164
|
+
**Example**:
|
|
165
|
+
\`\`\`
|
|
166
|
+
Before: Single 400-line setupCommand() function with nested conditionals handling all
|
|
167
|
+
target types inline.
|
|
168
|
+
|
|
169
|
+
After: Extracted per-target config builders into a TARGET_HANDLERS map. Each handler
|
|
170
|
+
is a pure function returning McpConfig. The main command orchestrates selection and
|
|
171
|
+
writing only.
|
|
172
|
+
|
|
173
|
+
Improvement: Adding a new target now requires only adding one entry to TARGET_HANDLERS
|
|
174
|
+
rather than editing the main function. Test coverage became straightforward.
|
|
175
|
+
\`\`\`
|
|
176
|
+
|
|
177
|
+
Tags: \`refactoring\`, \`architecture\`
|
|
178
|
+
`,
|
|
179
|
+
"tag-taxonomy.md": `# Tag Taxonomy
|
|
180
|
+
|
|
181
|
+
Standard tags for knowledgine knowledge captures. Use 2–5 tags per capture.
|
|
182
|
+
Choose the most specific applicable tags; avoid generic tags like "code" or "misc".
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Primary Category Tags (choose one)
|
|
187
|
+
|
|
188
|
+
| Tag | Use for |
|
|
189
|
+
|-----|---------|
|
|
190
|
+
| \`bug-fix\` | Resolved defects with root cause analysis |
|
|
191
|
+
| \`design-decision\` | Architectural or implementation choices with reasoning |
|
|
192
|
+
| \`pattern\` | Reusable code or design patterns |
|
|
193
|
+
| \`troubleshooting\` | Multi-step diagnostic processes |
|
|
194
|
+
| \`external-knowledge\` | Insights from external sources (docs, articles, SO) |
|
|
195
|
+
| \`refactoring\` | Code quality improvements |
|
|
196
|
+
|
|
197
|
+
## Domain Tags (choose 0–3)
|
|
198
|
+
|
|
199
|
+
### Languages & Runtimes
|
|
200
|
+
| Tag | Use for |
|
|
201
|
+
|-----|---------|
|
|
202
|
+
| \`typescript\` | TypeScript-specific patterns, type system |
|
|
203
|
+
| \`javascript\` | JavaScript-specific patterns |
|
|
204
|
+
| \`nodejs\` | Node.js runtime, native modules, ESM |
|
|
205
|
+
| \`sql\` | SQL queries, schema design |
|
|
206
|
+
| \`bash\` | Shell scripts, CLI tools |
|
|
207
|
+
|
|
208
|
+
### Quality & Safety
|
|
209
|
+
| Tag | Use for |
|
|
210
|
+
|-----|---------|
|
|
211
|
+
| \`null-safety\` | Null/undefined handling, optional chaining |
|
|
212
|
+
| \`type-safety\` | TypeScript strict mode, type guards |
|
|
213
|
+
| \`error-handling\` | Error propagation, try/catch patterns |
|
|
214
|
+
| \`validation\` | Input validation, schema validation |
|
|
215
|
+
| \`security\` | Auth, injection prevention, secrets management |
|
|
216
|
+
| \`testing\` | Test patterns, test utilities, coverage |
|
|
217
|
+
|
|
218
|
+
### Architecture
|
|
219
|
+
| Tag | Use for |
|
|
220
|
+
|-----|---------|
|
|
221
|
+
| \`architecture\` | High-level structural decisions |
|
|
222
|
+
| \`api-design\` | REST, RPC, GraphQL interface design |
|
|
223
|
+
| \`database\` | Database schema, migrations, queries |
|
|
224
|
+
| \`caching\` | In-memory or distributed caching |
|
|
225
|
+
| \`async\` | Async/await patterns, concurrency |
|
|
226
|
+
|
|
227
|
+
### Infrastructure & Tooling
|
|
228
|
+
| Tag | Use for |
|
|
229
|
+
|-----|---------|
|
|
230
|
+
| \`build\` | Build system, bundler configuration |
|
|
231
|
+
| \`ci-cd\` | CI/CD pipelines, GitHub Actions |
|
|
232
|
+
| \`devops\` | Deployment, infrastructure as code |
|
|
233
|
+
| \`dependencies\` | Package management, version upgrades |
|
|
234
|
+
| \`native-modules\` | Native Node.js addons, ABI compatibility |
|
|
235
|
+
| \`esm\` | ES modules, import/export |
|
|
236
|
+
| \`performance\` | Optimization, profiling, benchmarks |
|
|
237
|
+
| \`memory\` | Memory management, leak detection |
|
|
238
|
+
|
|
239
|
+
### Project-Specific
|
|
240
|
+
| Tag | Use for |
|
|
241
|
+
|-----|---------|
|
|
242
|
+
| \`sqlite\` | SQLite, sqlite-vec, FTS5 |
|
|
243
|
+
| \`mcp\` | Model Context Protocol integration |
|
|
244
|
+
| \`embedding\` | Vector embeddings, semantic search |
|
|
245
|
+
| \`entity-extraction\` | Named entity recognition, graph |
|
|
246
|
+
| \`ingest\` | Knowledge ingestion pipeline |
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Tagging Examples
|
|
251
|
+
|
|
252
|
+
| Scenario | Tags |
|
|
253
|
+
|----------|------|
|
|
254
|
+
| Fixed a TypeScript null reference error | \`bug-fix\`, \`typescript\`, \`null-safety\` |
|
|
255
|
+
| Decided to use Zod for validation | \`design-decision\`, \`validation\`, \`typescript\` |
|
|
256
|
+
| Found ESM import extension pattern | \`external-knowledge\`, \`esm\`, \`nodejs\` |
|
|
257
|
+
| Optimized SQLite FTS5 query | \`performance\`, \`sqlite\`, \`database\` |
|
|
258
|
+
| Refactored command handler structure | \`refactoring\`, \`architecture\` |
|
|
259
|
+
`,
|
|
260
|
+
"format-examples.md": `# Format Examples
|
|
261
|
+
|
|
262
|
+
Concrete examples of well-formatted knowledge captures.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Example 1: Bug Fix (TypeScript)
|
|
267
|
+
|
|
268
|
+
**Title**: Fix "object is possibly undefined" in KnowledgeRepository.getById
|
|
269
|
+
|
|
270
|
+
**Tags**: \`bug-fix\`, \`typescript\`, \`null-safety\`
|
|
271
|
+
|
|
272
|
+
**Content**:
|
|
273
|
+
\`\`\`
|
|
274
|
+
Problem: TypeScript error "object is possibly 'undefined'" when accessing note.id after
|
|
275
|
+
calling repository.getById(). The method signature returned Note | undefined but all
|
|
276
|
+
call sites assumed Note.
|
|
277
|
+
|
|
278
|
+
Root cause: The method was added when the codebase was less strict. The return type
|
|
279
|
+
correctly reflects that a record might not exist, but call sites were not updated.
|
|
280
|
+
|
|
281
|
+
Fix:
|
|
282
|
+
1. Updated all call sites to handle the undefined case explicitly:
|
|
283
|
+
const note = repository.getById(id);
|
|
284
|
+
if (!note) { throw new Error(\`Note \${id} not found\`); }
|
|
285
|
+
2. Added a getByIdOrThrow() helper for cases where undefined is a programming error.
|
|
286
|
+
|
|
287
|
+
Prevention: Avoid non-null assertions (!). Add repository methods with explicit error
|
|
288
|
+
semantics (OrThrow suffix) so callers choose their error handling strategy.
|
|
289
|
+
\`\`\`
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Example 2: Design Decision (Architecture)
|
|
294
|
+
|
|
295
|
+
**Title**: Use append-only markers in CLAUDE.md for knowledgine rules section
|
|
296
|
+
|
|
297
|
+
**Tags**: \`design-decision\`, \`architecture\`
|
|
298
|
+
|
|
299
|
+
**Content**:
|
|
300
|
+
\`\`\`
|
|
301
|
+
Decision: Wrap the injected rules section in HTML comment markers
|
|
302
|
+
<!-- knowledgine:rules:start --> and <!-- knowledgine:rules:end --> rather than
|
|
303
|
+
replacing the entire file or using a separate file.
|
|
304
|
+
|
|
305
|
+
Options considered:
|
|
306
|
+
A) Separate .knowledgine/RULES.md file — requires agent to know about the extra file
|
|
307
|
+
B) Replace entire CLAUDE.md — destroys user customizations on re-run
|
|
308
|
+
C) Append-only (no markers) — cannot update or remove without leaving duplicates
|
|
309
|
+
D) Marked section (chosen) — idempotent updates, preserves surrounding content
|
|
310
|
+
|
|
311
|
+
Chosen: Option D. The markers allow the CLI to find and replace exactly the
|
|
312
|
+
knowledgine section on subsequent runs while leaving user-written content intact.
|
|
313
|
+
This makes setup re-runnable and upgrade-safe.
|
|
314
|
+
|
|
315
|
+
Trade-off: If the user manually removes one marker, the update logic will break.
|
|
316
|
+
Documented in the README as a known limitation.
|
|
317
|
+
\`\`\`
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Example 3: Troubleshooting (Native Module)
|
|
322
|
+
|
|
323
|
+
**Title**: sqlite-vec fails after Node.js major version upgrade — run npm rebuild
|
|
324
|
+
|
|
325
|
+
**Tags**: \`troubleshooting\`, \`sqlite\`, \`native-modules\`, \`nodejs\`
|
|
326
|
+
|
|
327
|
+
**Content**:
|
|
328
|
+
\`\`\`
|
|
329
|
+
Symptom: "Error: The specified module could not be found" (Windows) or
|
|
330
|
+
"invalid ELF header" (Linux) when loading sqlite-vec after upgrading Node.js.
|
|
331
|
+
|
|
332
|
+
Root cause: Native addons (.node files) are compiled against a specific Node.js ABI
|
|
333
|
+
version (NODE_MODULE_VERSION). Upgrading Node.js changes the ABI, making pre-compiled
|
|
334
|
+
binaries incompatible.
|
|
335
|
+
|
|
336
|
+
Diagnosis steps:
|
|
337
|
+
1. Confirmed error occurs only after Node upgrade, not on fresh install
|
|
338
|
+
2. Checked node-gyp output: "gyp info using node@20.x.x | ABI 115"
|
|
339
|
+
3. Found existing .node file compiled for ABI 108 (Node 18)
|
|
340
|
+
|
|
341
|
+
Resolution: Run \`npm rebuild\` (or \`pnpm rebuild\`) after every Node.js major version
|
|
342
|
+
upgrade. This recompiles all native modules for the current ABI.
|
|
343
|
+
|
|
344
|
+
For CI: Pin NODE_MODULE_VERSION in cache keys to avoid stale compiled artifacts.
|
|
345
|
+
\`\`\`
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Example 4: Pattern Discovery
|
|
350
|
+
|
|
351
|
+
**Title**: Pattern: early-return guard clauses to eliminate deep nesting
|
|
352
|
+
|
|
353
|
+
**Tags**: \`pattern\`, \`refactoring\`
|
|
354
|
+
|
|
355
|
+
**Content**:
|
|
356
|
+
\`\`\`
|
|
357
|
+
Problem: Functions with multiple validation steps produce deeply nested if/else blocks
|
|
358
|
+
that are hard to read and test independently.
|
|
359
|
+
|
|
360
|
+
Pattern: Use guard clauses (early returns) to validate preconditions at the top of the
|
|
361
|
+
function, keeping the happy path at the minimum indent level.
|
|
362
|
+
|
|
363
|
+
Before:
|
|
364
|
+
function processNote(note: Note | undefined) {
|
|
365
|
+
if (note) {
|
|
366
|
+
if (note.content) {
|
|
367
|
+
if (note.content.length > 0) {
|
|
368
|
+
// actual logic here — 3 levels deep
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
After:
|
|
375
|
+
function processNote(note: Note | undefined) {
|
|
376
|
+
if (!note) return;
|
|
377
|
+
if (!note.content) return;
|
|
378
|
+
if (note.content.length === 0) return;
|
|
379
|
+
// actual logic here — top level
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
Applies to: Any function with multiple nullable inputs or precondition checks.
|
|
383
|
+
Caveat: When early returns have side effects (logging, metrics), make that explicit.
|
|
384
|
+
\`\`\`
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Example 5: External Knowledge
|
|
389
|
+
|
|
390
|
+
**Title**: ESM requires .js extension in TypeScript import paths even for .ts source files
|
|
391
|
+
|
|
392
|
+
**Tags**: \`external-knowledge\`, \`esm\`, \`typescript\`, \`nodejs\`
|
|
393
|
+
|
|
394
|
+
**Content**:
|
|
395
|
+
\`\`\`
|
|
396
|
+
Source: https://www.typescriptlang.org/docs/handbook/esm-node.html
|
|
397
|
+
|
|
398
|
+
Insight: When compiling TypeScript to ESM (module: "NodeNext" or "ESNext" + type:
|
|
399
|
+
"module" in package.json), import paths MUST end in .js — not .ts — even when the
|
|
400
|
+
source file is .ts.
|
|
401
|
+
|
|
402
|
+
Reason: TypeScript does not rename import extensions at compile time. The runtime
|
|
403
|
+
(Node.js ESM loader) looks for .js files. TypeScript resolves .ts source files when
|
|
404
|
+
you write \`import foo from "./foo.js"\` — it knows that .js refers to the compiled .ts.
|
|
405
|
+
|
|
406
|
+
Applied to this project: All internal imports in packages/cli/src/ use .js extensions.
|
|
407
|
+
Forgetting this causes "Cannot find module" at runtime despite TypeScript compiling
|
|
408
|
+
successfully (because tsc resolves the type but Node.js cannot find the file).
|
|
409
|
+
|
|
410
|
+
Gotcha: \`import type\` paths also need .js extensions in strict ESM mode.
|
|
411
|
+
\`\`\`
|
|
412
|
+
`,
|
|
413
|
+
};
|
|
414
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-capture/references.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAA2B;IAChD,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgLrB;IAEC,iBAAiB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFpB;IAEC,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwJvB;CACA,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const SKILL_MD = "---\nname: knowledgine-capture\ndescription: >\n Record knowledge to the local knowledge base after solving problems, making design\n decisions, or discovering reusable patterns. Invoke whenever you have just fixed a bug,\n made an architectural choice, found a reusable pattern, learned something from external\n sources, or completed a refactoring. Capturing while context is fresh prevents knowledge\n loss across sessions.\n---\n# knowledgine-capture\n\n## Purpose\n\nPersist valuable learnings from the current session into the local knowledge base so they\nare available for future sessions and team members. The knowledge base is only as useful\nas what is recorded into it.\n\n## When to Use\n\nCapture knowledge when **any** of the following events occur in the session:\n\n1. **Bug fix** \u2014 You identified a root cause and applied a solution\n2. **Design decision** \u2014 You chose one approach over alternatives with reasoning\n3. **Pattern discovery** \u2014 You found a reusable pattern worth applying elsewhere\n4. **Troubleshooting** \u2014 You worked through a non-obvious diagnosis process\n5. **External knowledge** \u2014 You applied insights from documentation, articles, or Stack Overflow\n6. **Refactoring** \u2014 You improved existing code with a clear before/after\n\n## When NOT to Use\n\n- Trivial edits (typo fixes, formatting changes) that contain no transferable insight\n- Highly project-specific one-off changes with no reuse value\n- Duplicate entries: first search with `search_knowledge` to check if the knowledge already exists\n\n## How to Capture (MCP Tool)\n\nUse the `capture_knowledge` MCP tool:\n\n```\ncapture_knowledge(\n content: string, // Full explanation: problem + solution + context\n title: string, // Short descriptive title (max ~80 chars)\n tags: string[], // 2\u20135 tags from the standard taxonomy\n source?: string // Optional: URL, filename, or reference source\n)\n```\n\n## How to Capture (CLI Alternative)\n\n```bash\nknowledgine capture add \"<content>\" --title \"<title>\" --tags \"<tag1>,<tag2>\"\n```\n\n## Content Format\n\nStructure each capture as three parts:\n\n1. **Problem / Context** \u2014 What situation triggered this learning?\n2. **Solution / Decision** \u2014 What was done and how?\n3. **Rationale / Notes** \u2014 Why this approach? What alternatives were considered?\n\nExample:\n```\n**Problem**: TypeScript threw \"Type 'unknown' is not assignable to type 'User'\" when\nparsing API response.\n\n**Solution**: Added a type guard function isUser(val: unknown): val is User that checks\nfor required fields before narrowing the type.\n\n**Rationale**: Using 'as User' cast was unsafe because the API response structure could\nchange. The type guard provides runtime validation and compile-time safety.\n```\n\n## Step-by-Step Instructions\n\n1. **Identify the trigger** \u2014 Which of the 6 capture events occurred?\n2. **Draft the content** \u2014 Write problem + solution + rationale in plain prose\n3. **Choose a title** \u2014 Concise, searchable (start with verb or noun phrase)\n4. **Select 2\u20135 tags** \u2014 Use the standard taxonomy (see capture-guide.md)\n5. **Call capture_knowledge** \u2014 Pass content, title, tags, and optional source\n6. **Verify** \u2014 Confirm the tool returned a success response\n\n## Best Practices\n\n- Capture immediately after the event while details are fresh\n- Write for a future reader who has no context from this session\n- Prefer one focused capture per insight over large omnibus entries\n- Include error messages verbatim \u2014 they are the most effective search terms\n- Tag precisely: broad tags like \"misc\" reduce discoverability\n\n## Reference Files\n\n- See `capture-guide.md` for detailed guidance on each trigger type with examples\n- See `tag-taxonomy.md` for the standard tag categories\n- See `format-examples.md` for 3\u20135 concrete capture examples\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-capture/skill-md.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,m2HA+FpB,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const SKILL_MD = `---
|
|
2
|
+
name: knowledgine-capture
|
|
3
|
+
description: >
|
|
4
|
+
Record knowledge to the local knowledge base after solving problems, making design
|
|
5
|
+
decisions, or discovering reusable patterns. Invoke whenever you have just fixed a bug,
|
|
6
|
+
made an architectural choice, found a reusable pattern, learned something from external
|
|
7
|
+
sources, or completed a refactoring. Capturing while context is fresh prevents knowledge
|
|
8
|
+
loss across sessions.
|
|
9
|
+
---
|
|
10
|
+
# knowledgine-capture
|
|
11
|
+
|
|
12
|
+
## Purpose
|
|
13
|
+
|
|
14
|
+
Persist valuable learnings from the current session into the local knowledge base so they
|
|
15
|
+
are available for future sessions and team members. The knowledge base is only as useful
|
|
16
|
+
as what is recorded into it.
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
Capture knowledge when **any** of the following events occur in the session:
|
|
21
|
+
|
|
22
|
+
1. **Bug fix** — You identified a root cause and applied a solution
|
|
23
|
+
2. **Design decision** — You chose one approach over alternatives with reasoning
|
|
24
|
+
3. **Pattern discovery** — You found a reusable pattern worth applying elsewhere
|
|
25
|
+
4. **Troubleshooting** — You worked through a non-obvious diagnosis process
|
|
26
|
+
5. **External knowledge** — You applied insights from documentation, articles, or Stack Overflow
|
|
27
|
+
6. **Refactoring** — You improved existing code with a clear before/after
|
|
28
|
+
|
|
29
|
+
## When NOT to Use
|
|
30
|
+
|
|
31
|
+
- Trivial edits (typo fixes, formatting changes) that contain no transferable insight
|
|
32
|
+
- Highly project-specific one-off changes with no reuse value
|
|
33
|
+
- Duplicate entries: first search with \`search_knowledge\` to check if the knowledge already exists
|
|
34
|
+
|
|
35
|
+
## How to Capture (MCP Tool)
|
|
36
|
+
|
|
37
|
+
Use the \`capture_knowledge\` MCP tool:
|
|
38
|
+
|
|
39
|
+
\`\`\`
|
|
40
|
+
capture_knowledge(
|
|
41
|
+
content: string, // Full explanation: problem + solution + context
|
|
42
|
+
title: string, // Short descriptive title (max ~80 chars)
|
|
43
|
+
tags: string[], // 2–5 tags from the standard taxonomy
|
|
44
|
+
source?: string // Optional: URL, filename, or reference source
|
|
45
|
+
)
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
## How to Capture (CLI Alternative)
|
|
49
|
+
|
|
50
|
+
\`\`\`bash
|
|
51
|
+
knowledgine capture add "<content>" --title "<title>" --tags "<tag1>,<tag2>"
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
## Content Format
|
|
55
|
+
|
|
56
|
+
Structure each capture as three parts:
|
|
57
|
+
|
|
58
|
+
1. **Problem / Context** — What situation triggered this learning?
|
|
59
|
+
2. **Solution / Decision** — What was done and how?
|
|
60
|
+
3. **Rationale / Notes** — Why this approach? What alternatives were considered?
|
|
61
|
+
|
|
62
|
+
Example:
|
|
63
|
+
\`\`\`
|
|
64
|
+
**Problem**: TypeScript threw "Type 'unknown' is not assignable to type 'User'" when
|
|
65
|
+
parsing API response.
|
|
66
|
+
|
|
67
|
+
**Solution**: Added a type guard function isUser(val: unknown): val is User that checks
|
|
68
|
+
for required fields before narrowing the type.
|
|
69
|
+
|
|
70
|
+
**Rationale**: Using 'as User' cast was unsafe because the API response structure could
|
|
71
|
+
change. The type guard provides runtime validation and compile-time safety.
|
|
72
|
+
\`\`\`
|
|
73
|
+
|
|
74
|
+
## Step-by-Step Instructions
|
|
75
|
+
|
|
76
|
+
1. **Identify the trigger** — Which of the 6 capture events occurred?
|
|
77
|
+
2. **Draft the content** — Write problem + solution + rationale in plain prose
|
|
78
|
+
3. **Choose a title** — Concise, searchable (start with verb or noun phrase)
|
|
79
|
+
4. **Select 2–5 tags** — Use the standard taxonomy (see capture-guide.md)
|
|
80
|
+
5. **Call capture_knowledge** — Pass content, title, tags, and optional source
|
|
81
|
+
6. **Verify** — Confirm the tool returned a success response
|
|
82
|
+
|
|
83
|
+
## Best Practices
|
|
84
|
+
|
|
85
|
+
- Capture immediately after the event while details are fresh
|
|
86
|
+
- Write for a future reader who has no context from this session
|
|
87
|
+
- Prefer one focused capture per insight over large omnibus entries
|
|
88
|
+
- Include error messages verbatim — they are the most effective search terms
|
|
89
|
+
- Tag precisely: broad tags like "misc" reduce discoverability
|
|
90
|
+
|
|
91
|
+
## Reference Files
|
|
92
|
+
|
|
93
|
+
- See \`capture-guide.md\` for detailed guidance on each trigger type with examples
|
|
94
|
+
- See \`tag-taxonomy.md\` for the standard tag categories
|
|
95
|
+
- See \`format-examples.md\` for 3–5 concrete capture examples
|
|
96
|
+
`;
|
|
97
|
+
//# sourceMappingURL=skill-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-md.js","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-capture/skill-md.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+FvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../src/templates/skills/knowledgine-debrief/references.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2I7C,CAAC"}
|