@skillkit/cli 1.12.0 → 1.13.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/index.d.ts CHANGED
@@ -483,6 +483,14 @@ declare class MemoryCommand extends Command {
483
483
  * Show memory configuration
484
484
  */
485
485
  private showConfig;
486
+ /**
487
+ * Sync learnings to CLAUDE.md
488
+ */
489
+ private syncClaudeMd;
490
+ /**
491
+ * Show memory index (progressive disclosure Layer 1)
492
+ */
493
+ private showIndex;
486
494
  /**
487
495
  * Format relevance/effectiveness score with color
488
496
  */
package/dist/index.js CHANGED
@@ -5384,7 +5384,10 @@ import {
5384
5384
  initializeMemoryDirectory,
5385
5385
  getMemoryStatus,
5386
5386
  createMemoryCompressor,
5387
- createMemoryInjector
5387
+ createMemoryInjector,
5388
+ createClaudeMdUpdater,
5389
+ syncGlobalClaudeMd,
5390
+ createProgressiveDisclosureManager
5388
5391
  } from "@skillkit/core";
5389
5392
  var MemoryCommand = class extends Command26 {
5390
5393
  static paths = [["memory"], ["mem"]];
@@ -5395,17 +5398,19 @@ var MemoryCommand = class extends Command26 {
5395
5398
  captured from coding sessions across all AI agents.
5396
5399
 
5397
5400
  Subcommands:
5398
- - status: Show current memory status
5399
- - search: Search memories by query
5400
- - list: List all learnings
5401
- - show: Show a specific learning
5402
- - compress: Compress observations into learnings
5403
- - export: Export a learning as a skill
5404
- - import: Import memories from another project
5405
- - clear: Clear session observations
5406
- - add: Manually add a learning
5407
- - rate: Rate a learning's effectiveness
5408
- - config: Configure memory settings
5401
+ - status: Show current memory status
5402
+ - search: Search memories by query
5403
+ - list: List all learnings
5404
+ - show: Show a specific learning
5405
+ - compress: Compress observations into learnings
5406
+ - export: Export a learning as a skill
5407
+ - import: Import memories from another project
5408
+ - clear: Clear session observations
5409
+ - add: Manually add a learning
5410
+ - rate: Rate a learning's effectiveness
5411
+ - sync-claude: Sync learnings to CLAUDE.md
5412
+ - index: Show memory index (progressive disclosure)
5413
+ - config: Configure memory settings
5409
5414
  `,
5410
5415
  examples: [
5411
5416
  ["Show memory status", "$0 memory status"],
@@ -5418,7 +5423,9 @@ var MemoryCommand = class extends Command26 {
5418
5423
  ["Export as skill", "$0 memory export <id> --name my-skill"],
5419
5424
  ["Clear session", "$0 memory clear"],
5420
5425
  ["Add manual learning", '$0 memory add --title "..." --content "..."'],
5421
- ["Rate effectiveness", "$0 memory rate <id> 85"]
5426
+ ["Rate effectiveness", "$0 memory rate <id> 85"],
5427
+ ["Sync to CLAUDE.md", "$0 memory sync-claude"],
5428
+ ["Show memory index", "$0 memory index"]
5422
5429
  ]
5423
5430
  });
5424
5431
  // Subcommand (status, search, list, show, compress, export, import, clear, add, rate, config)
@@ -5500,9 +5507,13 @@ var MemoryCommand = class extends Command26 {
5500
5507
  return this.rateLearning();
5501
5508
  case "config":
5502
5509
  return this.showConfig();
5510
+ case "sync-claude":
5511
+ return this.syncClaudeMd();
5512
+ case "index":
5513
+ return this.showIndex();
5503
5514
  default:
5504
5515
  console.error(chalk18.red(`Unknown action: ${action}`));
5505
- console.log(chalk18.gray("Available actions: status, search, list, show, compress, export, import, clear, add, rate, config"));
5516
+ console.log(chalk18.gray("Available actions: status, search, list, show, compress, export, import, clear, add, rate, sync-claude, index, config"));
5506
5517
  return 1;
5507
5518
  }
5508
5519
  }
@@ -5981,6 +5992,117 @@ ${learning.title}
5981
5992
  console.log();
5982
5993
  return 0;
5983
5994
  }
5995
+ /**
5996
+ * Sync learnings to CLAUDE.md
5997
+ */
5998
+ async syncClaudeMd() {
5999
+ const projectPath = process.cwd();
6000
+ if (this.global) {
6001
+ if (this.dryRun) {
6002
+ console.log(chalk18.gray("(Dry run - previewing global CLAUDE.md sync)\n"));
6003
+ }
6004
+ const result2 = this.dryRun ? { updated: false, path: "~/.claude/CLAUDE.md", learningsAdded: 0, learningSummaries: [], previousLearnings: 0 } : syncGlobalClaudeMd({ minEffectiveness: 60 });
6005
+ if (this.dryRun) {
6006
+ const globalStore = new LearningStore("global");
6007
+ const learnings = globalStore.getAll().filter((l) => (l.effectiveness ?? 0) >= 60 || l.useCount >= 3).slice(0, 20);
6008
+ console.log(chalk18.cyan(`Would add ${learnings.length} learnings to global CLAUDE.md`));
6009
+ for (const l of learnings.slice(0, 5)) {
6010
+ console.log(` ${chalk18.gray("\u25CF")} ${l.title}`);
6011
+ }
6012
+ if (learnings.length > 5) {
6013
+ console.log(chalk18.gray(` ... and ${learnings.length - 5} more`));
6014
+ }
6015
+ return 0;
6016
+ }
6017
+ if (result2.updated) {
6018
+ console.log(chalk18.green(`\u2713 Updated global CLAUDE.md with ${result2.learningsAdded} learnings`));
6019
+ console.log(chalk18.gray(` Path: ${result2.path}`));
6020
+ } else {
6021
+ console.log(chalk18.yellow("No learnings to sync to global CLAUDE.md"));
6022
+ }
6023
+ return 0;
6024
+ }
6025
+ const updater = createClaudeMdUpdater(projectPath);
6026
+ if (this.dryRun) {
6027
+ const preview = updater.preview({ minEffectiveness: 60 });
6028
+ console.log(chalk18.gray("(Dry run preview)\n"));
6029
+ if (!preview.wouldUpdate) {
6030
+ console.log(chalk18.yellow("No learnings to sync to CLAUDE.md"));
6031
+ return 0;
6032
+ }
6033
+ console.log(chalk18.cyan(`Would add ${preview.learnings.length} learnings to CLAUDE.md
6034
+ `));
6035
+ for (const learning of preview.learnings.slice(0, 5)) {
6036
+ console.log(` ${chalk18.gray("\u25CF")} ${learning.title}`);
6037
+ }
6038
+ if (preview.learnings.length > 5) {
6039
+ console.log(chalk18.gray(` ... and ${preview.learnings.length - 5} more`));
6040
+ }
6041
+ console.log(chalk18.bold("\nFormatted section preview:"));
6042
+ console.log(chalk18.gray("\u2500".repeat(50)));
6043
+ console.log(preview.formattedSection.slice(0, 500));
6044
+ if (preview.formattedSection.length > 500) {
6045
+ console.log(chalk18.gray("..."));
6046
+ }
6047
+ return 0;
6048
+ }
6049
+ const result = updater.update({ minEffectiveness: 60 });
6050
+ if (result.updated) {
6051
+ console.log(chalk18.green(`\u2713 Updated CLAUDE.md with ${result.learningsAdded} learnings`));
6052
+ console.log(chalk18.gray(` Path: ${result.path}`));
6053
+ if (this.verbose && result.learningSummaries.length > 0) {
6054
+ console.log(chalk18.cyan("\nLearnings added:"));
6055
+ for (const title of result.learningSummaries.slice(0, 10)) {
6056
+ console.log(` ${chalk18.gray("\u25CF")} ${title}`);
6057
+ }
6058
+ }
6059
+ } else {
6060
+ console.log(chalk18.yellow("No learnings to sync to CLAUDE.md"));
6061
+ }
6062
+ return 0;
6063
+ }
6064
+ /**
6065
+ * Show memory index (progressive disclosure Layer 1)
6066
+ */
6067
+ async showIndex() {
6068
+ const projectPath = process.cwd();
6069
+ const manager = createProgressiveDisclosureManager(projectPath);
6070
+ let maxResults = 50;
6071
+ if (this.limit) {
6072
+ const parsed = parseInt(this.limit, 10);
6073
+ if (isNaN(parsed) || parsed <= 0) {
6074
+ console.log(chalk18.red("Invalid --limit value. Must be a positive number."));
6075
+ return 1;
6076
+ }
6077
+ maxResults = parsed;
6078
+ }
6079
+ const index = manager.getIndex({ includeGlobal: this.global, maxResults });
6080
+ if (this.json) {
6081
+ console.log(JSON.stringify(index, null, 2));
6082
+ return 0;
6083
+ }
6084
+ console.log(chalk18.bold(`
6085
+ Memory Index (${index.length} entries)
6086
+ `));
6087
+ if (index.length === 0) {
6088
+ console.log(chalk18.gray("No learnings found."));
6089
+ return 0;
6090
+ }
6091
+ const displayLimit = this.limit ? parseInt(this.limit, 10) : 20;
6092
+ const displayed = index.slice(0, displayLimit);
6093
+ for (const entry of displayed) {
6094
+ const effectiveness = entry.effectiveness !== void 0 ? ` [${this.formatScore(entry.effectiveness)}%]` : "";
6095
+ const scope = entry.scope === "global" ? chalk18.magenta("[G]") : chalk18.blue("[P]");
6096
+ console.log(`${scope} ${chalk18.gray(entry.id.slice(0, 8))} ${entry.title}${chalk18.green(effectiveness)}`);
6097
+ console.log(` Tags: ${entry.tags.join(", ")} | Uses: ${entry.useCount}`);
6098
+ }
6099
+ if (index.length > displayLimit) {
6100
+ console.log(chalk18.gray(`
6101
+ ... and ${index.length - displayLimit} more (use --limit to show more)`));
6102
+ }
6103
+ console.log(chalk18.gray('\nUse "skillkit memory show <id>" to view full details'));
6104
+ return 0;
6105
+ }
5984
6106
  /**
5985
6107
  * Format relevance/effectiveness score with color
5986
6108
  */
@@ -140130,6 +140252,8 @@ var ServeCommand = class extends Command52 {
140130
140252
  console.log(colors.muted(` GET /trending - Top skills`));
140131
140253
  console.log(colors.muted(` GET /categories - Skill categories`));
140132
140254
  console.log(colors.muted(` GET /cache/stats - Cache statistics`));
140255
+ console.log(colors.muted(` GET /docs - Interactive API docs`));
140256
+ console.log(colors.muted(` GET /openapi.json - OpenAPI specification`));
140133
140257
  console.log("");
140134
140258
  console.log(colors.muted("Press Ctrl+C to stop"));
140135
140259
  await new Promise(() => {