prompt

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchitecturePreferences

type ArchitecturePreferences = types.ArchitecturePreferences

Type aliases for the shared types - used in prompt templates

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader handles loading and rendering prompt templates

func NewLoader

func NewLoader(promptsDir string) *Loader

NewLoader creates a new prompt loader promptsDir is the directory containing custom prompt templates (optional)

func (*Loader) ListAvailable

func (l *Loader) ListAvailable() ([]string, error)

ListAvailable returns a list of available prompt templates

func (*Loader) Load

func (l *Loader) Load(agentName, inlinePrompt, promptFile string) (string, error)

Load loads a prompt template for the given agent Priority order: 1. Inline prompt (if provided) 2. Custom prompt file (if promptFile is provided) 3. Prompt from promptsDir (if directory exists) 4. Embedded default template

func (*Loader) LoadAndRender

func (l *Loader) LoadAndRender(agentName, inlinePrompt, promptFile string, vars Variables) (string, error)

LoadAndRender loads and renders a prompt in one step

func (*Loader) Render

func (l *Loader) Render(promptTemplate string, vars Variables) (string, error)

Render renders a prompt template with the given variables

type StackConflict

type StackConflict = types.StackConflict

Type aliases for the shared types - used in prompt templates

type StackResolution

type StackResolution = types.StackResolution

Type aliases for the shared types - used in prompt templates

type TechStack

type TechStack = types.TechStack

Type aliases for the shared types - used in prompt templates

type Variables

type Variables struct {
	PRDPath       string   // Primary input file (backward compatible)
	InputFiles    []string // All input files (when input is a directory)
	InputDir      string   // Input directory path (empty if single file)
	HasMultiInput bool     // True if multiple input files
	OutputDir     string
	OutputPath    string
	AgentName     string
	ExistingFiles []string                // List of files already in OutputDir
	HasExisting   bool                    // True if there are existing outputs to consider
	Persona       string                  // Implementation style: minimal, balanced, production
	Stack         TechStack               // Technology stack preferences
	Preferences   ArchitecturePreferences // Architectural style preferences

	// Mode-specific variables for existing codebase modifications
	Mode           string // "create" or "modify"
	TargetCodebase string // Path to existing codebase (for modify mode)
	SpecsOutputDir string // Directory for spec outputs
	CodeOutputDir  string // Directory for code outputs

	// Resolution holds user-resolved conflicts from UI (nil if no UI interaction)
	Resolution *StackResolution

	// Custom allows arbitrary key-value pairs
	Custom map[string]string
}

Variables holds the template variables for prompt rendering

func (Variables) GetResolvedValue

func (v Variables) GetResolvedValue(category string) string

GetResolvedValue returns the resolved value for a category, or the config default

func (Variables) HasCache

func (v Variables) HasCache() bool

HasCache returns true if a cache is configured (not "none" or empty)

func (Variables) HasDataLake

func (v Variables) HasDataLake() bool

HasDataLake returns true if a data lake is configured (not "none" or empty)

func (Variables) HasDatabase

func (v Variables) HasDatabase() bool

HasDatabase returns true if a database is configured (not "none" or empty)

func (Variables) HasMessageQueue

func (v Variables) HasMessageQueue() bool

HasMessageQueue returns true if a message queue is configured (not "none" or empty)

func (Variables) HasResolution

func (v Variables) HasResolution() bool

HasResolution returns true if UI-resolved conflicts are available

func (Variables) HasTargetCodebase

func (v Variables) HasTargetCodebase() bool

HasTargetCodebase returns true if a target codebase is specified

func (Variables) HasUnresolvedConflicts

func (v Variables) HasUnresolvedConflicts() bool

HasUnresolvedConflicts returns true if there are conflicts that need resolution

func (Variables) IsBalanced

func (v Variables) IsBalanced() bool

IsBalanced returns true if persona is "balanced"

func (Variables) IsCreateMode

func (v Variables) IsCreateMode() bool

IsCreateMode returns true if mode is "create" or empty (default)

func (Variables) IsGRPC

func (v Variables) IsGRPC() bool

IsGRPC returns true if gRPC API style is preferred

func (Variables) IsGitHubActions

func (v Variables) IsGitHubActions() bool

IsGitHubActions returns true if compute is github-actions

func (Variables) IsGraphQL

func (v Variables) IsGraphQL() bool

IsGraphQL returns true if GraphQL API style is preferred

func (Variables) IsKubernetes

func (v Variables) IsKubernetes() bool

IsKubernetes returns true if compute is kubernetes-based (kubernetes, eks, gke, aks)

func (Variables) IsMinimal

func (v Variables) IsMinimal() bool

IsMinimal returns true if persona is "minimal"

func (Variables) IsModifyMode

func (v Variables) IsModifyMode() bool

IsModifyMode returns true if mode is "modify"

func (Variables) IsProduction

func (v Variables) IsProduction() bool

IsProduction returns true if persona is "production"

func (Variables) IsREST

func (v Variables) IsREST() bool

IsREST returns true if REST API style is preferred

func (Variables) IsServerless

func (v Variables) IsServerless() bool

IsServerless returns true if compute is serverless (lambda, cloud-functions, etc.)

func (Variables) IsStateless

func (v Variables) IsStateless() bool

IsStateless returns true if stateless architecture is preferred This is true if either: 1. Preferences.Stateless is explicitly true, OR 2. All storage technologies (database, cache, message_queue) are "none" or empty

func (Variables) NeedsContainerization

func (v Variables) NeedsContainerization() bool

NeedsContainerization returns true if the app should be containerized This is false for GitHub Actions or serverless compute

func (Variables) NeedsKubernetesManifests

func (v Variables) NeedsKubernetesManifests() bool

NeedsKubernetesManifests returns true if k8s manifests should be generated

func (Variables) WantsBatteries

func (v Variables) WantsBatteries() bool

WantsBatteries returns true if feature-rich dependencies are preferred

func (Variables) WantsComprehensiveDocs

func (v Variables) WantsComprehensiveDocs() bool

WantsComprehensiveDocs returns true if comprehensive documentation is wanted

func (Variables) WantsE2ETests

func (v Variables) WantsE2ETests() bool

WantsE2ETests returns true if e2e tests are wanted

func (Variables) WantsIntegrationTests

func (v Variables) WantsIntegrationTests() bool

WantsIntegrationTests returns true if integration tests are wanted

func (Variables) WantsMinimalDeps

func (v Variables) WantsMinimalDeps() bool

WantsMinimalDeps returns true if minimal dependencies are preferred

func (Variables) WantsMinimalDocs

func (v Variables) WantsMinimalDocs() bool

WantsMinimalDocs returns true if minimal documentation is wanted

func (Variables) WantsTests

func (v Variables) WantsTests() bool

WantsTests returns true if testing is enabled (any level)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL