workflows

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package workflows provides integration with spec-workflows repositories.

This package enables visionspec to load workflows, templates, and rubrics from external spec-workflows repositories, supporting organization customization through the fork pattern.

Usage:

// Auto-discover spec-workflows repository
repo, err := workflows.DiscoverRepo("")

// Load from a specific path
repo, err := workflows.LoadRepo("/path/to/spec-workflows")

// Get a workflow
workflow, err := repo.GetWorkflow("aws-working-backwards/product")

// Get loaders for templates and rubrics
templateLoader := repo.TemplateLoader("aws-working-backwards")
rubricLoader := repo.RubricLoader("aws-working-backwards")

Index

Constants

View Source
const (
	// EnvWorkflowsRepo is the environment variable for specifying the workflows repo path.
	EnvWorkflowsRepo = "VISIONSPEC_WORKFLOWS_REPO"

	// DirName is the standard directory name for spec-workflows.
	DirName = "spec-workflows"

	// HiddenDirName is the hidden directory name for spec-workflows.
	HiddenDirName = ".spec-workflows"

	// UserConfigDir is the user-level config directory name.
	UserConfigDir = ".config/visionspec"
)

Variables

This section is empty.

Functions

func DiscoverRepoPath

func DiscoverRepoPath(explicitPath string) string

DiscoverRepoPath returns the path to a spec-workflows repository without loading it. Uses the same search order as DiscoverRepo. Returns empty string if not found.

Types

type Repo

type Repo struct {
	// Path is the local filesystem path to the repo
	Path string

	// Workflows maps workflow IDs to Workflow definitions
	Workflows map[string]*Workflow
	// contains filtered or unexported fields
}

Repo represents a spec-workflows repository.

func DiscoverRepo

func DiscoverRepo(explicitPath string) (*Repo, error)

DiscoverRepo attempts to find a spec-workflows repository using the following search order:

  1. explicitPath parameter (if non-empty)
  2. VISIONSPEC_WORKFLOWS_REPO environment variable
  3. Walk up from current directory looking for spec-workflows/ or .spec-workflows/
  4. ~/.config/visionspec/spec-workflows/

Returns the loaded Repo if found, or an error if no repository is discovered.

func LoadRepo

func LoadRepo(path string) (*Repo, error)

LoadRepo loads a spec-workflows repository from the given path.

func (*Repo) ExtensionPath

func (r *Repo) ExtensionPath(name string) string

ExtensionPath returns the path to an extension directory.

func (*Repo) GetWorkflow

func (r *Repo) GetWorkflow(id string) (*Workflow, error)

GetWorkflow returns the workflow with the given ID.

func (*Repo) HasExtension

func (r *Repo) HasExtension(name string) bool

HasExtension checks if an extension exists in the repo.

func (*Repo) ListWorkflows

func (r *Repo) ListWorkflows() []string

ListWorkflows returns all available workflow IDs.

func (*Repo) RubricLoader

func (r *Repo) RubricLoader(methodology string) rubrics.Loader

RubricLoader returns a rubric loader for the given methodology. Falls back to default rubrics if methodology-specific rubrics don't exist.

func (*Repo) RuleDetailsPath

func (r *Repo) RuleDetailsPath() string

RuleDetailsPath returns the path to the rule-details directory.

func (*Repo) TemplateLoader

func (r *Repo) TemplateLoader(methodology string) templates.Loader

TemplateLoader returns a template loader for the given methodology. Falls back to default templates if methodology-specific templates don't exist.

type Workflow

type Workflow struct {
	// Name is the methodology name (e.g., "aws-working-backwards")
	Name string

	// Level is "product" or "feature"
	Level string

	// Description describes the workflow
	Description string

	// EntryPoint is the path to core-workflow.md
	EntryPoint string

	// RuleDetails is the path to rule-details directory
	RuleDetails string

	// Templates is the path to templates directory for this methodology
	Templates string

	// Rubrics is the path to rubrics directory for this methodology
	Rubrics string
}

Workflow represents a workflow definition from spec-workflows.

func (*Workflow) ID

func (w *Workflow) ID() string

ID returns the workflow identifier (e.g., "aws-working-backwards/product")

Jump to

Keyboard shortcuts

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