analyze

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package analyze implements AI-powered codebase bootstrapping for cloop. It scans an existing project directory, collects contextual signals (git history, README, directory layout, TODOs, manifest files), and asks the configured AI provider to propose a 5-10 task cloop plan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(ctx *Context, goal string) string

BuildPrompt constructs the AI prompt from a collected Context.

func ProposalToPlan

func ProposalToPlan(proposal *Proposal) *pm.Plan

ProposalToPlan converts a Proposal into a pm.Plan ready to persist.

Types

type Context

type Context struct {
	GitLog    string
	Readme    string
	Changelog string
	DirTree   string
	Todos     string
	Manifest  string // content of go.mod / package.json / Cargo.toml (first found)
}

Context holds the raw signals collected from the target directory.

func Collect

func Collect(dir string) (*Context, error)

Collect gathers project signals from dir.

type Proposal

type Proposal struct {
	Goal  string         `json:"goal"`
	Tasks []ProposedTask `json:"tasks"`
}

Proposal is the AI's full plan proposal for an analysed project.

func Analyze

func Analyze(ctx context.Context, p provider.Provider, opts provider.Options, dir, goal string) (*Proposal, error)

Analyze runs the full analysis pipeline: collect → prompt → call AI → parse.

func ParseProposal

func ParseProposal(response string) (*Proposal, error)

ParseProposal extracts the Proposal from an AI response string.

type ProposedTask

type ProposedTask struct {
	Title            string   `json:"title"`
	Description      string   `json:"description"`
	Priority         int      `json:"priority"`
	Role             string   `json:"role"`
	EstimatedMinutes int      `json:"estimated_minutes"`
	Tags             []string `json:"tags"`
}

ProposedTask is a single task returned by the AI analysis.

Jump to

Keyboard shortcuts

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