Documentation
¶
Overview ¶
Package repocontext gathers common repo metadata (name, CLAUDE.md, README, git log) used by multiple commands as prompt context for AI calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatherRepoContext ¶
func GatherRepoContext() string
GatherRepoContext returns a markdown snapshot of the current repo state: CLAUDE.md/AGENTS.md/README.md previews, recent commits, working tree, and file structure. It operates on the current working directory and never returns an error — failures are surfaced as empty sections.
Types ¶
type Context ¶
type Context struct {
// RepoPath is the absolute path to the repository root.
RepoPath string
// Name is the base directory name of the repository.
Name string
// Claude is the full content of CLAUDE.md, or empty if not present.
Claude string
// Readme is the first 2048 bytes of README.md, or empty if not present.
Readme string
// GitLog is the output of `git log --oneline -20`, or empty on error.
GitLog string
}
Context holds the gathered metadata for a repository.
func Gather ¶
Gather reads repo metadata from repoPath. If repoPath is empty, os.Getwd is used. Missing files are silently ignored; only the repoPath resolution can return an error.
func (Context) MarkdownSections ¶
MarkdownSections renders the populated fields as markdown sections. Fields with no content are omitted.