Documentation
¶
Overview ¶
Package specdoc is a thin codegrapher-owned adapter over the specscore-cli artifact parsers (github.com/specscore/specscore-cli). It turns a SpecScore artifact file (Feature, Idea, or Plan) into a single normalized Doc that codegrapher's extractor consumes.
This package copies no parsing logic: the body of each artifact is parsed by specscore-cli's exported parsers. The only thing read here directly is the leading YAML frontmatter `format:` value, used solely to classify the artifact kind before dispatching — that is classification, not body parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct {
Kind Kind
Slug string
Title string
Status string
Grade string // only populated for ideas (header field); empty otherwise
// Items are the artifact's child structural elements — plan tasks, or
// section headings for features/ideas. ID is a stable within-doc handle
// (e.g. task number); Title is the human label.
Items []Item
// Refs are raw cross-references to other artifacts, as (Kind, Target)
// pairs. Resolution into graph edges happens in a later layer.
Refs []Ref
}
Doc is the normalized, kind-agnostic view of a SpecScore artifact that codegrapher's extractor consumes. Fields not reachable through specscore-cli's exported API for a given kind are left zero.
func Parse ¶
Parse reads a SpecScore artifact file, classifies it by its frontmatter `format:` value, dispatches to the matching specscore-cli parser, and maps the result into a normalized Doc.
func ParseContent ¶
ParseContent is Parse for callers that already hold the artifact bytes (the indexer extract path). logicalPath is the artifact's project-relative path — used only to derive the artifact slug (idea/plan slug = filename stem; feature slug = README.md's parent directory) and for error messages, NOT to read the file. Because the underlying specscore-cli parsers read by path, the content is spilled to a temp file that mirrors the tail of logicalPath so slug derivation stays correct regardless of the indexer's working directory.