Documentation
¶
Overview ¶
Package maturity provides types and functions for maturity model management.
Index ¶
- Constants
- func DefaultLevelNames() map[int]string
- func GenerateMarp(specFile, outputFile string) error
- func GenerateSimpleXLSX(specFile, outputFile string) error
- func GenerateXLSX(specFile, outputFile string) error
- func OperatorSymbol(op string) string
- type Criterion
- type DomainAssessment
- type DomainModel
- type Enabler
- type KPIThreshold
- type Level
- type LevelProgress
- type LevelThresholds
- type MarpGenerator
- type Spec
- type SpecMetadata
- type XLSXGenerator
Constants ¶
const ( StatusNotStarted = "not_started" StatusInProgress = "in_progress" StatusCompleted = "completed" StatusBlocked = "blocked" )
Enabler status constants.
const ( TypeImplementation = "implementation" TypeProcess = "process" TypeTraining = "training" TypeTooling = "tooling" )
Enabler type constants.
const ( OpGTE = "gte" // Greater than or equal OpLTE = "lte" // Less than or equal OpGT = "gt" // Greater than OpLT = "lt" // Less than OpEQ = "eq" // Equal )
Operator constants.
const ( LevelNameReactive = "Reactive" LevelNameBasic = "Basic" LevelNameDefined = "Defined" LevelNameManaged = "Managed" LevelNameOptimizing = "Optimizing" )
Level name constants.
Variables ¶
This section is empty.
Functions ¶
func DefaultLevelNames ¶
DefaultLevelNames returns the standard M1-M5 level names.
func GenerateMarp ¶
GenerateMarp is a convenience function to generate Marp from a spec file.
func GenerateSimpleXLSX ¶
GenerateSimpleXLSX generates a simple XLSX report using omniframe. This provides a basic export without conditional styling.
func GenerateXLSX ¶
GenerateXLSX is a convenience function to generate XLSX from a spec file.
func OperatorSymbol ¶
OperatorSymbol returns the symbol for an operator.
Types ¶
type Criterion ¶
type Criterion struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
// SLO Definition
MetricName string `json:"metricName"` // Human-readable metric description
Operator string `json:"operator"` // gte, lte, gt, lt, eq
Target float64 `json:"target"` // Target value
Unit string `json:"unit,omitempty"` // %, days, count, seconds, etc.
// Classification
Layer string `json:"layer,omitempty"` // requirements, code, infra, runtime, adoption, support
Category string `json:"category,omitempty"` // prevention, detection, response
// Assessment (populated during evaluation)
Current float64 `json:"current,omitempty"` // Current value
IsMet bool `json:"isMet,omitempty"` // Calculated: meets target?
// Weighting
Weight float64 `json:"weight,omitempty"` // Relative importance (default 1.0)
Required bool `json:"required,omitempty"` // Must pass for level (default true if omitted)
}
Criterion is a measurable SLO that defines level achievement.
func (*Criterion) CurrentString ¶
CurrentString returns a formatted current value string.
func (*Criterion) TargetString ¶
TargetString returns a formatted target string like ">=95%".
type DomainAssessment ¶
type DomainAssessment struct {
Domain string `json:"domain"`
AssessedAt string `json:"assessedAt,omitempty"`
AssessedBy string `json:"assessedBy,omitempty"`
CurrentLevel int `json:"currentLevel"` // Achieved level (1-5)
TargetLevel int `json:"targetLevel"` // Goal level
CriteriaValues map[string]float64 `json:"criteriaValues,omitempty"` // Current values by criterion ID
EnablerStatus map[string]string `json:"enablerStatus,omitempty"` // Status by enabler ID
}
DomainAssessment captures current state against a domain's maturity model.
type DomainModel ¶
type DomainModel struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Owner string `json:"owner,omitempty"`
Levels []Level `json:"levels"`
}
DomainModel defines maturity levels for a specific domain.
func (*DomainModel) AllCriteria ¶
func (d *DomainModel) AllCriteria() []Criterion
AllCriteria returns all criteria across all levels for a domain.
func (*DomainModel) AllEnablers ¶
func (d *DomainModel) AllEnablers() []Enabler
AllEnablers returns all enablers across all levels for a domain.
func (*DomainModel) CriteriaForLevel ¶
func (d *DomainModel) CriteriaForLevel(level int) []Criterion
CriteriaForLevel returns criteria for a specific level.
func (*DomainModel) EnablersForLevel ¶
func (d *DomainModel) EnablersForLevel(level int) []Enabler
EnablersForLevel returns enablers for a specific level.
type Enabler ¶
type Enabler struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
// Classification
Type string `json:"type,omitempty"` // implementation, process, training, tooling
Layer string `json:"layer,omitempty"` // requirements, code, infra, runtime, adoption, support
// Effort
Effort string `json:"effort,omitempty"` // T-shirt size or duration
Team string `json:"team,omitempty"` // Responsible team
// Tracking
Status string `json:"status,omitempty"` // not_started, in_progress, completed
CriteriaIDs []string `json:"criteriaIds,omitempty"` // Which SLOs this enables
// Dependencies
DependsOn []string `json:"dependsOn,omitempty"` // Other enabler IDs
}
Enabler is implementation work to achieve criteria.
type KPIThreshold ¶
type KPIThreshold struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Unit string `json:"unit,omitempty"`
Operator string `json:"operator,omitempty"` // gte (default), lte for "lower is better"
Thresholds LevelThresholds `json:"thresholds"`
Current any `json:"current,omitempty"` // Current value for assessment
}
KPIThreshold defines the progression of a KPI across maturity levels.
type Level ¶
type Level struct {
Level int `json:"level"` // 1-5
Name string `json:"name"` // Reactive, Basic, Defined, Managed, Optimizing
Description string `json:"description"`
Criteria []Criterion `json:"criteria,omitempty"` // SLOs that define the level
Enablers []Enabler `json:"enablers,omitempty"` // Tasks to achieve the level
}
Level defines a maturity level (M1-M5) for a domain.
func (*Level) CalculateLevelProgress ¶
func (l *Level) CalculateLevelProgress(values map[string]float64, enablerStatus map[string]string) LevelProgress
CalculateLevelProgress calculates progress for a level given current values.
type LevelProgress ¶
type LevelProgress struct {
Level int `json:"level"`
CriteriaMet int `json:"criteriaMet"`
CriteriaTotal int `json:"criteriaTotal"`
ProgressPercent float64 `json:"progressPercent"`
EnablersDone int `json:"enablersDone"`
EnablersTotal int `json:"enablersTotal"`
}
LevelProgress tracks progress toward a maturity level.
type LevelThresholds ¶
type LevelThresholds struct {
M1 any `json:"m1,omitempty"`
M2 any `json:"m2,omitempty"`
M3 any `json:"m3,omitempty"`
M4 any `json:"m4,omitempty"`
M5 any `json:"m5,omitempty"`
}
LevelThresholds holds threshold values for each maturity level.
type MarpGenerator ¶
type MarpGenerator struct {
// contains filtered or unexported fields
}
MarpGenerator generates Marp presentations from maturity specs.
func NewMarpGenerator ¶
func NewMarpGenerator(spec *Spec) *MarpGenerator
NewMarpGenerator creates a new Marp generator.
func (*MarpGenerator) Generate ¶
func (g *MarpGenerator) Generate() (string, error)
Generate creates the Marp presentation content.
func (*MarpGenerator) SaveAs ¶
func (g *MarpGenerator) SaveAs(filename string) error
SaveAs saves the presentation to a file.
type Spec ¶
type Spec struct {
Schema string `json:"$schema,omitempty"`
Metadata *SpecMetadata `json:"metadata,omitempty"`
KPIThresholds map[string][]KPIThreshold `json:"kpiThresholds,omitempty"`
Domains map[string]*DomainModel `json:"domains"`
Assessments map[string]*DomainAssessment `json:"assessments,omitempty"`
}
Spec defines a complete maturity specification for an organization. It contains maturity models for multiple domains.
func ReadSpecFile ¶
ReadSpecFile reads a maturity spec from a JSON file.
func (*Spec) GetDomain ¶
func (s *Spec) GetDomain(name string) (*DomainModel, bool)
GetDomain returns the domain model by name.
func (*Spec) WriteSpecFile ¶
WriteSpecFile writes a maturity spec to a JSON file.
type SpecMetadata ¶
type SpecMetadata struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Organization string `json:"organization,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
SpecMetadata contains metadata about the maturity specification.
type XLSXGenerator ¶
type XLSXGenerator struct {
// contains filtered or unexported fields
}
XLSXGenerator generates Excel reports from maturity specs.
func NewXLSXGenerator ¶
func NewXLSXGenerator(spec *Spec) *XLSXGenerator
NewXLSXGenerator creates a new XLSX generator.
func (*XLSXGenerator) Generate ¶
func (g *XLSXGenerator) Generate() error
Generate creates the XLSX file with all sheets.
func (*XLSXGenerator) SaveAs ¶
func (g *XLSXGenerator) SaveAs(filename string) error
SaveAs saves the XLSX file to the specified path.