prompt

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package prompt renders the templated agent prompts emitted when a review finishes, following crit's hook naming, resolution order, and template variables (https://github.com/tomasz-tomczyk/crit).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HookForFinish

func HookForFinish(approved bool) string

HookForFinish names the hook that fires for a finish result.

func RenderFinish

func RenderFinish(prompts map[string]string, projectRoot string, ctx Context) string

RenderFinish resolves and renders the finish prompt. prompts is the merged config prompts map; projectRoot may be empty. Rendering errors fall back to a plain message rather than blocking the finish.

func StockTemplates

func StockTemplates() map[string][]byte

StockTemplates returns the embedded stock template file names and contents, for `critty install prompts` and staleness checking.

Types

type Context

type Context struct {
	ReviewPath        string
	SessionKey        string
	Mode              string // "diff" (git) or "files"
	InternalMode      string // "git", "diff", "files", or "plan"
	PlanSlug          string
	UnresolvedCount   int
	TotalCount        int
	FilesWithComments []string
	UnresolvedJSON    string
	CommentsJSON      string
	Approved          bool
	NextRoundCmd      string
}

Context carries the values exposed to finish templates.

func (Context) TemplateData

func (c Context) TemplateData() map[string]any

TemplateData returns the snake_case variable map, matching crit's names.

Jump to

Keyboard shortcuts

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