plan

package
v2026.615.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNotBuilt       = "not_built"
	StatusPartiallyBuilt = "partially_built"
	StatusBuilt          = "built"
)

Variables

This section is empty.

Functions

func AppendTodoLine

func AppendTodoLine(body string, text string) string

func ComputeStatus

func ComputeStatus(total, checked int) string

func CountPending

func CountPending(plansDir string) (int, error)

func FormatTodoLine

func FormatTodoLine(text string, checked bool) string

func ReadFile

func ReadFile(path string) (Meta, Sections, []byte, error)

func RemoveTodoLine

func RemoveTodoLine(body string, sha string) (string, bool, error)

func ReplaceTodoChecked

func ReplaceTodoChecked(body string, sha string) (string, bool, error)

func ResolvePath

func ResolvePath(plansDir, name string) (string, error)

func SkeletonBody

func SkeletonBody(goal string) []byte

func StatusFromItems

func StatusFromItems(items []TodoItem) string

func TodoSHA

func TodoSHA(text string) string

func WriteDocument

func WriteDocument(meta Meta, body []byte) ([]byte, error)

func WriteFile

func WriteFile(path string, content []byte) error

Types

type GitMeta

type GitMeta struct {
	CommitHash   string
	LastCommitAt string
}

func GitMetaFromRoot

func GitMetaFromRoot(projRoot string) GitMeta

type Meta

type Meta struct {
	CreatedAt    string `yaml:"created_at"`
	CommitHash   string `yaml:"commit_hash"`
	LastCommitAt string `yaml:"last_commit_at"`
	Status       string `yaml:"status"`
}

func NewMeta

func NewMeta(git GitMeta, status string) Meta

func ParseDocument

func ParseDocument(b []byte) (Meta, []byte, error)

func RefreshStatus

func RefreshStatus(body []byte) ([]byte, Meta, error)

type Sections

type Sections struct {
	Goal    string
	Context string
	Design  string
	Todo    TodoSection
}

func ParseSections

func ParseSections(body []byte) Sections

type TodoItem

type TodoItem struct {
	SHA     string
	Text    string
	Checked bool
	Line    string
}

func OpenTodos

func OpenTodos(items []TodoItem) []TodoItem

func ParseChecklist

func ParseChecklist(lines []string) []TodoItem

type TodoSection

type TodoSection struct {
	Rules     string
	Mermaid   string
	Checklist []TodoItem
	RawBody   string
}

Jump to

Keyboard shortcuts

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