spectype

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package spectype defines the registry of specification document types.

Each SpecType represents a distinct document artifact in a specification workflow (e.g., PRD, MRD, Press Release, FAQ, 6-Pager).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorshipMode

type AuthorshipMode string

AuthorshipMode indicates whether a spec is typically human-authored or LLM-synthesized.

const (
	// AuthorshipHuman indicates the spec is primarily human-authored.
	AuthorshipHuman AuthorshipMode = "human"

	// AuthorshipSynthesized indicates the spec is primarily LLM-synthesized.
	AuthorshipSynthesized AuthorshipMode = "synthesized"

	// AuthorshipHybrid indicates the spec involves both human and LLM authorship.
	AuthorshipHybrid AuthorshipMode = "hybrid"
)

type Category

type Category string

Category groups spec types by their role in the workflow.

const (
	// CategorySource represents human-authored discovery documents.
	CategorySource Category = "source"

	// CategoryGTM represents go-to-market documents (often synthesized).
	CategoryGTM Category = "gtm"

	// CategoryTechnical represents technical specification documents.
	CategoryTechnical Category = "technical"

	// CategoryExecution represents execution tracking documents.
	CategoryExecution Category = "execution"

	// CategoryOutput represents reconciled output documents.
	CategoryOutput Category = "output"

	// CategoryStrategic represents strategic planning documents (e.g., V2MOM).
	CategoryStrategic Category = "strategic"
)

type PDLCStage added in v0.3.0

type PDLCStage string

PDLCStage identifies which stage of the ProductBuildersHQ Product Development Lifecycle (PDLC) a spec type belongs to. This is orthogonal to Category (which groups specs by their role in a *workflow*, e.g. source vs. gtm vs. technical): PDLCStage groups them by which of the six PDLC stages they are produced in, so a downstream consumer (e.g. Threat Model Spec) can bucket any workflow's specs into the PDLC stages without knowing the individual spec types.

Only the two spec-driven stages apply here — Implementation, Deployment, Builder Operations, and Product Operations consume non-spec artifacts (code, IaC, telemetry), never workflow specs, so no spec type carries those values. Execution-tracking spec types (plan, roadmap) carry no PDLCStage: they track work across the whole lifecycle rather than belonging to one content-producing stage.

These values are string constants, not an imported Go type, deliberately: specification-workflow-spec sits upstream of visionspec in the visionstudio -> visionspec -> specification-workflow-spec dependency chain, and pdlc itself depends on visionspec — so importing github.com/ProductBuildersHQ/pdlc here would close an import cycle. The values must match pdlc's Stage* constants (see stages.go in that module); a downstream consumer that can safely import both (e.g. Threat Model Spec) should carry the conformance test verifying they stay in sync.

const (
	// PDLCStageProductDefinition matches pdlc.StageProductDefinition.
	PDLCStageProductDefinition PDLCStage = "product-definition"

	// PDLCStageBuilderDefinition matches pdlc.StageBuilderDefinition.
	PDLCStageBuilderDefinition PDLCStage = "builder-definition"
)

type SpecType

type SpecType struct {
	// ID is the canonical identifier (e.g., "prd", "press", "narrative-6p").
	ID string `json:"id" jsonschema:"required,description=Canonical identifier for the spec type"`

	// Name is the human-readable name (e.g., "Product Requirements Document").
	Name string `json:"name" jsonschema:"required,description=Human-readable name"`

	// ShortName is an abbreviated name for UI display (e.g., "PRD", "6-Pager").
	ShortName string `json:"shortName,omitempty" jsonschema:"description=Abbreviated name for compact display"`

	// Description explains the purpose of this spec type.
	Description string `json:"description,omitempty" jsonschema:"description=Purpose and usage of this spec type"`

	// Category groups this spec type (source, gtm, technical, etc.).
	Category Category `json:"category" jsonschema:"required,enum=source,enum=gtm,enum=technical,enum=execution,enum=output,enum=strategic"`

	// PDLCStage is the PDLC stage this spec type is produced in. Empty for
	// spec types that aren't tied to one content-producing stage (e.g. plan,
	// roadmap). See the PDLCStage type doc for the full rationale.
	PDLCStage PDLCStage `json:"pdlcStage,omitempty" jsonschema:"enum=product-definition,enum=builder-definition"`

	// Authorship indicates typical authorship mode.
	Authorship AuthorshipMode `json:"authorship" jsonschema:"required,enum=human,enum=synthesized,enum=hybrid"`

	// Filename is the canonical filename (e.g., "PRD.md", "press.md").
	Filename string `json:"filename" jsonschema:"required,description=Canonical filename for this spec"`

	// EvalFilename is the filename for evaluation results (e.g., "PRD.eval.json").
	EvalFilename string `json:"evalFilename,omitempty" jsonschema:"description=Filename for LLM-as-Judge evaluation results"`

	// Origins lists the methodologies that use this spec type.
	Origins []string `json:"origins,omitempty" jsonschema:"description=Methodologies that originated or use this spec type"`

	// Aliases are alternative names for this spec type.
	Aliases []string `json:"aliases,omitempty" jsonschema:"description=Alternative names or abbreviations"`
}

SpecType defines a specification document type in the registry.

func CoreSpecTypes

func CoreSpecTypes() []SpecType

CoreSpecTypes returns the built-in spec type definitions.

type SpecTypeRegistry

type SpecTypeRegistry struct {
	// Version is the schema version for this registry.
	Version string `json:"version" jsonschema:"required,description=Schema version"`

	// Types is the list of registered spec types.
	Types []SpecType `json:"types" jsonschema:"required,description=Registered specification types"`
}

SpecTypeRegistry is a collection of spec type definitions.

Jump to

Keyboard shortcuts

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