profiles

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package profiles provides reusable configuration profiles for visionspec.

Profiles bundle together spec requirements, templates, and rubrics into a cohesive configuration that can be selected at runtime or compiled into custom CLI tools.

Default profiles are provided for common product stages:

  • 0-1: Minimal configuration for idea validation
  • startup: Lightweight configuration for pre-PMF startups
  • growth: Metrics-driven configuration for 1-N scaling
  • enterprise: Comprehensive configuration for post-PMF enterprises

Organizations can create custom profiles that extend default profiles or define entirely new configurations.

Index

Constants

This section is empty.

Variables

View Source
var DefaultProfileNames = []string{

	"0-1", "startup", "growth", "enterprise",

	"aws", "google", "stripe", "lean-startup", "design-thinking", "jtbd",
}

DefaultProfileNames returns the names of all default profiles.

Stage-based profiles (by company maturity):

  • 0-1: Pre-product-market-fit exploration
  • startup: Early product development
  • growth: Scaling product and team
  • enterprise: Mature organization with compliance needs

Methodology profiles (by product development approach):

  • aws: Amazon Working Backwards with Leadership Principles
  • google: Google Design Docs + RFC culture with OKRs
  • lean-startup: Eric Ries' Build-Measure-Learn with validated learning
  • design-thinking: Stanford d.school human-centered design
  • jtbd: Clayton Christensen's Jobs-to-be-Done framework

Functions

func IsDefaultProfile

func IsDefaultProfile(name string) bool

IsDefaultProfile returns true if the name is a default profile.

func WriteProfileYAML

func WriteProfileYAML(path string, py *ProfileYAML) error

WriteProfileYAML writes a ProfileYAML to a file.

Types

type Loader

type Loader interface {
	// Load returns a profile by name.
	Load(name string) (*Profile, error)

	// Available returns all available profile names.
	Available() []string
}

Loader loads profiles by name.

func DefaultLoader

func DefaultLoader() Loader

DefaultLoader returns a loader for built-in default profiles.

func NewChainLoader

func NewChainLoader(loaders ...Loader) Loader

NewChainLoader creates a loader that tries multiple loaders in order.

func NewEmbedFSLoader

func NewEmbedFSLoader(fsys embed.FS, dir string) Loader

NewEmbedFSLoader creates a loader from an embedded filesystem. The dir parameter specifies the base directory within the embed.FS.

func NewFileLoader

func NewFileLoader(dir string) Loader

NewFileLoader creates a loader from a filesystem directory.

func NewResolvingLoader

func NewResolvingLoader(base Loader) Loader

NewResolvingLoader creates a loader that resolves profile inheritance.

type Profile

type Profile struct {
	// Name is the profile identifier (e.g., "startup", "enterprise").
	Name string `yaml:"name" json:"name"`

	// Description explains the profile's purpose and use case.
	Description string `yaml:"description" json:"description"`

	// Extends is the name of a parent profile to inherit from.
	// Settings from this profile override the parent.
	Extends string `yaml:"extends,omitempty" json:"extends,omitempty"`

	// SpecConfig defines which specs are required and their settings.
	SpecConfig *types.SpecConfig `yaml:"spec_config,omitempty" json:"spec_config,omitempty"`

	// TemplateLoader provides templates for this profile.
	// Set by the loader, not from YAML.
	TemplateLoader templates.Loader `yaml:"-" json:"-"`

	// RubricLoader provides rubrics for this profile.
	// Set by the loader, not from YAML.
	RubricLoader rubrics.Loader `yaml:"-" json:"-"`

	// Path is the filesystem path where the profile was loaded from.
	// Empty for embedded profiles.
	Path string `yaml:"-" json:"-"`
}

Profile represents a complete visionspec configuration profile.

func (*Profile) GetRubricLoader

func (p *Profile) GetRubricLoader() rubrics.Loader

GetRubricLoader returns the rubric loader, falling back to default.

func (*Profile) GetSpecConfig

func (p *Profile) GetSpecConfig() *types.SpecConfig

GetSpecConfig returns the effective SpecConfig, merging with parent if extends is set.

func (*Profile) GetTemplateLoader

func (p *Profile) GetTemplateLoader() templates.Loader

GetTemplateLoader returns the template loader, falling back to default.

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 names.

func (*Profile) Summary

func (p *Profile) Summary() string

Summary returns a short description for display.

func (*Profile) Validate

func (p *Profile) Validate() error

Validate checks if the profile is valid.

type ProfileYAML

type ProfileYAML struct {
	Name        string                            `yaml:"name"`
	Description string                            `yaml:"description"`
	Extends     string                            `yaml:"extends,omitempty"`
	SpecConfig  map[string]*types.SpecRequirement `yaml:"spec_config,omitempty"`
}

ProfileYAML is the YAML representation of a profile.

func ProfileToYAML

func ProfileToYAML(p *Profile) *ProfileYAML

ProfileToYAML converts a Profile back to ProfileYAML for serialization.

func (*ProfileYAML) ToProfile

func (py *ProfileYAML) ToProfile() *Profile

ToProfile converts ProfileYAML to a Profile.

Jump to

Keyboard shortcuts

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