Documentation
¶
Overview ¶
Package codeskim provides a code outline/skimming tool for agents. It strips implementation details from source files and returns only the structural elements: package declarations, imports, type definitions, function signatures, and doc comments. This lets agents understand large codebases without consuming massive context.
Problem: Agents need to navigate large codebases to understand structure, find functions, and identify types. Reading entire files consumes too much LLM context. This package produces compact outlines that capture the essential API surface of source files.
For Go files, it uses the stdlib go/parser and go/ast for precise AST-based extraction. For other languages, it uses a line-based heuristic that identifies common patterns (function definitions, class declarations, etc.).
Safety guards:
- File size capped at 1 MB to prevent excessive memory usage
- Output truncated at 32 KB to limit LLM context consumption
- Directory listings skip hidden files and common noise (node_modules, .git)
Dependencies:
- Go stdlib only (go/parser, go/ast, go/token)
- No external system dependencies
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ToolProvider ¶
type ToolProvider struct{}
ToolProvider wraps the code skim tool and satisfies the tools.ToolProviders interface.
func NewToolProvider ¶
func NewToolProvider() *ToolProvider
NewToolProvider creates a ToolProvider for the code skim tool.
func (*ToolProvider) GetTools ¶
func (p *ToolProvider) GetTools() []tool.Tool
GetTools returns the code skim tool.