prd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package prd provides types and operations for Product Requirements Documents. Types are imported from github.com/grokify/structured-plan/requirements/prd.

Index

Constants

View Source
const (
	StatusDraft      = structuredprd.StatusDraft
	StatusInReview   = structuredprd.StatusInReview
	StatusApproved   = structuredprd.StatusApproved
	StatusDeprecated = structuredprd.StatusDeprecated
)

Status constants

View Source
const (
	ProficiencyLow    = structuredprd.ProficiencyLow
	ProficiencyMedium = structuredprd.ProficiencyMedium
	ProficiencyHigh   = structuredprd.ProficiencyHigh
	ProficiencyExpert = structuredprd.ProficiencyExpert
)

Technical proficiency constants

View Source
const (
	PriorityCritical = structuredprd.PriorityCritical
	PriorityHigh     = structuredprd.PriorityHigh
	PriorityMedium   = structuredprd.PriorityMedium
	PriorityLow      = structuredprd.PriorityLow
)

Priority constants

View Source
const (
	MoSCoWMust   = structuredprd.MoSCoWMust
	MoSCoWShould = structuredprd.MoSCoWShould
	MoSCoWCould  = structuredprd.MoSCoWCould
	MoSCoWWont   = structuredprd.MoSCoWWont
)

MoSCoW priority constants

View Source
const (
	NFRPerformance     = structuredprd.NFRPerformance
	NFRScalability     = structuredprd.NFRScalability
	NFRReliability     = structuredprd.NFRReliability
	NFRAvailability    = structuredprd.NFRAvailability
	NFRSecurity        = structuredprd.NFRSecurity
	NFRMultiTenancy    = structuredprd.NFRMultiTenancy
	NFRObservability   = structuredprd.NFRObservability
	NFRMaintainability = structuredprd.NFRMaintainability
	NFRUsability       = structuredprd.NFRUsability
	NFRCompatibility   = structuredprd.NFRCompatibility
	NFRCompliance      = structuredprd.NFRCompliance
)

NFR category constants

View Source
const (
	PhaseTypeGeneric   = structuredprd.PhaseTypeGeneric
	PhaseTypeQuarter   = structuredprd.PhaseTypeQuarter
	PhaseTypeMonth     = structuredprd.PhaseTypeMonth
	PhaseTypeSprint    = structuredprd.PhaseTypeSprint
	PhaseTypeMilestone = structuredprd.PhaseTypeMilestone
)

Phase type constants

View Source
const (
	RiskImpactCritical = structuredprd.RiskImpactCritical
	RiskImpactHigh     = structuredprd.RiskImpactHigh
	RiskImpactMedium   = structuredprd.RiskImpactMedium
	RiskImpactLow      = structuredprd.RiskImpactLow
)

Risk impact constants

View Source
const (
	RiskProbabilityHigh   = structuredprd.RiskProbabilityHigh
	RiskProbabilityMedium = structuredprd.RiskProbabilityMedium
	RiskProbabilityLow    = structuredprd.RiskProbabilityLow
)

Risk probability constants

View Source
const (
	EvidenceInterview      = structuredprd.EvidenceInterview
	EvidenceSurvey         = structuredprd.EvidenceSurvey
	EvidenceAnalytics      = structuredprd.EvidenceAnalytics
	EvidenceSupportTicket  = structuredprd.EvidenceSupportTicket
	EvidenceMarketResearch = structuredprd.EvidenceMarketResearch
	EvidenceAssumption     = structuredprd.EvidenceAssumption
)

Evidence type constants

View Source
const (
	StrengthLow    = structuredprd.StrengthLow
	StrengthMedium = structuredprd.StrengthMedium
	StrengthHigh   = structuredprd.StrengthHigh
)

Evidence strength constants

View Source
const (
	AlternativeCompetitor   = structuredprd.AlternativeCompetitor
	AlternativeWorkaround   = structuredprd.AlternativeWorkaround
	AlternativeDoNothing    = structuredprd.AlternativeDoNothing
	AlternativeInternalTool = structuredprd.AlternativeInternalTool
)

