/** * @fileoverview Semantic skill matching using embeddings * @module @skillsmith/core/matching/SkillMatcher * @see SMI-602: Implement recommend_skills MCP tool * * Provides semantic similarity matching between skills using * the EmbeddingService for vector-based comparisons. * * @example * const matcher = new SkillMatcher({ useFallback: true }); * const matches = await matcher.findSimilarSkills('react testing', skills, 5); */ import { type EmbeddingServiceOptions } from '../embeddings/index.js'; /** * Skill data for matching */ export interface MatchableSkill { /** Unique skill identifier */ id: string; /** Skill display name */ name: string; /** Skill description */ description: string; /** Optional trigger phrases for overlap detection */ triggerPhrases?: string[]; /** Optional keywords for keyword-based fallback */ keywords?: string[]; /** Optional quality score (0-100) */ qualityScore?: number; } /** * Result of a skill match */ export interface SkillMatchResult { /** Matched skill */ skill: MatchableSkill; /** Semantic similarity score (0-1) */ similarityScore: number; /** Why this skill matched */ matchReason: string; } /** * Options for SkillMatcher */ export interface SkillMatcherOptions extends EmbeddingServiceOptions { /** Minimum similarity threshold (0-1, default 0.3) */ minSimilarity?: number; /** Quality score weight (0-1, default 0.3) */ qualityWeight?: number; } /** * Semantic skill matcher using embeddings. * * Finds skills similar to a query using vector similarity, * with optional quality score boosting. * * @example * const matcher = new SkillMatcher({ useFallback: true }); * await matcher.initialize(skills); * const results = await matcher.findSimilarSkills('react testing', skills); */ export declare class SkillMatcher { private embeddingService; private skillEmbeddings; private initialized; private readonly minSimilarity; private readonly qualityWeight; constructor(options?: SkillMatcherOptions); /** * Check if matcher is using fallback mode */ isUsingFallback(): boolean; /** * Initialize skill embeddings for a set of skills. * Call this before matching for best performance. */ initialize(skills: MatchableSkill[]): Promise; /** * Convert skill to text for embedding */ private skillToText; /** * Find skills similar to a query string. * * @param query - Search query or context description * @param skills - Pool of skills to search * @param limit - Maximum results to return * @returns Ranked list of matching skills * * @example * const matches = await matcher.findSimilarSkills( * 'React TypeScript frontend testing', * availableSkills, * 5 * ); */ findSimilarSkills(query: string, skills: MatchableSkill[], limit?: number): Promise; /** * Find skills similar to a set of installed skills. * * @param installedSkills - Currently installed skills * @param candidateSkills - Pool of skills to recommend from * @param limit - Maximum results * @returns Ranked list of recommended skills */ findComplementarySkills(installedSkills: MatchableSkill[], candidateSkills: MatchableSkill[], limit?: number): Promise; /** * Generate a human-readable match reason */ private generateMatchReason; /** * Get embedding dimension */ getEmbeddingDimension(): number; /** * Clear cached embeddings */ clear(): void; /** * Close resources */ close(): void; } export default SkillMatcher; //# sourceMappingURL=SkillMatcher.d.ts.map