Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderMockupPrompt ¶
func RenderMockupPrompt(ctx *MockupPromptContext) (string, error)
RenderMockupPrompt renders the mockup prompt template with the given context.
func WriteDesignSystem ¶
func WriteDesignSystem(path string, ds *DesignSystem) error
WriteDesignSystem writes a DesignSystem to a design-system.md file.
Types ¶
type DesignSystem ¶
type DesignSystem struct {
Version int `yaml:"version" json:"version"`
Framework FrameworkType `yaml:"framework" json:"framework"`
LastScanned time.Time `yaml:"last_scanned" json:"last_scanned"`
ExternalLibs []string `yaml:"external_libs,omitempty" json:"external_libs,omitempty"`
Style *StyleInfo `yaml:"style,omitempty" json:"style,omitempty"`
}
DesignSystem contains the project's design tokens and styling conventions. Does NOT index components - the AI agent discovers those via codebase search.
func LoadDesignSystem ¶
func LoadDesignSystem(path string) (*DesignSystem, error)
LoadDesignSystem reads and parses a design-system.md file.
type DetectionResult ¶
type DetectionResult struct {
IsFrontend bool `json:"is_frontend"`
Framework FrameworkType `json:"framework"`
Confidence int `json:"confidence"`
ComponentDirs []string `json:"component_dirs"`
Indicators []string `json:"indicators"`
ConfigFile string `json:"config_file"`
}
DetectionResult is the result of frontend framework detection.
func DetectFramework ¶
func DetectFramework(projectPath string) (*DetectionResult, error)
DetectFramework detects the frontend framework in the given project path. It uses a 3-tier heuristic: config files > package.json > file extensions.
type FrameworkType ¶
type FrameworkType string
FrameworkType identifies the frontend framework in use.
const ( FrameworkReact FrameworkType = "react" FrameworkNextJS FrameworkType = "nextjs" FrameworkVue FrameworkType = "vue" FrameworkNuxt FrameworkType = "nuxt" FrameworkSvelte FrameworkType = "svelte" FrameworkSvelteKit FrameworkType = "sveltekit" FrameworkAngular FrameworkType = "angular" FrameworkUnknown FrameworkType = "unknown" )
func (FrameworkType) String ¶
func (f FrameworkType) String() string
String returns the display name for the framework.
type MockupFormat ¶
type MockupFormat string
MockupFormat is the output format for the generated mockup file.
const ( MockupFormatHTML MockupFormat = "html" MockupFormatJSX MockupFormat = "jsx" )
func (MockupFormat) IsValid ¶
func (f MockupFormat) IsValid() bool
IsValid returns true if the format is supported.
type MockupPromptContext ¶
type MockupPromptContext struct {
SpecName string `json:"spec_name"`
SpecPath string `json:"spec_path"`
SpecTitle string `json:"spec_title"`
Framework FrameworkType `json:"framework"`
Format MockupFormat `json:"format"`
OutputPath string `json:"output_path"`
ExternalLibs []string `json:"external_libs,omitempty"`
HasDesignSystem bool `json:"has_design_system"`
Style *StyleInfo `json:"style,omitempty"`
HasStyle bool `json:"has_style"`
UserPrompt string `json:"user_prompt,omitempty"`
}
MockupPromptContext is the template rendering context for the AI agent prompt.
func BuildMockupPromptContext ¶
func BuildMockupPromptContext( specName string, specPath string, specTitle string, framework FrameworkType, format MockupFormat, outputPath string, ds *DesignSystem, style *StyleInfo, userPrompt string, ) *MockupPromptContext
BuildMockupPromptContext assembles a MockupPromptContext from the gathered data.
type MockupResult ¶
type MockupResult struct {
Status string `json:"status"`
Framework string `json:"framework"`
SpecName string `json:"spec_name"`
MockupPath string `json:"mockup_path"`
PromptPath string `json:"prompt_path,omitempty"`
Format string `json:"format"`
DesignSystemCreated bool `json:"design_system_created"`
AgentLaunched bool `json:"agent_launched"`
Committed bool `json:"committed"`
}
MockupResult is the JSON output for --json mode.
type SpecContent ¶
type SpecContent struct {
Title string `json:"title"`
UserStories []string `json:"user_stories"`
Requirements []string `json:"requirements"`
FullContent string `json:"full_content"`
}
SpecContent is parsed content from a spec.md file.
func ParseSpec ¶
func ParseSpec(specPath string) (*SpecContent, error)
ParseSpec reads and parses a spec.md file into SpecContent.
type StyleInfo ¶
type StyleInfo struct {
CSSFramework string `json:"css_framework"`
Preprocessor string `json:"preprocessor,omitempty"`
StylingApproach string `json:"styling_approach"`
ThemeColors map[string]string `json:"theme_colors,omitempty"`
FontFamilies []string `json:"font_families,omitempty"`
CSSVariables []string `json:"css_variables,omitempty"`
SampleImports []string `json:"sample_imports,omitempty"`
}
StyleInfo describes the project's CSS/styling patterns.
func ScanStyles ¶
ScanStyles detects the project's CSS framework, variables, and styling patterns.
type UpdateResult ¶
type UpdateResult struct {
Status string `json:"status"`
ScanDurationMs int64 `json:"scan_duration_ms"`
}
UpdateResult is the JSON output for mockup update --json mode.