Alternative type constants

View Source
const (
	DecisionProposed   = structuredprd.DecisionProposed
	DecisionAccepted   = structuredprd.DecisionAccepted
	DecisionSuperseded = structuredprd.DecisionSuperseded
	DecisionDeprecated = structuredprd.DecisionDeprecated
)

Decision status constants

View Source
const (
	ReviewApprove     = structuredprd.ReviewApprove
	ReviewRevise      = structuredprd.ReviewRevise
	ReviewReject      = structuredprd.ReviewReject
	ReviewHumanReview = structuredprd.ReviewHumanReview
)

Review decision constants

View Source
const (
	TriggerInitial = structuredprd.TriggerInitial
	TriggerReview  = structuredprd.TriggerReview
	TriggerScore   = structuredprd.TriggerScore
	TriggerHuman   = structuredprd.TriggerHuman
)

Revision trigger type constants

View Source
const DefaultFilename = structuredprd.DefaultFilename

DefaultFilename is the standard PRD filename.

View Source
const DefaultPersonaLibraryFilename = structuredprd.DefaultPersonaLibraryFilename

DefaultPersonaLibraryFilename is the standard filename for persona libraries.

Variables

This section is empty.

Functions

func AddBusinessObjective

func AddBusinessObjective(p *PRD, description, rationale string) string

AddBusinessObjective adds a business objective (as an OKR objective) to the PRD. Returns the generated ID. Deprecated: Use AddObjective for new code.

func AddDecision

func AddDecision(p *PRD, decision, rationale, madeBy string) string

AddDecision adds a decision record to the PRD. Returns the generated ID.

func AddFunctionalRequirement

func AddFunctionalRequirement(p *PRD, title, description string, priority MoSCoW) string

AddFunctionalRequirement adds a functional requirement to the PRD. Returns the generated ID.

func AddNonFunctionalRequirement

func AddNonFunctionalRequirement(p *PRD, category NFRCategory, title, description, target string, priority MoSCoW) string

AddNonFunctionalRequirement adds a non-functional requirement to the PRD. Returns the generated ID.

func AddObjective added in v0.3.0

func AddObjective(p *PRD, title, description string) string

AddObjective adds an objective (OKR) to the PRD. Returns the generated ID.

func AddOutOfScope

func AddOutOfScope(p *PRD, item string)

AddOutOfScope adds an out-of-scope item (non-goal) to the PRD.

func AddPersona

func AddPersona(p *PRD, name, role string, painPoints []string) string

AddPersona adds a user persona to the PRD. Returns the generated ID.

func AddProductGoal

func AddProductGoal(p *PRD, description, rationale string) string

AddProductGoal adds a product goal (as an OKR objective) to the PRD. Returns the generated ID. Deprecated: Use AddObjective for new code.

func AddRisk

func AddRisk(p *PRD, description string, probability RiskProbability, impact RiskImpact, mitigation string) string

AddRisk adds a risk to the PRD. Returns the generated ID.

func AddSolution

func AddSolution(p *PRD, name, description string, tradeoffs []string) string

AddSolution adds a solution option to the PRD. Returns the generated ID.

func AddSuccessMetric

func AddSuccessMetric(p *PRD, name, description, target string) string

AddSuccessMetric adds a success metric as a KeyResult to the first OKR. If no objectives exist, one is created first. Returns the generated ID.

func CategoryDescriptions

func CategoryDescriptions() map[string]string

CategoryDescriptions returns a map of category IDs to descriptions. Useful for providing context to LLM judges.

func CategoryOwners

func CategoryOwners() map[string]string

CategoryOwners returns a map of category IDs to suggested owners. Useful for assigning findings to responsible teams.

func GenerateEvaluationTemplate

func GenerateEvaluationTemplate(prd *PRD, filename string) *evaluation.EvaluationReport

