instructions

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package instructions implements pure instruction-file discovery logic from context/agent-instructions: project roots, ancestor chains, and per-directory deduplication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AncestorChain

func AncestorChain(root, cwd string) []string

AncestorChain returns directories from root to cwd, inclusive and broadest first. If cwd is outside root, it returns only root.

func FindProjectRoot

func FindProjectRoot(cwd string, markers []string) string

FindProjectRoot walks upward from cwd to the first root marker such as .git; if none exists before the filesystem root, it returns cwd.

Types

type LoadedFile

type LoadedFile struct {
	DisplayPath string
	Content     string
}

LoadedFile is an instruction candidate whose content has been read.

func DedupByDirectory

func DedupByDirectory(files []LoadedFile) []LoadedFile

DedupByDirectory keeps the earliest candidate with identical trimmed content within each directory. Identical content in different directories is retained.

Jump to

Keyboard shortcuts

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