prompt

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package prompt builds prompts for Smith (Claude Code) workers from bead metadata.

Prompts combine repo context (AGENTS.md), bead description, coding standards, and per-anvil overrides into a single instruction string for Claude.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCustomTemplate

func LoadCustomTemplate(anvilPath string) string

LoadCustomTemplate reads a custom template file for an anvil. Returns empty string if the file doesn't exist.

Types

type BeadContext

type BeadContext struct {
	// BeadID is the unique bead identifier.
	BeadID string
	// Title is the bead title.
	Title string
	// Description is the full bead description.
	Description string
	// IssueType is the bead type (bug, feature, task, etc.).
	IssueType string
	// Priority is the bead priority (0-4).
	Priority int
	// Parent is the parent bead ID (if any).
	Parent string
	// Branch is the git branch created for this work.
	Branch string
	// AnvilName is the name of the anvil (repo label).
	AnvilName string
	// AnvilPath is the path to the main repo.
	AnvilPath string
	// WorktreePath is the path to the worker's worktree.
	WorktreePath string
	// SchematicPlan is an optional implementation plan produced by the
	// Schematic pre-worker. When non-empty it is included in the prompt.
	SchematicPlan string
	// Iteration is the current Smith-Warden cycle (1 = first attempt).
	// On iteration 2+ the prompt includes prior feedback.
	Iteration int
	// PriorFeedback is pre-formatted feedback from the previous iteration
	// (Warden review or Temper build/test failure). Set on iteration 2+.
	PriorFeedback string
	// PriorFeedbackSource describes where the feedback came from
	// (e.g. "Warden review" or "build/test verification").
	PriorFeedbackSource string
}

BeadContext holds the information needed to build a Smith prompt.

type Builder

type Builder struct {
	// CustomTemplate is an optional per-anvil template override.
	// If empty, the default template is used.
	CustomTemplate string
}

Builder constructs prompts from templates and context.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a Builder with default settings.

func (*Builder) Build

func (b *Builder) Build(ctx BeadContext) (string, error)

Build constructs a complete prompt for a Smith worker.

Jump to

Keyboard shortcuts

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