GenerateEvaluationTemplate creates an EvaluationReport template from a PRD document. The template includes all standard categories plus custom sections. Scores are initialized to zero - they will be filled in by the LLM judge.

func GenerateEvaluationTemplateWithWeights

func GenerateEvaluationTemplateWithWeights(prd *PRD, filename string, weights map[string]float64) *evaluation.EvaluationReport

GenerateEvaluationTemplateWithWeights creates a template with custom category weights.

func GenerateID

func GenerateID() string

GenerateID generates a PRD ID based on the current date. Format: PRD-YYYY-DDD where DDD is the day of year.

func GenerateIDWithPrefix

func GenerateIDWithPrefix(prefix string) string

GenerateIDWithPrefix generates an ID with a custom prefix. Format: PREFIX-YYYY-DDD where DDD is the day of year.

func NextID

func NextID(p *PRD, prefix string) string

NextID generates the next ID for a given prefix based on existing IDs in the PRD.

func RenderExecMarkdown

func RenderExecMarkdown(view *ExecView) string

RenderExecMarkdown generates markdown output for exec view. Wrapper around structured-prd RenderExecMarkdown function.

func RenderPMMarkdown

func RenderPMMarkdown(view *PMView) string

RenderPMMarkdown generates markdown output for PM view. Wrapper around structured-prd RenderPMMarkdown function.

func RenderPRFAQMarkdown

func RenderPRFAQMarkdown(view *PRFAQView) string

RenderPRFAQMarkdown generates markdown output for PR/FAQ view. Wrapper around structured-prd RenderPRFAQMarkdown function.

func RenderSixPagerMarkdown

func RenderSixPagerMarkdown(view *SixPagerView) string

RenderSixPagerMarkdown generates markdown output for 6-pager view. Wrapper around structured-prd RenderSixPagerMarkdown function.

func Save

func Save(prd *PRD, path string) error

Save writes a PRD to a JSON file. Wrapper around structured-prd Save function.

func ScoreToEvaluationReport

func ScoreToEvaluationReport(prd *PRD, filename string) *evaluation.EvaluationReport

ScoreToEvaluationReport converts deterministic scoring results to an EvaluationReport. This allows the existing deterministic scoring to output in the standardized format that can be combined with LLM-based evaluations.

func SelectSolution

func SelectSolution(p *PRD, solutionID, rationale string) bool

SelectSolution selects a solution by ID and records the rationale. Returns true if the solution was found and selected.

func SetProblemStatement

func SetProblemStatement(p *PRD, statement, impact string, confidence float64)

SetProblemStatement sets the problem statement in the executive summary and optionally creates a detailed ProblemDefinition.

func UpdateStatus

func UpdateStatus(p *PRD, status Status)

UpdateStatus changes the PRD status.

Types

type AcceptanceCriterion

type AcceptanceCriterion = structuredprd.AcceptanceCriterion

User story types

type AccessibilitySpec

type AccessibilitySpec = structuredprd.AccessibilitySpec

UX types

type Alternative

type Alternative = structuredprd.Alternative

Market definition types

type AlternativeSnapshot

type AlternativeSnapshot = structuredprd.AlternativeSnapshot

6-Pager view types

type AlternativeType

type AlternativeType = structuredprd.AlternativeType

Market definition types

type Approver

type Approver = structuredprd.Approver

Metadata types

type Assumption

type Assumption = structuredprd.Assumption

Assumption types

type AssumptionsConstraints

type AssumptionsConstraints = structuredprd.AssumptionsConstraints

Assumption types

type Blocker

type Blocker = structuredprd.Blocker

Review types

type CategoryScore

type CategoryScore = structuredprd.CategoryScore

Scoring types

type CategoryWeight

type CategoryWeight = structuredprd.CategoryWeight

Scoring types

func DefaultWeights

func DefaultWeights() []CategoryWeight

DefaultWeights returns the standard category weights. Wrapper around structured-prd DefaultWeights function.

