spec

package
v1.0.42 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MaxBranchLength = 244

Variables

View Source
var StopWords = map[string]bool{
	"i": true, "a": true, "an": true, "the": true,
	"to": true, "for": true, "of": true, "in": true,
	"on": true, "at": true, "by": true, "with": true,
	"from": true, "is": true, "are": true, "was": true,
	"were": true, "be": true, "been": true, "being": true,
	"have": true, "has": true, "had": true, "do": true,
	"does": true, "did": true, "will": true, "would": true,
	"should": true, "could": true, "can": true, "may": true,
	"might": true, "must": true, "shall": true, "this": true,
	"that": true, "these": true, "those": true, "my": true,
	"your": true, "our": true, "their": true, "want": true,
	"need": true, "add": true, "get": true, "set": true,
}

Functions

func BranchExists

func BranchExists(repoPath, name string) (bool, error)

func CheckFeatureCollision

func CheckFeatureCollision(repoRoot, featureNum string) error

func DirExists

func DirExists(path string) bool

func DiscoverDocs

func DiscoverDocs(featureDir string) ([]string, error)

func EnsureDir

func EnsureDir(path string) error

func FileExists

func FileExists(path string) bool

func FilterStopWords

func FilterStopWords(words []string) []string

func GenerateBranchName

func GenerateBranchName(description string, number int) string

func GetCurrentBranch

func GetCurrentBranch(repoPath string) (string, error)

func GetFeatureDir

func GetFeatureDir(repoRoot, branch string) string

func GetFeatureNum

func GetFeatureNum(branch string) string

func GetNextFeatureNum

func GetNextFeatureNum(repoRoot string) (string, error)

func GetPlanFile

func GetPlanFile(featureDir string) string

func GetSpecFile

func GetSpecFile(featureDir string) string

func GetTasksFile

func GetTasksFile(featureDir string) string

func ListAvailableFeatures

func ListAvailableFeatures(repoRoot string) []string

func ParseFeatureNum

func ParseFeatureNum(branchName string) string

func PreserveAcronyms

func PreserveAcronyms(original, word string) string

func TruncateToLimit

func TruncateToLimit(name string, maxBytes int) string

Types

type DetectionOptions

type DetectionOptions struct {
	// SpecOverride bypasses all detection steps and uses this spec name directly (FR-013)
	SpecOverride string
	// Interactive enables the interactive prompt fallback (step 4)
	Interactive bool
}

DetectionOptions configures feature context detection behavior

type FeatureContext

type FeatureContext struct {
	RepoRoot   string
	Branch     string
	FeatureDir string
	SpecFile   string
	PlanFile   string
	TasksFile  string
	HasGit     bool
}

func DetectFeatureContext

func DetectFeatureContext(workDir string) (*FeatureContext, error)

DetectFeatureContext detects the current feature context using the 4-step fallback chain (FR-011) Steps: 1) env var/regex match → 2) yaml alias → 3) git heuristic → 4) error with available features

func DetectFeatureContextWithOptions

func DetectFeatureContextWithOptions(workDir string, opts DetectionOptions) (*FeatureContext, error)

DetectFeatureContextWithOptions detects feature context with configurable behavior

Jump to

Keyboard shortcuts

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