Documentation
¶
Overview ¶
Package templates provides embedded templates for role contexts and messages.
Index ¶
- func CommandNames() ([]string, error)
- func GetAllRoleTemplates() (map[string][]byte, error)
- func HasCommands(workspacePath string) bool
- func MissingCommands(workspacePath string) ([]string, error)
- func ProvisionCommands(workspacePath string) error
- type EscalationData
- type HandoffData
- type NudgeData
- type RoleData
- type SpawnData
- type Templates
- func (t *Templates) MessageNames() []string
- func (t *Templates) ProviderTemplateNames() map[string][]string
- func (t *Templates) RenderMessage(name string, data interface{}) (string, error)
- func (t *Templates) RenderRole(role string, data RoleData) (string, error)
- func (t *Templates) RenderRoleForProvider(role, provider string, data RoleData) (string, error)
- func (t *Templates) RoleNames() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandNames ¶
CommandNames returns the list of embedded slash commands.
func GetAllRoleTemplates ¶
GetAllRoleTemplates returns all role templates as a map of filename to content.
func HasCommands ¶
HasCommands checks if a workspace has the .cursor/commands/ directory provisioned.
func MissingCommands ¶
MissingCommands returns the list of embedded commands missing from the workspace.
func ProvisionCommands ¶
ProvisionCommands creates the .cursor/commands/ directory with standard slash commands. This ensures crew/polecat workspaces have the handoff command and other utilities even if the source repo doesn't have them tracked. If a command already exists, it is skipped (no overwrite).
Types ¶
type EscalationData ¶
type EscalationData struct {
Polecat string
Issue string
Reason string
NudgeCount int
LastStatus string
Suggestions []string
}
EscalationData contains information for escalation messages.
type HandoffData ¶
type HandoffData struct {
Role string
CurrentWork string
Status string
NextSteps []string
Notes string
PendingMail int
GitBranch string
GitDirty bool
}
HandoffData contains information for session handoff messages.
type NudgeData ¶
type NudgeData struct {
Polecat string
Reason string
NudgeCount int
MaxNudges int
Issue string
Status string
}
NudgeData contains information for nudge messages.
type RoleData ¶
type RoleData struct {
Role string // mayor, witness, refinery, polecat, crew, deacon
RigName string // e.g., "greenplace"
TownRoot string // e.g., "/Users/steve/ai"
TownName string // e.g., "ai" - the town identifier for session names
WorkDir string // current working directory
DefaultBranch string // default branch for merges (e.g., "main", "develop")
Polecat string // polecat name (for polecat role)
Polecats []string // list of polecats (for witness role)
BeadsDir string // BEADS_DIR path
IssuePrefix string // beads issue prefix
MayorSession string // e.g., "gt-ai-mayor" - dynamic mayor session name
DeaconSession string // e.g., "gt-ai-deacon" - dynamic deacon session name
Provider string // model provider: "anthropic", "openai", "google" (for template selection)
Model string // specific model being used
}
RoleData contains information for rendering role contexts.
type SpawnData ¶
type SpawnData struct {
Issue string
Title string
Priority int
Description string
Branch string
RigName string
Polecat string
}
SpawnData contains information for spawn assignment messages.
type Templates ¶
type Templates struct {
// contains filtered or unexported fields
}
Templates manages role and message templates.
func (*Templates) MessageNames ¶
MessageNames returns the list of available message templates.
func (*Templates) ProviderTemplateNames ¶
ProviderTemplateNames returns the list of provider-specific role templates.
func (*Templates) RenderMessage ¶
RenderMessage renders a message template.
func (*Templates) RenderRole ¶
RenderRole renders a role context template. If data.Provider is set and a provider-specific template exists, it uses that. Otherwise, it falls back to the default template.
func (*Templates) RenderRoleForProvider ¶
RenderRoleForProvider renders a role template optimized for a specific provider. Falls back to default template if no provider-specific template exists.