Documentation
¶
Overview ¶
Package project discovers and generates project context for AI-powered code reviews.
It uses a layered approach:
- Discover explicit documentation (README, /docs, AI agent config files, ARCHITECTURE.md, etc.)
- Read manifest files (go.mod, package.json, Cargo.toml, etc.) for tech stack info
- Capture directory structure (top-level + 1-2 levels) for architecture hints
- If docs are thin, use a cheap LLM to infer project purpose/domain from the gathered signals
The result is a compact project briefing injected into batch review prompts so each batch doesn't waste tokens re-discovering what the project is about.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// Summary is the final project briefing, ready for injection into prompts.
Summary string
// InputHash is a SHA-256 hash of all inputs used to generate the summary.
// Used for cache invalidation.
InputHash string
// FromCache indicates whether this result was loaded from cache.
FromCache bool
}
Context holds the discovered project context.
func Discover ¶
func Discover(ctx context.Context, repoRoot string, client ai.Client, cachedHash string, onProgress func(string)) (*Context, error)
Discover gathers project context from a repository root. If an LLM client is provided and documentation is thin, it uses the LLM to infer project purpose. The client can be nil to skip LLM inference. If cachedHash is non-empty and matches the current inputs, Discover returns early with FromCache=true and an empty Summary (caller should use cached version).