UNPKG

devibe

Version:

Intelligent repository cleanup with auto mode, AI learning, markdown consolidation, auto-consolidate workflow, context-aware classification, and cost optimization

96 lines 2.61 kB
/** * Documentation Index Generator * * Uses AI to intelligently analyze docs folder structure and generate: * 1. INDEX.md in docs/ folder with categorized document links * 2. Brief descriptions of each document (AI-powered) * 3. Auto-detected categories based on folder structure * 4. Keeps index up-to-date on subsequent runs * * Philosophy: * - Preserve existing folder structure * - Let AI understand document purpose and relationships * - Create navigable, searchable index * - Update README to point to docs/INDEX.md */ import type { ProjectConventions } from '../project-convention-analyzer.js'; export interface DocFile { path: string; relativePath: string; name: string; category?: string; title?: string; description?: string; wordCount?: number; lastModified: Date; } export interface DocCategory { name: string; displayName: string; description?: string; files: DocFile[]; subfolders?: DocCategory[]; } export interface DocsIndexResult { indexPath: string; categoriesFound: number; filesIndexed: number; readmeUpdated: boolean; } export declare class DocsIndexGenerator { private aiAvailable; initialize(): Promise<void>; /** * Generate or update documentation index */ generate(rootPath: string, conventions?: ProjectConventions, dryRun?: boolean): Promise<DocsIndexResult>; /** * Find docs folder based on conventions */ private findDocsFolder; /** * Scan docs folder recursively for markdown files */ private scanDocsFolder; /** * Extract title from markdown content or filename */ private extractTitle; /** * Count words in content */ private countWords; /** * Categorize documents based on folder structure and AI analysis */ private categorizeDocuments; /** * Format category name for display */ private formatCategoryName; /** * Get AI-generated category description */ private getCategoryDescription; /** * Use AI to enhance file descriptions */ private enhanceWithAI; /** * Generate INDEX.md content */ private generateIndexContent; /** * Slugify text for anchor links */ private slugify; /** * Update README.md with unified index section */ private updateReadmeWithIndex; /** * Get a preview of what would be generated (for dry-run) */ preview(rootPath: string, conventions?: ProjectConventions): Promise<string>; } //# sourceMappingURL=docs-index-generator.d.ts.map