plan

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Overview

Package plan parses plan files under docs/plans and scaffolds new plans from the rendered plans template (awf new plan). Unlike internal/adr it is not coupled to sequential numbering - plans are date-prefixed.

Index

Constants

This section is empty.

Variables

View Source
var FilenameRe = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}-.+\.md$`)

FilenameRe matches a plan filename (YYYY-MM-DD-slug.md); it excludes template.md and README.md just as adr.FilenameRe's numeric form does.

View Source
var ValidStatuses = map[string]bool{"Proposed": true, "Implemented": true}

ValidStatuses are the two plan lifecycle states (ADR-0097): mutable while Proposed, frozen at Implemented.

Functions

func NewFile

func NewFile(dir, title string) (string, error)

NewFile scaffolds a new plan under dir from the rendered plans template (dir/template.md): today's date filled, marker comments stripped, named YYYY-MM-DD-slug.md. No sequential number is allocated. Refuses to overwrite. touches-invariant: plan-new-unnumbered - unnumbered dated plan scaffold; proof in plan_test.go

Types

type Plan

type Plan struct {
	Filename       string
	Path           string
	Date           string
	ADRs           []int
	Status         string
	HasFrontmatter bool
	// CommitSubjects are the planned commit subjects a plan marks with “`commit
	// fences (ADR-0111): the first non-empty line of each fenced block whose info
	// string's first token is `commit` and which carries no `awf-ignore` opt-out.
	CommitSubjects []string
}

Plan is a parsed plan record. HasFrontmatter is false for the grandfathered pre-convention corpus (ADR-0098), which the checks skip.

func ParseDir

func ParseDir(dir string) ([]Plan, error)

ParseDir scans dir for plan files (YYYY-MM-DD-*.md) and parses each. Files without frontmatter parse to a Plan with HasFrontmatter false.

Jump to

Keyboard shortcuts

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