taskadd

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package taskadd provides AI-powered natural language task creation. It converts a free-form description into a fully structured Task with title, description, priority, estimated minutes, tags, and suggested dependencies derived from the existing plan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTaskPrompt

func GenerateTaskPrompt(description string, existingPlan *pm.Plan) string

GenerateTaskPrompt builds the AI prompt that converts a free-form task description into a structured TaskSpec. existingPlan may be nil when no plan exists yet.

func PrintSpec

func PrintSpec(spec *TaskSpec, existingPlan *pm.Plan)

PrintSpec pretty-prints a TaskSpec to stdout.

func RefineFieldPrompt

func RefineFieldPrompt(spec *TaskSpec, field, guidance string, existingPlan *pm.Plan) string

RefineFieldPrompt returns a prompt asking the AI to update a single field.

Types

type TaskSpec

type TaskSpec 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"`
	SuggestedDependsOn []int    `json:"suggested_depends_on"`
	Rationale          string   `json:"rationale"`
}

TaskSpec holds the AI-structured representation of a new task.

func Enrich

func Enrich(ctx context.Context, p provider.Provider, opts provider.Options, description string, existingPlan *pm.Plan) (*TaskSpec, error)

Enrich calls the AI provider to convert a free-form description into a structured TaskSpec using the existing plan for dependency context.

func ParseTaskResponse

func ParseTaskResponse(response string) (*TaskSpec, error)

ParseTaskResponse parses the AI's JSON response into a TaskSpec. It tolerates leading/trailing whitespace and extracts the first JSON object it finds in the response.

func Refine

func Refine(
	ctx context.Context,
	p provider.Provider,
	opts provider.Options,
	description string,
	spec *TaskSpec,
	existingPlan *pm.Plan,
	scanner *bufio.Scanner,
) (*TaskSpec, bool, error)

Refine runs the interactive refinement REPL. It returns the (possibly modified) spec, whether the user accepted, and any error. Pass a nil scanner to use os.Stdin via bufio.

Jump to

Keyboard shortcuts

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