prompts

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package prompts provides LLM prompt templates for git-courer operations. Each operation has its own focused prompt — no generic one-size-fits-all. Templates are loaded from .txt files in the txt/ directory.

Index

Constants

View Source
const FallbackBranchCreate = `` /* 181-byte string literal not displayed */
View Source
const FallbackDecideCommit = `` /* 168-byte string literal not displayed */
View Source
const FallbackGenerateMessage = `` /* 250-byte string literal not displayed */
View Source
const InterpretGitOp = `` /* 344-byte string literal not displayed */

InterpretGitOp is a generic template that wraps operation-specific prompts. It takes the operation name and delegates to the specific template.

Variables

This section is empty.

Functions

func Get

func Get(op string) string

Get returns the prompt template for the given operation. Falls back to a minimal generic prompt for unknown operations.

func GetAll

func GetAll() map[string]string

GetAll returns all available templates (for debugging/listing)

func GetCommitMessage

func GetCommitMessage() string

GetCommitMessage returns the commit message template

func GetDecideCommit

func GetDecideCommit() string

GetDecideCommit returns the decide commit template

func GetWithFallback

func GetWithFallback(op string) string

GetWithFallback returns the template, falling back to embedded if file loading fails

func HasTemplate

func HasTemplate(op string) bool

HasTemplate checks if a template exists for the given operation

func Render

func Render(tmpl string, data interface{}) (string, error)

Render processes a template with the given data

func RenderOp

func RenderOp(op string, params interface{}) (string, error)

RenderOp renders a template for an operation with the provided params

func RenderWithData

func RenderWithData(tmpl string, data interface{}) (string, error)

Render renders a template string with the given data. Kept for backward compatibility.

func TemplateFor

func TemplateFor(op string) string

TemplateFor returns the prompt template for the given operation. Kept for backward compatibility.

Types

type DecideParams

type DecideParams struct {
	Instruction   string
	CurrentBranch string
	GitStatus     string
	Untracked     string
	Modified      string
	Deleted       string
}

DecideParams for deciding what to commit

func BuildDecideParams

func BuildDecideParams(instruction, gitStatus, untracked, modified, deleted string) DecideParams

BuildDecideParams creates DecideParams

type InterpretParams

type InterpretParams struct {
	Operation       string
	Instruction     string
	Context         string
	OperationPrompt string
}

InterpretParams holds parameters for the generic interpreter

func BuildInterpretParams

func BuildInterpretParams(op, instruction string, ctx map[string]string) InterpretParams

BuildInterpretParams creates InterpretParams for a given operation

type MessageParams

type MessageParams struct {
	CurrentBranch   string
	Files           string
	Diff            string
	RejectedMessage string
}

MessageParams for commit message generation

func BuildMessageParams

func BuildMessageParams(files []string, diff string) MessageParams

BuildMessageParams creates MessageParams for commit message

func BuildMessageParamsWithRetry

func BuildMessageParamsWithRetry(files []string, diff, rejected string) MessageParams

BuildMessageParamsWithRetry creates MessageParams with rejection context

type OpParams

type OpParams struct {
	Instruction    string
	CurrentBranch  string
	Branches       string
	Tags           string
	RecentCommits  string
	UntrackedFiles string
	Remotes        string
	Remote         string
}

OpParams for any per-operation prompt

func BuildOpParams

func BuildOpParams(instruction string, ctx map[string]string) OpParams

BuildOpParams constructs OpParams from a context map

Jump to

Keyboard shortcuts

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