@skillkit/cli 1.11.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
  */
@@ -1240,6 +1248,16 @@ declare class SkillMdCheckCommand extends Command {
1240
1248
  private scanDir;
1241
1249
  }
1242
1250
 
1251
+ declare class ServeCommand extends Command {
1252
+ static paths: string[][];
1253
+ static usage: clipanion.Usage;
1254
+ port: string;
1255
+ host: string;
1256
+ corsOrigin: string;
1257
+ cacheTtl: string;
1258
+ execute(): Promise<number>;
1259
+ }
1260
+
1243
1261
  declare const loadSkillMetadata: typeof loadSkillMetadata$1;
1244
1262
  declare const saveSkillMetadata: typeof saveSkillMetadata$1;
1245
1263
  declare function getSearchDirs(agentType?: AgentType): string[];
@@ -1247,4 +1265,4 @@ declare function getInstallDir(global?: boolean, agentType?: AgentType): string;
1247
1265
  declare function getAgentConfigPath(agentType?: AgentType): string;
1248
1266
  declare function initProject(agentType?: AgentType): Promise<void>;
1249
1267
 
1250
- export { AICommand, AgentAvailableCommand, AgentCommand, AgentCreateCommand, AgentFromSkillCommand, AgentInstallCommand, AgentListCommand, AgentShowCommand, AgentSyncCommand, AgentTranslateCommand, AgentValidateCommand, AuditCommand, CICDCommand, CheckCommand, CommandAvailableCommand, CommandCmd, CommandInstallCommand, ContextCommand, CreateCommand, DisableCommand, EnableCommand, FindCommand, FixCommand, GuidelineCommand, GuidelineCreateCommand, GuidelineDisableCommand, GuidelineEnableCommand, GuidelineListCommand, GuidelineRemoveCommand, GuidelineShowCommand, HookCommand, HookTemplateApplyCommand, HookTemplateListCommand, HookTemplateShowCommand, InitCommand, InstallCommand, LearnCommand, ListCommand, ManifestAddCommand, ManifestCommand, ManifestGenerateCommand, ManifestInitCommand, ManifestInstallCommand, ManifestRemoveCommand, MarketplaceCommand, MemoryCommand, MeshCommand, MessageCommand, MethodologyCommand, PatternApproveCommand, PatternClusterCommand, PatternExportCommand, PatternFeedbackCommand, PatternImportCommand, PatternRejectCommand, PatternStatusCommand, PauseCommand, PlanCommand, PluginCommand, PrimerCommand, ProfileCommand, ProfileCreateCommand, ProfileListCommand, ProfileRemoveCommand, PublishCommand, PublishSubmitCommand, QuickCommand, ReadCommand, RecommendCommand, RemoveCommand, ResumeCommand, RunCommand, SessionCommand, SessionCompleteCommand, SessionInProgressCommand, SessionListCommand, SessionLoadCommand, SessionNoteCommand, SessionStartCommand, SessionStatusCommand, SettingsCommand, SkillMdCheckCommand, SkillMdInitCommand, SkillMdValidateCommand, StatusCommand, SyncCommand, TeamCommand, TestCommand, TranslateCommand, TreeCommand, UICommand, UpdateCommand, ValidateCommand, WorkflowCreateCommand, WorkflowListCommand, WorkflowPipelineCommand, WorkflowPipelineListCommand, WorkflowRunCommand, getAgentConfigPath, getInstallDir, getSearchDirs, initProject, loadSkillMetadata, saveSkillMetadata };
1268
+ export { AICommand, AgentAvailableCommand, AgentCommand, AgentCreateCommand, AgentFromSkillCommand, AgentInstallCommand, AgentListCommand, AgentShowCommand, AgentSyncCommand, AgentTranslateCommand, AgentValidateCommand, AuditCommand, CICDCommand, CheckCommand, CommandAvailableCommand, CommandCmd, CommandInstallCommand, ContextCommand, CreateCommand, DisableCommand, EnableCommand, FindCommand, FixCommand, GuidelineCommand, GuidelineCreateCommand, GuidelineDisableCommand, GuidelineEnableCommand, GuidelineListCommand, GuidelineRemoveCommand, GuidelineShowCommand, HookCommand, HookTemplateApplyCommand, HookTemplateListCommand, HookTemplateShowCommand, InitCommand, InstallCommand, LearnCommand, ListCommand, ManifestAddCommand, ManifestCommand, ManifestGenerateCommand, ManifestInitCommand, ManifestInstallCommand, ManifestRemoveCommand, MarketplaceCommand, MemoryCommand, MeshCommand, MessageCommand, MethodologyCommand, PatternApproveCommand, PatternClusterCommand, PatternExportCommand, PatternFeedbackCommand, PatternImportCommand, PatternRejectCommand, PatternStatusCommand, PauseCommand, PlanCommand, PluginCommand, PrimerCommand, ProfileCommand, ProfileCreateCommand, ProfileListCommand, ProfileRemoveCommand, PublishCommand, PublishSubmitCommand, QuickCommand, ReadCommand, RecommendCommand, RemoveCommand, ResumeCommand, RunCommand, ServeCommand, SessionCommand, SessionCompleteCommand, SessionInProgressCommand, SessionListCommand, SessionLoadCommand, SessionNoteCommand, SessionStartCommand, SessionStatusCommand, SettingsCommand, SkillMdCheckCommand, SkillMdInitCommand, SkillMdValidateCommand, StatusCommand, SyncCommand, TeamCommand, TestCommand, TranslateCommand, TreeCommand, UICommand, UpdateCommand, ValidateCommand, WorkflowCreateCommand, WorkflowListCommand, WorkflowPipelineCommand, WorkflowPipelineListCommand, WorkflowRunCommand, getAgentConfigPath, getInstallDir, getSearchDirs, initProject, loadSkillMetadata, saveSkillMetadata };
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
  */
