Documentation
¶
Index ¶
- type ConfigNode
- type ContextScope
- type Location
- type Metrics
- type RefType
- type Reference
- type ScopeType
- type Tree
- func (t *Tree) AllPaths() []string
- func (t *Tree) AllReferences() []Reference
- func (t *Tree) DiscoverCommands(agentConfig *agent.Config, rootPath string) ([]*ContextScope, error)
- func (t *Tree) DiscoverScopes(agentConfig *agent.Config, rootPath string) ([]*ContextScope, error)
- func (t *Tree) DiscoverSkills(agentConfig *agent.Config, rootPath string) ([]*ContextScope, error)
- func (t *Tree) NodeCount() int
- func (t *Tree) PrintTree()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigNode ¶
type ConfigNode struct {
Path string
Content []byte
Parsed *parser.ParsedFile
References []Reference
Children []*ConfigNode
Parent *ConfigNode
Depth int
}
ConfigNode represents a node in the configuration tree
type ContextScope ¶
type ContextScope struct {
// Type indicates whether this is a main or subagent scope
Type ScopeType
// Name identifies the scope ("main" or the subagent name)
Name string
// Entrypoint is the root file path for this scope
Entrypoint string
// Nodes contains all ConfigNodes that belong to this scope
Nodes []*ConfigNode
// FilePaths is a convenience list of all file paths in this scope
FilePaths []string
// Children contains nested scopes (commands/skills for main, skills for subagents)
Children []*ContextScope
// DeclaredSkills contains skill names declared in frontmatter
DeclaredSkills []string
// DeclaredTools contains tool names declared in frontmatter
DeclaredTools []string
}
ContextScope represents an isolated scope for analysis. Each scope contains a subset of files that form a coherent context, either the main agent configuration or a subagent's configuration.
type Metrics ¶
type Metrics struct {
TotalFiles int
TotalReferences int
EstimatedTokens int
TotalBytes int
ReferencesByType map[string]int
FilesByType map[string]int
MaxDepth int
UnresolvedRefs int
}
Metrics contains computed metrics about the configuration
func ComputeMetrics ¶
ComputeMetrics computes metrics for a configuration tree
type Reference ¶
type Reference struct {
Type RefType
Value string
Source Location
Priority int // Based on surrounding markers
Context string // Surrounding text for context
Resolved bool // Whether the reference was resolved
Target string // Resolved path/URL
}
Reference represents a reference found in a configuration file
type Tree ¶
type Tree struct {
Root *ConfigNode
RootPath string // Absolute path to project root
Nodes map[string]*ConfigNode // Path -> Node
}
Tree represents the complete configuration tree
func (*Tree) AllReferences ¶
AllReferences returns all references from all nodes
func (*Tree) DiscoverCommands ¶
func (t *Tree) DiscoverCommands(agentConfig *agent.Config, rootPath string) ([]*ContextScope, error)
DiscoverCommands finds all slash commands in .claude/commands/ and builds scopes for them. Each command file becomes its own context scope that can be analyzed independently.
func (*Tree) DiscoverScopes ¶
DiscoverScopes finds all context scopes in the tree. It identifies the main scope and any subagent scopes from: 1. RefTypeSubagent references in parsed files 2. Files in well-known paths like .claude/agents/
func (*Tree) DiscoverSkills ¶
DiscoverSkills finds all skills in .claude/skills/ and builds scopes for them. Each skill directory becomes its own context scope that can be analyzed independently.