context

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package context provides CONTEXT.md generation for agent onboarding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(analysis *docs.RepoAnalysis, history *GitHistory, scanState *state.ScanState, w io.Writer) error

Generate writes a CONTEXT.md to w based on analysis, git history, and scan state. scanState may be nil if no previous scan exists.

Types

type AuthorStats

type AuthorStats struct {
	Name    string
	Commits int
}

AuthorStats tracks commit count per contributor.

type CommitSummary

type CommitSummary struct {
	Hash    string
	Message string
	Author  string
	Date    time.Time
	Files   int // number of files changed
}

CommitSummary holds metadata about a single commit.

type GitHistory

type GitHistory struct {
	RecentWeeks  []WeekActivity
	TopAuthors   []AuthorStats
	TotalCommits int
}

GitHistory holds aggregated git log analysis.

func AnalyzeHistory

func AnalyzeHistory(repoPath string, weeks int) (*GitHistory, error)

AnalyzeHistory walks the git log and groups commits by week. weeks controls how many weeks of history to include (default: 4).

type WeekActivity

type WeekActivity struct {
	WeekStart time.Time
	Commits   []CommitSummary
}

WeekActivity groups commits by ISO week.

Jump to

Keyboard shortcuts

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