fingerprint

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSummary added in v0.2.0

func FormatSummary(fp *ProjectFingerprint) string

FormatSummary produces a human-readable summary of the project fingerprint.

Types

type Convention added in v0.2.0

type Convention struct {
	Name        string
	Description string
	Confidence  float64
}

Convention describes a detected coding convention.

type Fingerprint

type Fingerprint struct {
	Name           string         // repo/directory name
	Languages      []LanguageInfo // detected languages with percentages
	TotalFiles     int
	TotalLines     int
	Dependencies   int // count from package manager files
	HasTests       bool
	HasCI          bool
	License        string
	GitInfo        *GitInfo
	PackageManager string // npm, go mod, cargo, pip, etc.
}

Fingerprint holds a structured summary of a repository or directory.

func Generate

func Generate(dir string) (*Fingerprint, error)

Generate produces a fingerprint for the given directory.

func (*Fingerprint) Format

func (f *Fingerprint) Format() string

Format renders the fingerprint as a concise string suitable for LLM context injection. The output targets under 500 tokens.

func (*Fingerprint) FormatMarkdown

func (f *Fingerprint) FormatMarkdown() string

FormatMarkdown renders the fingerprint as markdown for display.

type GitInfo

type GitInfo struct {
	Branch       string
	CommitCount  int
	LastCommit   string
	Contributors int
}

GitInfo holds version-control metadata extracted via git commands.

type LanguageInfo

type LanguageInfo struct {
	Name       string
	Percentage float64
	Files      int
	Lines      int
}

LanguageInfo holds detection results for a single programming language.

type ProjectFingerprint added in v0.2.0

type ProjectFingerprint struct {
	Language        string            // primary language
	Languages       []ProjectLangInfo // all detected languages
	Framework       string            // e.g., "chi", "gin", "express", "django", "next.js"
	BuildSystem     string            // "go modules", "npm", "cargo", "gradle", "maven"
	TestFramework   string            // "go test", "jest", "pytest", "cargo test"
	LintTools       []string
	PackageManager  string
	CI              string // "github-actions", "gitlab-ci", "circleci"
	Docker          bool
	Monorepo        bool
	ProjectSize     string // "tiny" (<10 files), "small", "medium", "large" (>1000)
	Conventions     []Convention
	Recommendations []string
	// contains filtered or unexported fields
}

ProjectFingerprint holds a comprehensive analysis of a project's type, tech stack, conventions, and recommended configuration.

func Scan added in v0.2.0

func Scan(projectDir string) (*ProjectFingerprint, error)

Scan performs a comprehensive analysis of the project directory, detecting languages, frameworks, build systems, CI, conventions, and generating recommendations.

type ProjectLangInfo added in v0.2.0

type ProjectLangInfo struct {
	Name       string
	FileCount  int
	Percentage float64
}

ProjectLangInfo holds detection results for a single language in the project scan.

Jump to

Keyboard shortcuts

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