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 ¶
- func BuildPrompt(s *state.ProjectState) string
- func BuildPromptFromPlan(goal string, plan *pm.Plan) string
- func Generate(ctx context.Context, p provider.Provider, model string, timeout time.Duration, ...) (string, error)
- func GenerateFromPlan(ctx context.Context, p provider.Provider, model string, timeout time.Duration, ...) (string, error)
- func RenderHTML(prose, goal string, m Metrics) string
- func RenderMarkdown(prose, goal string, m Metrics) string
- type Format
- type Metrics
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 ¶
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 ¶
RenderHTML wraps the narrative prose in a self-contained HTML document with clean typography.
func RenderMarkdown ¶
RenderMarkdown wraps the narrative prose in a Markdown document.
Types ¶
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 ¶
CollectMetrics computes project metrics from a plan.