Documentation
¶
Overview ¶
Package gitfacts renders a deterministic, zero-LLM analysis of a git repository: modules and churn, commit conventions, dependencies, build/test layout, branch-unique work, and the existing CLAUDE.md as a prior. Its output is the entire input to `culi gen`'s model calls — pay for intelligence only where determinism can't reach (§9). The render is content-hashed so an unchanged repo costs zero LLM calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Facts ¶
type Facts struct {
Repo string
Root string
Branch string // current branch ("" when detached/unreadable)
Modules []Module
// Conventions describes commit-subject style (conventional-commit ratio,
// common prefixes).
Conventions string
Deps []string
BuildTest string // Makefile targets, CI workflows, test-file count
// BranchWork is non-empty only when a branch was requested: unique
// commits vs the merge base and the directories they touch.
BranchWork string
// Prior is the existing CLAUDE.md with culi marker spans stripped — the
// human-authored content the draft must respect, never duplicate.
Prior string
}
Facts is one repo's deterministic analysis.
func Collect ¶
Collect analyzes the repo at root. branch "" analyzes the repo as a whole; otherwise BranchWork covers branch-unique commits. Individual probe failures degrade to empty sections (detached HEAD, mid-rebase, shallow clones must not fail the run); only "not a git repo" is fatal.