instructions

package
v0.20260526.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeGlobal  = "global"
	ScopeProject = "project"
)
View Source
const DefaultMaxFileBytes = 32 * 1024

Variables

This section is empty.

Functions

func ActivateDirsFromAbsPath

func ActivateDirsFromAbsPath(projRoot, absPath string) []string

func AddRule

func AddRule(scope, projHex, text string) (n int, err error)

func FindAgentsFile

func FindAgentsFile(dir string) (filePath string, ok bool)

func FormatInstructionBlock

func FormatInstructionBlock(sections PromptSections) string

func LoadAllRulesText

func LoadAllRulesText(projHex string) (string, error)

func MergeActivatedDirs

func MergeActivatedDirs(existing, newly []string) []string

func NormalizeRelDir

func NormalizeRelDir(projRoot, absPath string) string

func ParseRuleNumber

func ParseRuleNumber(s string) (int, error)

func PathsFromShellCommand

func PathsFromShellCommand(projRoot, command string) []string

func RemoveRule

func RemoveRule(scope, projHex string, number int) (err error)

func WriteRulesList

func WriteRulesList(w io.Writer, projHex string) error

Types

type Loader

type Loader struct {
	MaxFileBytes int64
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader() *Loader

func (*Loader) BuildPromptSections

func (l *Loader) BuildPromptSections(projRoot, projHex string, activatedDirs []string) (PromptSections, error)

func (*Loader) LoadGlobal

func (l *Loader) LoadGlobal() (path, content string, ok bool)

func (*Loader) LoadRepoDir

func (l *Loader) LoadRepoDir(projRoot, relDir string) (path, content string, ok bool)

func (*Loader) LoadRepoRoot

func (l *Loader) LoadRepoRoot(projRoot string) (path, content string, ok bool)

type PromptSections

type PromptSections struct {
	CustomRules        string
	GlobalInstructions string
	RepoInstructions   string
}

type RuleEntry

type RuleEntry struct {
	Number   int
	Text     string
	Scope    string
	FilePath string
}

func ListRules

func ListRules(scope, projHex string) (out []RuleEntry, err error)

Jump to

Keyboard shortcuts

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