narrative

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package narrative generates polished executive-level project story reports aimed at non-technical stakeholders. Unlike retro (team retrospective) or standup (daily sync), a narrative is a flowing prose "project story" with an introduction, chapters per completed task cluster, current state, and what's next.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(s *state.ProjectState) string

BuildPrompt constructs the AI prompt for narrative generation.

func BuildPromptFromPlan

func BuildPromptFromPlan(goal string, plan *pm.Plan) string

BuildPromptFromPlan builds the prompt from just a plan (when full state is unavailable).

func Generate

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

Generate calls the AI provider to produce a narrative and returns the raw prose.

func GenerateFromPlan

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

GenerateFromPlan calls the AI provider using only a plan (no full session state).

func RenderHTML

func RenderHTML(prose, goal string, m Metrics) string

RenderHTML wraps the narrative prose in a self-contained HTML document with clean typography.

func RenderMarkdown

func RenderMarkdown(prose, goal string, m Metrics) string

RenderMarkdown wraps the narrative prose in a Markdown document.

Types

type Format

type Format string

Format controls the output format of the narrative.

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

type Metrics

type Metrics struct {
	TotalTasks      int
	DoneTasks       int
	InProgressTasks int
	PendingTasks    int
	FailedTasks     int
	SkippedTasks    int
	TotalDuration   time.Duration
	EstimatedTotal  int // total estimated minutes across all tasks
	ActualTotal     int // total actual minutes across completed tasks
}

Metrics holds key project metrics collected for the narrative.

func CollectMetrics

func CollectMetrics(plan *pm.Plan) Metrics

CollectMetrics computes project metrics from a plan.

Jump to

Keyboard shortcuts

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