summarize

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package summarize generates AI executive summaries of completed work for stakeholder communication. Unlike retro (retrospective/lessons) and report (status-focused), this targets non-technical stakeholder audiences.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(goal string, tasks []TaskContext, sinceLabel string) string

BuildPrompt constructs the executive summary prompt from task contexts and goal.

func CopyToClipboard

func CopyToClipboard(content string) error

CopyToClipboard copies content to the system clipboard using xclip (Linux) or pbcopy (macOS). Returns an error if neither tool is available or the copy fails.

func FormatHTML

func FormatHTML(s *Summary, goal string, taskCount int, sinceLabel string) string

FormatHTML renders a Summary as a self-contained HTML document.

func FormatJSON

func FormatJSON(s *Summary) string

FormatJSON returns the Summary as indented JSON.

func FormatMarkdown

func FormatMarkdown(s *Summary, goal string, taskCount int, sinceLabel string) string

FormatMarkdown renders a Summary as a Markdown document.

func SaveToFile

func SaveToFile(workDir, content, ext string) (string, error)

SaveToFile writes the summary content to .cloop/summaries/<timestamp>.<ext>. Returns the absolute path where the file was written.

Types

type Summary

type Summary struct {
	// HighLevel is a one-paragraph narrative overview of what was accomplished.
	HighLevel string `json:"high_level"`

	// Accomplishments groups completed work by theme.
	Accomplishments []ThemeGroup `json:"accomplishments"`

	// Decisions lists notable architectural or product decisions made during execution.
	Decisions []string `json:"decisions"`

	// Risks lists remaining risks or open concerns after the work is complete.
	Risks []string `json:"risks"`
}

Summary is the structured output of an executive summary.

func Generate

func Generate(ctx context.Context, p provider.Provider, model string, timeout time.Duration, goal string, tasks []TaskContext, sinceLabel string) (*Summary, error)

Generate calls the provider and produces a structured Summary.

func ParseSummary

func ParseSummary(output string) (*Summary, error)

ParseSummary extracts a Summary from the AI's JSON response.

type TaskContext

type TaskContext struct {
	ID              int
	Title           string
	Description     string
	Status          pm.TaskStatus
	Role            string
	Tags            []string
	Result          string
	ArtifactContent string
	Annotations     []pm.Annotation
	CompletedAt     *time.Time
}

TaskContext holds the data collected for a single completed task.

func CollectTaskContexts

func CollectTaskContexts(workDir string, plan *pm.Plan, sinceVersion int) []TaskContext

CollectTaskContexts gathers all relevant task data for tasks that are done, optionally filtering to those completed after a given snapshot version.

type ThemeGroup

type ThemeGroup struct {
	Theme string   `json:"theme"`
	Items []string `json:"items"`
}

ThemeGroup is a cluster of related accomplishments under a common theme.

Jump to

Keyboard shortcuts

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