Documentation
¶
Index ¶
- Constants
- Variables
- func ConfigExists(dir string) bool
- func CopyFromCache(cachePath, destPath, filePath string) error
- func EnsureCacheDir() (string, error)
- func GetAllFrameworkNames() []string
- func GetAllLanguageNames() []string
- func GetAllWorkflowNames() []string
- func GetCachePath() (string, error)
- func GetComponentPaths(languages, frameworks, workflows []string) []string
- func GetGlobalConfigPath() (string, error)
- func GetSourcePath(destPath string) string
- func GetSourcePaths(destPaths []string) []string
- type Component
- type ComponentType
- type Config
- func (c *Config) AddFramework(name string)
- func (c *Config) AddLanguage(name string)
- func (c *Config) AddWorkflow(name string)
- func (c *Config) GetAllValues() map[string]interface{}
- func (c *Config) GetValue(key string) (interface{}, error)
- func (c *Config) HasFramework(name string) bool
- func (c *Config) HasLanguage(name string) bool
- func (c *Config) HasWorkflow(name string) bool
- func (c *Config) RemoveFramework(name string)
- func (c *Config) RemoveLanguage(name string)
- func (c *Config) RemoveWorkflow(name string)
- func (c *Config) Save(dir string) error
- func (c *Config) SetValue(key, value string) error
- type Downloader
- func (d *Downloader) CheckForUpdates(currentVersion string) (*github.VersionInfo, error)
- func (d *Downloader) ClearCache() error
- func (d *Downloader) DownloadFile(version, path string) ([]byte, error)
- func (d *Downloader) DownloadVersion(version string) (string, error)
- func (d *Downloader) GetCacheSize() (int64, error)
- func (d *Downloader) GetLatestVersion() (string, error)
- type ExtractResult
- type Extractor
- func (e *Extractor) BackupFile(path, backupDir string) error
- func (e *Extractor) Extract(paths []string, force bool) (*ExtractResult, error)
- func (e *Extractor) ExtractAll(force bool) (*ExtractResult, error)
- func (e *Extractor) FileExists(path string) bool
- func (e *Extractor) GetDestPath() string
- func (e *Extractor) GetSourcePath() string
- func (e *Extractor) ReadFile(path string) ([]byte, error)
- func (e *Extractor) RemoveFile(path string) error
- func (e *Extractor) RestoreBackup(backupDir string) error
- func (e *Extractor) ValidateExtraction(paths []string) []string
- func (e *Extractor) WriteFile(path string, content []byte) error
- type GlobalConfig
- type InstalledItems
- type Template
Constants ¶
const ( // ConfigFileName is the default config file name ConfigFileName = "aicof.yaml" // AltConfigFileName is the hidden config file name AltConfigFileName = ".aicof.yaml" )
const DefaultOwner = "ar4mirez"
DefaultOwner is the GitHub owner
const DefaultRegistry = "https://github.com/ar4mirez/aicof"
DefaultRegistry is the default GitHub repository for AICoF
const DefaultRepo = "aicof"
DefaultRepo is the GitHub repository name
const TemplatePrefix = "template/"
TemplatePrefix is the path prefix in the repository where template files are stored This allows the CLI to find source files in the downloaded archive
Variables ¶
var CoreFiles = []string{
"CLAUDE.md",
"AI_INSTRUCTIONS.md",
".agent/README.md",
".agent/project.md.template",
".agent/state.md.template",
".agent/language-guides/README.md",
".agent/framework-guides/README.md",
".agent/workflows/README.md",
".agent/memory/.gitkeep",
".agent/tasks/.gitkeep",
}
CoreFiles contains essential files always installed
var Frameworks = []Component{
{Name: "react", Path: ".agent/framework-guides/react.md", Description: "React"},
{Name: "nextjs", Path: ".agent/framework-guides/nextjs.md", Description: "Next.js"},
{Name: "express", Path: ".agent/framework-guides/express.md", Description: "Express.js"},
{Name: "django", Path: ".agent/framework-guides/django.md", Description: "Django"},
{Name: "fastapi", Path: ".agent/framework-guides/fastapi.md", Description: "FastAPI"},
{Name: "flask", Path: ".agent/framework-guides/flask.md", Description: "Flask"},
{Name: "gin", Path: ".agent/framework-guides/gin.md", Description: "Gin"},
{Name: "echo", Path: ".agent/framework-guides/echo.md", Description: "Echo"},
{Name: "fiber", Path: ".agent/framework-guides/fiber.md", Description: "Fiber"},
{Name: "axum", Path: ".agent/framework-guides/axum.md", Description: "Axum"},
{Name: "actix-web", Path: ".agent/framework-guides/actix-web.md", Description: "Actix-web"},
{Name: "rocket", Path: ".agent/framework-guides/rocket.md", Description: "Rocket"},
{Name: "spring-boot-kotlin", Path: ".agent/framework-guides/spring-boot-kotlin.md", Description: "Spring Boot (Kotlin)"},
{Name: "ktor", Path: ".agent/framework-guides/ktor.md", Description: "Ktor"},
{Name: "android-compose", Path: ".agent/framework-guides/android-compose.md", Description: "Android Compose"},
{Name: "spring-boot-java", Path: ".agent/framework-guides/spring-boot-java.md", Description: "Spring Boot (Java)"},
{Name: "quarkus", Path: ".agent/framework-guides/quarkus.md", Description: "Quarkus"},
{Name: "micronaut", Path: ".agent/framework-guides/micronaut.md", Description: "Micronaut"},
{Name: "aspnet-core", Path: ".agent/framework-guides/aspnet-core.md", Description: "ASP.NET Core"},
{Name: "blazor", Path: ".agent/framework-guides/blazor.md", Description: "Blazor"},
{Name: "unity", Path: ".agent/framework-guides/unity.md", Description: "Unity"},
{Name: "laravel", Path: ".agent/framework-guides/laravel.md", Description: "Laravel"},
{Name: "symfony", Path: ".agent/framework-guides/symfony.md", Description: "Symfony"},
{Name: "wordpress", Path: ".agent/framework-guides/wordpress.md", Description: "WordPress"},
{Name: "swiftui", Path: ".agent/framework-guides/swiftui.md", Description: "SwiftUI"},
{Name: "uikit", Path: ".agent/framework-guides/uikit.md", Description: "UIKit"},
{Name: "vapor", Path: ".agent/framework-guides/vapor.md", Description: "Vapor"},
{Name: "rails", Path: ".agent/framework-guides/rails.md", Description: "Rails"},
{Name: "sinatra", Path: ".agent/framework-guides/sinatra.md", Description: "Sinatra"},
{Name: "hanami", Path: ".agent/framework-guides/hanami.md", Description: "Hanami"},
{Name: "flutter", Path: ".agent/framework-guides/flutter.md", Description: "Flutter"},
{Name: "shelf", Path: ".agent/framework-guides/shelf.md", Description: "Shelf"},
{Name: "dart-frog", Path: ".agent/framework-guides/dart-frog.md", Description: "Dart Frog"},
}
Frameworks contains all available framework guides
var Languages = []Component{
{Name: "typescript", Path: ".agent/language-guides/typescript.md", Description: "TypeScript/JavaScript"},
{Name: "python", Path: ".agent/language-guides/python.md", Description: "Python"},
{Name: "go", Path: ".agent/language-guides/go.md", Description: "Go"},
{Name: "rust", Path: ".agent/language-guides/rust.md", Description: "Rust"},
{Name: "kotlin", Path: ".agent/language-guides/kotlin.md", Description: "Kotlin"},
{Name: "java", Path: ".agent/language-guides/java.md", Description: "Java"},
{Name: "csharp", Path: ".agent/language-guides/csharp.md", Description: "C#/.NET"},
{Name: "php", Path: ".agent/language-guides/php.md", Description: "PHP"},
{Name: "swift", Path: ".agent/language-guides/swift.md", Description: "Swift"},
{Name: "cpp", Path: ".agent/language-guides/cpp.md", Description: "C/C++"},
{Name: "ruby", Path: ".agent/language-guides/ruby.md", Description: "Ruby"},
{Name: "sql", Path: ".agent/language-guides/sql.md", Description: "SQL"},
{Name: "shell", Path: ".agent/language-guides/shell.md", Description: "Shell/Bash"},
{Name: "r", Path: ".agent/language-guides/r.md", Description: "R"},
{Name: "dart", Path: ".agent/language-guides/dart.md", Description: "Dart"},
{Name: "html-css", Path: ".agent/language-guides/html-css.md", Description: "HTML/CSS"},
{Name: "lua", Path: ".agent/language-guides/lua.md", Description: "Lua"},
{Name: "assembly", Path: ".agent/language-guides/assembly.md", Description: "Assembly"},
{Name: "cuda", Path: ".agent/language-guides/cuda.md", Description: "CUDA"},
{Name: "solidity", Path: ".agent/language-guides/solidity.md", Description: "Solidity"},
{Name: "zig", Path: ".agent/language-guides/zig.md", Description: "Zig"},
}
Languages contains all available language guides
var Templates = []Template{ { Name: "full", Description: "All guides and workflows (~160 files)", Languages: getAllNames(Languages), Frameworks: getAllNames(Frameworks), Workflows: []string{"all"}, }, { Name: "starter", Description: "Core files + common languages (TypeScript, Python, Go)", Languages: []string{"typescript", "python", "go"}, Frameworks: []string{}, Workflows: []string{"all"}, }, { Name: "minimal", Description: "Just CLAUDE.md and workflows", Languages: []string{}, Frameworks: []string{}, Workflows: []string{"all"}, }, }
Templates contains predefined installation templates
var ValidConfigKeys = []string{
"version",
"registry",
"installed.languages",
"installed.frameworks",
"installed.workflows",
}
ValidConfigKeys lists all valid configuration keys
var Workflows = []Component{
{Name: "initialize-project", Path: ".agent/workflows/initialize-project.md", Description: "Project setup"},
{Name: "create-rfd", Path: ".agent/workflows/create-rfd.md", Description: "Technical decision documents"},
{Name: "create-prd", Path: ".agent/workflows/create-prd.md", Description: "Requirements documents"},
{Name: "generate-tasks", Path: ".agent/workflows/generate-tasks.md", Description: "Task breakdown"},
{Name: "code-review", Path: ".agent/workflows/code-review.md", Description: "Pre-commit quality review"},
{Name: "security-audit", Path: ".agent/workflows/security-audit.md", Description: "Security assessment"},
{Name: "testing-strategy", Path: ".agent/workflows/testing-strategy.md", Description: "Test planning"},
{Name: "cleanup-project", Path: ".agent/workflows/cleanup-project.md", Description: "Prune unused guides"},
{Name: "refactoring", Path: ".agent/workflows/refactoring.md", Description: "Technical debt remediation"},
{Name: "dependency-update", Path: ".agent/workflows/dependency-update.md", Description: "Safe dependency updates"},
{Name: "update-framework", Path: ".agent/workflows/update-framework.md", Description: "AICoF version updates"},
{Name: "troubleshooting", Path: ".agent/workflows/troubleshooting.md", Description: "Debugging workflow"},
{Name: "generate-agents-md", Path: ".agent/workflows/generate-agents-md.md", Description: "Cross-tool compatibility"},
{Name: "document-work", Path: ".agent/workflows/document-work.md", Description: "Capture patterns"},
}
Workflows contains all available workflows
Functions ¶
func ConfigExists ¶
ConfigExists checks if a config file exists in the directory
func CopyFromCache ¶
CopyFromCache copies a single file from the cache source directly The filePath is the destination path; source is found in template/ subdirectory
func EnsureCacheDir ¶
EnsureCacheDir creates the cache directory if it doesn't exist
func GetAllFrameworkNames ¶
func GetAllFrameworkNames() []string
GetAllFrameworkNames returns all framework names
func GetAllLanguageNames ¶
func GetAllLanguageNames() []string
GetAllLanguageNames returns all language names
func GetAllWorkflowNames ¶
func GetAllWorkflowNames() []string
GetAllWorkflowNames returns all workflow names
func GetCachePath ¶
GetCachePath returns the path to the cache directory
func GetComponentPaths ¶
GetComponentPaths returns all paths for a given set of components
func GetGlobalConfigPath ¶
GetGlobalConfigPath returns the path to the global config directory
func GetSourcePath ¶
GetSourcePath returns the source path in the repository for a given destination path This prepends the TemplatePrefix to locate files in the downloaded archive
func GetSourcePaths ¶
GetSourcePaths returns source paths for a slice of destination paths
Types ¶
type Component ¶
Component represents an installable component
func FindFramework ¶
FindFramework finds a framework by name
type ComponentType ¶
type ComponentType string
ComponentType represents the type of component
const ( ComponentTypeLanguage ComponentType = "language" ComponentTypeFramework ComponentType = "framework" ComponentTypeWorkflow ComponentType = "workflow" )
type Config ¶
type Config struct {
Version string `yaml:"version"`
Installed InstalledItems `yaml:"installed"`
Registry string `yaml:"registry,omitempty"`
}
Config represents the project's AICoF configuration
func LoadConfig ¶
LoadConfig loads config from the current directory
func LoadConfigFrom ¶
LoadConfigFrom loads config from a specific directory
func (*Config) AddFramework ¶
AddFramework adds a framework to the installed list
func (*Config) AddLanguage ¶
AddLanguage adds a language to the installed list
func (*Config) AddWorkflow ¶
AddWorkflow adds a workflow to the installed list
func (*Config) GetAllValues ¶ added in v1.1.0
GetAllValues returns all config values as a map
func (*Config) HasFramework ¶
HasFramework checks if a framework is installed
func (*Config) HasLanguage ¶
HasLanguage checks if a language is installed
func (*Config) HasWorkflow ¶
HasWorkflow checks if a workflow is installed
func (*Config) RemoveFramework ¶
RemoveFramework removes a framework from the installed list
func (*Config) RemoveLanguage ¶
RemoveLanguage removes a language from the installed list
func (*Config) RemoveWorkflow ¶
RemoveWorkflow removes a workflow from the installed list
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader handles downloading and extracting framework files
func NewDownloader ¶
func NewDownloader() (*Downloader, error)
NewDownloader creates a new downloader
func (*Downloader) CheckForUpdates ¶
func (d *Downloader) CheckForUpdates(currentVersion string) (*github.VersionInfo, error)
CheckForUpdates checks if a newer version is available
func (*Downloader) ClearCache ¶
func (d *Downloader) ClearCache() error
ClearCache removes all cached downloads
func (*Downloader) DownloadFile ¶
func (d *Downloader) DownloadFile(version, path string) ([]byte, error)
DownloadFile downloads a single file from a version
func (*Downloader) DownloadVersion ¶
func (d *Downloader) DownloadVersion(version string) (string, error)
DownloadVersion downloads a specific version to the cache If version is "dev", downloads from main branch
func (*Downloader) GetCacheSize ¶
func (d *Downloader) GetCacheSize() (int64, error)
GetCacheSize returns the total size of the cache in bytes
func (*Downloader) GetLatestVersion ¶
func (d *Downloader) GetLatestVersion() (string, error)
GetLatestVersion fetches the latest version number Returns "dev" if no releases exist
type ExtractResult ¶
type ExtractResult struct {
FilesCreated []string
DirsCreated []string
FilesSkipped []string
Errors []error
}
ExtractResult contains the result of an extraction
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor handles extracting framework files to a destination
func NewExtractor ¶
NewExtractor creates a new extractor
func (*Extractor) BackupFile ¶
BackupFile creates a backup of a file
func (*Extractor) Extract ¶
func (e *Extractor) Extract(paths []string, force bool) (*ExtractResult, error)
Extract copies specific files from source to destination The paths parameter contains destination paths (e.g., ".agent/language-guides/go.md") Source paths are calculated by prepending TemplatePrefix (e.g., "template/.agent/language-guides/go.md")
func (*Extractor) ExtractAll ¶
func (e *Extractor) ExtractAll(force bool) (*ExtractResult, error)
ExtractAll extracts all framework files from the template/ directory
func (*Extractor) FileExists ¶
FileExists checks if a file exists in the destination
func (*Extractor) GetDestPath ¶
GetDestPath returns the destination path
func (*Extractor) GetSourcePath ¶
GetSourcePath returns the source path
func (*Extractor) RemoveFile ¶
RemoveFile removes a file from the destination
func (*Extractor) RestoreBackup ¶
RestoreBackup restores files from a backup directory
func (*Extractor) ValidateExtraction ¶
ValidateExtraction checks if extracted files are valid
type GlobalConfig ¶
type GlobalConfig struct {
DefaultTemplate string `yaml:"default_template,omitempty"`
DefaultLanguages []string `yaml:"default_languages,omitempty"`
DefaultFrameworks []string `yaml:"default_frameworks,omitempty"`
CachePath string `yaml:"cache_path,omitempty"`
}
GlobalConfig represents global CLI settings stored in ~/.config/aicof/
type InstalledItems ¶
type InstalledItems struct {
Languages []string `yaml:"languages,omitempty"`
Frameworks []string `yaml:"frameworks,omitempty"`
Workflows []string `yaml:"workflows,omitempty"`
}
InstalledItems tracks what components are installed