type Constraint

type Constraint = structuredprd.Constraint

Assumption types

type CustomSection

type CustomSection = structuredprd.CustomSection

Custom section types

type CustomerProblemSection

type CustomerProblemSection = structuredprd.CustomerProblemSection

6-Pager view types

type DecisionRecord

type DecisionRecord = structuredprd.DecisionRecord

Decision types

type DecisionStatus

type DecisionStatus = structuredprd.DecisionStatus

Decision types

type DecisionsDefinition

type DecisionsDefinition = structuredprd.DecisionsDefinition

Decision types

type Deliverable

type Deliverable = structuredprd.Deliverable

Roadmap types

type Demographics

type Demographics = structuredprd.Demographics

Persona types

type EvaluationCategory

type EvaluationCategory = structuredprd.EvaluationCategory

EvaluationCategory is an alias for the structured-prd evaluation category type.

func GetCategoriesFromDocument

func GetCategoriesFromDocument(prd *PRD) []EvaluationCategory

GetCategoriesFromDocument extracts the list of categories that should be evaluated based on what's present in the document. This includes standard categories and any custom sections defined in the PRD.

func StandardCategories

func StandardCategories() []EvaluationCategory

StandardCategories returns the standard PRD evaluation categories. These match the sections defined in the PRD schema.

type Evidence

type Evidence = structuredprd.Evidence

Problem definition types (from extended PRD)

type EvidenceSnapshot

type EvidenceSnapshot = structuredprd.EvidenceSnapshot

6-Pager view types

type EvidenceStrength

type EvidenceStrength = structuredprd.EvidenceStrength

Problem definition types (from extended PRD)

type EvidenceType

type EvidenceType = structuredprd.EvidenceType

Problem definition types (from extended PRD)

type ExecAction

type ExecAction = structuredprd.ExecAction

View types

type ExecHeader

type ExecHeader = structuredprd.ExecHeader

View types

type ExecRisk

type ExecRisk = structuredprd.ExecRisk

View types

type ExecView

type ExecView = structuredprd.ExecView

View types

func GenerateExecView

func GenerateExecView(prd *PRD, scores *ScoringResult) *ExecView

GenerateExecView creates an executive-friendly view of the PRD. Wrapper around structured-prd GenerateExecView function.

type ExecutiveSummary

type ExecutiveSummary = structuredprd.ExecutiveSummary

Executive summary types

type FAQ

type FAQ = structuredprd.FAQ

6-Pager view types

type FAQSection

type FAQSection = structuredprd.FAQSection

6-Pager view types

type FeatureSnapshot

type FeatureSnapshot = structuredprd.FeatureSnapshot

6-Pager view types

type Framework added in v0.3.0

type Framework = structuredprd.Framework

Goals types (v0.5.0+)

type FunctionalRequirement

type FunctionalRequirement = structuredprd.FunctionalRequirement

Requirements types

type GlossaryTerm

type GlossaryTerm = structuredprd.GlossaryTerm

Glossary types

type GoalItem added in v0.3.0

type GoalItem = structuredprd.GoalItem

Goals types (v0.5.0+)

type Goals added in v0.3.0

type Goals = structuredprd.Goals

Goals types (v0.5.0+)

type Integration

type Integration = structuredprd.Integration

Technical architecture types

type InteractionFlow

type InteractionFlow = structuredprd.InteractionFlow

UX types

type KeyResult added in v0.3.0

type KeyResult = structuredprd.KeyResult

OKR types (v0.4.0+)

type LibraryMetadata

type LibraryMetadata = structuredprd.LibraryMetadata

Persona library types

type LibraryPersona

type LibraryPersona = structuredprd.LibraryPersona

Persona library types

type MarketDefinition

type MarketDefinition = structuredprd.MarketDefinition

Market definition types

type Metadata

type Metadata = structuredprd.Metadata

Metadata types

type MetricSnapshot

