scaffold

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package scaffold creates new agents and pipelines from embedded templates.

Index

Constants

This section is empty.

Variables

View Source
var AgentTemplates embed.FS

AgentTemplates holds the embedded scaffolding templates used to generate new agents and pipelines.

View Source
var LangFilePatterns = map[string]string{
	"go":      "**/*.go",
	"python":  "**/*.py",
	"bash":    "**/*.sh",
	"ansible": "**/*.yml",
	"generic": "**/*",
}

LangFilePatterns maps language to glob patterns for scaffolded agents.

View Source
var LangVerifyCommands = map[string]string{
	"go":      "go build ./... && go test ./...",
	"python":  "ruff check . && python -m py_compile *.py",
	"bash":    "shellcheck *.sh",
	"ansible": "ansible-lint",
	"generic": "",
}

LangVerifyCommands maps language to verification commands for scaffolded agents.

Functions

func CopyAgent

func CopyAgent(ctx context.Context, agentsDir, from, to string, force bool) error

CopyAgent copies an existing agent to a new name.

func CreateAgent

func CreateAgent(ctx context.Context, opts CreateOptions) error

CreateAgent scaffolds a new agent from templates.

func CreatePipeline

func CreatePipeline(ctx context.Context, opts CreatePipelineOptions) error

CreatePipeline scaffolds a new pipeline config from templates.

func IsValidAgentName

func IsValidAgentName(name string) bool

IsValidAgentName reports whether name is a valid agent name.

func ListTemplates

func ListTemplates() ([]string, error)

ListTemplates returns the names of all embedded template files.

func Render

func Render(name string, data AgentData) (string, error)

Render executes a template by name with the given data.

func ToTitleCase

func ToTitleCase(name string) string

ToTitleCase converts hyphenated-name to Title Case.

Types

type AgentData

type AgentData struct {
	Name        string // e.g. "xss-testing"
	NameTitle   string // e.g. "XSS Testing"
	Description string // e.g. "XSS vulnerability scanner"
	Lang        string // e.g. "go", "python", "bash", "ansible", "generic"
	Version     string // e.g. "0.1.0"
}

AgentData contains the data for rendering agent templates.

type CreateOptions

type CreateOptions struct {
	Name        string
	Lang        string
	Description string
	AgentsDir   string
	Force       bool
}

CreateOptions configures agent scaffolding.

type CreatePipelineOptions

type CreatePipelineOptions struct {
	Name        string
	Description string
	OutputDir   string
	Force       bool
}

CreatePipelineOptions configures pipeline scaffolding.

type PipelineData

type PipelineData struct {
	Name        string // e.g. "security-pipeline"
	Description string // e.g. "Security analysis pipeline"
}

PipelineData contains the data for rendering pipeline templates.

Jump to

Keyboard shortcuts

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