Documentation
¶
Index ¶
- Constants
- Variables
- func CountLines(content string) int
- func DetectSecrets(contents string, filePath string) []types.ValidationError
- func DetermineSeverity(message string) string
- func ExtractBaseToolName(tool string) string
- func FindFrontmatterFieldLine(content, fieldName string) int
- func FindLineNumber(content, pattern string) int
- func FindSectionLine(content, sectionName string) int
- func GetFrontmatterEndLine(content string) int
- func ValidateAllowedTools(data map[string]any, filePath string, contents string) []types.ValidationError
- func ValidateToolFieldName(data map[string]any, filePath string, contents string, componentType string) []types.ValidationError
- type Frontmatter
- type ImprovementRecommendation
Constants ¶
const ( SeverityHigh = "high" SeverityMedium = "medium" SeverityLow = "low" )
Severity levels
Variables ¶
var DeprecatedTools = map[string]string{
"TaskOutput": "TaskOutput is deprecated (v2.1.83) — use Read on the background task's output file path instead",
}
DeprecatedTools maps tool names to their deprecation message.
var KnownTools = map[string]bool{ "Read": true, "Write": true, "Edit": true, "MultiEdit": true, "Glob": true, "Grep": true, "LS": true, "Bash": true, "Task": true, "Agent": true, "WebFetch": true, "WebSearch": true, "AskUserQuestion": true, "TodoWrite": true, "TaskCreate": true, "TaskUpdate": true, "TaskList": true, "TaskGet": true, "TaskStop": true, "Skill": true, "LSP": true, "NotebookEdit": true, "EnterPlanMode": true, "ExitPlanMode": true, "EnterWorktree": true, "ExitWorktree": true, "KillShell": true, "TaskOutput": true, "SendMessage": true, "Monitor": true, "RemoteTrigger": true, "CronCreate": true, "CronDelete": true, "CronList": true, "*": true, }
KnownTools is the set of valid Claude Code tool names. Source: Claude Code documentation.
Functions ¶
func CountLines ¶
CountLines returns the total number of lines in content
func DetectSecrets ¶
func DetectSecrets(contents string, filePath string) []types.ValidationError
DetectSecrets checks for hardcoded secrets in content
func DetermineSeverity ¶
DetermineSeverity determines issue severity based on the message
func ExtractBaseToolName ¶
extractBaseToolName returns the base tool name from patterns like "Task(name)" or "Bash(npm:*)".
func FindFrontmatterFieldLine ¶
FindFrontmatterFieldLine finds the line number of a YAML frontmatter field
func FindLineNumber ¶
FindLineNumber finds the line number (1-based) where a pattern first appears
func FindSectionLine ¶
FindSectionLine finds the line number of a markdown section header
func GetFrontmatterEndLine ¶
GetFrontmatterEndLine returns the line number where frontmatter ends
func ValidateAllowedTools ¶
func ValidateAllowedTools(data map[string]any, filePath string, contents string) []types.ValidationError
ValidateAllowedTools validates that allowed-tools and tools fields contain known tool names
func ValidateToolFieldName ¶
func ValidateToolFieldName(data map[string]any, filePath string, contents string, componentType string) []types.ValidationError
ValidateToolFieldName ensures components use correct field name (tools vs allowed-tools) - Agents MUST use 'tools:', not 'allowed-tools:' - Commands and Skills MUST use 'allowed-tools:', not 'tools:'
Types ¶
type Frontmatter ¶
Frontmatter represents parsed frontmatter data
func ParseYAMLFrontmatter ¶
func ParseYAMLFrontmatter(content string) (*Frontmatter, error)
ParseYAMLFrontmatter extracts YAML frontmatter from markdown content. Frontmatter must start at the beginning of the file with "---".
type ImprovementRecommendation ¶
type ImprovementRecommendation struct {
Description string
PointValue int
Line int
Severity string
}
ImprovementRecommendation represents a specific fix with point value
func GetAgentImprovements ¶
func GetAgentImprovements(content string, data map[string]any) []ImprovementRecommendation
GetAgentImprovements returns specific improvement recommendations for agents
func GetCommandImprovements ¶
func GetCommandImprovements(content string, data map[string]any) []ImprovementRecommendation
GetCommandImprovements returns specific improvement recommendations for commands
func GetSkillImprovements ¶
func GetSkillImprovements(content string, data map[string]any) []ImprovementRecommendation
GetSkillImprovements returns specific improvement recommendations for skills