Documentation
¶
Overview ¶
Package scaffold provides shared template functions for generating eval suites, task files, and fixtures used by waza new skill/eval.
Index ¶
- func EvalYAML(name, engine, model string) string
- func Fixture() string
- func ParseTriggerPhrases(description string) (useFor []TriggerPhrase, doNotUseFor []TriggerPhrase)
- func ReadProjectDefaults() (engine, model string)
- func TaskFiles(_ string) map[string]string
- func TitleCase(s string) string
- func TriggerTestsYAML(skillName string, useFor, doNotUseFor []TriggerPhrase) string
- func ValidateName(name string) error
- type FileEntry
- type FileOutcome
- type FileWriter
- type Inventory
- type InventoryItem
- type TriggerPhrase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTriggerPhrases ¶
func ParseTriggerPhrases(description string) (useFor []TriggerPhrase, doNotUseFor []TriggerPhrase)
ParseTriggerPhrases extracts USE FOR and DO NOT USE FOR phrases from a skill description field. Phrases may be quoted or comma-separated.
func ReadProjectDefaults ¶
func ReadProjectDefaults() (engine, model string)
ReadProjectDefaults reads engine and model from .waza.yaml if it exists. Falls back to copilot-sdk and claude-sonnet-4.6.
func TriggerTestsYAML ¶
func TriggerTestsYAML(skillName string, useFor, doNotUseFor []TriggerPhrase) string
TriggerTestsYAML generates a trigger_tests.yaml file from parsed phrases.
func ValidateName ¶
ValidateName rejects names with path-traversal characters or empty names.
Types ¶
type FileEntry ¶
type FileEntry struct {
Path string // absolute path on disk
Label string // human-readable description
IsDir bool // true for directories, false for files
Content string // file content (ignored for directories)
}
FileEntry describes a file or directory to be written.
type FileOutcome ¶
type FileOutcome int
FileOutcome describes what happened when processing a file entry.
const ( // OutcomeCreated means the file or directory was newly created. OutcomeCreated FileOutcome = iota // OutcomeSkipped means the file or directory already existed. OutcomeSkipped )
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
FileWriter creates files and directories that don't exist, skipping those that do. It records an inventory of outcomes for each entry.
func NewFileWriter ¶
func NewFileWriter(baseDir string) *FileWriter
NewFileWriter creates a FileWriter rooted at baseDir. Relative display paths in the inventory are computed against baseDir.
type Inventory ¶
type Inventory struct {
Items []InventoryItem
BaseDir string
}
Inventory holds the results of a FileWriter.Write call.
func (*Inventory) CreatedCount ¶
CreatedCount returns the number of items that were created.
type InventoryItem ¶
type InventoryItem struct {
Entry FileEntry
Outcome FileOutcome
RelPath string // path relative to the base directory, used for display
}
InventoryItem records the outcome for a single file entry.
type TriggerPhrase ¶
TriggerPhrase holds a parsed trigger or anti-trigger phrase.