projectctx

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package projectctx discovers project-level instruction files (AGENTS.md) and composes them into the agent's system prompt as a labelled section.

This is a layered capability, not core behavior: the agent loop works fine without it. It is gated by the config feature flag `features.agents_file` and wired in at the chat surface (cmd/neo), keeping the core policy-free.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Augment

func Augment(base string, docs []Doc) string

Augment appends discovered instructions to a base system prompt as a single labelled section, each file under its own source-path heading. It returns base unchanged when there are no docs, so callers can apply it unconditionally.

Types

type Doc

type Doc struct {
	Path    string
	Content string
}

Doc is one discovered instruction file: where it came from and its contents.

func Load

func Load(cwd string) ([]Doc, error)

Load discovers AGENTS.md instruction files for a session rooted at cwd, returned in increasing priority (earlier = more general, later = more specific):

  • ~/.neo/AGENTS.md user-global guidance
  • AGENTS.md from the repo root down to cwd, outermost first

The upward walk stops at the repository root (the first ancestor containing .git) or the filesystem root. Missing or empty files are skipped — only a genuine read error (e.g. permissions) is returned.

Jump to

Keyboard shortcuts

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