Help us shape the future of Go! Take the 2026 Go Developer Survey

prompt

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 7 Imported by: 0

README

Model prompts

This package builds the instructions used by Wingman's built-in agent. Choose a model with /model; its matching prompt variant is selected automatically. Project guidance comes from AGENTS.md or CLAUDE.md, and reusable workflows come from skills. See customization.

Working on templates

Model-specific instructions live in models/<variant>/mode_agent.txt. Routing uses the longest normalized model-name prefix, with shared instructions as the fallback. Shared Plan and unattended templates control those modes.

BuildBaseInstructions combines the model and mode instructions. BuildSessionContext adds project instructions, skills, memory, and environment context. Keep those shared sections in their existing templates when adapting a model prompt.

Use Wingman's tool names and argument formats. Approval handling, session continuation, and background commands follow Wingman's runtime behavior.

Source references

GPT variants adapt the effective Codex model-catalog instructions. The catalog baseline is commit be2e129ecd67d900c016eda12d5d193e33d9c3da. Claude variants adapt the rendered Claude Code instructions for each model. Gemini adapts packages/core/src/prompts/snippets.ts from gemini-cli at commit 29315e53d0c2e9b78f301f3c24db235b0f3fa597 (Apache-2.0).

Check a change

From the repository root:

go test ./pkg/code/prompt ./pkg/code/agent

For model-catalog changes, also run:

go test ./pkg/model ./pkg/external/codex ./pkg/acp/codex ./pkg/agent

These tests check routing, rendering, and integration. Use matched model and effort runs of the ACP benchmark to compare task behavior or latency.

Documentation

Index

Constants

View Source
const BoundaryMarker = "--- session context ---"

Variables

This section is empty.

Functions

func BuildAgentContext added in v0.9.1

func BuildAgentContext(data SectionData) string

func BuildBaseInstructions added in v0.16.10

func BuildBaseInstructions(base string, data SectionData) string

BuildBaseInstructions contains only model and mode guidance. Session data changes independently and is appended to conversation history by the harness.

func BuildInstructions

func BuildInstructions(base string, data SectionData) string

func BuildSessionContext added in v0.16.10

func BuildSessionContext(data SectionData) string

Types

type Section

type Section struct {
	Title   string
	Content string
}

type SectionData

type SectionData struct {
	Model model.Model
	// ModeInstructions follows shared tool guidance so Plan and unattended
	// restrictions retain precedence over the model's implementation defaults.
	ModeInstructions    string
	PlanMode            bool
	UnattendedMode      bool
	Date                string
	Timezone            string
	OS                  string
	Arch                string
	WorkingDir          string
	Shell               string
	MemoryDir           string
	MemoryContent       string
	Skills              string
	ProjectInstructions string
}

type Variant added in v0.14.3

type Variant struct {
	Agent      string
	Plan       string
	Unattended string
}

func VariantFor added in v0.14.3

func VariantFor(id string) Variant

Jump to

Keyboard shortcuts

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