system

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package system provides system prompt construction for GenCode. It assembles prompts from modular components: base identity, provider-specific instructions, and dynamic environment information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMemory added in v1.1.1

func LoadMemory(cwd string) string

LoadMemory loads memory content from standard locations. Priority: GEN.md files first, falling back to CLAUDE.md if not found.

User level (first found wins):

  1. ~/.gen/GEN.md (preferred)
  2. ~/.claude/CLAUDE.md (fallback)

Project level (first found wins):

  1. .gen/GEN.md or GEN.md (preferred)
  2. .claude/CLAUDE.md or CLAUDE.md (fallback)

Both user and project level content are concatenated.

func Prompt

func Prompt(cfg Config) string

Prompt builds the complete system prompt. Assembly order: base + tools + provider/generic + environment

Types

type Config

type Config struct {
	Provider string // Provider name: anthropic, openai, google
	Model    string // Model identifier
	Cwd      string // Current working directory
	IsGit    bool   // Whether cwd is a git repository

	// Extension points (reserved for future use)
	Memory   string   // CLAUDE.md or similar memory content
	PlanMode bool     // Whether in plan mode
	Extra    []string // Additional prompt sections
}

Config holds configuration for system prompt generation.

Jump to

Keyboard shortcuts

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