Versions in this module Expand all Collapse all v0 v0.2.0 May 15, 2026 Changes in this version + func AutoFix(opp MigrationOpportunity, content string) (string, error) + func CoChangeAnalysisMap(projectDir string) map[string][]string + func CompareScores(before, after *HealthScore) string + func DetectFramework(dir string) string + func EstimateRemovableLines(items []DeadCode) int + func ExpandQuery(query string) []string + func ExtractSnippet(doc *Document, queryTerms []string, maxLen int) string + func FindEntryPoints(projectDir string) []string + func FindKeyFiles(projectDir string, limit int) []string + func FormatAPIMap(apiMap *APIMap) string + func FormatDeadCode(items []DeadCode) string + func FormatDefinition(def *Definition) string + func FormatGroups(groups []FileGroup) string + func FormatOpportunities(opps []MigrationOpportunity) string + func FormatReferences(symbol string, refs []*Reference) string + func FormatResults(query string, hits []SearchHit) string + func FormatScore(score *HealthScore) string + func FormatSmells(smells []CodeSmell) string + func GenerateOpenAPI(apiMap *APIMap) string + func GenerateRemovalPlan(items []DeadCode) string + func InferArchitecture(packages []SummaryPackageInfo) string + func InferPurpose(pkgPath string, symbols []string) string + func IsInterfaceImpl(name string, content string) bool + func IsTestFunction(name string) bool + func MaintainabilityIndex(fc FunctionComplexity) float64 + func RenderCompact(summary *CodebaseSummary) string + func RenderForPrompt(summary *CodebaseSummary, budget int) string + func RenderTreeContext(file string, symbols []Symbol, maxLines int) string + type APIEndpoint struct + Description string + File string + Handler string + Line int + Method string + Middleware []string + Path string + func ScanChi(content, file string) []APIEndpoint + func ScanEcho(content, file string) []APIEndpoint + func ScanFiber(content, file string) []APIEndpoint + func ScanGin(content, file string) []APIEndpoint + func ScanGorilla(content, file string) []APIEndpoint + func ScanNetHTTP(content, file string) []APIEndpoint + type APIMap struct + BaseURL string + Endpoints []APIEndpoint + Version string + func (m *APIMap) FindEndpointByPath(path string) *APIEndpoint + type APIScanner struct + func NewAPIScanner() *APIScanner + func (s *APIScanner) ScanProject(dir string) (*APIMap, error) + type CodeSmell struct + Category string + Description string + File string + ID string + Line int + Name string + RefactoringSuggestion string + Severity string + type CodebaseSummary struct + Architecture string + Description string + EntryPoints []string + GeneratedAt time.Time + KeyFiles []string + Language string + Packages []SummaryPackageInfo + ProjectName string + TotalFiles int + TotalLOC int + type ComplexityAnalyzer struct + HighCognitive int + HighCyclomatic int + HighLOC int + HighNesting int + func NewComplexityAnalyzer() *ComplexityAnalyzer + func (ca *ComplexityAnalyzer) AnalyzeFile(path, content string) (*ComplexityReport, error) + func (ca *ComplexityAnalyzer) AnalyzeGeneric(content, language string) []FunctionComplexity + func (ca *ComplexityAnalyzer) AnalyzeGoAST(content string) []FunctionComplexity + func (ca *ComplexityAnalyzer) FindHotspots(dir string, limit int) []FunctionComplexity + func (ca *ComplexityAnalyzer) FormatReport(report *ComplexityReport) string + func (ca *ComplexityAnalyzer) SuggestRefactoring(fc FunctionComplexity) []string + type ComplexityReport struct + BlankLines int + CLOC int + File string + FileComplexity float64 + Functions []FunctionComplexity + LOC int + type Contributor struct + Commits int + LastActive time.Time + Name string + Percentage float64 + type DeadCode struct + Confidence float64 + File string + Kind string + Line int + Name string + Reason string + type DeadCodeDetector struct + Declarations map[string]*Declaration + References map[string]int + func NewDeadCodeDetector() *DeadCodeDetector + func (d *DeadCodeDetector) FindUnused() []DeadCode + func (d *DeadCodeDetector) FindUnusedExports(projectDir string) []DeadCode + func (d *DeadCodeDetector) Scan(projectDir string) ([]DeadCode, error) + func (d *DeadCodeDetector) ScanFile(path, content string) + type Declaration struct + Exported bool + File string + Kind string + Line int + Name string + Package string + type Definition struct + DocComment string + Exported bool + File string + Kind string + Line int + Name string + Package string + Signature string + type DepEdge struct + From string + To string + Weight int + type DepGraph struct + Edges []DepEdge + Nodes map[string]*DepNode + Root string + func NewDepGraph() *DepGraph + func (dg *DepGraph) AddEdge(edge DepEdge) + func (dg *DepGraph) AddNode(node DepNode) + func (dg *DepGraph) BuildFromGoMod(projectDir string) error + func (dg *DepGraph) BuildFromPackageJSON(projectDir string) error + func (dg *DepGraph) FindCycles() [][]string + func (dg *DepGraph) HotPaths() [][]string + func (dg *DepGraph) Layers() [][]string + func (dg *DepGraph) RenderASCII(maxWidth int) string + func (dg *DepGraph) RenderDOT() string + func (dg *DepGraph) RenderMermaid() string + func (dg *DepGraph) Stats() GraphStats + func (dg *DepGraph) TopologicalSort() []string + type DepNode struct + FileCount int + ID string + ImportedBy []string + Imports []string + LOC int + Name string + Type string + type DocIssue struct + Line int + Message string + Severity string + Suggestion string + Symbol string + Type string + type DocLintResult struct + File string + Issues []DocIssue + Score float64 + Stats DocStats + type DocLinter struct + MinCommentLength int + RequireExported bool + func NewDocLinter() *DocLinter + func (dl *DocLinter) CheckGoDoc(name, comment string) []DocIssue + func (dl *DocLinter) CoverageReport(results []*DocLintResult) string + func (dl *DocLinter) FormatReport(results []*DocLintResult) string + func (dl *DocLinter) LintDirectory(dir string) ([]*DocLintResult, error) + func (dl *DocLinter) LintFile(path, content string) (*DocLintResult, error) + func (dl *DocLinter) SuggestDocComment(name, kind, signature string) string + type DocStats struct + AvgLength int + Coverage float64 + Documented int + MissingCount int + TotalExported int + type Document struct + Content string + ID string + Length int + Path string + Terms map[string]int + Type string + type FileGroup struct + Confidence float64 + Files []string + Name string + Reason string + Type string + type FileGrouper struct + Groups []FileGroup + ProjectDir string + func NewFileGrouper(projectDir string) *FileGrouper + func (fg *FileGrouper) AnalyzeGroups() ([]FileGroup, error) + func (fg *FileGrouper) FindByFeature(featureName string) []string + func (fg *FileGrouper) FindRelated(file string) []string + func (fg *FileGrouper) FindTestPair(file string) string + func (fg *FileGrouper) SuggestEditGroup(targetFile string) []string + type FileOwnership struct + Contributors []Contributor + LastModified time.Time + Path string + PrimaryOwner string + TotalCommits int + type FunctionComplexity struct + Cognitive int + Cyclomatic int + EndLine int + LOC int + Name string + Nesting int + Parameters int + Returns int + StartLine int + type GraphStats struct + Cycles int + ExternalNodes int + InternalNodes int + MaxDepth int + MostImported string + MostImporting string + StdlibNodes int + TotalEdges int + TotalNodes int + type HealthIssue struct + Description string + Dimension string + File string + Severity string + Suggestion string + type HealthScore struct + Dimensions map[string]float64 + Grade string + Issues []HealthIssue + Overall float64 + Strengths []string + type HealthScorer struct + Weights map[string]float64 + func NewHealthScorer() *HealthScorer + func (hs *HealthScorer) Score(projectDir string) (*HealthScore, error) + func (hs *HealthScorer) ScoreCodeQuality(dir string) (float64, []HealthIssue) + func (hs *HealthScorer) ScoreComplexity(dir string) (float64, []HealthIssue) + func (hs *HealthScorer) ScoreDependencies(dir string) (float64, []HealthIssue) + func (hs *HealthScorer) ScoreDocumentation(dir string) (float64, []HealthIssue) + func (hs *HealthScorer) ScoreMaintainability(dir string) (float64, []HealthIssue) + func (hs *HealthScorer) ScoreSecurity(dir string) (float64, []HealthIssue) + func (hs *HealthScorer) ScoreTestCoverage(dir string) (float64, []HealthIssue) + type MigrationDetector struct + Rules []MigrationRule + func NewMigrationDetector() *MigrationDetector + func (md *MigrationDetector) AddRule(rule MigrationRule) + func (md *MigrationDetector) Scan(projectDir string) ([]MigrationOpportunity, error) + func (md *MigrationDetector) ScanFile(path, content string) []MigrationOpportunity + type MigrationOpportunity struct + AutoFixable bool + Category string + File string + Line int + NewPattern string + OldPattern string + Priority string + Reason string + type MigrationRule struct + AutoFixable bool + Category string + ID string + Language string + NewPattern string + OldPattern *regexp.Regexp + Priority string + Reason string + Since string + type NavIndex struct + Definitions map[string]*Definition + Implementations map[string][]string + References map[string][]*Reference + func NewNavIndex() *NavIndex + func (idx *NavIndex) BuildIndex(projectDir string) error + func (idx *NavIndex) FindCallees(funcName string) []string + func (idx *NavIndex) FindCallers(funcName string) []*Reference + func (idx *NavIndex) FindImplementations(interfaceName string) []string + func (idx *NavIndex) FindReferences(symbol string) []*Reference + func (idx *NavIndex) GoToDefinition(symbol string) *Definition + func (idx *NavIndex) SearchSymbols(query string, kind string) []*Definition + func (idx *NavIndex) TypeHierarchy(typeName string) string + type OwnerRule struct + Owners []string + Pattern string + Source string + type OwnershipMap struct + Owners map[string]*FileOwnership + Rules []OwnerRule + func NewOwnershipMap() *OwnershipMap + func (om *OwnershipMap) BuildFromGitHistory(projectDir string) error + func (om *OwnershipMap) DetectBusFactorRisk() []string + func (om *OwnershipMap) FindExpertFor(path string) string + func (om *OwnershipMap) FormatOwnership(limit int) string + func (om *OwnershipMap) GetOwner(path string) *FileOwnership + func (om *OwnershipMap) GetOwnersByDirectory(dir string) map[string]string + func (om *OwnershipMap) LoadCodeowners(path string) error + func (om *OwnershipMap) SuggestReviewers(changedFiles []string) []string + type Reference struct + Context string + File string + Kind string + Line int + type SearchHit struct + Document *Document + MatchedTerms []string + Score float64 + Snippet string + type SemanticSearchIndex struct + AvgDocLen float64 + Documents map[string]*Document + IDF map[string]float64 + TotalDocs int + func NewSemanticSearchIndex() *SemanticSearchIndex + func (si *SemanticSearchIndex) BM25Score(queryTerms []string, doc *Document) float64 + func (si *SemanticSearchIndex) IndexDirectory(dir string) error + func (si *SemanticSearchIndex) IndexFile(path, content string) + func (si *SemanticSearchIndex) RebuildIndex() error + func (si *SemanticSearchIndex) Search(query string, limit int) []SearchHit + func (si *SemanticSearchIndex) SearchByIntent(intent string) []SearchHit + type SmellDetector struct + Thresholds SmellThresholds + func NewSmellDetector() *SmellDetector + func (sd *SmellDetector) DetectDataClump(content string) []CodeSmell + func (sd *SmellDetector) DetectFeatureEnvy(content string) []CodeSmell + func (sd *SmellDetector) DetectGodObject(content string) []CodeSmell + func (sd *SmellDetector) DetectInFile(path, content string) []CodeSmell + func (sd *SmellDetector) DetectLongParamList(content string) []CodeSmell + func (sd *SmellDetector) DetectPrimitiveObsession(content string) []CodeSmell + func (sd *SmellDetector) ScanDirectory(dir string) []CodeSmell + type SmellThresholds struct + MaxFieldsPerStruct int + MaxFileLines int + MaxFuncLines int + MaxImports int + MaxMethodsPerType int + MaxParams int + MinMethodCohesion float64 + type SummaryGenerator struct + MaxTokens int + ProjectDir string + func NewSummaryGenerator(projectDir string, maxTokens int) *SummaryGenerator + func (sg *SummaryGenerator) Generate() (*CodebaseSummary, error) + type SummaryPackageInfo struct + Dependencies []string + Dependents []string + Files int + LOC int + Name string + Path string + PublicSymbols int + Purpose string type Symbol + func ParseFileEnhanced(path string) ([]Symbol, error) + func ParseSourceEnhanced(src, ext string) ([]Symbol, error) + type TreeContextRenderer struct + type TreeSitterParser struct + IncludeUnexported bool + func NewTreeSitterParser() *TreeSitterParser + func (p *TreeSitterParser) ParseFile(path string) ([]Symbol, error) + func (p *TreeSitterParser) ParseSource(src, ext, path string) ([]Symbol, error) v0.1.0 May 12, 2026 Changes in this version + func CacheClear() + func CacheSize() int + func ComputeFileHash(path string) (string, error) + func IncrementalReindex(dir string, ignore []string, indexer CodeIndexer) (added, skipped, removed int, err error) + type CallGraph struct + func BuildCallGraph(root string) (*CallGraph, error) + func (cg *CallGraph) CalleesOf(funcName string, maxDepth int) []string + func (cg *CallGraph) CallersOf(funcName string, maxDepth int) []string + func (cg *CallGraph) Neighborhood(funcName string, depth int) []string + type ChangeSetContext struct + ChangedFiles []string + DependencyFiles []string + ImpactedFiles []string + TotalFiles int + func FromGitDiff(root string, graph *ImportGraph) (*ChangeSetContext, error) + func FromGitDiffRange(root string, baseRef string, graph *ImportGraph) (*ChangeSetContext, error) + func (c *ChangeSetContext) FormatContext(maxTokens int) string + type CoChangeAnalysis struct + func BuildCoChangeAnalysis(root string, commitLimit int) (*CoChangeAnalysis, error) + func (ca *CoChangeAnalysis) RelatedFiles(filePath string, topK int) []string + type CodeChunk struct + Content string + EndLine int + Path string + StartLine int + Vector []float32 + type CodeIndexer interface + ClearFileChunks func(path string) error + GetFileHash func(path string) (string, error) + IndexCodeChunk func(path, content, symbol, lang string, start, end, tokens int, hash string) error + ListIndexedPaths func() ([]string, error) + SearchCode func(query string, limit int) ([]CodeSearchResult, error) + type CodeSearchResult struct + Content string + EndLine int + Path string + Score float64 + StartLine int + Symbol string + type EnhancedGoParser struct + func (p *EnhancedGoParser) ParseGoFile(content, filePath string) []EnhancedSymbol + type EnhancedSymbol struct + Exported bool + File string + Kind string + Line int + Name string + References []string + func ParsePythonFile(content, filePath string) []EnhancedSymbol + type FileCache struct + Hash string + Mtime int64 + Symbols []string + type FileMap struct + Path string + Symbols []Symbol + type FileSummary struct + Functions []string + LineCount int + Path string + Types []string + type FileWatcher struct + func NewFileWatcher(root string, onChange func(path string)) (*FileWatcher, error) + func (fw *FileWatcher) Start() + func (fw *FileWatcher) Stop() + type GitignoreRules struct + func LoadGitignoreRules(dir string) *GitignoreRules + func (gr *GitignoreRules) ShouldIgnore(path string) bool + type HierarchicalSummary struct + Packages []PackageSummary + Root string + func BuildHierarchy(root string) (*HierarchicalSummary, error) + func (h *HierarchicalSummary) FormatLevel1(maxTokens int) string + func (h *HierarchicalSummary) FormatLevel2(pkgPath string, maxTokens int) string + func (h *HierarchicalSummary) FormatLevel3(filePath string) string + type ImportGraph struct + func BuildImportGraph(root string) (*ImportGraph, error) + func (g *ImportGraph) DependenciesOf(filePath string, maxDepth int) []string + func (g *ImportGraph) DependentsOf(filePath string, maxDepth int) []string + func (g *ImportGraph) Edges() map[string][]string + func (g *ImportGraph) ImpactSet(files []string, maxDepth int) []string + func (g *ImportGraph) Reverse() map[string][]string + type IncrementalMap struct + func NewIncrementalMap(cacheDir string) (*IncrementalMap, error) + func (im *IncrementalMap) AllSymbols() map[string][]string + func (im *IncrementalMap) Save() error + func (im *IncrementalMap) Symbols(path string) []string + func (im *IncrementalMap) Update(rootDir string) (changed []string, err error) + type IndexPatterns struct + Exclude []string + Include []string + func DefaultIndexPatterns() IndexPatterns + func LoadIndexPatterns() IndexPatterns + func (p IndexPatterns) ShouldIndex(path string) bool + type InterfaceExtraction struct + Constants []string + Functions []string + Package string + Types []string + func ExtractInterface(filePath string) (*InterfaceExtraction, error) + func (ie *InterfaceExtraction) Format() string + func (ie *InterfaceExtraction) TokenEstimate() int + type Options struct + IgnorePatterns []string + MaxFiles int + MaxTokens int + type PackageSummary struct + Files []FileSummary + Name string + Path string + Symbols int + type PredictedFile struct + Path string + Reason string + Score float64 + type RecentEdit struct + At time.Time + Path string + type RecentEditTracker struct + func NewRecentEditTracker(max int) *RecentEditTracker + func (t *RecentEditTracker) Recent(within time.Duration) []RecentEdit + func (t *RecentEditTracker) Record(path string) + type RelevancePrediction struct + Files []PredictedFile + func PredictRelevantFiles(prompt string, recentEdits []RecentEdit, graph *ImportGraph, ...) *RelevancePrediction + type RepoMap struct + Files []FileMap + TokenEst int + func Generate(dir string, opts Options) (*RepoMap, error) + func (rm *RepoMap) Format(maxTokens int) string + type RerankResult struct + Chunk CodeSearchResult + Score float64 + func Rerank(query string, candidates []CodeSearchResult, topK int) []RerankResult + type SemanticIndex struct + func BuildSemanticIndex(dir string, ignore []string, maxFiles int) (*SemanticIndex, error) + func LoadSemanticIndex(path string) (*SemanticIndex, error) + func (idx *SemanticIndex) Save(path string) error + func (idx *SemanticIndex) Search(query string, topK int) []CodeChunk + func (idx *SemanticIndex) Size() int + type ShapleyRanker struct + func NewShapleyRanker(chunks []CodeChunk) *ShapleyRanker + func (sr *ShapleyRanker) ComputeScores(relevantPaths []string, query string) []ShapleyScore + func (sr *ShapleyRanker) Format(chunks []CodeChunk) string + func (sr *ShapleyRanker) SelectOptimalContext(query string, tokenBudget int) []CodeChunk + type ShapleyScore struct + Content string + EndLine int + Path string + Score float64 + StartLine int + type Symbol struct + Kind string + Line int + Name string + type SymbolGraph struct + func BuildSymbolGraph(dir string, opts Options) (*SymbolGraph, error) + func (sg *SymbolGraph) ComputePageRank(iterations int, damping float64) + func (sg *SymbolGraph) FormatMap(maxTokens int) string + func (sg *SymbolGraph) TopSymbols(n int) []SymbolNode + type SymbolNode struct + File string + Kind string + Rank float64 + Symbol string