spec

package
v0.17.29 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoCompleter

type AutoCompleter interface {
	CheckAndComplete(ctx context.Context, specID string) error
}

AutoCompleter checks if all linked prompts are completed and marks the spec as completed.

func NewAutoCompleter

func NewAutoCompleter(queueDir, completedDir, specsDir string) AutoCompleter

NewAutoCompleter creates a new AutoCompleter.

type Frontmatter

type Frontmatter struct {
	Status string   `yaml:"status"`
	Tags   []string `yaml:"tags,omitempty"`
}

Frontmatter represents the YAML frontmatter in a spec file.

type Lister

type Lister interface {
	List(ctx context.Context) ([]*SpecFile, error)
	Summary(ctx context.Context) (*Summary, error)
}

Lister lists spec files from a directory.

func NewLister

func NewLister(specsDir string) Lister

NewLister creates a new Lister that scans the given directory.

type SpecFile

type SpecFile struct {
	Path        string
	Frontmatter Frontmatter
	Name        string // filename without extension
	Body        []byte
}

SpecFile represents a loaded spec file with frontmatter and body.

func Load

func Load(ctx context.Context, path string) (*SpecFile, error)

Load reads a spec file from disk, parsing frontmatter and body.

func (*SpecFile) MarkCompleted

func (s *SpecFile) MarkCompleted()

MarkCompleted sets the spec status to completed.

func (*SpecFile) Save

func (s *SpecFile) Save(ctx context.Context) error

Save writes the spec file back to disk.

func (*SpecFile) SetStatus

func (s *SpecFile) SetStatus(status string)

SetStatus sets the status field in the frontmatter.

type Status

type Status string

Status represents the lifecycle state of a spec.

const (
	StatusDraft     Status = "draft"
	StatusApproved  Status = "approved"
	StatusPrompted  Status = "prompted"
	StatusCompleted Status = "completed"
)

type Summary

type Summary struct {
	Draft                  int
	Approved               int
	Prompted               int
	Completed              int
	Total                  int
	LinkedPromptsCompleted int `json:"linked_prompts_completed,omitempty"`
	LinkedPromptsTotal     int `json:"linked_prompts_total,omitempty"`
}

Summary holds counts of specs grouped by status.

Jump to

Keyboard shortcuts

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