Documentation
¶
Overview ¶
Package workflow defines specification workflow configurations.
A Workflow bundles spec requirements, synthesis rules, and evaluation criteria into a cohesive workflow configuration (e.g., "aws-one-way-door", "big-tech-feature", "pbhq-lite").
Index ¶
- Constants
- type Artifact
- type Artifacts
- type EvaluationConfig
- type Execution
- type FindingSeverityLimits
- type Methodology
- type Phase
- type Principle
- type ReviewGate
- type SpecRequirement
- type SpecSource
- type SynthesisRule
- type Workflow
- func (w *Workflow) Clone() *Workflow
- func (w *Workflow) GetCategory(specType string) string
- func (w *Workflow) IsRequired(specType string) bool
- func (w *Workflow) Merge(parent *Workflow) *Workflow
- func (w *Workflow) RequiredSpecs() []string
- func (w *Workflow) ToYAML() ([]byte, error)
- func (w *Workflow) Validate() error
Constants ¶
const SourceLocal = "local"
SourceLocal is the SpecSource.From sentinel meaning this workflow's own templates/ or rubrics/ directory (as opposed to another workflow).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶ added in v0.16.0
type Artifact struct {
// ID is the artifact identifier (e.g., "press_release").
ID string `json:"id" yaml:"id" jsonschema:"required,description=Artifact identifier"`
// Description explains the artifact.
Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Artifact explanation"`
// Category optionally groups artifacts (e.g., "primary", "supporting").
Category string `json:"category,omitempty" yaml:"category,omitempty" jsonschema:"description=Artifact grouping"`
}
Artifact is a named artifact produced by a methodology.
type Artifacts ¶ added in v0.16.0
type Artifacts []Artifact
Artifacts is a list of methodology artifacts. In YAML it accepts either a flat sequence or a mapping of category name to sequence (e.g., primary/supporting groups).
type EvaluationConfig ¶ added in v0.16.0
type EvaluationConfig struct {
// PassThreshold is the minimum score (0-100) to pass.
PassThreshold int `` /* 132-byte string literal not displayed */
// PartialThreshold is the minimum score (0-100) for partial pass.
PartialThreshold int `` /* 147-byte string literal not displayed */
// MaxFindingsSeverity defines maximum allowed findings by severity.
MaxFindingsSeverity *FindingSeverityLimits `` /* 139-byte string literal not displayed */
}
EvaluationConfig defines pass/fail thresholds.
type Execution ¶ added in v0.16.0
type Execution struct {
// Sequence is the ordered list of spec types to produce.
Sequence []string `json:"sequence,omitempty" yaml:"sequence,omitempty" jsonschema:"description=Ordered spec type IDs"`
// Phases groups specs into named phases.
Phases []Phase `json:"phases,omitempty" yaml:"phases,omitempty" jsonschema:"description=Named workflow phases"`
// IterationTrigger is the spec type that triggers iteration.
IterationTrigger string `` /* 137-byte string literal not displayed */
// ReviewGates are approval checkpoints.
ReviewGates []ReviewGate `json:"review_gates,omitempty" yaml:"review_gates,omitempty" jsonschema:"description=Approval checkpoints"`
}
Execution defines the ordered execution of specs.
type FindingSeverityLimits ¶ added in v0.16.0
type FindingSeverityLimits struct {
Critical int `json:"critical,omitempty" yaml:"critical,omitempty" jsonschema:"description=Max critical findings (-1 = unlimited)"`
High int `json:"high,omitempty" yaml:"high,omitempty" jsonschema:"description=Max high findings (-1 = unlimited)"`
Medium int `json:"medium,omitempty" yaml:"medium,omitempty" jsonschema:"description=Max medium findings (-1 = unlimited)"`
Low int `json:"low,omitempty" yaml:"low,omitempty" jsonschema:"description=Max low findings (-1 = unlimited)"`
}
FindingSeverityLimits defines maximum findings by severity level.
type Methodology ¶ added in v0.16.0
type Methodology struct {
// Name is the methodology name (e.g., "Amazon Working Backwards").
Name string `json:"name" yaml:"name" jsonschema:"required,description=Methodology name"`
// Description explains the methodology.
Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Methodology overview"`
// Creator is the person/company who created the methodology.
Creator string `json:"creator,omitempty" yaml:"creator,omitempty" jsonschema:"description=Methodology creator"`
// Source is the origin company or publication of the methodology.
Source string `json:"source,omitempty" yaml:"source,omitempty" jsonschema:"description=Origin company or publication"`
// Reference is a URL to the canonical methodology documentation.
Reference string `json:"reference,omitempty" yaml:"reference,omitempty" jsonschema:"format=uri,description=URL to methodology documentation"`
// Principles are the core principles of the methodology.
Principles []Principle `json:"principles,omitempty" yaml:"principles,omitempty" jsonschema:"description=Core methodology principles"`
// Artifacts are the key artifacts produced by the methodology.
Artifacts Artifacts `json:"artifacts,omitempty" yaml:"artifacts,omitempty" jsonschema:"description=Key artifacts"`
// Parameters holds methodology-specific structured configuration whose
// shape varies per methodology — e.g., Shape Up's betting cycle lengths,
// Continuous Discovery's interview cadence and assumption taxonomy, or
// V2MOM's cascading levels. This is documentation for humans and
// downstream renderers (e.g., a UI explaining "Shape Up uses 6-week
// cycles"); the loader does not interpret it.
Parameters map[string]any `` /* 154-byte string literal not displayed */
}
Methodology documents the underlying product development methodology.
type Phase ¶
type Phase struct {
// ID is the phase identifier.
ID string `json:"id" yaml:"id" jsonschema:"required,description=Phase identifier"`
// Name is the human-readable phase name.
Name string `json:"name" yaml:"name" jsonschema:"required,description=Phase name"`
// Description explains the phase purpose.
Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Phase purpose"`
// Specs are the spec types in this phase.
Specs []string `json:"specs" yaml:"specs" jsonschema:"required,description=Spec type IDs in this phase"`
}
Phase is a named group of specs in the workflow.
type Principle ¶ added in v0.16.0
type Principle struct {
// ID is the principle identifier (e.g., "customer_obsession").
ID string `json:"id" yaml:"id" jsonschema:"required,description=Principle identifier"`
// Name is the human-readable name.
Name string `json:"name" yaml:"name" jsonschema:"required,description=Principle name"`
// Description explains the principle.
Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Principle explanation"`
// Source is the origin (e.g., "Amazon", "Google").
Source string `json:"source,omitempty" yaml:"source,omitempty" jsonschema:"description=Origin company or methodology"`
}
Principle is a named principle with description.
type ReviewGate ¶ added in v0.16.0
type ReviewGate struct {
// After is the spec type after which this gate applies.
After string `json:"after" yaml:"after" jsonschema:"required,description=Spec type ID after which gate applies"`
// Action is the required action (e.g., "stakeholder_review", "tech_lead_review").
Action string `json:"action" yaml:"action" jsonschema:"required,description=Required approval action"`
// Required indicates whether passing this gate is mandatory.
Required bool `json:"required,omitempty" yaml:"required,omitempty" jsonschema:"description=Whether gate is mandatory"`
}
ReviewGate is an approval checkpoint after a spec.
type SpecRequirement ¶ added in v0.16.0
type SpecRequirement struct {
// Required indicates whether this spec must be present.
Required bool `json:"required" yaml:"required" jsonschema:"description=Whether this spec is required"`
// Category overrides the default category for this spec type.
Category string `` /* 156-byte string literal not displayed */
// Description provides workflow-specific context for this spec.
Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Workflow-specific description"`
// Template declares where this spec's document template comes from. Omit to
// use default resolution (the workflow's own templates/ dir, then the
// extends chain).
Template *SpecSource `json:"template,omitempty" yaml:"template,omitempty" jsonschema:"description=Provenance of this spec's template"`
// Rubric declares where this spec's evaluation rubric comes from. Omit to
// use default resolution (the workflow's own rubrics/ dir, then the extends
// chain).
Rubric *SpecSource `json:"rubric,omitempty" yaml:"rubric,omitempty" jsonschema:"description=Provenance of this spec's rubric"`
}
SpecRequirement defines whether a spec type is required and its configuration.
type SpecSource ¶ added in v0.16.0
type SpecSource struct {
// From is the owning workflow name, or "local" for this workflow's own dir.
From string `` /* 126-byte string literal not displayed */
}
SpecSource declares the provenance of a spec's template or rubric: the workflow that owns the file. The sentinel "local" (SourceLocal) means this workflow's own directory; any other value names the workflow to resolve the file from. Declaring a source makes provenance explicit and loader-enforced — a source that does not actually provide the file is a load-time error.
A source must not lead back to the declaring workflow: it is resolved with full inheritance, so naming a descendant (whose extends chain necessarily returns to the declaring workflow) or any other workflow whose resolution path re-enters it is a circular reference and a load-time error. Point sources at ancestors or unrelated workflows; content owned by a descendant must be physically copied, not referenced.
In YAML it accepts the object form or a bare-string shorthand:
template: {from: enterprise}
rubric: local
func (*SpecSource) UnmarshalYAML ¶ added in v0.16.0
func (s *SpecSource) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML supports both the object form and a bare-string shorthand for a spec source:
template: {from: enterprise}
rubric: local
The scalar form sets From directly.
type SynthesisRule ¶ added in v0.16.0
type SynthesisRule struct {
// Sources are the spec type IDs required to synthesize this spec.
Sources []string `json:"sources" yaml:"sources" jsonschema:"required,description=Source spec type IDs"`
// Guidance is the prompt context for LLM synthesis.
Guidance string `json:"guidance,omitempty" yaml:"guidance,omitempty" jsonschema:"description=LLM prompt guidance for synthesis"`
// PromptContext is additional context for the synthesis prompt.
PromptContext string `json:"prompt_context,omitempty" yaml:"prompt_context,omitempty" jsonschema:"description=Additional synthesis prompt context"`
// Required indicates all sources must be present (vs. best-effort).
Required bool `json:"required,omitempty" yaml:"required,omitempty" jsonschema:"description=Whether all sources are required"`
// Priority determines synthesis order when multiple rules exist.
Priority int `json:"priority,omitempty" yaml:"priority,omitempty" jsonschema:"description=Synthesis priority (higher = earlier)"`
}
SynthesisRule defines how a spec can be synthesized from source specs.
type Workflow ¶
type Workflow struct {
// Name is the workflow identifier (e.g., "aws-one-way-door", "pbhq-lite").
Name string `json:"name" yaml:"name" jsonschema:"required,description=Workflow identifier"`
// Description explains the workflow's purpose and use case.
Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Workflow purpose and target audience"`
// Extends is the name of a parent workflow to inherit from.
Extends string `json:"extends,omitempty" yaml:"extends,omitempty" jsonschema:"description=Parent workflow to inherit settings from"`
// Abstract indicates this workflow is a base for other workflows (not directly usable).
Abstract bool `json:"abstract,omitempty" yaml:"abstract,omitempty" jsonschema:"description=True if this workflow cannot be used directly"`
// Methodology documents the underlying product methodology.
Methodology *Methodology `` /* 127-byte string literal not displayed */
// SpecConfig defines which specs are required/optional.
SpecConfig map[string]*SpecRequirement `json:"spec_config,omitempty" yaml:"spec_config,omitempty" jsonschema:"description=Spec requirements by spec type ID"`
// Synthesis defines how specs are generated from other specs.
Synthesis map[string]*SynthesisRule `json:"synthesis,omitempty" yaml:"synthesis,omitempty" jsonschema:"description=Synthesis rules by target spec type"`
// Execution defines the ordered phases and gates.
Execution *Execution `json:"execution,omitempty" yaml:"execution,omitempty" jsonschema:"description=Phase ordering and gates"`
// Evaluation defines pass/fail thresholds.
Evaluation *EvaluationConfig `json:"evaluation,omitempty" yaml:"evaluation,omitempty" jsonschema:"description=Evaluation thresholds"`
}
Workflow represents a complete specification workflow configuration.
func LoadFromFS ¶ added in v0.16.0
LoadFromFS loads a workflow directory from an fs.FS. Expects profile.yaml at the root of the directory.
func ParseYAMLFile ¶ added in v0.16.0
ParseYAMLFile parses a Workflow from a YAML file path.
func ParseYAMLFromFS ¶ added in v0.16.0
ParseYAMLFromFS parses a Workflow from an fs.FS at the given path.
func (*Workflow) GetCategory ¶ added in v0.16.0
GetCategory returns the category for a spec type.
func (*Workflow) IsRequired ¶ added in v0.16.0
IsRequired returns whether a spec type is required.
func (*Workflow) Merge ¶ added in v0.16.0
Merge combines this workflow with a parent workflow. Settings from this workflow override the parent.
func (*Workflow) RequiredSpecs ¶ added in v0.16.0
RequiredSpecs returns the list of required spec type IDs.