@@ -140068,6 +140190,83 @@ var SkillMdCheckCommand = class extends Command51 {
140068
140190
  }
140069
140191
  };
140070
140192
 
140193
+ // src/commands/serve.ts
140194
+ init_onboarding();
140195
+ import { Command as Command52, Option as Option50 } from "clipanion";
140196
+ var ServeCommand = class extends Command52 {
140197
+ static paths = [["serve"], ["server"]];
140198
+ static usage = Command52.Usage({
140199
+ description: "Start the SkillKit REST API server for skill discovery",
140200
+ details: `
140201
+ Launches a local HTTP server that exposes the SkillKit skill catalog
140202
+ via a REST API. Useful for integrating with other tools, building
140203
+ custom UIs, or enabling agent-native skill discovery.
140204
+ `,
140205
+ examples: [
140206
+ ["Start server on default port", "$0 serve"],
140207
+ ["Start on custom port", "$0 serve --port 8080"],
140208
+ ["Start with custom CORS", '$0 serve --cors "http://localhost:3000"']
140209
+ ]
140210
+ });
140211
+ port = Option50.String("--port,-p", "3737", {
140212
+ description: "Port to listen on"
140213
+ });
140214
+ host = Option50.String("--host,-H", "0.0.0.0", {
140215
+ description: "Host to bind to"
140216
+ });
140217
+ corsOrigin = Option50.String("--cors", "*", {
140218
+ description: "CORS allowed origin"
140219
+ });
140220
+ cacheTtl = Option50.String("--cache-ttl", "86400000", {
140221
+ description: "Cache TTL in milliseconds"
140222
+ });
140223
+ async execute() {
140224
+ header("SkillKit API Server");
140225
+ const skills = (skills_default.skills || []).map((skill) => ({
140226
+ name: skill.name,
140227
+ description: skill.description,
140228
+ source: skill.source || "",
140229
+ repo: skill.repo,
140230
+ tags: skill.tags,
140231
+ category: skill.category
140232
+ }));
140233
+ step(`Loading ${skills.length} skills from marketplace`);
140234
+ const portNum = parseInt(this.port, 10) || 3737;
140235
+ const cacheTtlMs = parseInt(this.cacheTtl, 10) || 864e5;
140236
+ try {
140237
+ const { startServer } = await import("@skillkit/api");
140238
+ await startServer({
140239
+ port: portNum,
140240
+ host: this.host,
140241
+ corsOrigin: this.corsOrigin,
140242
+ cacheTtlMs,
140243
+ skills
140244
+ });
140245
+ step(`Server running at ${colors.cyan(`http://${this.host}:${portNum}`)}`);
140246
+ console.log("");
140247
+ console.log(colors.muted("Endpoints:"));
140248
+ console.log(colors.muted(` GET /health - Server health check`));
140249
+ console.log(colors.muted(` GET /search?q=... - Search skills`));
140250
+ console.log(colors.muted(` POST /search - Search with filters`));
140251
+ console.log(colors.muted(` GET /skills/:o/:r/:id - Get specific skill`));
140252
+ console.log(colors.muted(` GET /trending - Top skills`));
140253
+ console.log(colors.muted(` GET /categories - Skill categories`));
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`));
140257
+ console.log("");
140258
+ console.log(colors.muted("Press Ctrl+C to stop"));
140259
+ await new Promise(() => {
140260
+ });
140261
+ } catch (err) {
140262
+ const message = err instanceof Error ? err.message : String(err);
140263
+ console.error(colors.error(`Failed to start server: ${message}`));
140264
+ return 1;
140265
+ }
140266
+ return 0;
140267
+ }
140268
+ };
140269
+
140071
140270
  // src/index.ts
140072
140271
  init_helpers();
140073
140272
  export {
@@ -140143,6 +140342,7 @@ export {
140143
140342
  RemoveCommand,
140144
140343
  ResumeCommand,
140145
140344
  RunCommand,
140345
+ ServeCommand,
140146
140346
  SessionCommand,
140147
140347
  SessionCompleteCommand,
140148
140348
  SessionInProgressCommand,