Documentation
¶
Overview ¶
Package reindex detects and resolves duplicate numeric prefixes across multiple lifecycle directories for prompt and spec files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PromptManager ¶ added in v0.135.18
PromptManager is the subset of prompt.Manager that the reindex package uses.
type Reindexer ¶
Reindexer detects and resolves duplicate numeric prefixes across multiple directories.
func NewReindexer ¶
NewReindexer creates a Reindexer that scans the given dirs for NNN-slug.md files with duplicate numeric prefixes and renames conflicting files.
type Rename ¶
Rename represents a file rename performed by the reindexer.
func UpdateSpecRefs ¶ added in v0.76.0
func UpdateSpecRefs( ctx context.Context, specRenames []Rename, promptDirs []string, mover FileMover, pm PromptManager, ) ([]Rename, error)
UpdateSpecRefs propagates spec file renames to prompt files.
For each spec rename (old→new), it:
- Updates the frontmatter `spec:` field in any prompt file that references the old spec number.
- Renames any prompt file whose filename contains `spec-NNN` where NNN matches the old spec number.
promptDirs are scanned for .md files. mover is used for file renames. pm is used to load prompt files. Returns the list of prompt file renames performed.