type MetricSnapshot = structuredprd.MetricSnapshot

6-Pager view types

type MetricsSummary

type MetricsSummary = structuredprd.MetricsSummary

View types

type MoSCoW

type MoSCoW = structuredprd.MoSCoW

User story types

func ParseMoSCoW

func ParseMoSCoW(s string) MoSCoW

ParseMoSCoW converts a string to MoSCoW priority type.

type NFRCategory

type NFRCategory = structuredprd.NFRCategory

Requirements types

func ParseNFRCategory

func ParseNFRCategory(s string) NFRCategory

ParseNFRCategory converts a string to NFRCategory type.

type NonFunctionalRequirement

type NonFunctionalRequirement = structuredprd.NonFunctionalRequirement

Requirements types

type OKR added in v0.3.0

type OKR = structuredprd.OKR

OKR types (v0.4.0+)

type Objective

type Objective = structuredprd.Objective

Objectives types

type Objectives

type Objectives = structuredprd.Objectives

Objectives types

type PMView

type PMView = structuredprd.PMView

View types

func GeneratePMView

func GeneratePMView(prd *PRD) *PMView

GeneratePMView creates a PM-friendly view of the PRD. Wrapper around structured-prd GeneratePMView function.

type PRD

type PRD = structuredprd.Document

PRD is an alias for Document from structured-prd, maintaining backward compatibility.

func Load

func Load(path string) (*PRD, error)

Load reads a PRD from a JSON file. Wrapper around structured-prd Load function.

func New

func New(id, title string, authors ...Person) *PRD

New creates a new PRD with required fields initialized. Wrapper around structured-prd New function.

type PRFAQView

type PRFAQView = structuredprd.PRFAQView

PR/FAQ view types

func GeneratePRFAQView

func GeneratePRFAQView(prd *PRD) *PRFAQView

GeneratePRFAQView creates an Amazon-style PR/FAQ view of the PRD. Wrapper around structured-prd GeneratePRFAQView function.

type Person

type Person = structuredprd.Person

Metadata types

type Persona

type Persona = structuredprd.Persona

Persona types

type PersonaLibrary

type PersonaLibrary = structuredprd.PersonaLibrary

Persona library types

func LoadPersonaLibrary

func LoadPersonaLibrary(path string) (*PersonaLibrary, error)

LoadPersonaLibrary reads a persona library from a JSON file.

func NewPersonaLibrary

func NewPersonaLibrary() *PersonaLibrary

NewPersonaLibrary creates a new empty persona library.

type PersonaSnapshot

type PersonaSnapshot = structuredprd.PersonaSnapshot

6-Pager view types

type PersonaSummary

type PersonaSummary = structuredprd.PersonaSummary

View types

type Phase

type Phase = structuredprd.Phase

Roadmap types

type PhaseSnapshot

type PhaseSnapshot = structuredprd.PhaseSnapshot

6-Pager view types

type PhaseStatus

type PhaseStatus = structuredprd.PhaseStatus

Roadmap types

type PhaseTarget added in v0.3.0

type PhaseTarget = structuredprd.PhaseTarget

OKR types (v0.4.0+)

type PhaseType

type PhaseType = structuredprd.PhaseType

Roadmap types

type PressReleaseSection

type PressReleaseSection = structuredprd.PressReleaseSection

6-Pager view types

type Priority

type Priority = structuredprd.Priority

User story types

type ProblemDefinition

type ProblemDefinition = structuredprd.ProblemDefinition

Problem definition types (from extended PRD)

type QualityScores

type QualityScores = structuredprd.QualityScores

Review types

type Quote

type Quote = structuredprd.Quote

6-Pager view types

type Requirements

type Requirements = structuredprd.Requirements

Requirements types

type RequirementsList

type RequirementsList = structuredprd.RequirementsList

View types

type ResultItem added in v0.3.0

type ResultItem = structuredprd.ResultItem

Goals types (v0.5.0+)

type ReviewDecision

