profile

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package profile defines specification workflow profiles.

A Profile bundles spec requirements, synthesis rules, and evaluation criteria into a cohesive workflow configuration (e.g., "aws-product", "big-tech-feature", "pbhq-lite").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationConfig

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 FindingSeverityLimits

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

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"`

	// 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 []string `json:"artifacts,omitempty" yaml:"artifacts,omitempty" jsonschema:"description=Key artifacts"`
}

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

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 Profile

type Profile struct {
	// Name is the profile identifier (e.g., "aws-product", "pbhq-lite").
	Name string `json:"name" yaml:"name" jsonschema:"required,description=Profile identifier"`

	// Description explains the profile's purpose and use case.
	Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Profile purpose and target audience"`

	// Extends is the name of a parent profile to inherit from.
	Extends string `json:"extends,omitempty" yaml:"extends,omitempty" jsonschema:"description=Parent profile to inherit settings from"`

	// Abstract indicates this profile is a base for other profiles (not directly usable).
	Abstract bool `json:"abstract,omitempty" yaml:"abstract,omitempty" jsonschema:"description=True if this profile 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"`

	// Workflow defines the ordered phases and gates.
	Workflow *Workflow `json:"workflow,omitempty" yaml:"workflow,omitempty" jsonschema:"description=Phase ordering and gates"`

	// Evaluation defines pass/fail thresholds.
	Evaluation *EvaluationConfig `json:"evaluation,omitempty" yaml:"evaluation,omitempty" jsonschema:"description=Evaluation thresholds"`
}

Profile represents a complete specification workflow configuration.

func LoadFromFS

func LoadFromFS(fsys fs.FS, dir string) (*Profile, error)

LoadFromFS loads a profile directory from an fs.FS. Expects profile.yaml at the root of the directory.

func ParseYAML

func ParseYAML(data []byte) (*Profile, error)

ParseYAML parses a Profile from YAML bytes.

func ParseYAMLFile

func ParseYAMLFile(path string) (*Profile, error)

ParseYAMLFile parses a Profile from a YAML file path.

func ParseYAMLFromFS

func ParseYAMLFromFS(fsys fs.FS, path string) (*Profile, error)

ParseYAMLFromFS parses a Profile from an fs.FS at the given path.

func (*Profile) Clone

func (p *Profile) Clone() *Profile

Clone creates a deep copy of the Profile.

func (*Profile) GetCategory

func (p *Profile) GetCategory(specType string) string

GetCategory returns the category for a spec type.

func (*Profile) IsRequired

func (p *Profile) IsRequired(specType string) bool

IsRequired returns whether a spec type is required.

func (*Profile) Merge

func (p *Profile) Merge(parent *Profile) *Profile

Merge combines this profile with a parent profile. Settings from this profile override the parent.

func (*Profile) RequiredSpecs

func (p *Profile) RequiredSpecs() []string

RequiredSpecs returns the list of required spec type IDs.

func (*Profile) ToYAML

func (p *Profile) ToYAML() ([]byte, error)

ToYAML serializes a Profile to YAML bytes.

func (*Profile) Validate

func (p *Profile) Validate() error

Validate checks if the profile is valid.

type ReviewGate

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

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 `` /* 142-byte string literal not displayed */

	// Description provides profile-specific context for this spec.
	Description string `json:"description,omitempty" yaml:"description,omitempty" jsonschema:"description=Profile-specific description"`

	// Template specifies a custom template path.
	Template string `json:"template,omitempty" yaml:"template,omitempty" jsonschema:"description=Custom template path"`

	// Rubric specifies a custom rubric path.
	Rubric string `json:"rubric,omitempty" yaml:"rubric,omitempty" jsonschema:"description=Custom rubric path"`
}

SpecRequirement defines whether a spec type is required and its configuration.

type SynthesisRule

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 {
	// 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"`
}

Workflow defines the ordered execution of specs.

Jump to

Keyboard shortcuts

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