spec

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: BSD-2-Clause Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, specsInboxDir, specsInProgressDir, specsCompletedDir string,
) AutoCompleter

NewAutoCompleter creates a new AutoCompleter.

type Frontmatter

type Frontmatter struct {
	Status    string   `yaml:"status"`
	Tags      []string `yaml:"tags,omitempty"`
	Approved  string   `yaml:"approved,omitempty"`
	Prompted  string   `yaml:"prompted,omitempty"`
	Verifying string   `yaml:"verifying,omitempty"`
	Completed string   `yaml:"completed,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(dirs ...string) Lister

NewLister creates a new Lister that scans the given directories.

type SpecFile

type SpecFile struct {
	Path        string
	Frontmatter Frontmatter
	Name        string // filename without extension
	Body        []byte
	// contains filtered or unexported fields
}

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) MarkVerifying added in v0.18.5

func (s *SpecFile) MarkVerifying()

MarkVerifying sets the spec status to verifying.

func (*SpecFile) Save

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

Save writes the spec file back to disk.

func (*SpecFile) SetNowFunc added in v0.20.0

func (s *SpecFile) SetNowFunc(f func() time.Time)

SetNowFunc sets the time source for testability.

func (*SpecFile) SetStatus

func (s *SpecFile) SetStatus(status string)

SetStatus sets the status field in the frontmatter and stamps the matching timestamp once.

type Status

type Status string

Status represents the lifecycle state of a spec.

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

type Summary

type Summary struct {
	Draft                  int
	Approved               int
	Prompted               int
	Verifying              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