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 ¶
- func BuildPrompt(goal string, tasks []TaskContext, sinceLabel string) string
- func CopyToClipboard(content string) error
- func FormatHTML(s *Summary, goal string, taskCount int, sinceLabel string) string
- func FormatJSON(s *Summary) string
- func FormatMarkdown(s *Summary, goal string, taskCount int, sinceLabel string) string
- func SaveToFile(workDir, content, ext string) (string, error)
- type Summary
- type TaskContext
- type ThemeGroup
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 ¶
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 ¶
FormatHTML renders a Summary as a self-contained HTML document.
func FormatJSON ¶
FormatJSON returns the Summary as indented JSON.
func FormatMarkdown ¶
FormatMarkdown renders a Summary as a Markdown document.
func SaveToFile ¶
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 ¶
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 ¶
ThemeGroup is a cluster of related accomplishments under a common theme.