type ReviewDecision = structuredprd.ReviewDecision

Review types

type ReviewsDefinition

type ReviewsDefinition = structuredprd.ReviewsDefinition

Review types

type RevisionRecord

type RevisionRecord = structuredprd.RevisionRecord

Revision types

type RevisionTrigger

type RevisionTrigger = structuredprd.RevisionTrigger

Review types

type RevisionTriggerType

type RevisionTriggerType = structuredprd.RevisionTriggerType

Revision types

type Risk

type Risk = structuredprd.Risk

Risk types

type RiskImpact

type RiskImpact = structuredprd.RiskImpact

Risk types

func ParseRiskImpact

func ParseRiskImpact(s string) RiskImpact

ParseRiskImpact converts a string to RiskImpact type.

type RiskProbability

type RiskProbability = structuredprd.RiskProbability

Risk types

func ParseRiskProbability

func ParseRiskProbability(s string) RiskProbability

ParseRiskProbability converts a string to RiskProbability type.

type RiskSnapshot

type RiskSnapshot = structuredprd.RiskSnapshot

6-Pager view types

type RiskStatus

type RiskStatus = structuredprd.RiskStatus

Risk types

type RiskSummary

type RiskSummary = structuredprd.RiskSummary

View types

type Roadmap

type Roadmap = structuredprd.Roadmap

Roadmap types

type ScopeSnapshot

type ScopeSnapshot = structuredprd.ScopeSnapshot

6-Pager view types

type ScoringResult

type ScoringResult = structuredprd.ScoringResult

Scoring types

func Score

func Score(prd *PRD) *ScoringResult

Score evaluates a PRD and returns scoring results. Wrapper around structured-prd Score function.

type SixPagerView

type SixPagerView = structuredprd.SixPagerView

6-Pager view types

func GenerateSixPagerView

func GenerateSixPagerView(prd *PRD) *SixPagerView

GenerateSixPagerView creates an Amazon-style 6-pager view of the PRD. Wrapper around structured-prd GenerateSixPagerView function.

type SolutionDefinition

type SolutionDefinition = structuredprd.SolutionDefinition

Solution definition types

type SolutionOption

type SolutionOption = structuredprd.SolutionOption

Solution definition types

type SolutionSection

type SolutionSection = structuredprd.SolutionSection

6-Pager view types

type SolutionSummary

type SolutionSummary = structuredprd.SolutionSummary

View types

type Status

type Status = structuredprd.Status

Metadata types

func ParseStatus

func ParseStatus(s string) (Status, bool)

ParseStatus converts a string to Status type.

type SuccessMetricsSection

type SuccessMetricsSection = structuredprd.SuccessMetricsSection

6-Pager view types

type TechnicalArchitecture

type TechnicalArchitecture = structuredprd.TechnicalArchitecture

Technical architecture types

type TechnicalProficiency

type TechnicalProficiency = structuredprd.TechnicalProficiency

Persona types

type Technology

type Technology = structuredprd.Technology

Technical architecture types

type TechnologyStack

type TechnologyStack = structuredprd.TechnologyStack

Technical architecture types

type TimelineSection

type TimelineSection = structuredprd.TimelineSection

6-Pager view types

type UXRequirements

type UXRequirements = structuredprd.UXRequirements

UX types

type UserStory

type UserStory = structuredprd.UserStory

User story types

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a validation failure.

type ValidationResult

type ValidationResult struct {
	Valid    bool
	Errors   []ValidationError
	Warnings []ValidationWarning
}

ValidationResult contains validation errors and warnings.

func Validate

func Validate(prd *PRD) *ValidationResult

Validate checks the PRD for structural and content issues. This is a basic validation that checks required fields.

type ValidationWarning

type ValidationWarning struct {
	Field   string
	Message string
}

ValidationWarning represents a non-blocking issue.

type Wireframe

type Wireframe = structuredprd.Wireframe

UX types

Jump to

Keyboard shortcuts

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