retro

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package retro provides AI-powered sprint retrospective analysis for cloop sessions. After a PM session completes (or at any point), it analyzes execution patterns, surfaces insights, and suggests concrete process improvements.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(s *state.ProjectState, stats SessionStats) string

BuildPrompt constructs the retrospective analysis prompt.

func FormatMarkdown

func FormatMarkdown(a *Analysis, s *state.ProjectState) string

FormatMarkdown renders the analysis as a comprehensive markdown retrospective report. plan is optional; when non-nil a task time comparison table is included. costSummary is optional; when non-empty a cost section is included.

func FormatMarkdownFull

func FormatMarkdownFull(a *Analysis, goal string, plan *pm.Plan, costSummary string) string

FormatMarkdownFull is the full renderer used by both Analyze (state-based) and Generate (plan-based). journalSummaries is an optional map of task ID string → AI-generated journal summary.

func FormatMarkdownFullWithJournal

func FormatMarkdownFullWithJournal(a *Analysis, goal string, plan *pm.Plan, costSummary string, journalSummaries map[string]string) string

FormatMarkdownFullWithJournal is like FormatMarkdownFull but also renders per-task journal summaries. journalSummaries maps task ID string → AI-generated narrative summary from the journal.

func SLASection

func SLASection(plan *pm.Plan) string

SLASection renders SLA compliance stats for inclusion in retro output. Returns empty string when there are no tasks with deadlines.

Types

type Analysis

type Analysis struct {
	// HealthScore is an overall project health score from 1-10.
	HealthScore float64 `json:"health_score"`

	// Summary is a 1-2 sentence high-level assessment.
	Summary string `json:"summary"`

	// WentWell lists things that worked effectively.
	WentWell []string `json:"went_well"`

	// WentWrong lists failures, blockers, or inefficiencies.
	WentWrong []string `json:"went_wrong"`

	// Bottlenecks lists specific slow or blocked areas.
	Bottlenecks []string `json:"bottlenecks"`

	// Insights lists key learnings from the session.
	Insights []string `json:"insights"`

	// NextActions lists concrete recommended follow-up steps.
	NextActions []string `json:"next_actions"`

	// VelocityNotes is a human-readable assessment of task throughput.
	VelocityNotes string `json:"velocity_notes"`

	// LessonsLearned is an AI-written narrative of lessons learned.
	LessonsLearned string `json:"lessons_learned"`

	// ProcessImprovements is an AI-written narrative of suggested process improvements.
	ProcessImprovements string `json:"process_improvements"`
}

Analysis is the structured output of a retrospective.

func Analyze

func Analyze(ctx context.Context, p provider.Provider, model string, timeout time.Duration, s *state.ProjectState) (*Analysis, error)

Analyze calls the provider to generate a retrospective analysis from full session state.

func Generate

func Generate(ctx context.Context, p provider.Provider, model string, timeout time.Duration, plan *pm.Plan, costSummary string) (*Analysis, error)

Generate produces a retrospective report from a plan and an optional cost summary string. It is the primary entry point when the full session state is unavailable.

func ParseAnalysis

func ParseAnalysis(output string) (*Analysis, error)

ParseAnalysis extracts an Analysis from the AI's JSON response.

type SessionStats

type SessionStats struct {
	TotalTasks    int
	DoneTasks     int
	FailedTasks   int
	SkippedTasks  int
	PendingTasks  int
	AvgTaskDur    time.Duration
	TotalDuration time.Duration
	InputTokens   int
	OutputTokens  int
}

SessionStats holds computed metrics about a session.

func ComputeStats

func ComputeStats(s *state.ProjectState) SessionStats

ComputeStats derives session statistics from state.

type TaskTimeComparison

type TaskTimeComparison struct {
	TaskID           int
	Title            string
	Status           pm.TaskStatus
	EstimatedMinutes int
	ActualMinutes    int
	// WallClockMinutes is derived from StartedAt/CompletedAt when ActualMinutes is 0.
	WallClockMinutes int
}

TaskTimeComparison holds per-task estimated vs actual time data.

func ComputeTimeComparisons

func ComputeTimeComparisons(plan *pm.Plan) []TaskTimeComparison

ComputeTimeComparisons builds per-task estimated vs actual time data.

Jump to

Keyboard shortcuts

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