import type { CrawledPage, CrawlResult } from './doc-crawler.js'; export interface SkillMetadata { title: string; description: string; sourceUrl: string; pagesCrawled: number; maxDepthReached: number; generatedAt: string; sourceUrls: string[]; } export interface GeneratedSkill { skillMd: string; referenceFiles: Map; metadata: SkillMetadata; skillName: string; } export interface SavedSkillFiles { skillDir: string; skillMdPath: string; referenceFiles: string[]; } export declare class SkillGenerator { private readonly CONTENT_PREVIEW_LENGTH; private readonly MIN_CATEGORIZATION_SCORE; private readonly MIN_CONTENT_LENGTH; private readonly MIN_HEADINGS_COUNT; /** * Generate agent skill from crawled documentation */ generateSkill(crawlResult: CrawlResult, rootUrl: string, skillName?: string): GeneratedSkill; /** * Generate skill name from URL or provided name (sanitized) */ private generateSkillName; /** * Extract title from URL or first page */ private extractTitle; /** * Generate description with "when to use" triggers and keywords extracted from pages * Description must be comprehensive, include triggers, and stay within 1024 chars */ private generateDescription; /** * Extract key topics from page titles, headings, and content */ private extractKeyTopics; /** * Extract domain name from URL */ private extractDomainName; /** * Extract use cases from pages and categories */ private extractUseCases; /** * Generate trigger keywords from categories and topics */ private generateTriggers; /** * Categorize pages into categories based on URL patterns and content */ private categorizePages; /** * Infer categories from URL patterns */ private inferCategories; /** * Generate reference files for each category * Includes full content, code examples, and table of contents from headings * Adds table of contents at the top for files longer than 100 lines */ private generateReferenceFiles; /** * Generate SKILL.md with YAML frontmatter * Optimized for progressive disclosure - concise body focused on procedural instructions */ private generateSkillMd; /** * Get guidance on when to read a specific category reference file */ private getWhenToReadGuidance; /** * Save skill to file system in proper directory structure * Prevents nested skill directories by checking if outputDir is already a skill directory */ saveSkill(skill: GeneratedSkill, outputDir: string, filename?: string): Promise; /** * Slugify text for anchor links */ private slugify; /** * Capitalize first letter */ private capitalize; /** * Check if crawled content is sufficient for skill generation */ canGenerateSkill(pages: CrawledPage[]): { canGenerate: boolean; reason?: string; }; /** * Validate description quality - checks length and presence of trigger keywords */ private validateDescription; } //# sourceMappingURL=skill-generator.d.ts.map