/** * @fileoverview Shared context-word extraction for skill recommendations. * @module @skillsmith/core/services/context-words * @see SMI-5986: CLI `recommend --context` (`recommend.ts:76`) and MCP * `skill_recommend`'s `project_context` (`recommend.ts:127`) each derived a * "context words" slice for the recommendation stack via * `.filter((w) => w.length > 3)` — a bare length threshold that silently * dropped real 2-3 character technical terms ("git", "ci", "aws", "sql") * that happen to be short. When a caller's context consisted only of such * terms, the resulting derived stack was empty and the SMI-5896 * empty-stack guard (`buildEmptyStackGuidance`, this module's sibling) * fired even though the caller *did* supply usable context. * * Shared here (not duplicated per-twin) so CLI and MCP can't independently * drift on what counts as noise vs. a real short technical term — the same * class of duplication risk `buildEmptyStackGuidance` above already closed * for the empty-stack message itself (plan-review correction, SMI-5984 * Wave 1: a bare length threshold "admits noise words" and leaves the two * twins free to drift apart again independently). */ /** * Extract up to `maxWords` usable technical terms from free-text project * context for the recommendation stack. * * Replaces the old `.filter((w) => w.length > 3)` threshold: real technical * terms of 2-3 characters ("git", "ci", "aws", "sql") are now kept, while * single-character tokens, punctuation-only tokens (including one that * survives edge-stripping because it's made entirely of `+`/`#`, e.g. "++" * or "+#" — PR review round 3, SMI-5986), and short English function words * ("a", "the", "is", ...) are still dropped as noise. Words of 4+ * characters are unaffected — this only changes the outcome for the short * end of the spectrum the length threshold got wrong. * * @param projectContext - Free-text project/context description. `null`/ * `undefined`/empty returns `[]`, mirroring both callers' pre-existing * `if (project_context)` guard. * @param maxWords - Maximum number of words to return (default 5). */ export declare function extractContextWords(projectContext: string | undefined | null, maxWords?: number): string[]; //# sourceMappingURL=context-words.d.ts.map