plan

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package plan provides plan mode functionality for GenCode. Plan mode allows AI to explore the codebase and create implementation plans before making changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePlanName

func GeneratePlanName(task string) string

GeneratePlanName generates a plan name based on task description. Format: YYYYMMDD-task-keywords (e.g., "20260129-add-dark-mode") If task is empty, uses timestamp only.

func GeneratePlanNameFromContent

func GeneratePlanNameFromContent(content string) string

GeneratePlanNameFromContent generates a plan name from plan content. Useful when creating name from the actual plan summary.

func SanitizeName

func SanitizeName(name string) string

SanitizeName ensures a name is valid for filesystem use

func ValidatePlanID

func ValidatePlanID(id string) bool

ValidatePlanID checks if a plan ID is valid

Types

type Plan

type Plan struct {
	ID        string     `yaml:"id"`
	CreatedAt time.Time  `yaml:"created_at"`
	Task      string     `yaml:"task"`
	Status    PlanStatus `yaml:"status"`
	Content   string     `yaml:"-"` // markdown body (not in frontmatter)
}

Plan represents a saved implementation plan

type PlanStatus

type PlanStatus string

PlanStatus represents the status of a plan

const (
	StatusDraft    PlanStatus = "draft"
	StatusApproved PlanStatus = "approved"
	StatusExecuted PlanStatus = "executed"
)

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages plan file storage

func NewStore

func NewStore() (*Store, error)

NewStore creates a new plan store Plans are stored in ~/.gen/plans/

func (*Store) Delete

func (s *Store) Delete(id string) error

Delete removes a plan file

func (*Store) GetPath

func (s *Store) GetPath(id string) string

GetPath returns the full path for a plan ID

func (*Store) List

func (s *Store) List() ([]*Plan, error)

List returns all saved plans

func (*Store) Load

func (s *Store) Load(id string) (*Plan, error)

Load loads a plan from disk by ID

func (*Store) Save

func (s *Store) Save(plan *Plan) (string, error)

Save saves a plan to disk and returns the file path

Jump to

Keyboard shortcuts

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