Documentation
¶
Index ¶
- func BranchExists(branchName string) bool
- func BranchToFilename(branch string) string
- func CreateBranch(branchName string) error
- func CurrentBranch() (string, error)
- func CurrentFile() (string, error)
- func GetCurrent() (string, error)
- func GitRoot() (string, error)
- func ListPlans() ([]string, error)
- func NameToBranch(name string) string
- func NameToFilename(name string) string
- func PlansDir() (string, error)
- func ResolveCurrentPlan(name string) (string, error)
- func ResolvePlanPath(name string) (string, error)
- func Serialize(p *Plan, notes string) ([]byte, error)
- func SetCurrent(name string) error
- func SwitchBranch(branchName string) error
- func WriteFile(path string, p *Plan, notes string) error
- type Context
- type Decision
- type FileRef
- type NullableString
- type Plan
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchExists ¶
BranchExists checks if a git branch exists.
func CreateBranch ¶
CreateBranch creates a new git branch with the given name and switches to it.
func CurrentBranch ¶
CurrentBranch returns the current git branch name.
func CurrentFile ¶
CurrentFile returns the path to the .current file that tracks the active plan.
func GetCurrent ¶
GetCurrent reads the current plan name from plans/.current. Returns empty string if no current plan is set.
func NameToBranch ¶
NameToBranch converts a plan name to a branch name.
func NameToFilename ¶
NameToFilename converts a plan name to a filename slug.
func ResolveCurrentPlan ¶
ResolveCurrentPlan figures out which plan to use: 1. If a name is given, use that 2. If plans/.current exists, use that 3. If current branch matches a plan's branch field, use that 4. If only one active plan exists, use that Returns the plan name or error.
func ResolvePlanPath ¶
ResolvePlanPath returns the full path to a named plan file.
func Serialize ¶
Serialize converts a Plan and notes string into the file format: ---\n<yaml>\n---\n<rendered markdown>
func SetCurrent ¶
SetCurrent writes the current plan name to plans/.current.
func SwitchBranch ¶
SwitchBranch switches to an existing git branch.
Types ¶
type Context ¶
type Context struct {
CurrentFile NullableString `yaml:"current_file"`
LastError NullableString `yaml:"last_error"`
TestState NullableString `yaml:"test_state"`
OpenQuestions NullableString `yaml:"open_questions"`
PendingRefactor NullableString `yaml:"pending_refactor"`
}
Context holds session state fields.
type NullableString ¶
type NullableString string
NullableString is a string that marshals to YAML ~ when empty.
func (NullableString) MarshalYAML ¶
func (n NullableString) MarshalYAML() (interface{}, error)
func (*NullableString) UnmarshalYAML ¶
func (n *NullableString) UnmarshalYAML(value *yaml.Node) error
type Plan ¶
type Plan struct {
Name string `yaml:"name"`
Goal string `yaml:"goal"`
Diagram string `yaml:"diagram,omitempty"` // optional — Mermaid diagram source
Branch string `yaml:"branch,omitempty"` // optional — associated git branch
Status string `yaml:"status"` // active, complete
SessionCount int `yaml:"session_count"`
Created string `yaml:"created"` // date string YYYY-MM-DD
Updated string `yaml:"updated"` // date string YYYY-MM-DD
CurrentTask int `yaml:"current_task"`
Constraints []string `yaml:"constraints,omitempty"` // global rules for the agent
PlanFiles []FileRef `yaml:"files,omitempty"` // key project files
Tasks []Task `yaml:"tasks"`
Context Context `yaml:"context"`
Decisions []Decision `yaml:"decisions"`
}
Plan is the complete plan state, stored as YAML frontmatter.
type Task ¶
type Task struct {
Text string `yaml:"text"`
Status string `yaml:"status"` // todo, active, done, blocked
Reason string `yaml:"reason,omitempty"` // only set when status=blocked
Spec string `yaml:"spec,omitempty"` // implementation instructions
Verify []string `yaml:"verify,omitempty"` // verification steps
Files []string `yaml:"files,omitempty"` // files this task touches
}
Task represents a single task in the plan.