Documentation
¶
Index ¶
- func BackupFile(src, backupDir string) error
- func CacheDir(repoURL string) string
- func Clone(repoURL, cacheDir string) error
- func CountInvalidFiles(results []ValidationResult) int
- func EnsureCache(repoURL string) (string, error)
- func ExtractPlaceholders(content string) []string
- func GetInvalidFiles(results []ValidationResult) []string
- func GetVersion(cacheDir string) (string, error)
- func HashContent(content string) string
- func HashFile(path string) (string, error)
- func IsHeadlessCommand(filename string) bool
- func Pull(cacheDir string) error
- func ReplacePlaceholders(content string, placeholders []Placeholder) string
- func TemplateFiles(cacheDir string, includeHeadless bool) ([]string, error)
- type CategorizedComparisons
- type CopyOptions
- type CopyStats
- type FileComparison
- type FileStatus
- type Placeholder
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupFile ¶
BackupFile copies a file to the backup directory preserving structure
func CountInvalidFiles ¶
func CountInvalidFiles(results []ValidationResult) int
CountInvalidFiles returns the count of invalid files from validation results
func EnsureCache ¶
EnsureCache clones or pulls the template repository
func ExtractPlaceholders ¶
ExtractPlaceholders finds all {{PLACEHOLDER}} patterns in content
func GetInvalidFiles ¶
func GetInvalidFiles(results []ValidationResult) []string
GetInvalidFiles returns a list of file paths that failed validation
func GetVersion ¶
GetVersion returns the current git commit hash of the cached repo
func HashContent ¶
HashContent returns the SHA256 hash of content
func IsHeadlessCommand ¶
IsHeadlessCommand returns true if the file is a headless command
func ReplacePlaceholders ¶
func ReplacePlaceholders(content string, placeholders []Placeholder) string
ReplacePlaceholders replaces {{PLACEHOLDER}} patterns in content
Types ¶
type CategorizedComparisons ¶
type CategorizedComparisons struct {
Outdated []FileComparison
Missing []FileComparison
Current []FileComparison
Custom []FileComparison
}
CategorizedComparisons holds file comparisons grouped by status
func CategorizeComparisons ¶
func CategorizeComparisons(comparisons []FileComparison) CategorizedComparisons
CategorizeComparisons groups file comparisons by their status
type CopyOptions ¶
type CopyOptions struct {
Placeholders []Placeholder
IncludeHeadless bool
BackupDir string // If set, backup existing files here before overwriting
ProtectCustom bool // If true, don't overwrite files not in templates
}
CopyOptions configures the template copy operation
type CopyStats ¶
type CopyStats struct {
CommandsCopied int
HeadlessCommandsCopied int
SkillsCopied int
AgentsCopied int
OtherFilesCopied int
PlaceholdersReplaced int
FileHashes map[string]string // Template file hashes (before placeholder replacement)
}
CopyStats tracks what was copied
func CopyTemplates ¶
func CopyTemplates(cacheDir, projectDir string, opts CopyOptions) (*CopyStats, error)
CopyTemplates copies templates from cache to project .claude/ directory
type FileComparison ¶
type FileComparison struct {
Path string
Status FileStatus
}
FileComparison represents the result of comparing a local file with a template
type FileStatus ¶
type FileStatus string
FileStatus represents the comparison status of a file
const ( StatusCurrent FileStatus = "CURRENT" // File matches template StatusOutdated FileStatus = "OUTDATED" // File differs from template StatusMissing FileStatus = "MISSING" // File doesn't exist locally StatusCustom FileStatus = "CUSTOM" // File exists locally but not in templates )
type Placeholder ¶
Placeholder represents a template placeholder and its value
type ValidationResult ¶
ValidationResult holds the result of validating a single file
func ValidateClaudeDir ¶
func ValidateClaudeDir(projectDir string) ([]ValidationResult, error)
ValidateClaudeDir validates all markdown files in .claude/ have proper frontmatter