Documentation
¶
Overview ¶
Package prd provides types and operations for Product Requirements Documents. Types are imported from github.com/grokify/structured-requirements/prd.
Index ¶
- Constants
- func AddBusinessObjective(p *PRD, description, rationale string) string
- func AddDecision(p *PRD, decision, rationale, madeBy string) string
- func AddFunctionalRequirement(p *PRD, title, description string, priority MoSCoW) string
- func AddNonFunctionalRequirement(p *PRD, category NFRCategory, title, description, target string, ...) string
- func AddOutOfScope(p *PRD, item string)
- func AddPersona(p *PRD, name, role string, painPoints []string) string
- func AddProductGoal(p *PRD, description, rationale string) string
- func AddRisk(p *PRD, description string, probability RiskProbability, impact RiskImpact, ...) string
- func AddSolution(p *PRD, name, description string, tradeoffs []string) string
- func AddSuccessMetric(p *PRD, name, description, target string) string
- func CategoryDescriptions() map[string]string
- func CategoryOwners() map[string]string
- func GenerateEvaluationTemplate(prd *PRD, filename string) *evaluation.EvaluationReport
- func GenerateEvaluationTemplateWithWeights(prd *PRD, filename string, weights map[string]float64) *evaluation.EvaluationReport
- func GenerateID() string
- func GenerateIDWithPrefix(prefix string) string
- func NextID(p *PRD, prefix string) string
- func RenderExecMarkdown(view *ExecView) string
- func RenderPMMarkdown(view *PMView) string
- func RenderPRFAQMarkdown(view *PRFAQView) string
- func RenderSixPagerMarkdown(view *SixPagerView) string
- func Save(prd *PRD, path string) error
- func ScoreToEvaluationReport(prd *PRD, filename string) *evaluation.EvaluationReport
- func SelectSolution(p *PRD, solutionID, rationale string) bool
- func SetProblemStatement(p *PRD, statement, impact string, confidence float64)
- func UpdateStatus(p *PRD, status Status)
- type AcceptanceCriterion
- type AccessibilitySpec
- type Alternative
- type AlternativeSnapshot
- type AlternativeType
- type Approver
- type Assumption
- type AssumptionsConstraints
- type Blocker
- type CategoryScore
- type CategoryWeight
- type Constraint
- type CustomSection
- type CustomerProblemSection
- type DecisionRecord
- type DecisionStatus
- type DecisionsDefinition
- type Deliverable
- type Demographics
- type EvaluationCategory
- type Evidence
- type EvidenceSnapshot
- type EvidenceStrength
- type EvidenceType
- type ExecAction
- type ExecHeader
- type ExecRisk
- type ExecView
- type ExecutiveSummary
- type FAQ
- type FAQSection
- type FeatureSnapshot
- type FunctionalRequirement
- type GlossaryTerm
- type Integration
- type InteractionFlow
- type LibraryMetadata
- type LibraryPersona
- type MarketDefinition
- type Metadata
- type MetricSnapshot
- type MetricsSummary
- type MoSCoW
- type NFRCategory
- type NonFunctionalRequirement
- type Objective
- type Objectives
- type PMView
- type PRD
- type PRFAQView
- type Person
- type Persona
- type PersonaLibrary
- type PersonaSnapshot
- type PersonaSummary
- type Phase
- type PhaseSnapshot
- type PhaseStatus
- type PhaseType
- type PressReleaseSection
- type Priority
- type ProblemDefinition
- type QualityScores
- type Quote
- type Requirements
- type RequirementsList
- type ReviewDecision
- type ReviewsDefinition
- type RevisionRecord
- type RevisionTrigger
- type RevisionTriggerType
- type Risk
- type RiskImpact
- type RiskProbability
- type RiskSnapshot
- type RiskStatus
- type RiskSummary
- type Roadmap
- type ScopeSnapshot
- type ScoringResult
- type SixPagerView
- type SolutionDefinition
- type SolutionOption
- type SolutionSection
- type SolutionSummary
- type Status
- type SuccessMetric
- type SuccessMetricsSection
- type TechnicalArchitecture
- type TechnicalProficiency
- type Technology
- type TechnologyStack
- type TimelineSection
- type UXRequirements
- type UserStory
- type ValidationError
- type ValidationResult
- type ValidationWarning
- type Wireframe
Constants ¶
const ( StatusDraft = structuredprd.StatusDraft StatusInReview = structuredprd.StatusInReview StatusApproved = structuredprd.StatusApproved StatusDeprecated = structuredprd.StatusDeprecated )
Status constants
const ( ProficiencyLow = structuredprd.ProficiencyLow ProficiencyMedium = structuredprd.ProficiencyMedium ProficiencyHigh = structuredprd.ProficiencyHigh ProficiencyExpert = structuredprd.ProficiencyExpert )
Technical proficiency constants
const ( PriorityCritical = structuredprd.PriorityCritical PriorityHigh = structuredprd.PriorityHigh PriorityMedium = structuredprd.PriorityMedium PriorityLow = structuredprd.PriorityLow )
Priority constants
const ( MoSCoWMust = structuredprd.MoSCoWMust MoSCoWShould = structuredprd.MoSCoWShould MoSCoWCould = structuredprd.MoSCoWCould MoSCoWWont = structuredprd.MoSCoWWont )
MoSCoW priority constants
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
const ( PhaseTypeGeneric = structuredprd.PhaseTypeGeneric PhaseTypeQuarter = structuredprd.PhaseTypeQuarter PhaseTypeMonth = structuredprd.PhaseTypeMonth PhaseTypeSprint = structuredprd.PhaseTypeSprint PhaseTypeMilestone = structuredprd.PhaseTypeMilestone )
Phase type constants
const ( RiskImpactCritical = structuredprd.RiskImpactCritical RiskImpactHigh = structuredprd.RiskImpactHigh RiskImpactMedium = structuredprd.RiskImpactMedium RiskImpactLow = structuredprd.RiskImpactLow )
Risk impact constants
const ( RiskProbabilityHigh = structuredprd.RiskProbabilityHigh RiskProbabilityMedium = structuredprd.RiskProbabilityMedium RiskProbabilityLow = structuredprd.RiskProbabilityLow )
Risk probability constants
const ( EvidenceInterview = structuredprd.EvidenceInterview EvidenceSurvey = structuredprd.EvidenceSurvey EvidenceAnalytics = structuredprd.EvidenceAnalytics EvidenceSupportTicket = structuredprd.EvidenceSupportTicket EvidenceMarketResearch = structuredprd.EvidenceMarketResearch EvidenceAssumption = structuredprd.EvidenceAssumption )
Evidence type constants
const ( StrengthLow = structuredprd.StrengthLow StrengthMedium = structuredprd.StrengthMedium StrengthHigh = structuredprd.StrengthHigh )
Evidence strength constants
const ( AlternativeCompetitor = structuredprd.AlternativeCompetitor AlternativeWorkaround = structuredprd.AlternativeWorkaround AlternativeDoNothing = structuredprd.AlternativeDoNothing AlternativeInternalTool = structuredprd.AlternativeInternalTool )
Alternative type constants
const ( DecisionProposed = structuredprd.DecisionProposed DecisionAccepted = structuredprd.DecisionAccepted DecisionSuperseded = structuredprd.DecisionSuperseded DecisionDeprecated = structuredprd.DecisionDeprecated )
Decision status constants
const ( ReviewApprove = structuredprd.ReviewApprove ReviewRevise = structuredprd.ReviewRevise ReviewReject = structuredprd.ReviewReject ReviewHumanReview = structuredprd.ReviewHumanReview )
Review decision constants
const ( TriggerInitial = structuredprd.TriggerInitial TriggerReview = structuredprd.TriggerReview TriggerScore = structuredprd.TriggerScore TriggerHuman = structuredprd.TriggerHuman )
Revision trigger type constants
const DefaultFilename = structuredprd.DefaultFilename
DefaultFilename is the standard PRD filename.
const DefaultPersonaLibraryFilename = structuredprd.DefaultPersonaLibraryFilename
DefaultPersonaLibraryFilename is the standard filename for persona libraries.
Variables ¶
This section is empty.
Functions ¶
func AddBusinessObjective ¶
AddBusinessObjective adds a business objective to the PRD. Returns the generated ID.
func AddDecision ¶
AddDecision adds a decision record to the PRD. Returns the generated ID.
func AddFunctionalRequirement ¶
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 AddOutOfScope ¶
AddOutOfScope adds an out-of-scope item (non-goal) to the PRD.
func AddPersona ¶
AddPersona adds a user persona to the PRD. Returns the generated ID.
func AddProductGoal ¶
AddProductGoal adds a product goal to the PRD. Returns the generated ID.
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 ¶
AddSolution adds a solution option to the PRD. Returns the generated ID.
func AddSuccessMetric ¶
AddSuccessMetric adds a success metric to the PRD. Returns the generated ID.
func CategoryDescriptions ¶
CategoryDescriptions returns a map of category IDs to descriptions. Useful for providing context to LLM judges.
func CategoryOwners ¶
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 ¶
GenerateIDWithPrefix generates an ID with a custom prefix. Format: PREFIX-YYYY-DDD where DDD is the day of year.
func RenderExecMarkdown ¶
RenderExecMarkdown generates markdown output for exec view. Wrapper around structured-prd RenderExecMarkdown function.
func RenderPMMarkdown ¶
RenderPMMarkdown generates markdown output for PM view. Wrapper around structured-prd RenderPMMarkdown function.
func RenderPRFAQMarkdown ¶
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 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 ¶
SelectSolution selects a solution by ID and records the rationale. Returns true if the solution was found and selected.
func SetProblemStatement ¶
SetProblemStatement sets the problem statement in the executive summary and optionally creates a detailed ProblemDefinition.
Types ¶
type AcceptanceCriterion ¶
type AcceptanceCriterion = structuredprd.AcceptanceCriterion
User story types
type AlternativeSnapshot ¶
type AlternativeSnapshot = structuredprd.AlternativeSnapshot
6-Pager view types
type AssumptionsConstraints ¶
type AssumptionsConstraints = structuredprd.AssumptionsConstraints
Assumption 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 CustomerProblemSection ¶
type CustomerProblemSection = structuredprd.CustomerProblemSection
6-Pager view types
type DecisionsDefinition ¶
type DecisionsDefinition = structuredprd.DecisionsDefinition
Decision 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 EvidenceStrength ¶
type EvidenceStrength = structuredprd.EvidenceStrength
Problem definition types (from extended PRD)
type EvidenceType ¶
type EvidenceType = structuredprd.EvidenceType
Problem definition types (from extended PRD)
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 FunctionalRequirement ¶
type FunctionalRequirement = structuredprd.FunctionalRequirement
Requirements types
type MarketDefinition ¶
type MarketDefinition = structuredprd.MarketDefinition
Market definition types
type MoSCoW ¶
type MoSCoW = structuredprd.MoSCoW
User story types
func ParseMoSCoW ¶
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 PMView ¶
type PMView = structuredprd.PMView
View types
func GeneratePMView ¶
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.
type PRFAQView ¶
type PRFAQView = structuredprd.PRFAQView
PR/FAQ view types
func GeneratePRFAQView ¶
GeneratePRFAQView creates an Amazon-style PR/FAQ view of the PRD. Wrapper around structured-prd GeneratePRFAQView function.
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 PressReleaseSection ¶
type PressReleaseSection = structuredprd.PressReleaseSection
6-Pager view types
type ProblemDefinition ¶
type ProblemDefinition = structuredprd.ProblemDefinition
Problem definition types (from extended PRD)
type RevisionTriggerType ¶
type RevisionTriggerType = structuredprd.RevisionTriggerType
Revision 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 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 Status ¶
type Status = structuredprd.Status
Metadata types
func ParseStatus ¶
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 TechnologyStack ¶
type TechnologyStack = structuredprd.TechnologyStack
Technical architecture types
type ValidationError ¶
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 ¶
ValidationWarning represents a non-blocking issue.