plan

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveCurrentPlan added in v0.1.8

func ArchiveCurrentPlan(workspaceDir string) (string, error)

ArchiveCurrentPlan moves a completed current_plan.md to .brocode/plans/archive/ and cleans up current_plan.md so no stale tasks linger.

func ArchiveDirPath added in v0.1.8

func ArchiveDirPath(workspaceDir string) string

ArchiveDirPath returns the directory path for archived completed plans.

func AutoArchiveIfDone added in v0.1.8

func AutoArchiveIfDone(workspaceDir string) (bool, string, error)

AutoArchiveIfDone archives the plan if all steps have been marked done.

func CurrentPlanPath added in v0.1.8

func CurrentPlanPath(workspaceDir string) string

CurrentPlanPath returns the file path for the live active plan.

func RenderMarkdownPlan added in v0.1.8

func RenderMarkdownPlan(p *Plan) string

RenderMarkdownPlan formats a Plan into standard GitHub-flavored Markdown.

func SaveCurrentPlan added in v0.1.8

func SaveCurrentPlan(workspaceDir string, p *Plan) error

SaveCurrentPlan writes the active plan into .brocode/current_plan.md. If an existing plan with a different goal was active, it safely archives the previous plan into .brocode/plans/archive/ first so past tasks are never lost.

Types

type Plan

type Plan struct {
	Goal      string     `json:"goal"`
	Status    string     `json:"status"` // "ACTIVE" | "IN_PROGRESS" | "COMPLETED"
	CreatedAt time.Time  `json:"created_at"`
	Steps     []PlanStep `json:"steps"`
	Files     []string   `json:"files,omitempty"`
}

Plan represents an explicit execution plan for complex multi-file tasks.

func FromJSON

func FromJSON(data string) (*Plan, error)

func LoadCurrentPlan added in v0.1.8

func LoadCurrentPlan(workspaceDir string) (*Plan, error)

LoadCurrentPlan reads and parses .brocode/current_plan.md if it exists.

func MarkStepsDoneByEditedFiles added in v0.1.8

func MarkStepsDoneByEditedFiles(workspaceDir string, editedFiles []string) (*Plan, error)

MarkStepsDoneByEditedFiles matches edited file paths against step descriptions, marking matching steps as done and saving the updated plan.

func ParseMarkdownPlan added in v0.1.8

func ParseMarkdownPlan(md string) *Plan

ParseMarkdownPlan extracts goal, status, checklist tasks, and impacted files using universal Markdown structural grammar (GFM task lists, ordered lists, numbered headings).

func SyncPlanProgress added in v0.1.31

func SyncPlanProgress(workspaceDir string, editedFiles []string, responseContent string) (*Plan, bool, error)

SyncPlanProgress updates current_plan.md by matching edited files and checked tasks (- [x]) from the response.

func (*Plan) IsAllStepsDone added in v0.1.8

func (p *Plan) IsAllStepsDone() bool

IsAllStepsDone checks if all steps in the plan have been marked done.

func (*Plan) ToJSON

func (p *Plan) ToJSON() string

type PlanStep

type PlanStep struct {
	ID          string   `json:"id"`
	Description string   `json:"description"`
	Status      string   `json:"status"` // "pending" | "in_progress" | "done" | "blocked" | "skipped"
	Files       []string `json:"files,omitempty"`
}

PlanStep represents a single task unit within a structured plan.

Jump to

Keyboard shortcuts

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