skill-tree 0.1.6 → 0.2.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.mts CHANGED
@@ -30,8 +30,6 @@ interface Skill {
30
30
  derivedFrom?: string[];
31
31
  /** Skills forked from this one (source → child tracking) */
32
32
  forks?: string[];
33
- /** Performance metrics */
34
- metrics: SkillMetrics;
35
33
  /** Upstream tracking for skills imported with 'link' mode */
36
34
  upstream?: SkillUpstream;
37
35
  source?: SkillSource$1;
@@ -76,20 +74,6 @@ interface ExpandTriggerConfig {
76
74
  };
77
75
  }
78
76
  type SkillStatus = 'draft' | 'active' | 'deprecated' | 'experimental';
79
- interface SkillMetrics {
80
- /** Number of times this skill was used */
81
- usageCount: number;
82
- /** Success rate (0-1) */
83
- successRate: number;
84
- /** When was this skill last used */
85
- lastUsed?: Date;
86
- /** User feedback scores */
87
- feedbackScores: number[];
88
- /** Average execution time in ms */
89
- avgExecutionTime?: number;
90
- /** Average confidence from matching */
91
- averageConfidence?: number;
92
- }
93
77
  interface SkillSource$1 {
94
78
  /** Where the skill came from */
95
79
  type: 'extracted' | 'manual' | 'imported' | 'composed';
@@ -264,7 +248,6 @@ interface SkillFilter {
264
248
  status?: SkillStatus[];
265
249
  tags?: string[];
266
250
  author?: string;
267
- minSuccessRate?: number;
268
251
  createdAfter?: Date;
269
252
  createdBefore?: Date;
270
253
  /** Filter by scope */
@@ -1087,9 +1070,23 @@ type SkillState = 'available' | 'expanded' | 'pending';
1087
1070
  * Flexible criteria for selecting skills into a loadout
1088
1071
  */
1089
1072
  interface LoadoutCriteria {
1090
- /** Always include these skill IDs */
1073
+ /**
1074
+ * Always include these skill IDs in the result, regardless of other
1075
+ * filters (status, tags, author, relationships, etc.). Missing skills
1076
+ * are fetched from storage on demand. The list is treated as a SET +
1077
+ * order hint — included skills come first in the order they appear
1078
+ * here, then the rest of the filtered set.
1079
+ *
1080
+ * `exclude` wins over `include`: IDs listed in both are excluded.
1081
+ *
1082
+ * For "restrict to exactly these N skills" semantics, combine
1083
+ * `include: [...]` with `maxSkills: include.length`.
1084
+ */
1091
1085
  include?: string[];
1092
- /** Never include these skill IDs */
1086
+ /**
1087
+ * Drop these skill IDs from the result. Wins over `include` —
1088
+ * an ID in both lists is excluded.
1089
+ */
1093
1090
  exclude?: string[];
1094
1091
  /** Match any of these tags */
1095
1092
  tags?: string[];
@@ -1097,8 +1094,6 @@ interface LoadoutCriteria {
1097
1094
  tagsAll?: string[];
1098
1095
  /** Filter by status (default: ['active']) */
1099
1096
  status?: SkillStatus[];
1100
- /** Quality threshold (0-1) */
1101
- minSuccessRate?: number;
1102
1097
  /** Filter by author */
1103
1098
  author?: string;
1104
1099
  /** Semantic match to task description */
@@ -1127,8 +1122,14 @@ interface LoadoutCriteria {
1127
1122
  maxSkills?: number;
1128
1123
  /** Context budget (estimated tokens) */
1129
1124
  maxTokens?: number;
1130
- /** How to order results for selection */
1131
- priorityOrder?: 'relevance' | 'usage' | 'successRate' | 'recent';
1125
+ /**
1126
+ * How to order results for selection. Currently only `'relevance'` is
1127
+ * recognized; it's a no-op until skill-tree gains semantic ranking. Live
1128
+ * usage-based ranking (formerly `'usage'` / `'successRate'` / `'recent'`)
1129
+ * is now the caller's responsibility — pre-rank and pass IDs via
1130
+ * `include: [...]`. See README "Metrics ownership" for the rationale.
1131
+ */
1132
+ priorityOrder?: 'relevance';
1132
1133
  /** How to apply to current state */
1133
1134
  mode?: 'replace' | 'merge' | 'subtract';
1134
1135
  }
@@ -1386,10 +1387,6 @@ declare class SkillGraphServer {
1386
1387
  * Collapse a skill (hide full content)
1387
1388
  */
1388
1389
  collapseSkill(skillId: string): boolean;
1389
- /**
1390
- * Record skill usage (for LRU tracking and auto-expansion)
1391
- */
1392
- recordUsage(skillId: string): void;
1393
1390
  /**
1394
1391
  * Agent requests to add skills
1395
1392
  * If requireApproval is true, adds to pending; otherwise directly adds
@@ -1524,21 +1521,14 @@ type SkillBankToServingEvent = {
1524
1521
  skillId: string;
1525
1522
  };
1526
1523
  /**
1527
- * Events that flow from Serving Layer to SkillBank
1524
+ * Events that flow from Serving Layer to SkillBank.
1525
+ *
1526
+ * `skill:used`, `skill:feedback`, and `skill:requested` were removed when
1527
+ * skill-tree dropped its `SkillMetrics` model — usage tracking is now
1528
+ * external (e.g., cognitive-core's `playbook.evolution.*`). See
1529
+ * docs/SKILL_TREE_METRICS_DEPRECATION.md.
1528
1530
  */
1529
1531
  type ServingToSkillBankEvent = {
1530
- type: 'skill:used';
1531
- skillId: string;
1532
- success: boolean;
1533
- } | {
1534
- type: 'skill:feedback';
1535
- skillId: string;
1536
- score: number;
1537
- comment?: string;
1538
- } | {
1539
- type: 'skill:requested';
1540
- skillId: string;
1541
- } | {
1542
1532
  type: 'loadout:changed';
1543
1533
  state: LoadoutState;
1544
1534
  };
@@ -2494,7 +2484,13 @@ declare class SkillBank {
2494
2484
  */
2495
2485
  private mapToServingEvent;
2496
2486
  /**
2497
- * Handle events from serving layer
2487
+ * Handle events from serving layer.
2488
+ *
2489
+ * The `loadout:changed` event is currently the only one we react to.
2490
+ * Earlier versions also handled `skill:used` / `skill:feedback` to mutate
2491
+ * `Skill.metrics`, but skill-tree no longer tracks per-skill usage —
2492
+ * cognitive-core owns that signal via `playbook.evolution.*`. See
2493
+ * docs/SKILL_TREE_METRICS_DEPRECATION.md.
2498
2494
  */
2499
2495
  private handleServingEvent;
2500
2496
  /**
@@ -2532,8 +2528,6 @@ interface SkillBankStats {
2532
2528
  totalSkills: number;
2533
2529
  byStatus: Record<Skill['status'], number>;
2534
2530
  byTag: Record<string, number>;
2535
- avgSuccessRate: number;
2536
- totalUsage: number;
2537
2531
  byScope?: {
2538
2532
  personal: number;
2539
2533
  team: number;
@@ -2795,8 +2789,6 @@ interface SkillSelector {
2795
2789
  tags?: string[];
2796
2790
  /** Include skills matching this status */
2797
2791
  status?: ('active' | 'experimental')[];
2798
- /** Minimum success rate to include */
2799
- minSuccessRate?: number;
2800
2792
  /** Maximum number of skills to include */
2801
2793
  limit?: number;
2802
2794
  }
@@ -3112,7 +3104,24 @@ declare class LoadoutCompiler {
3112
3104
  private config;
3113
3105
  constructor(storage: StorageAdapter, config?: LoadoutCompilerConfig);
3114
3106
  /**
3115
- * Main entry point - compile skills from criteria
3107
+ * Main entry point - compile skills from criteria.
3108
+ *
3109
+ * Filter pipeline order:
3110
+ * 1. status (initial query)
3111
+ * 2. exclude (drop matching IDs)
3112
+ * 3. tags / tagsAll
3113
+ * 4. author
3114
+ * 5. semantic (currently no-op)
3115
+ * 6. relationships (rootSkills traversal)
3116
+ * 7. **include** — presence guarantee: ensures every ID in the
3117
+ * include list is in the result regardless of the filters above,
3118
+ * fetching missing ones from storage as needed. `exclude` still
3119
+ * wins (excluded IDs are removed from the include list before
3120
+ * this step).
3121
+ * 8. limits (maxSkills, maxTokens)
3122
+ *
3123
+ * For "restrict to exactly these skills" semantics, combine
3124
+ * `include: [...]` with `maxSkills: include.length`.
3116
3125
  */
3117
3126
  compile(criteria: LoadoutCriteria): Promise<Skill[]>;
3118
3127
  /**
@@ -3128,7 +3137,9 @@ declare class LoadoutCompiler {
3128
3137
  */
3129
3138
  mergeLoadouts(current: Skill[], additions: Skill[], mode?: 'replace' | 'merge' | 'subtract'): Skill[];
3130
3139
  /**
3131
- * Apply explicit include/exclude filters
3140
+ * Apply explicit exclude filter. Include is handled separately at the
3141
+ * compile level (see `ensureIncludedPresent`) so it can guarantee
3142
+ * presence regardless of the other filters in this method or below.
3132
3143
  */
3133
3144
  applyExplicitFilters(skills: Skill[], criteria: LoadoutCriteria): Skill[];
3134
3145
  /**
@@ -3150,6 +3161,20 @@ declare class LoadoutCompiler {
3150
3161
  * Apply relationship-based filters (root skills, dependencies)
3151
3162
  */
3152
3163
  applyRelationshipFilters(skills: Skill[], criteria: LoadoutCriteria): Promise<Skill[]>;
3164
+ /**
3165
+ * Ensure every ID in `criteria.include` is present in the result,
3166
+ * regardless of which earlier filter would have dropped it. Missing
3167
+ * skills are fetched directly from storage.
3168
+ *
3169
+ * `criteria.exclude` still wins: an ID listed in both `include` and
3170
+ * `exclude` is treated as excluded (consistent with openteams' "deny
3171
+ * wins" inheritance rule on permissions).
3172
+ *
3173
+ * Included skills are placed at the front of the result, preserving
3174
+ * the order of `criteria.include`. Other skills retain their relative
3175
+ * order behind them.
3176
+ */
3177
+ ensureIncludedPresent(current: Skill[], criteria: LoadoutCriteria): Promise<Skill[]>;
3153
3178
  /**
3154
3179
  * Apply limits and sorting
3155
3180
  */
@@ -3848,6 +3873,8 @@ declare class IndexerService {
3848
3873
  force?: boolean;
3849
3874
  autoClassify?: boolean;
3850
3875
  detectRelationships?: boolean;
3876
+ /** Import all scraped skills into SkillBank regardless of classification status */
3877
+ importAll?: boolean;
3851
3878
  }): Promise<{
3852
3879
  scraped: ScrapeResult;
3853
3880
  indexed: IndexResult;
@@ -3886,6 +3913,6 @@ declare class IndexerService {
3886
3913
  *
3887
3914
  * @packageDocumentation
3888
3915
  */
3889
- declare const VERSION = "0.1.0";
3916
+ declare const VERSION = "0.2.0";
3890
3917
 
3891
- export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BumpType, CachedStorageAdapter, type CachedStorageConfig, CatalogRenderer, type CatalogRendererConfig, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, type DiscoveredSkill, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, type FetchResult, type ForkOptions, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RollbackOptions, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillMetrics, type SkillNamespace, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaxonomyNode, type UpstreamUpdate, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, conditionalHook, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseVersion, refactoringProfile, satisfiesRange, securityProfile, sortVersions, testingProfile, writeAgentsMd };
3918
+ export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BumpType, CachedStorageAdapter, type CachedStorageConfig, CatalogRenderer, type CatalogRendererConfig, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, type DiscoveredSkill, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, type FetchResult, type ForkOptions, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RollbackOptions, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillNamespace, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaxonomyNode, type UpstreamUpdate, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, conditionalHook, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseVersion, refactoringProfile, satisfiesRange, securityProfile, sortVersions, testingProfile, writeAgentsMd };
package/dist/index.d.ts CHANGED
@@ -30,8 +30,6 @@ interface Skill {
30
30
  derivedFrom?: string[];
31
31
  /** Skills forked from this one (source → child tracking) */
32
32
  forks?: string[];
33
- /** Performance metrics */
34
- metrics: SkillMetrics;
35
33
  /** Upstream tracking for skills imported with 'link' mode */
36
34
  upstream?: SkillUpstream;
37
35
  source?: SkillSource$1;
@@ -76,20 +74,6 @@ interface ExpandTriggerConfig {
76
74
  };
77
75
  }
78
76
  type SkillStatus = 'draft' | 'active' | 'deprecated' | 'experimental';
79
- interface SkillMetrics {
80
- /** Number of times this skill was used */
81
- usageCount: number;
82
- /** Success rate (0-1) */
83
- successRate: number;
84
- /** When was this skill last used */
85
- lastUsed?: Date;
86
- /** User feedback scores */
87
- feedbackScores: number[];
88
- /** Average execution time in ms */
89
- avgExecutionTime?: number;
90
- /** Average confidence from matching */
91
- averageConfidence?: number;
92
- }
93
77
  interface SkillSource$1 {
94
78
  /** Where the skill came from */
95
79
  type: 'extracted' | 'manual' | 'imported' | 'composed';
@@ -264,7 +248,6 @@ interface SkillFilter {
264
248
  status?: SkillStatus[];
265
249
  tags?: string[];
266
250
  author?: string;
267
- minSuccessRate?: number;
268
251
  createdAfter?: Date;
269
252
  createdBefore?: Date;
270
253
  /** Filter by scope */
@@ -1087,9 +1070,23 @@ type SkillState = 'available' | 'expanded' | 'pending';
1087
1070
  * Flexible criteria for selecting skills into a loadout
1088
1071
  */
1089
1072
  interface LoadoutCriteria {
1090
- /** Always include these skill IDs */
1073
+ /**
1074
+ * Always include these skill IDs in the result, regardless of other
1075
+ * filters (status, tags, author, relationships, etc.). Missing skills
1076
+ * are fetched from storage on demand. The list is treated as a SET +
1077
+ * order hint — included skills come first in the order they appear
1078
+ * here, then the rest of the filtered set.
1079
+ *
1080
+ * `exclude` wins over `include`: IDs listed in both are excluded.
1081
+ *
1082
+ * For "restrict to exactly these N skills" semantics, combine
1083
+ * `include: [...]` with `maxSkills: include.length`.
1084
+ */
1091
1085
  include?: string[];
1092
- /** Never include these skill IDs */
1086
+ /**
1087
+ * Drop these skill IDs from the result. Wins over `include` —
1088
+ * an ID in both lists is excluded.
1089
+ */
1093
1090
  exclude?: string[];
1094
1091
  /** Match any of these tags */
1095
1092
  tags?: string[];
@@ -1097,8 +1094,6 @@ interface LoadoutCriteria {
1097
1094
  tagsAll?: string[];
1098
1095
  /** Filter by status (default: ['active']) */
1099
1096
  status?: SkillStatus[];
1100
- /** Quality threshold (0-1) */
1101
- minSuccessRate?: number;
1102
1097
  /** Filter by author */
1103
1098
  author?: string;
1104
1099
  /** Semantic match to task description */
@@ -1127,8 +1122,14 @@ interface LoadoutCriteria {
1127
1122
  maxSkills?: number;
1128
1123
  /** Context budget (estimated tokens) */
1129
1124
  maxTokens?: number;
1130
- /** How to order results for selection */
1131
- priorityOrder?: 'relevance' | 'usage' | 'successRate' | 'recent';
1125
+ /**
1126
+ * How to order results for selection. Currently only `'relevance'` is
1127
+ * recognized; it's a no-op until skill-tree gains semantic ranking. Live
1128
+ * usage-based ranking (formerly `'usage'` / `'successRate'` / `'recent'`)
1129
+ * is now the caller's responsibility — pre-rank and pass IDs via
1130
+ * `include: [...]`. See README "Metrics ownership" for the rationale.
1131
+ */
1132
+ priorityOrder?: 'relevance';
1132
1133
  /** How to apply to current state */
1133
1134
  mode?: 'replace' | 'merge' | 'subtract';
1134
1135
  }
@@ -1386,10 +1387,6 @@ declare class SkillGraphServer {
1386
1387
  * Collapse a skill (hide full content)
1387
1388
  */
1388
1389
  collapseSkill(skillId: string): boolean;
1389
- /**
1390
- * Record skill usage (for LRU tracking and auto-expansion)
1391
- */
1392
- recordUsage(skillId: string): void;
1393
1390
  /**
1394
1391
  * Agent requests to add skills
1395
1392
  * If requireApproval is true, adds to pending; otherwise directly adds
@@ -1524,21 +1521,14 @@ type SkillBankToServingEvent = {
1524
1521
  skillId: string;
1525
1522
  };
1526
1523
  /**
1527
- * Events that flow from Serving Layer to SkillBank
1524
+ * Events that flow from Serving Layer to SkillBank.
1525
+ *
1526
+ * `skill:used`, `skill:feedback`, and `skill:requested` were removed when
1527
+ * skill-tree dropped its `SkillMetrics` model — usage tracking is now
1528
+ * external (e.g., cognitive-core's `playbook.evolution.*`). See
1529
+ * docs/SKILL_TREE_METRICS_DEPRECATION.md.
1528
1530
  */
1529
1531
  type ServingToSkillBankEvent = {
1530
- type: 'skill:used';
1531
- skillId: string;
1532
- success: boolean;
1533
- } | {
1534
- type: 'skill:feedback';
1535
- skillId: string;
1536
- score: number;
1537
- comment?: string;
1538
- } | {
1539
- type: 'skill:requested';
1540
- skillId: string;
1541
- } | {
1542
1532
  type: 'loadout:changed';
1543
1533
  state: LoadoutState;
1544
1534
  };
@@ -2494,7 +2484,13 @@ declare class SkillBank {
2494
2484
  */
2495
2485
  private mapToServingEvent;
2496
2486
  /**
2497
- * Handle events from serving layer
2487
+ * Handle events from serving layer.
2488
+ *
2489
+ * The `loadout:changed` event is currently the only one we react to.
2490
+ * Earlier versions also handled `skill:used` / `skill:feedback` to mutate
2491
+ * `Skill.metrics`, but skill-tree no longer tracks per-skill usage —
2492
+ * cognitive-core owns that signal via `playbook.evolution.*`. See
2493
+ * docs/SKILL_TREE_METRICS_DEPRECATION.md.
2498
2494
  */
2499
2495
  private handleServingEvent;
2500
2496
  /**
@@ -2532,8 +2528,6 @@ interface SkillBankStats {
2532
2528
  totalSkills: number;
2533
2529
  byStatus: Record<Skill['status'], number>;
2534
2530
  byTag: Record<string, number>;
2535
- avgSuccessRate: number;
2536
- totalUsage: number;
2537
2531
  byScope?: {
2538
2532
  personal: number;
2539
2533
  team: number;
@@ -2795,8 +2789,6 @@ interface SkillSelector {
2795
2789
  tags?: string[];
2796
2790
  /** Include skills matching this status */
2797
2791
  status?: ('active' | 'experimental')[];
2798
- /** Minimum success rate to include */
2799
- minSuccessRate?: number;
2800
2792
  /** Maximum number of skills to include */
2801
2793
  limit?: number;
2802
2794
  }
@@ -3112,7 +3104,24 @@ declare class LoadoutCompiler {
3112
3104
  private config;
3113
3105
  constructor(storage: StorageAdapter, config?: LoadoutCompilerConfig);
3114
3106
  /**
3115
- * Main entry point - compile skills from criteria
3107
+ * Main entry point - compile skills from criteria.
3108
+ *
3109
+ * Filter pipeline order:
3110
+ * 1. status (initial query)
3111
+ * 2. exclude (drop matching IDs)
3112
+ * 3. tags / tagsAll
3113
+ * 4. author
3114
+ * 5. semantic (currently no-op)
3115
+ * 6. relationships (rootSkills traversal)
3116
+ * 7. **include** — presence guarantee: ensures every ID in the
3117
+ * include list is in the result regardless of the filters above,
3118
+ * fetching missing ones from storage as needed. `exclude` still
3119
+ * wins (excluded IDs are removed from the include list before
3120
+ * this step).
3121
+ * 8. limits (maxSkills, maxTokens)
3122
+ *
3123
+ * For "restrict to exactly these skills" semantics, combine
3124
+ * `include: [...]` with `maxSkills: include.length`.
3116
3125
  */
3117
3126
  compile(criteria: LoadoutCriteria): Promise<Skill[]>;
3118
3127
  /**
@@ -3128,7 +3137,9 @@ declare class LoadoutCompiler {
3128
3137
  */
3129
3138
  mergeLoadouts(current: Skill[], additions: Skill[], mode?: 'replace' | 'merge' | 'subtract'): Skill[];
3130
3139
  /**
3131
- * Apply explicit include/exclude filters
3140
+ * Apply explicit exclude filter. Include is handled separately at the
3141
+ * compile level (see `ensureIncludedPresent`) so it can guarantee
3142
+ * presence regardless of the other filters in this method or below.
3132
3143
  */
3133
3144
  applyExplicitFilters(skills: Skill[], criteria: LoadoutCriteria): Skill[];
3134
3145
  /**
@@ -3150,6 +3161,20 @@ declare class LoadoutCompiler {
3150
3161
  * Apply relationship-based filters (root skills, dependencies)
3151
3162
  */
3152
3163
  applyRelationshipFilters(skills: Skill[], criteria: LoadoutCriteria): Promise<Skill[]>;
3164
+ /**
3165
+ * Ensure every ID in `criteria.include` is present in the result,
3166
+ * regardless of which earlier filter would have dropped it. Missing
3167
+ * skills are fetched directly from storage.
3168
+ *
3169
+ * `criteria.exclude` still wins: an ID listed in both `include` and
3170
+ * `exclude` is treated as excluded (consistent with openteams' "deny
3171
+ * wins" inheritance rule on permissions).
3172
+ *
3173
+ * Included skills are placed at the front of the result, preserving
3174
+ * the order of `criteria.include`. Other skills retain their relative
3175
+ * order behind them.
3176
+ */
3177
+ ensureIncludedPresent(current: Skill[], criteria: LoadoutCriteria): Promise<Skill[]>;
3153
3178
  /**
3154
3179
  * Apply limits and sorting
3155
3180
  */
@@ -3848,6 +3873,8 @@ declare class IndexerService {
3848
3873
  force?: boolean;
3849
3874
  autoClassify?: boolean;
3850
3875
  detectRelationships?: boolean;
3876
+ /** Import all scraped skills into SkillBank regardless of classification status */
3877
+ importAll?: boolean;
3851
3878
  }): Promise<{
3852
3879
  scraped: ScrapeResult;
3853
3880
  indexed: IndexResult;
@@ -3886,6 +3913,6 @@ declare class IndexerService {
3886
3913
  *
3887
3914
  * @packageDocumentation
3888
3915
  */
3889
- declare const VERSION = "0.1.0";
3916
+ declare const VERSION = "0.2.0";
3890
3917
 
3891
- export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BumpType, CachedStorageAdapter, type CachedStorageConfig, CatalogRenderer, type CatalogRendererConfig, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, type DiscoveredSkill, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, type FetchResult, type ForkOptions, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RollbackOptions, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillMetrics, type SkillNamespace, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaxonomyNode, type UpstreamUpdate, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, conditionalHook, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseVersion, refactoringProfile, satisfiesRange, securityProfile, sortVersions, testingProfile, writeAgentsMd };
3918
+ export { type AgentConfig, AgentsGenerator, type AgentsGeneratorConfig, AgentsParser, AgentsSync, type BaseHookContext, type BumpType, CachedStorageAdapter, type CachedStorageConfig, CatalogRenderer, type CatalogRendererConfig, type ConflictConfig, type ConflictResolution$1 as ConflictResolution, ConflictStore, type ConflictStrategy, DEFAULT_AGENTS_CONFIG, type DiscoveredSkill, type EvictionStrategy, type ExpandTrigger, type ExpandTriggerConfig, type FederatedRemoteConfig, type FederationEvent, type FederationEventHandler, FederationManager, type FederationManagerOptions, type FetchResult, type ForkOptions, GitSyncAdapter, type GitSyncAdapterOptions, type SyncResult$1 as GitSyncResult, type GraphServerConfig, type HookContext, type HookEvent, type HookExecutionResult, type HookHandler, type HookPriority, HookRegistry, type HookResult, type ImportMode, type ImportOptions, type ImportResult, type IndexResult, IndexerService, type IndexerServiceConfig, type SkillSource as IndexerSkillSource, type IndexerStats, LineageTracker, type LineageTree, LoadoutCompiler, type LoadoutCompilerConfig, type LoadoutCriteria, type LoadoutSource, type LoadoutState, type LoadoutView, type MaterializationConfig, Materializer, MemoryStorageAdapter, type MergeConfig, type MergeConflict, type MergePreview, type MergeResult, type MergeStrategy, type MergeSuggestion, type MigrationOptions, type MigrationProgressItem, type MigrationResult, type NewVersionOptions, type ParsedAgentSkill, type ParsedAgentsFile, type ParsedVersion, type ProjectContext, ProjectDetector, type PullOptions, type PullUpstreamOptions, type PullUpstreamResult, type PushOptions, type RegisterHookOptions, type RegisteredHook, type RelationshipResult, type RemoteConfig, RemoteManager, type RemoteState, RemoteStore, type RollbackOptions, type ScrapeResult, type ServingEvent, type ServingEventHandler, type ShareOptions, type ShareResult, type Skill, type SkillAccessControl, SkillBank, type SkillBankConfig, type SkillBankStats, type SkillChange, type SkillConflict, type SkillCrudHookContext, type SkillDiffChanges, type SkillFilter, type SkillFork, type SkillFormat, SkillGraphServer, type SkillLineage, type SkillMergeResult, SkillMerger, type SkillNamespace, type SkillScope, type SkillSelector, type SkillServingMetadata, type SkillSource$1 as SkillSource, type SkillState, type SkillStatus, type SkillSummary, type SkillSyncState, type SkillTreeEvent, type SkillTreeEventHandler, type SkillUpstream, type SkillVersion, type SkillVisibility, type StorageAdapter, type StorageConfig, type StorageHookContext, type SyncBehaviorConfig, type SyncConfig, type ConflictResolution as SyncConflictResolution, type SyncError, SyncManager, type SyncManagerOptions, type SyncOptions, type SyncResult, type SyncState, type SyncStatus, type TaxonomyNode, type UpstreamUpdate, VERSION, type VersionChanges, type VersionDiff, ViewRenderer, type ViewRendererConfig, builtInProfiles, bumpVersion, codeReviewProfile, combineHandlers, compareVersions, conditionalHook, createAgentsGenerator, createAgentsParser, createAgentsSync, createBackupHook, createConflictStore, createDefaultSyncConfig, createFederationManager, createGitSyncAdapter, createLoggingHook, createSaveValidationHook, createSkillBank, createSkillMerger, createSyncManager, debuggingProfile, devopsProfile, discoverSkills, documentationProfile, formatVersion, generateAgentsMd, getBuiltInProfile, getLatestVersion, hasSkilltreeDir, hookRegistry, implementationProfile, importFromAgentsMd, inferBumpType, isValidVersion, listBuiltInProfiles, migrateStorage, parseVersion, refactoringProfile, satisfiesRange, securityProfile, sortVersions, testingProfile, writeAgentsMd };