goals

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package goals provides a framework-agnostic wrapper for goal-setting systems.

Organizations use either OKR (Objectives and Key Results) or V2MOM (Vision, Values, Methods, Obstacles, Measures) for strategic planning. This package provides a unified interface that supports both frameworks through a discriminated union pattern.

Use Goals in PRDs and roadmaps to support organizations using either framework, with common rendering and reporting regardless of the underlying goal system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Framework

type Framework string

Framework identifies the goal-setting framework in use.

const (
	// FrameworkOKR indicates OKR (Objectives and Key Results) framework.
	FrameworkOKR Framework = "okr"
	// FrameworkV2MOM indicates V2MOM (Vision, Values, Methods, Obstacles, Measures) framework.
	FrameworkV2MOM Framework = "v2mom"
)

type GoalItem

type GoalItem struct {
	ID          string   `json:"id,omitempty"`
	Title       string   `json:"title"`
	Description string   `json:"description,omitempty"`
	Owner       string   `json:"owner,omitempty"`
	Status      string   `json:"status,omitempty"`
	Priority    string   `json:"priority,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

GoalItem represents a high-level goal that can be either: - An Objective (OKR framework) - A Method (V2MOM framework)

This abstraction enables framework-agnostic rendering for roadmaps, reports, and presentations.

type Goals

type Goals struct {
	// Framework identifies which goal system is in use ("okr" or "v2mom").
	Framework Framework `json:"framework"`

	// OKR contains OKR data when Framework is "okr".
	OKR *okr.OKRSet `json:"okr,omitempty"`

	// V2MOM contains V2MOM data when Framework is "v2mom".
	V2MOM *v2mom.V2MOM `json:"v2mom,omitempty"`
}

Goals is a framework-agnostic container for organizational goals. It supports both OKR and V2MOM through a discriminated union pattern. Exactly one of OKR or V2MOM should be set based on the Framework field.

func NewOKR

func NewOKR(okrs *okr.OKRSet) *Goals

NewOKR creates a Goals wrapper containing OKR data.

func NewV2MOM

func NewV2MOM(v *v2mom.V2MOM) *Goals

NewV2MOM creates a Goals wrapper containing V2MOM data.

func (*Goals) GoalCount

func (g *Goals) GoalCount() int

GoalCount returns the number of goals.

func (*Goals) GoalItems

func (g *Goals) GoalItems() []GoalItem

GoalItems returns all goals as a unified slice. Returns Objectives for OKR, Methods for V2MOM.

func (*Goals) GoalLabel

func (g *Goals) GoalLabel() string

GoalLabel returns the display label for goals. Returns "Objectives" for OKR, "Methods" for V2MOM.

func (*Goals) IsOKR

func (g *Goals) IsOKR() bool

IsOKR returns true if this Goals uses the OKR framework.

func (*Goals) IsV2MOM

func (g *Goals) IsV2MOM() bool

IsV2MOM returns true if this Goals uses the V2MOM framework.

func (*Goals) ResultCount

func (g *Goals) ResultCount() int

ResultCount returns the number of results.

func (*Goals) ResultItems

func (g *Goals) ResultItems() []ResultItem

ResultItems returns all measurable results as a unified slice. Returns Key Results for OKR, Measures for V2MOM.

func (*Goals) ResultItemsByPhase

func (g *Goals) ResultItemsByPhase() map[string][]ResultItem

ResultItemsByPhase returns results grouped by phase ID.

func (*Goals) ResultLabel

func (g *Goals) ResultLabel() string

ResultLabel returns the display label for results. Returns "Key Results" for OKR, "Measures" for V2MOM.

type ResultItem

type ResultItem struct {
	ID          string  `json:"id,omitempty"`
	Title       string  `json:"title"`
	Metric      string  `json:"metric,omitempty"`
	Baseline    string  `json:"baseline,omitempty"`
	Target      string  `json:"target,omitempty"`
	Current     string  `json:"current,omitempty"`
	Unit        string  `json:"unit,omitempty"`
	Status      string  `json:"status,omitempty"`
	Score       float64 `json:"score,omitempty"` // 0.0-1.0 achievement score
	GoalID      string  `json:"goalId,omitempty"`
	PhaseID     string  `json:"phaseId,omitempty"`     // For roadmap alignment
	PhaseTarget string  `json:"phaseTarget,omitempty"` // Target for specific phase
}

ResultItem represents a measurable result that can be either: - A Key Result (OKR framework) - A Measure (V2MOM framework)

This abstraction enables framework-agnostic rendering for tracking and reporting.

Directories

Path Synopsis
okr
Package okr provides types and utilities for OKR (Objectives and Key Results) goal-setting documents.
Package okr provides types and utilities for OKR (Objectives and Key Results) goal-setting documents.
render
Package render provides interfaces and utilities for rendering OKR documents to various output formats including Marp slides.
Package render provides interfaces and utilities for rendering OKR documents to various output formats including Marp slides.
render/marp
Package marp provides a Marp markdown renderer for OKR documents.
Package marp provides a Marp markdown renderer for OKR documents.
Package v2mom provides types and utilities for V2MOM strategic planning documents.
Package v2mom provides types and utilities for V2MOM strategic planning documents.
render
Package render provides interfaces and utilities for rendering V2MOM documents to various output formats.
Package render provides interfaces and utilities for rendering V2MOM documents to various output formats.
render/marp
Package marp provides a Marp markdown renderer for V2MOM documents.
Package marp provides a Marp markdown renderer for V2MOM documents.

Jump to

Keyboard shortcuts

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