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
- func DiscoverRepoPath(explicitPath string) string
- type Repo
- func (r *Repo) ExtensionPath(name string) string
- func (r *Repo) GetWorkflow(id string) (*Workflow, error)
- func (r *Repo) HasExtension(name string) bool
- func (r *Repo) ListWorkflows() []string
- func (r *Repo) RubricLoader(methodology string) rubrics.Loader
- func (r *Repo) RuleDetailsPath() string
- func (r *Repo) TemplateLoader(methodology string) templates.Loader
- type Workflow
Constants ¶
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 ¶
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 ¶
DiscoverRepo attempts to find a spec-workflows repository using the following search order:
- explicitPath parameter (if non-empty)
- VISIONSPEC_WORKFLOWS_REPO environment variable
- Walk up from current directory looking for spec-workflows/ or .spec-workflows/
- ~/.config/visionspec/spec-workflows/
Returns the loaded Repo if found, or an error if no repository is discovered.
func (*Repo) ExtensionPath ¶
ExtensionPath returns the path to an extension directory.
func (*Repo) GetWorkflow ¶
GetWorkflow returns the workflow with the given ID.
func (*Repo) HasExtension ¶
HasExtension checks if an extension exists in the repo.
func (*Repo) ListWorkflows ¶
ListWorkflows returns all available workflow IDs.
func (*Repo) RubricLoader ¶
RubricLoader returns a rubric loader for the given methodology. Falls back to default rubrics if methodology-specific rubrics don't exist.
func (*Repo) RuleDetailsPath ¶
RuleDetailsPath returns the path to the rule-details directory.
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.