workflow

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToTask

func CopyToTask(workflowName, taskName string) error

CopyToTask copies WORKFLOW.yaml to a task folder. Reads from local override or embedded template.

func FormatProgression

func FormatProgression(stages []string, current string) string

FormatProgression formats stage names with current stage in parentheses. Example: "plan → (implement) → review → ready"

func TemplateDir

func TemplateDir(name string) string

TemplateDir returns the path to a workflow template directory.

func WorkflowsDir

func WorkflowsDir() string

WorkflowsDir returns the path to the workflows directory.

Types

type Instructions

type Instructions struct {
	Lead   string `yaml:"lead"`
	Worker string `yaml:"worker"`
}

Instructions contains guidance for lead and worker.

type Stage

type Stage struct {
	Name         string `yaml:"name"`
	Instructions string `yaml:"instructions"`
}

Stage represents a workflow stage.

type Workflow

type Workflow struct {
	Name         string       `yaml:"name"`
	Description  string       `yaml:"description"`
	Instructions Instructions `yaml:"instructions"`
	Stages       []Stage      `yaml:"stages"`
}

Workflow represents a workflow template.

func Load

func Load(workflowDir string) (*Workflow, error)

Load loads a workflow by name. First checks for local override in .subtask/workflows/<name>/WORKFLOW.yaml, then falls back to embedded default.

func LoadByName

func LoadByName(name string) (*Workflow, error)

LoadByName loads a workflow by name. First checks for local override, then falls back to embedded default.

func LoadFromTask

func LoadFromTask(taskName string) (*Workflow, error)

LoadFromTask loads a workflow from a task's folder (if WORKFLOW.yaml exists).

func (*Workflow) FirstStage

func (w *Workflow) FirstStage() string

FirstStage returns the first stage name.

func (*Workflow) FormatProgression

func (w *Workflow) FormatProgression(current string) string

FormatProgression returns a formatted stage progression string. Example: "plan → implement → review" with current stage marked.

func (*Workflow) GetStage

func (w *Workflow) GetStage(name string) *Stage

GetStage returns a stage by name, or nil if not found.

func (*Workflow) NextStage

func (w *Workflow) NextStage(current string) string

NextStage returns the next stage name after current, or "" if current is last.

func (*Workflow) StageIndex

func (w *Workflow) StageIndex(name string) int

StageIndex returns the index of a stage by name, or -1 if not found.

func (*Workflow) StageNames

func (w *Workflow) StageNames() []string

StageNames returns all stage names.

Jump to

Keyboard shortcuts

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