llm

package
v8.166.0-rc.37 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PlanMigration

func PlanMigration(ctx context.Context, root string) (Migration, Report, error)

PlanMigration plans the migration of the repository at root. A repository with findings gets no migration.

Types

type Config

type Config struct {
	Flavours gen.FlavourSlice
	Language string
}

type Finding

type Finding struct {
	// Path is relative to the repository root, with slashes.
	Path    string
	Problem string
	Fix     string
}

Finding is a reason to leave a repository unchanged.

type LLM

type LLM struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*LLM, error)

func (*LLM) BaseLLMRules

func (l *LLM) BaseLLMRules() input.Input

func (*LLM) GoLLMRules

func (l *LLM) GoLLMRules() input.Input

type Migration

type Migration struct {
	// contains filtered or unexported fields
}

Migration moves a repository's existing agent instructions and skills to AGENTS.md and .agents/skills. Claude instructions with no AGENTS.md to go with are the repository's instructions: their content moves to AGENTS.md. A root CLAUDE.md is left as an import of AGENTS.md, a .claude/CLAUDE.md is deleted. Claude files that keep their own content import AGENTS.md.

func (Migration) Apply

func (m Migration) Apply(ctx context.Context, body string) error

Apply migrates the repository, with body as the content of the devctl-managed block. It stops before the first write if a file it changes is no longer as planned or the content cannot be prepared, and writes AGENTS.md before it changes the file whose content moved there.

func (Migration) Steps

func (m Migration) Steps() []string

Steps describes the changes Apply makes.

type Mode

type Mode int

Mode selects what gen llm may change in a repository.

const (
	// DefaultMode handles repositories without instructions and repositories
	// whose AGENTS.md has a devctl-managed block. Alignment runs in this mode.
	DefaultMode Mode = iota
	// MigrationMode also moves existing instructions and skills.
	MigrationMode
)

type Report

type Report struct {
	Findings []Finding
}

Report lists the findings of a preflight. A repository with findings must not be changed.

func Preflight

func Preflight(ctx context.Context, root string, mode Mode) (Report, error)

Preflight checks the repository at root before any LLM output is written.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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