brief

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package brief generates one-page AI executive project briefs for stakeholder updates. It gathers signals from forecast, health, risk, and retro packages, then calls the provider once to synthesize a concise brief in Markdown, HTML, or Slack block-kit JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(workDir string, b *Brief) (string, error)

Save writes the brief to .cloop/briefs/brief-<timestamp>.<ext> and returns the path.

Types

type Brief

type Brief struct {
	Goal        string
	GeneratedAt time.Time
	Format      Format
	Content     string // rendered content in the requested format
}

Brief is the generated executive brief.

func Generate

func Generate(ctx context.Context, p provider.Provider, model string, timeout time.Duration,
	s *state.ProjectState, format Format,
	retroWentWell, retroWentWrong, retroNextAction []string,
) (*Brief, error)

Generate calls the provider to create an executive brief, then renders it in the requested format. The brief is also saved to .cloop/briefs/.

type BriefMeta

type BriefMeta struct {
	Filename  string
	CreatedAt time.Time
	Format    Format
	// first line of the brief (after the # heading)
	Preview string
}

BriefMeta stores metadata about a saved brief file.

func ListBriefs

func ListBriefs(workDir string) ([]BriefMeta, error)

ListBriefs returns metadata for all saved briefs, newest first.

type Format

type Format string

Format specifies the output format for the brief.

const (
	FormatMarkdown Format = "markdown"
	FormatHTML     Format = "html"
	FormatSlack    Format = "slack"
)

type Input

type Input struct {
	State    *state.ProjectState
	Plan     *pm.Plan
	Forecast *forecast.Forecast
	// Top-N risk findings (derived locally from task RiskScore fields)
	TopRisks []*risk.Finding
	// Simple heuristic health score (0-100)
	HealthScore int
	// Retro highlights (last 3 went_well / went_wrong / next_actions)
	RetroWentWell   []string
	RetroWentWrong  []string
	RetroNextAction []string
}

Input holds all pre-computed context for brief generation.

Jump to

Keyboard shortcuts

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