docs

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

FS is the file system implementation used by this package. Override in tests with a testable.MockFileSystem.

Functions

func Generate

func Generate(analysis *RepoAnalysis, w io.Writer) error

Generate writes an AGENTS.md scaffold to w based on the analysis.

func Update

func Update(existingPath string, analysis *RepoAnalysis, w io.Writer) error

Update regenerates auto-sections in an existing AGENTS.md while preserving manual content. It reads the existing file, regenerates auto-sections from the analysis, and writes the result to w.

Types

type BuildCommand

type BuildCommand struct {
	Name    string // e.g., "build", "test", "lint"
	Command string // e.g., "go build ./..."
	Source  string // which file suggested it
}

BuildCommand is a detected build/test command.

type CodePattern

type CodePattern struct {
	Name        string // e.g., "Cobra CLI", "Registry Pattern"
	Description string
}

CodePattern is a detected code pattern or convention.

type Detection

type Detection struct {
	File       string
	Components []TechComponent
	Commands   []BuildCommand
}

Detection holds what was detected from a single build file.

func DetectAll

func DetectAll(repoPath string) []Detection

DetectAll runs all detectors against the repo and returns findings.

type Detector

type Detector struct {
	File   string // filename to look for, e.g., "go.mod"
	Detect func(repoPath string) *Detection
}

Detector checks for a specific build file and extracts info.

type DirEntry

type DirEntry struct {
	Path  string
	IsDir bool
	Depth int
}

DirEntry represents a directory or file in the repo tree.

type RepoAnalysis

type RepoAnalysis struct {
	Name          string
	Language      string
	Description   string
	DirectoryTree []DirEntry
	TechStack     []TechComponent
	BuildCommands []BuildCommand
	Patterns      []CodePattern
	HasREADME     bool
	HasAGENTSMD   bool
}

RepoAnalysis holds the results of analyzing a repository.

func Analyze

func Analyze(repoPath string) (*RepoAnalysis, error)

Analyze scans a repository path and returns analysis results.

type TechComponent

type TechComponent struct {
	Name    string // e.g., "Go", "Node.js", "Python"
	Version string // e.g., "1.24", "18", "3.11"
	Source  string // file that detected it, e.g., "go.mod"
}

TechComponent represents a detected technology.

Jump to

Keyboard shortcuts

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