Documentation
¶
Overview ¶
Package prd provides data types for structured Product Requirements Documents.
Index ¶
- Constants
- Variables
- func GenerateID() string
- func GenerateIDWithPrefix(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(doc *Document, path string) error
- func ToJSON(v interface{}) (string, error)
- type AcceptanceCriterion
- type AccessibilitySpec
- type AlertingSpec
- type Alternative
- type AlternativeSnapshot
- type AlternativeType
- type Approver
- type Assumption
- type AssumptionsConstraints
- type Blocker
- type CategoryScore
- type CategoryWeight
- type CompletenessReport
- type Constraint
- type ConstraintType
- type CustomSection
- type CustomerProblemSection
- type DataSegregation
- type DecisionRecord
- type DecisionStatus
- type DecisionsDefinition
- type Deliverable
- type DeliverableStatus
- type DeliverableType
- type Demographics
- type Dependency
- type Document
- type EncryptionModel
- 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 GoalReference
- type GoalsAlignment
- type Integration
- type InteractionFlow
- type IsolationModel
- type LibraryMetadata
- type LibraryPersona
- type LoggingSpec
- type MarkdownOptions
- type MarketDefinition
- type Metadata
- type MetricSnapshot
- type MetricsSpec
- type MetricsSummary
- type MoSCoW
- type MultiTenancySpec
- type NFRCategory
- type NetworkIsolation
- type NonFunctionalRequirement
- type Objective
- type Objectives
- type ObservabilitySpec
- type PMView
- type PRFAQView
- type Person
- type Persona
- type PersonaLibrary
- func (lib *PersonaLibrary) Add(p Persona) (string, error)
- func (lib *PersonaLibrary) Count() int
- func (lib *PersonaLibrary) ExportAllFrom(doc *Document) (added int, updated int, errs []error)
- func (lib *PersonaLibrary) ExportFrom(doc *Document, personaID string) (string, error)
- func (lib *PersonaLibrary) Get(id string) *LibraryPersona
- func (lib *PersonaLibrary) GetByName(name string) *LibraryPersona
- func (lib *PersonaLibrary) ImportTo(doc *Document, personaID string, isPrimary bool) error
- func (lib *PersonaLibrary) List() []LibraryPersona
- func (lib *PersonaLibrary) ListByTag(tag string) []LibraryPersona
- func (lib *PersonaLibrary) Remove(id string) error
- func (lib *PersonaLibrary) Save(path string) error
- func (lib *PersonaLibrary) SyncFromLibrary(doc *Document) int
- func (lib *PersonaLibrary) Update(p Persona) error
- type PersonaSnapshot
- type PersonaSummary
- type Phase
- type PhaseSnapshot
- type PhaseStatus
- type PhaseType
- type PressReleaseSection
- type Priority
- type ProblemDefinition
- type QualityScores
- type Quote
- type RecommendPriority
- type Recommendation
- type ReliabilitySpec
- 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 SLOSpec
- type ScopeSnapshot
- type ScoringResult
- type SectionScore
- type SecuritySpec
- 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 TracingSpec
- type UXRequirements
- type UserStory
- type ValidationError
- type ValidationResult
- type ValidationWarning
- type Wireframe
Constants ¶
const ( ThresholdApprove = 8.0 ThresholdRevise = 6.5 ThresholdHumanReview = 6.5 ThresholdBlocker = 3.0 )
Thresholds for scoring decisions.
const DefaultFilename = "PRD.json"
DefaultFilename is the standard PRD filename.
const DefaultPersonaLibraryFilename = "personas.json"
DefaultPersonaLibraryFilename is the standard filename for persona libraries.
Variables ¶
var ( ErrPersonaNotFound = errors.New("persona not found in library") ErrPersonaAlreadyExists = errors.New("persona with this ID already exists") ErrPersonaNameRequired = errors.New("persona name is required") ErrInvalidPersonaID = errors.New("invalid persona ID") )
Common errors for persona library operations.
Functions ¶
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.
func RenderPMMarkdown ¶
RenderPMMarkdown generates markdown output for PM view.
func RenderPRFAQMarkdown ¶
RenderPRFAQMarkdown generates markdown output for the PR/FAQ view.
func RenderSixPagerMarkdown ¶
func RenderSixPagerMarkdown(view *SixPagerView) string
RenderSixPagerMarkdown generates markdown output for the 6-pager view.
Types ¶
type AcceptanceCriterion ¶
type AcceptanceCriterion struct {
ID string `json:"id"`
Description string `json:"description"`
Given string `json:"given,omitempty"` // Precondition
When string `json:"when,omitempty"` // Action
Then string `json:"then,omitempty"` // Expected result
}
AcceptanceCriterion defines a testable condition for a user story.
type AccessibilitySpec ¶
type AccessibilitySpec struct {
Standard string `json:"standard"` // WCAG 2.1 AA
Requirements []string `json:"requirements,omitempty"`
TestingApproach string `json:"testing_approach,omitempty"`
}
AccessibilitySpec defines accessibility requirements.
type AlertingSpec ¶
type AlertingSpec struct {
Channels []string `json:"channels"` // PagerDuty, Slack, Email
EscalationPolicy string `json:"escalation_policy,omitempty"`
OnCallIntegration bool `json:"on_call_integration,omitempty"`
}
AlertingSpec defines alerting requirements.
type Alternative ¶
type Alternative struct {
// ID is the unique identifier for this alternative.
ID string `json:"id"`
// Name is the name of the alternative.
Name string `json:"name"`
// Type categorizes the alternative.
Type AlternativeType `json:"type"`
// Description provides details about the alternative.
Description string `json:"description,omitempty"`
// Strengths are advantages of this alternative.
Strengths []string `json:"strengths,omitempty"`
// Weaknesses are disadvantages of this alternative.
Weaknesses []string `json:"weaknesses,omitempty"`
// WhyNotChosen explains why this alternative was not selected.
WhyNotChosen string `json:"why_not_chosen,omitempty"`
}
Alternative represents a competing product or alternative approach.
type AlternativeSnapshot ¶
type AlternativeSnapshot struct {
Name string `json:"name"`
Weaknesses []string `json:"weaknesses"`
}
AlternativeSnapshot describes current alternatives/workarounds.
type AlternativeType ¶
type AlternativeType string
AlternativeType categorizes alternatives.
const ( // AlternativeCompetitor is a competing product. AlternativeCompetitor AlternativeType = "competitor" // AlternativeWorkaround is a manual or existing workaround. AlternativeWorkaround AlternativeType = "workaround" // AlternativeDoNothing represents the option to not address the problem. AlternativeDoNothing AlternativeType = "do_nothing" // AlternativeInternalTool is an existing internal solution. AlternativeInternalTool AlternativeType = "internal_tool" )
type Approver ¶
type Approver struct {
Person
ApprovedAt *time.Time `json:"approved_at,omitempty"`
Approved bool `json:"approved"`
Comments string `json:"comments,omitempty"`
}
Approver represents a person with approval authority.
type Assumption ¶
type Assumption struct {
ID string `json:"id"`
Description string `json:"description"`
Rationale string `json:"rationale,omitempty"`
Risk string `json:"risk,omitempty"` // What happens if assumption is wrong
Validated bool `json:"validated,omitempty"`
}
Assumption represents a condition assumed to be true.
type AssumptionsConstraints ¶
type AssumptionsConstraints struct {
Assumptions []Assumption `json:"assumptions"`
Constraints []Constraint `json:"constraints"`
Dependencies []Dependency `json:"dependencies,omitempty"`
}
AssumptionsConstraints contains assumptions and constraints.
type Blocker ¶
type Blocker struct {
// ID is the unique identifier for this blocker.
ID string `json:"id"`
// Category is the scoring category related to this blocker.
Category string `json:"category"`
// Description describes the blocking issue.
Description string `json:"description"`
}
Blocker represents an issue that blocks PRD approval.
type CategoryScore ¶
type CategoryScore struct {
Category string `json:"category"`
Weight float64 `json:"weight"`
Score float64 `json:"score"`
MaxScore float64 `json:"max_score"`
Justification string `json:"justification"`
Evidence string `json:"evidence"`
BelowThreshold bool `json:"below_threshold"`
}
CategoryScore represents a score for a single category.
type CategoryWeight ¶
CategoryWeight defines the weight for each scoring category.
func DefaultWeights ¶
func DefaultWeights() []CategoryWeight
DefaultWeights returns the standard category weights. Weights sum to 1.0.
type CompletenessReport ¶
type CompletenessReport struct {
OverallScore float64 `json:"overall_score"` // 0-100
Grade string `json:"grade"` // A, B, C, D, F
Sections []SectionScore `json:"sections"` // Per-section scores
Recommendations []Recommendation `json:"recommendations"` // Improvement suggestions
Summary string `json:"summary"` // Human-readable summary
RequiredComplete int `json:"required_complete"` // Count of complete required sections
RequiredTotal int `json:"required_total"` // Total required sections
OptionalComplete int `json:"optional_complete"` // Count of complete optional sections
OptionalTotal int `json:"optional_total"` // Total optional sections
}
CompletenessReport contains the results of a PRD completeness check.
func (*CompletenessReport) FormatReport ¶
func (r *CompletenessReport) FormatReport() string
FormatReport returns a human-readable string representation of the report.
type Constraint ¶
type Constraint struct {
ID string `json:"id"`
Type ConstraintType `json:"type"`
Description string `json:"description"`
Impact string `json:"impact,omitempty"`
Mitigation string `json:"mitigation,omitempty"`
}
Constraint represents a limitation on the project.
type ConstraintType ¶
type ConstraintType string
ConstraintType represents types of constraints.
const ( ConstraintTechnical ConstraintType = "technical" ConstraintBudget ConstraintType = "budget" ConstraintTimeline ConstraintType = "timeline" ConstraintRegulatory ConstraintType = "regulatory" ConstraintResource ConstraintType = "resource" ConstraintLegal ConstraintType = "legal" )
type CustomSection ¶
type CustomSection struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Content any `json:"content"` // Flexible content structure
Schema string `json:"schema,omitempty"` // Optional JSON schema for validation
}
CustomSection allows project-specific sections.
type CustomerProblemSection ¶
type CustomerProblemSection struct {
Statement string `json:"statement"`
Impact string `json:"impact"`
Personas []PersonaSnapshot `json:"personas"`
CurrentAlternatives []AlternativeSnapshot `json:"current_alternatives"`
Evidence []EvidenceSnapshot `json:"evidence,omitempty"`
}
CustomerProblemSection describes the user pain points.
type DataSegregation ¶
type DataSegregation string
DataSegregation represents database isolation levels.
const ( DataSchemaPerTenant DataSegregation = "schema_per_tenant" // Separate schema per tenant DataDatabasePerTenant DataSegregation = "database_per_tenant" // Separate database per tenant )
type DecisionRecord ¶
type DecisionRecord struct {
// ID is the unique identifier for this decision.
ID string `json:"id"`
// Decision is the decision that was made.
Decision string `json:"decision"`
// Rationale explains why this decision was made.
Rationale string `json:"rationale,omitempty"`
// AlternativesConsidered lists other options that were evaluated.
AlternativesConsidered []string `json:"alternatives_considered,omitempty"`
// MadeBy is the person or group who made the decision.
MadeBy string `json:"made_by,omitempty"`
// Date is when the decision was made.
Date time.Time `json:"date,omitempty"`
// Status is the current status of the decision.
Status DecisionStatus `json:"status,omitempty"`
// RelatedIDs are IDs of related items (requirements, risks, etc.).
RelatedIDs []string `json:"related_ids,omitempty"`
}
DecisionRecord documents a decision made during PRD development.
type DecisionStatus ¶
type DecisionStatus string
DecisionStatus represents the status of a decision.
const ( // DecisionProposed means the decision is proposed but not finalized. DecisionProposed DecisionStatus = "proposed" // DecisionAccepted means the decision has been accepted. DecisionAccepted DecisionStatus = "accepted" // DecisionSuperseded means the decision has been replaced by another. DecisionSuperseded DecisionStatus = "superseded" // DecisionDeprecated means the decision is no longer relevant. DecisionDeprecated DecisionStatus = "deprecated" )
type DecisionsDefinition ¶
type DecisionsDefinition struct {
// Records are the decision records.
Records []DecisionRecord `json:"records,omitempty"`
}
DecisionsDefinition contains decision records for the PRD.
type Deliverable ¶
type Deliverable struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Type DeliverableType `json:"type"`
Status DeliverableStatus `json:"status,omitempty"`
}
Deliverable represents a phase deliverable.
type DeliverableStatus ¶
type DeliverableStatus string
DeliverableStatus represents the status of a deliverable.
const ( DeliverableNotStarted DeliverableStatus = "not_started" DeliverableInProgress DeliverableStatus = "in_progress" DeliverableCompleted DeliverableStatus = "completed" DeliverableBlocked DeliverableStatus = "blocked" )
type DeliverableType ¶
type DeliverableType string
DeliverableType represents types of deliverables.
const ( DeliverableFeature DeliverableType = "feature" DeliverableDocumentation DeliverableType = "documentation" DeliverableInfrastructure DeliverableType = "infrastructure" DeliverableIntegration DeliverableType = "integration" DeliverableMilestone DeliverableType = "milestone" )
type Demographics ¶
type Demographics struct {
AgeRange string `json:"age_range,omitempty"`
Location string `json:"location,omitempty"`
Industry string `json:"industry,omitempty"`
CompanySize string `json:"company_size,omitempty"`
Experience string `json:"experience,omitempty"` // Years of experience
}
Demographics contains optional demographic information.
type Dependency ¶
type Dependency struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type,omitempty"` // API, Service, Team, Vendor
Owner string `json:"owner,omitempty"`
Status string `json:"status,omitempty"` // Available, Pending, Blocked
DueDate string `json:"due_date,omitempty"`
}
Dependency represents an external dependency.
type Document ¶
type Document struct {
Metadata Metadata `json:"metadata"`
ExecutiveSummary ExecutiveSummary `json:"executive_summary"`
Objectives Objectives `json:"objectives"`
Personas []Persona `json:"personas"`
UserStories []UserStory `json:"user_stories"`
Requirements Requirements `json:"requirements"`
Roadmap Roadmap `json:"roadmap"`
// Optional sections
Assumptions *AssumptionsConstraints `json:"assumptions,omitempty"`
OutOfScope []string `json:"out_of_scope,omitempty"`
TechArchitecture *TechnicalArchitecture `json:"technical_architecture,omitempty"`
UXRequirements *UXRequirements `json:"ux_requirements,omitempty"`
Risks []Risk `json:"risks,omitempty"`
Glossary []GlossaryTerm `json:"glossary,omitempty"`
// Custom sections for project-specific needs
CustomSections []CustomSection `json:"custom_sections,omitempty"`
// Problem provides detailed problem definition with evidence.
Problem *ProblemDefinition `json:"problem,omitempty"`
// Market contains market analysis and competitive landscape.
Market *MarketDefinition `json:"market,omitempty"`
// Solution contains solution options and selection rationale.
Solution *SolutionDefinition `json:"solution,omitempty"`
// Decisions contains decision records for the PRD.
Decisions *DecisionsDefinition `json:"decisions,omitempty"`
// Reviews contains review outcomes and quality assessments.
Reviews *ReviewsDefinition `json:"reviews,omitempty"`
// RevisionHistory tracks changes to the PRD over time.
RevisionHistory []RevisionRecord `json:"revision_history,omitempty"`
// Goals contains alignment with strategic goals (V2MOM, OKR).
Goals *GoalsAlignment `json:"goals,omitempty"`
}
Document represents a complete Product Requirements Document.
func (*Document) AddRevision ¶
func (doc *Document) AddRevision(changes []string, trigger RevisionTriggerType, author string)
AddRevision records a revision in the Document history.
func (*Document) CheckCompleteness ¶
func (d *Document) CheckCompleteness() CompletenessReport
CheckCompleteness analyzes the PRD and returns a completeness report.
func (*Document) ToMarkdown ¶
func (d *Document) ToMarkdown(opts MarkdownOptions) string
ToMarkdown converts a PRD Document to markdown format.
type EncryptionModel ¶
type EncryptionModel string
EncryptionModel represents cryptographic isolation levels.
const ( EncryptionTenantSpecific EncryptionModel = "tenant_specific_keys" EncryptionBYOK EncryptionModel = "byok" // Bring Your Own Key )
type Evidence ¶
type Evidence struct {
// Type categorizes the evidence source.
Type EvidenceType `json:"type"`
// Source identifies where the evidence came from.
Source string `json:"source"`
// Summary describes what the evidence shows.
Summary string `json:"summary,omitempty"`
// SampleSize is the number of data points (for quantitative evidence).
SampleSize int `json:"sample_size,omitempty"`
// Strength indicates how strong the evidence is.
Strength EvidenceStrength `json:"strength,omitempty"`
// Date is when the evidence was collected.
Date string `json:"date,omitempty"`
}
Evidence supports a problem statement or claim.
type EvidenceSnapshot ¶
type EvidenceSnapshot struct {
Type string `json:"type"`
Description string `json:"description"`
Strength string `json:"strength"`
}
EvidenceSnapshot is a brief evidence summary.
type EvidenceStrength ¶
type EvidenceStrength string
EvidenceStrength indicates how strong evidence is.
const ( // StrengthLow indicates weak evidence. StrengthLow EvidenceStrength = "low" // StrengthMedium indicates moderate evidence. StrengthMedium EvidenceStrength = "medium" // StrengthHigh indicates strong evidence. StrengthHigh EvidenceStrength = "high" )
type EvidenceType ¶
type EvidenceType string
EvidenceType categorizes evidence sources.
const ( // EvidenceInterview is from user interviews. EvidenceInterview EvidenceType = "interview" // EvidenceSurvey is from user surveys. EvidenceSurvey EvidenceType = "survey" // EvidenceAnalytics is from product analytics. EvidenceAnalytics EvidenceType = "analytics" // EvidenceSupportTicket is from support tickets. EvidenceSupportTicket EvidenceType = "support_ticket" // EvidenceMarketResearch is from market research. EvidenceMarketResearch EvidenceType = "market_research" // EvidenceAssumption is an assumption (not validated). EvidenceAssumption EvidenceType = "assumption" )
type ExecAction ¶
type ExecAction struct {
Action string `json:"action"`
Owner string `json:"owner"`
Priority string `json:"priority"`
Rationale string `json:"rationale"`
}
ExecAction represents a required action.
type ExecHeader ¶
type ExecHeader struct {
PRDID string `json:"prd_id"`
Title string `json:"title"`
OverallDecision string `json:"overall_decision"`
ConfidenceLevel string `json:"confidence_level"`
OverallScore float64 `json:"overall_score"`
}
ExecHeader contains high-level decision info.
type ExecRisk ¶
type ExecRisk struct {
Risk string `json:"risk"`
Impact string `json:"impact"`
Mitigation string `json:"mitigation"`
Confidence string `json:"confidence"`
}
ExecRisk is a high-level risk summary.
type ExecView ¶
type ExecView struct {
Header ExecHeader `json:"header"`
Strengths []string `json:"strengths"`
Blockers []string `json:"blockers"`
RequiredActions []ExecAction `json:"required_actions"`
TopRisks []ExecRisk `json:"top_risks"`
RecommendationSummary string `json:"recommendation_summary"`
}
ExecView represents the Executive view of a PRD.
func GenerateExecView ¶
func GenerateExecView(doc *Document, scores *ScoringResult) *ExecView
GenerateExecView creates an executive-friendly view of the Document.
type ExecutiveSummary ¶
type ExecutiveSummary struct {
ProblemStatement string `json:"problem_statement"`
ProposedSolution string `json:"proposed_solution"`
ExpectedOutcomes []string `json:"expected_outcomes"`
TargetAudience string `json:"target_audience,omitempty"`
ValueProposition string `json:"value_proposition,omitempty"`
}
ExecutiveSummary provides high-level product overview.
type FAQSection ¶
type FAQSection struct {
CustomerFAQs []FAQ `json:"customer_faqs"`
InternalFAQs []FAQ `json:"internal_faqs"`
TechnicalFAQs []FAQ `json:"technical_faqs,omitempty"`
}
FAQSection contains anticipated questions and answers.
type FeatureSnapshot ¶
type FeatureSnapshot struct {
Name string `json:"name"`
Description string `json:"description"`
Priority string `json:"priority"`
}
FeatureSnapshot is a brief feature summary.
type FunctionalRequirement ¶
type FunctionalRequirement struct {
ID string `json:"id"` // e.g., FR-001
Title string `json:"title"`
Description string `json:"description"`
Category string `json:"category"` // Feature category
Priority MoSCoW `json:"priority"`
UserStoryIDs []string `json:"user_story_ids"` // Related user stories
AcceptanceCriteria []AcceptanceCriterion `json:"acceptance_criteria"`
PhaseID string `json:"phase_id"` // Target roadmap phase
Dependencies []string `json:"dependencies,omitempty"`
Assumptions []string `json:"assumptions,omitempty"`
Notes string `json:"notes,omitempty"`
}
FunctionalRequirement represents a functional requirement.
type GlossaryTerm ¶
type GlossaryTerm struct {
Term string `json:"term"`
Definition string `json:"definition"`
Acronym string `json:"acronym,omitempty"`
Context string `json:"context,omitempty"`
Related []string `json:"related,omitempty"` // Related terms
}
GlossaryTerm defines a glossary entry.
type GoalReference ¶
type GoalReference struct {
// ID is the unique identifier of the goals document.
ID string `json:"id"`
// Path is the file path to the goals document.
Path string `json:"path,omitempty"`
// URL is a URL to the goals document (e.g., Confluence, Notion).
URL string `json:"url,omitempty"`
// Version is the version of the goals document this PRD aligns with.
Version string `json:"version,omitempty"`
}
GoalReference represents a reference to an external goals document.
type GoalsAlignment ¶
type GoalsAlignment struct {
// V2MOMRef is a reference to an external V2MOM document.
V2MOMRef *GoalReference `json:"v2mom_ref,omitempty"`
// V2MOM is an embedded V2MOM document.
V2MOM *v2mom.V2MOM `json:"v2mom,omitempty"`
// OKRRef is a reference to an external OKR document.
OKRRef *GoalReference `json:"okr_ref,omitempty"`
// OKR is an embedded OKR document.
OKR *okr.OKRDocument `json:"okr,omitempty"`
// AlignedObjectives maps PRD objectives to goal IDs.
// Key is the PRD objective ID, value is the goal/method/objective ID.
AlignedObjectives map[string]string `json:"aligned_objectives,omitempty"`
}
GoalsAlignment represents alignment with strategic goals. This allows a PRD to reference or embed goals from the structured-goals package.
func (*GoalsAlignment) GetV2MOMMethodIDs ¶
func (g *GoalsAlignment) GetV2MOMMethodIDs() []string
GetV2MOMMethodIDs returns the IDs of all V2MOM methods referenced by this PRD.
func (*GoalsAlignment) HasOKR ¶
func (g *GoalsAlignment) HasOKR() bool
HasOKR returns true if OKR alignment is configured (ref or embedded).
func (*GoalsAlignment) HasV2MOM ¶
func (g *GoalsAlignment) HasV2MOM() bool
HasV2MOM returns true if V2MOM alignment is configured (ref or embedded).
type Integration ¶
type Integration struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // REST API, GraphQL, Event, Database
Description string `json:"description"`
Protocol string `json:"protocol,omitempty"`
AuthMethod string `json:"auth_method,omitempty"`
DataFormat string `json:"data_format,omitempty"` // JSON, XML, Protobuf
RateLimit string `json:"rate_limit,omitempty"`
Documentation string `json:"documentation,omitempty"` // URL to docs
}
Integration represents an external integration point.
type InteractionFlow ¶
type InteractionFlow struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Steps []string `json:"steps"`
DiagramURL string `json:"diagram_url,omitempty"`
}
InteractionFlow represents a user interaction flow.
type IsolationModel ¶
type IsolationModel string
IsolationModel represents tenant isolation strategies.
const ( IsolationPool IsolationModel = "pool" // Shared resources IsolationSilo IsolationModel = "silo" // Dedicated resources IsolationBridge IsolationModel = "bridge" // Hybrid approach )
type LibraryMetadata ¶
type LibraryMetadata struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
LibraryMetadata contains metadata about the persona library itself.
type LibraryPersona ¶
type LibraryPersona struct {
Persona
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
UsedInPRDs []string `json:"used_in_prds,omitempty"` // Track which PRDs use this persona
Tags []string `json:"tags,omitempty"` // For organization/filtering
Description string `json:"library_description,omitempty"` // Additional context for library
}
LibraryPersona extends Persona with library-specific metadata.
func (*LibraryPersona) ToPersona ¶
func (lp *LibraryPersona) ToPersona() Persona
ToPersona converts a LibraryPersona to a basic Persona (drops library metadata).
type LoggingSpec ¶
type LoggingSpec struct {
Format string `json:"format"` // JSON, structured
RetentionPeriod string `json:"retention_period"` // e.g., "90 days"
LogLevels []string `json:"log_levels"`
CorrelationID bool `json:"correlation_id"` // Include trace/correlation IDs
SensitiveDataHandling string `json:"sensitive_data_handling,omitempty"`
}
LoggingSpec defines logging requirements.
type MarkdownOptions ¶
type MarkdownOptions struct {
// IncludeFrontmatter adds YAML frontmatter for Pandoc
IncludeFrontmatter bool
// Margin sets the page margin (e.g., "2cm")
Margin string
// MainFont sets the main font family
MainFont string
// SansFont sets the sans-serif font family
SansFont string
// MonoFont sets the monospace font family
MonoFont string
// FontFamily sets the LaTeX font family (e.g., "helvet")
FontFamily string
}
MarkdownOptions configures markdown generation.
func DefaultMarkdownOptions ¶
func DefaultMarkdownOptions() MarkdownOptions
DefaultMarkdownOptions returns sensible defaults for markdown generation.
type MarketDefinition ¶
type MarketDefinition struct {
// Alternatives are competing products, workarounds, or alternative approaches.
Alternatives []Alternative `json:"alternatives,omitempty"`
// Differentiation describes how this solution differs from alternatives.
Differentiation []string `json:"differentiation,omitempty"`
// MarketRisks are risks related to market conditions or competition.
MarketRisks []string `json:"market_risks,omitempty"`
}
MarketDefinition contains market analysis and competitive landscape.
type Metadata ¶
type Metadata struct {
ID string `json:"id"`
Title string `json:"title"`
Version string `json:"version"`
Status Status `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Authors []Person `json:"authors"`
Reviewers []Person `json:"reviewers,omitempty"`
Approvers []Approver `json:"approvers,omitempty"`
Tags []string `json:"tags,omitempty"`
}
Metadata contains document metadata.
type MetricSnapshot ¶
type MetricSnapshot struct {
Name string `json:"name"`
Target string `json:"target"`
Baseline string `json:"baseline,omitempty"`
Measurement string `json:"measurement,omitempty"`
}
MetricSnapshot is a brief metric summary.
type MetricsSpec ¶
type MetricsSpec struct {
Format string `json:"format"` // Prometheus, OpenTelemetry
CollectionInterval string `json:"collection_interval"` // e.g., "15s"
RetentionPeriod string `json:"retention_period"`
CustomMetrics []string `json:"custom_metrics,omitempty"`
}
MetricsSpec defines metrics requirements.
type MetricsSummary ¶
type MetricsSummary struct {
Primary string `json:"primary,omitempty"`
Supporting []string `json:"supporting,omitempty"`
Guardrails []string `json:"guardrails,omitempty"`
}
MetricsSummary shows key metrics.
type MultiTenancySpec ¶
type MultiTenancySpec struct {
IsolationModel IsolationModel `json:"isolation_model"`
DataSegregation DataSegregation `json:"data_segregation"`
EncryptionModel EncryptionModel `json:"encryption_model,omitempty"`
NetworkIsolation NetworkIsolation `json:"network_isolation,omitempty"`
NoisyNeighborProtection string `json:"noisy_neighbor_protection,omitempty"`
}
MultiTenancySpec defines multi-tenancy requirements.
type NFRCategory ¶
type NFRCategory string
NFRCategory represents categories of non-functional requirements.
const ( NFRPerformance NFRCategory = "performance" NFRScalability NFRCategory = "scalability" NFRReliability NFRCategory = "reliability" NFRAvailability NFRCategory = "availability" NFRSecurity NFRCategory = "security" NFRMultiTenancy NFRCategory = "multi_tenancy" NFRObservability NFRCategory = "observability" NFRMaintainability NFRCategory = "maintainability" NFRUsability NFRCategory = "usability" NFRCompatibility NFRCategory = "compatibility" NFRCompliance NFRCategory = "compliance" NFRDisasterRecovery NFRCategory = "disaster_recovery" NFRCostEfficiency NFRCategory = "cost_efficiency" NFRPortability NFRCategory = "portability" NFRTestability NFRCategory = "testability" NFRExtensibility NFRCategory = "extensibility" NFRInteroperability NFRCategory = "interoperability" NFRLocalization NFRCategory = "localization" )
type NetworkIsolation ¶
type NetworkIsolation string
NetworkIsolation represents network-level isolation.
const ( NetworkVPCPerTenant NetworkIsolation = "vpc_per_tenant" NetworkNamespaceIsolation NetworkIsolation = "namespace_isolation" )
type NonFunctionalRequirement ¶
type NonFunctionalRequirement struct {
ID string `json:"id"` // e.g., NFR-001
Category NFRCategory `json:"category"`
Title string `json:"title"`
Description string `json:"description"`
Metric string `json:"metric"` // What is measured
Target string `json:"target"` // Target value (e.g., "P95 < 200ms")
MeasurementMethod string `json:"measurement_method,omitempty"`
Priority MoSCoW `json:"priority"`
PhaseID string `json:"phase_id"`
CurrentBaseline string `json:"current_baseline,omitempty"`
Notes string `json:"notes,omitempty"`
// SLO-specific fields (for observability/reliability)
SLO *SLOSpec `json:"slo,omitempty"`
// Multi-tenancy specific fields
MultiTenancy *MultiTenancySpec `json:"multi_tenancy,omitempty"`
// Security specific fields
Security *SecuritySpec `json:"security,omitempty"`
}
NonFunctionalRequirement represents a non-functional requirement.
type Objective ¶
type Objective struct {
ID string `json:"id"`
Description string `json:"description"`
Rationale string `json:"rationale,omitempty"`
AlignedWith string `json:"aligned_with,omitempty"` // Parent strategy/OKR
}
Objective represents a single business or product objective.
type Objectives ¶
type Objectives struct {
BusinessObjectives []Objective `json:"business_objectives"`
ProductGoals []Objective `json:"product_goals"`
SuccessMetrics []SuccessMetric `json:"success_metrics"`
}
Objectives defines business and product goals.
type ObservabilitySpec ¶
type ObservabilitySpec struct {
Logging LoggingSpec `json:"logging"`
Metrics MetricsSpec `json:"metrics"`
Tracing TracingSpec `json:"tracing"`
Alerting AlertingSpec `json:"alerting"`
Dashboards []string `json:"dashboards,omitempty"`
}
ObservabilitySpec defines observability requirements.
type PMView ¶
type PMView struct {
Title string `json:"title"`
Status string `json:"status"`
Owner string `json:"owner"`
Version string `json:"version"`
ProblemSummary string `json:"problem_summary"`
Personas []PersonaSummary `json:"personas"`
Goals []string `json:"goals"`
NonGoals []string `json:"non_goals"`
Solution SolutionSummary `json:"solution"`
Requirements RequirementsList `json:"requirements"`
Metrics MetricsSummary `json:"metrics"`
Risks []RiskSummary `json:"risks"`
OpenQuestions []string `json:"open_questions,omitempty"`
}
PMView represents the Product Manager view of a PRD.
func GeneratePMView ¶
GeneratePMView creates a PM-friendly view of the Document.
type PRFAQView ¶
type PRFAQView struct {
// Metadata
Title string `json:"title"`
Version string `json:"version"`
Author string `json:"author"`
Date string `json:"date"`
PRDID string `json:"prd_id"`
// The two main sections
PressRelease PressReleaseSection `json:"press_release"`
FAQ FAQSection `json:"faq"`
}
PRFAQView represents the Amazon-style PR/FAQ document format. This is a lighter-weight alternative to the full 6-pager, focusing on the press release and frequently asked questions.
func GeneratePRFAQView ¶
GeneratePRFAQView creates an Amazon-style PR/FAQ view from a PRD. This reuses the press release and FAQ generation logic from the 6-pager.
type Person ¶
type Person struct {
Name string `json:"name"`
Email string `json:"email,omitempty"`
Role string `json:"role,omitempty"`
}
Person represents an individual contributor.
type Persona ¶
type Persona struct {
ID string `json:"id"`
Name string `json:"name"` // e.g., "Developer Dan"
Role string `json:"role"` // Job title
Description string `json:"description"` // Background and context
Goals []string `json:"goals"` // What they want to achieve
PainPoints []string `json:"pain_points"` // Current frustrations
Behaviors []string `json:"behaviors,omitempty"` // Typical patterns
TechnicalProficiency TechnicalProficiency `json:"technical_proficiency,omitempty"`
Demographics *Demographics `json:"demographics,omitempty"`
Motivations []string `json:"motivations,omitempty"`
Frustrations []string `json:"frustrations,omitempty"`
PreferredChannels []string `json:"preferred_channels,omitempty"` // How they prefer to interact
Quote string `json:"quote,omitempty"` // Representative quote
ImageURL string `json:"image_url,omitempty"`
IsPrimary bool `json:"is_primary,omitempty"` // Is this the primary persona?
LibraryRef string `json:"library_ref,omitempty"` // Reference to persona in library (for tracking origin)
}
Persona represents a user persona for the product.
type PersonaLibrary ¶
type PersonaLibrary struct {
SchemaVersion string `json:"schema_version"`
Personas []LibraryPersona `json:"personas"`
Metadata LibraryMetadata `json:"metadata,omitempty"`
}
PersonaLibrary manages reusable personas across documents.
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.
func (*PersonaLibrary) Add ¶
func (lib *PersonaLibrary) Add(p Persona) (string, error)
Add adds a new persona to the library. Generates an ID if not provided. Returns the ID.
func (*PersonaLibrary) Count ¶
func (lib *PersonaLibrary) Count() int
Count returns the number of personas in the library.
func (*PersonaLibrary) ExportAllFrom ¶
func (lib *PersonaLibrary) ExportAllFrom(doc *Document) (added int, updated int, errs []error)
ExportAllFrom exports all personas from a document to the library. Returns the count of added and updated personas.
func (*PersonaLibrary) ExportFrom ¶
func (lib *PersonaLibrary) ExportFrom(doc *Document, personaID string) (string, error)
ExportFrom exports a persona from a document to the library. If the persona already exists in the library (by ID), it's updated. If not, it's added as a new persona. Returns the library persona ID.
func (*PersonaLibrary) Get ¶
func (lib *PersonaLibrary) Get(id string) *LibraryPersona
Get retrieves a persona by ID.
func (*PersonaLibrary) GetByName ¶
func (lib *PersonaLibrary) GetByName(name string) *LibraryPersona
GetByName retrieves a persona by name (case-sensitive).
func (*PersonaLibrary) ImportTo ¶
func (lib *PersonaLibrary) ImportTo(doc *Document, personaID string, isPrimary bool) error
ImportTo imports a persona from the library into a document. The persona is copied (not referenced) so the document is self-contained. Sets LibraryRef to track the origin.
func (*PersonaLibrary) List ¶
func (lib *PersonaLibrary) List() []LibraryPersona
List returns all personas in the library.
func (*PersonaLibrary) ListByTag ¶
func (lib *PersonaLibrary) ListByTag(tag string) []LibraryPersona
ListByTag returns personas matching a specific tag.
func (*PersonaLibrary) Remove ¶
func (lib *PersonaLibrary) Remove(id string) error
Remove removes a persona from the library by ID.
func (*PersonaLibrary) Save ¶
func (lib *PersonaLibrary) Save(path string) error
Save writes the persona library to a JSON file.
func (*PersonaLibrary) SyncFromLibrary ¶
func (lib *PersonaLibrary) SyncFromLibrary(doc *Document) int
SyncFromLibrary updates all personas in a document with their latest library versions. Only updates personas that have a LibraryRef set. Returns the count of updated personas.
func (*PersonaLibrary) Update ¶
func (lib *PersonaLibrary) Update(p Persona) error
Update updates an existing persona in the library.
type PersonaSnapshot ¶
type PersonaSnapshot struct {
Name string `json:"name"`
Role string `json:"role"`
PainPoints []string `json:"pain_points"`
}
PersonaSnapshot is a brief persona summary for the 6-pager.
type PersonaSummary ¶
type PersonaSummary struct {
Name string `json:"name"`
Role string `json:"role"`
PainPoints []string `json:"pain_points"`
IsPrimary bool `json:"is_primary"`
}
PersonaSummary is a condensed persona view.
type Phase ¶
type Phase struct {
ID string `json:"id"` // e.g., "phase-1", "q1-2026"
Name string `json:"name"` // e.g., "MVP", "Q1 2026"
Type PhaseType `json:"type"`
StartDate *time.Time `json:"start_date,omitempty"`
EndDate *time.Time `json:"end_date,omitempty"`
Goals []string `json:"goals"`
Deliverables []Deliverable `json:"deliverables"`
SuccessCriteria []string `json:"success_criteria"`
Dependencies []string `json:"dependencies,omitempty"` // Dependent phase IDs
Risks []Risk `json:"risks,omitempty"`
Status PhaseStatus `json:"status,omitempty"`
Progress *int `json:"progress,omitempty"` // 0-100 percentage
Notes string `json:"notes,omitempty"`
}
Phase represents a roadmap phase.
type PhaseSnapshot ¶
type PhaseSnapshot struct {
Name string `json:"name"`
Description string `json:"description"`
Deliverables []string `json:"deliverables"`
Status string `json:"status,omitempty"`
}
PhaseSnapshot is a brief phase summary.
type PhaseStatus ¶
type PhaseStatus string
PhaseStatus represents the current status of a phase.
const ( PhaseStatusPlanned PhaseStatus = "planned" PhaseStatusInProgress PhaseStatus = "in_progress" PhaseStatusCompleted PhaseStatus = "completed" PhaseStatusDelayed PhaseStatus = "delayed" PhaseStatusCancelled PhaseStatus = "cancelled" )
type PressReleaseSection ¶
type PressReleaseSection struct {
Headline string `json:"headline"`
Subheadline string `json:"subheadline"`
Summary string `json:"summary"`
ProblemSolved string `json:"problem_solved"`
Solution string `json:"solution"`
Quote Quote `json:"quote,omitempty"`
CustomerQuote Quote `json:"customer_quote,omitempty"`
CallToAction string `json:"call_to_action"`
Benefits []string `json:"benefits"`
}
PressReleaseSection is a future-dated announcement of the product.
type ProblemDefinition ¶
type ProblemDefinition struct {
// ID is the unique identifier for this problem.
ID string `json:"id,omitempty"`
// Statement is the problem statement.
Statement string `json:"statement"`
// UserImpact describes how users are affected by this problem.
UserImpact string `json:"user_impact,omitempty"`
// Evidence supports the existence and severity of the problem.
Evidence []Evidence `json:"evidence,omitempty"`
// Confidence is the confidence level in the problem definition (0.0-1.0).
Confidence float64 `json:"confidence,omitempty"`
// RootCauses are the underlying causes of the problem.
RootCauses []string `json:"root_causes,omitempty"`
// AffectedSegments are user segments affected by this problem.
AffectedSegments []string `json:"affected_segments,omitempty"`
// SecondaryProblems are related or secondary problems.
SecondaryProblems []ProblemDefinition `json:"secondary_problems,omitempty"`
}
ProblemDefinition contains the problem statement with evidence.
type QualityScores ¶
type QualityScores struct {
ProblemDefinition float64 `json:"problem_definition"`
UserUnderstanding float64 `json:"user_understanding"`
MarketAwareness float64 `json:"market_awareness"`
SolutionFit float64 `json:"solution_fit"`
ScopeDiscipline float64 `json:"scope_discipline"`
RequirementsQuality float64 `json:"requirements_quality"`
UXCoverage float64 `json:"ux_coverage"`
TechnicalFeasibility float64 `json:"technical_feasibility"`
MetricsQuality float64 `json:"metrics_quality"`
RiskManagement float64 `json:"risk_management"`
OverallScore float64 `json:"overall_score"`
}
QualityScores contains scores across the 10 quality dimensions.
type Quote ¶
type Quote struct {
Speaker string `json:"speaker"`
Role string `json:"role,omitempty"`
Text string `json:"text"`
}
Quote represents a quote in the press release.
type RecommendPriority ¶
type RecommendPriority string
RecommendPriority represents recommendation priority levels.
const ( RecommendCritical RecommendPriority = "critical" RecommendHigh RecommendPriority = "high" RecommendMedium RecommendPriority = "medium" RecommendLow RecommendPriority = "low" )
type Recommendation ¶
type Recommendation struct {
Section string `json:"section"`
Priority RecommendPriority `json:"priority"` // critical, high, medium, low
Message string `json:"message"`
Guidance string `json:"guidance,omitempty"`
}
Recommendation provides specific guidance on improving the PRD.
type ReliabilitySpec ¶
type ReliabilitySpec struct {
TargetUptime string `json:"target_uptime"` // e.g., "99.9%"
MTBF string `json:"mtbf,omitempty"` // Mean Time Between Failures
MTTR string `json:"mttr,omitempty"` // Mean Time To Recovery
RTO string `json:"rto,omitempty"` // Recovery Time Objective
RPO string `json:"rpo,omitempty"` // Recovery Point Objective
FailoverStrategy string `json:"failover_strategy,omitempty"`
BackupFrequency string `json:"backup_frequency,omitempty"`
DisasterRecoveryPlan bool `json:"disaster_recovery_plan,omitempty"`
}
ReliabilitySpec defines reliability requirements.
type Requirements ¶
type Requirements struct {
Functional []FunctionalRequirement `json:"functional"`
NonFunctional []NonFunctionalRequirement `json:"non_functional"`
}
Requirements contains both functional and non-functional requirements.
type RequirementsList ¶
type RequirementsList struct {
Must []string `json:"must"`
Should []string `json:"should"`
Could []string `json:"could"`
}
RequirementsList groups requirements by priority.
type ReviewDecision ¶
type ReviewDecision string
ReviewDecision represents the outcome of a review.
const ( // ReviewApprove means the PRD is approved. ReviewApprove ReviewDecision = "approve" // ReviewRevise means the PRD needs targeted revisions. ReviewRevise ReviewDecision = "revise" // ReviewReject means the PRD has blocking issues. ReviewReject ReviewDecision = "reject" // ReviewHumanReview means the PRD requires human review. ReviewHumanReview ReviewDecision = "human_review" )
type ReviewsDefinition ¶
type ReviewsDefinition struct {
// ReviewBoardSummary is a summary from the review board.
ReviewBoardSummary string `json:"review_board_summary,omitempty"`
// QualityScores contains scores across quality dimensions.
QualityScores *QualityScores `json:"quality_scores,omitempty"`
// Decision is the review decision.
Decision ReviewDecision `json:"decision,omitempty"`
// Blockers are issues that block approval.
Blockers []Blocker `json:"blockers,omitempty"`
// RevisionTriggers are issues requiring revision.
RevisionTriggers []RevisionTrigger `json:"revision_triggers,omitempty"`
}
ReviewsDefinition contains review outcomes and quality assessments.
type RevisionRecord ¶
type RevisionRecord struct {
// Version is the version number after this revision.
Version string `json:"version"`
// Changes lists what changed in this revision.
Changes []string `json:"changes"`
// Trigger indicates what triggered this revision.
Trigger RevisionTriggerType `json:"trigger"`
// Date is when this revision was made.
Date time.Time `json:"date"`
// Author is who made this revision.
Author string `json:"author,omitempty"`
}
RevisionRecord documents a revision to the PRD.
type RevisionTrigger ¶
type RevisionTrigger struct {
// IssueID is the unique identifier for this issue.
IssueID string `json:"issue_id"`
// Category is the scoring category related to this issue.
Category string `json:"category"`
// Severity indicates how severe the issue is (blocker, major, minor).
Severity string `json:"severity"`
// Description describes the issue.
Description string `json:"description"`
// RecommendedOwner suggests who should address this issue.
RecommendedOwner string `json:"recommended_owner,omitempty"`
}
RevisionTrigger represents an issue that requires revision.
type RevisionTriggerType ¶
type RevisionTriggerType string
RevisionTriggerType indicates what triggered a revision.
const ( // TriggerInitial is for the initial PRD creation. TriggerInitial RevisionTriggerType = "initial" // TriggerReview is for revisions from review feedback. TriggerReview RevisionTriggerType = "review" // TriggerScore is for revisions from scoring feedback. TriggerScore RevisionTriggerType = "score" // TriggerHuman is for revisions from human feedback. TriggerHuman RevisionTriggerType = "human" )
type Risk ¶
type Risk struct {
ID string `json:"id"`
Description string `json:"description"`
Probability RiskProbability `json:"probability"`
Impact RiskImpact `json:"impact"`
Mitigation string `json:"mitigation"`
Owner string `json:"owner,omitempty"`
Status RiskStatus `json:"status,omitempty"`
DueDate string `json:"due_date,omitempty"`
Notes string `json:"notes,omitempty"`
}
Risk represents a project risk.
type RiskImpact ¶
type RiskImpact string
RiskImpact represents risk impact levels.
const ( RiskImpactLow RiskImpact = "low" RiskImpactMedium RiskImpact = "medium" RiskImpactHigh RiskImpact = "high" RiskImpactCritical RiskImpact = "critical" )
type RiskProbability ¶
type RiskProbability string
RiskProbability represents risk probability levels.
const ( RiskProbabilityLow RiskProbability = "low" RiskProbabilityMedium RiskProbability = "medium" RiskProbabilityHigh RiskProbability = "high" )
type RiskSnapshot ¶
type RiskSnapshot struct {
Description string `json:"description"`
Impact string `json:"impact"`
Mitigation string `json:"mitigation"`
}
RiskSnapshot is a brief risk summary.
type RiskStatus ¶
type RiskStatus string
RiskStatus represents risk status.
const ( RiskStatusOpen RiskStatus = "open" RiskStatusMitigated RiskStatus = "mitigated" RiskStatusAccepted RiskStatus = "accepted" RiskStatusClosed RiskStatus = "closed" )
type RiskSummary ¶
type RiskSummary struct {
Description string `json:"description"`
Impact string `json:"impact"`
Mitigation string `json:"mitigation"`
}
RiskSummary is a condensed risk view.
type Roadmap ¶
type Roadmap struct {
Phases []Phase `json:"phases"`
}
Roadmap contains the product roadmap with phases.
type SLOSpec ¶
type SLOSpec struct {
SLI string `json:"sli"` // Service Level Indicator
SLOTarget string `json:"slo_target"` // e.g., "99.9%"
Window string `json:"window"` // e.g., "30 days rolling"
ErrorBudget string `json:"error_budget,omitempty"`
Consequences string `json:"consequences,omitempty"` // What happens on breach
AlertThreshold string `json:"alert_threshold,omitempty"`
}
SLOSpec defines Service Level Objective specifications.
type ScopeSnapshot ¶
type ScopeSnapshot struct {
InScope []string `json:"in_scope"`
OutOfScope []string `json:"out_of_scope"`
}
ScopeSnapshot defines what's in and out of scope.
type ScoringResult ¶
type ScoringResult struct {
CategoryScores []CategoryScore `json:"category_scores"`
WeightedScore float64 `json:"weighted_score"`
Decision string `json:"decision"`
Blockers []string `json:"blockers"`
RevisionTriggers []RevisionTrigger `json:"revision_triggers"`
Summary string `json:"summary"`
}
ScoringResult contains the complete scoring output.
func Score ¶
func Score(doc *Document) *ScoringResult
Score evaluates a Document and returns scoring results.
type SectionScore ¶
type SectionScore struct {
Name string `json:"name"`
Score float64 `json:"score"` // 0-100
MaxPoints float64 `json:"max_points"` // Weight in overall score
Required bool `json:"required"`
Status string `json:"status"` // complete, partial, missing
Issues []string `json:"issues,omitempty"`
Suggestions []string `json:"suggestions,omitempty"`
}
SectionScore represents the completeness score for a document section.
type SecuritySpec ¶
type SecuritySpec struct {
AuthenticationMethods []string `json:"authentication_methods,omitempty"` // OAuth2, SAML, MFA
AuthorizationModel string `json:"authorization_model,omitempty"` // RBAC, ABAC
EncryptionAtRest bool `json:"encryption_at_rest,omitempty"`
EncryptionInTransit bool `json:"encryption_in_transit,omitempty"`
ComplianceStandards []string `json:"compliance_standards,omitempty"` // SOC2, GDPR, HIPAA
VulnerabilityScanning bool `json:"vulnerability_scanning,omitempty"`
PenetrationTesting bool `json:"penetration_testing,omitempty"`
SecurityAuditFrequency string `json:"security_audit_frequency,omitempty"`
}
SecuritySpec defines security-specific requirements.
type SixPagerView ¶
type SixPagerView struct {
// Metadata
Title string `json:"title"`
Version string `json:"version"`
Author string `json:"author"`
Date string `json:"date"`
PRDID string `json:"prd_id"`
// The six sections
PressRelease PressReleaseSection `json:"press_release"`
FAQ FAQSection `json:"faq"`
CustomerProblem CustomerProblemSection `json:"customer_problem"`
Solution SolutionSection `json:"solution"`
SuccessMetrics SuccessMetricsSection `json:"success_metrics"`
Timeline TimelineSection `json:"timeline"`
}
SixPagerView represents the Amazon-style 6-pager document format. This is a deterministic transformation from PRD data.
func GenerateSixPagerView ¶
func GenerateSixPagerView(doc *Document) *SixPagerView
GenerateSixPagerView creates an Amazon-style 6-pager view from a PRD.
type SolutionDefinition ¶
type SolutionDefinition struct {
// SolutionOptions are the possible solutions considered.
SolutionOptions []SolutionOption `json:"solution_options,omitempty"`
// SelectedSolutionID is the ID of the chosen solution.
SelectedSolutionID string `json:"selected_solution_id,omitempty"`
// SolutionRationale explains why the selected solution was chosen.
SolutionRationale string `json:"solution_rationale,omitempty"`
// Confidence is the confidence level in the solution (0.0-1.0).
Confidence float64 `json:"confidence,omitempty"`
}
SolutionDefinition contains solution options and selection rationale.
func (*SolutionDefinition) SelectedSolution ¶
func (s *SolutionDefinition) SelectedSolution() *SolutionOption
SelectedSolution returns the selected solution option, or nil if none selected.
type SolutionOption ¶
type SolutionOption struct {
// ID is the unique identifier for this solution option.
ID string `json:"id"`
// Name is the name of this solution option.
Name string `json:"name"`
// Description provides details about the solution.
Description string `json:"description,omitempty"`
// ProblemsAddressed lists problem IDs this solution addresses.
ProblemsAddressed []string `json:"problems_addressed,omitempty"`
// Benefits are advantages of this solution.
Benefits []string `json:"benefits,omitempty"`
// Tradeoffs are compromises or downsides of this solution.
Tradeoffs []string `json:"tradeoffs,omitempty"`
// Risks are potential risks of this solution.
Risks []string `json:"risks,omitempty"`
// EstimatedEffort is a high-level effort estimate.
EstimatedEffort string `json:"estimated_effort,omitempty"`
}
SolutionOption represents a possible solution approach.
type SolutionSection ¶
type SolutionSection struct {
Overview string `json:"overview"`
HowItWorks string `json:"how_it_works"`
KeyFeatures []FeatureSnapshot `json:"key_features"`
Differentiators []string `json:"differentiators"`
Scope ScopeSnapshot `json:"scope"`
}
SolutionSection describes the proposed solution.
type SolutionSummary ¶
type SolutionSummary struct {
Name string `json:"name"`
Description string `json:"description"`
Rationale string `json:"rationale"`
Tradeoffs []string `json:"tradeoffs"`
}
SolutionSummary is a condensed solution view.
type SuccessMetric ¶
type SuccessMetric struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Metric string `json:"metric"` // What is measured
Target string `json:"target"` // Target value
CurrentBaseline string `json:"current_baseline,omitempty"`
MeasurementMethod string `json:"measurement_method,omitempty"`
}
SuccessMetric defines how success is measured.
type SuccessMetricsSection ¶
type SuccessMetricsSection struct {
PrimaryMetric MetricSnapshot `json:"primary_metric"`
SecondaryMetrics []MetricSnapshot `json:"secondary_metrics"`
Guardrails []MetricSnapshot `json:"guardrails,omitempty"`
BusinessGoals []string `json:"business_goals"`
}
SuccessMetricsSection defines how success will be measured.
type TechnicalArchitecture ¶
type TechnicalArchitecture struct {
Overview string `json:"overview"`
SystemDiagram string `json:"system_diagram,omitempty"` // URL or path to diagram
DataModel string `json:"data_model,omitempty"` // URL or path to ERD
IntegrationPoints []Integration `json:"integration_points,omitempty"`
TechnologyStack TechnologyStack `json:"technology_stack,omitempty"`
SecurityDesign string `json:"security_design,omitempty"`
ScalabilityDesign string `json:"scalability_design,omitempty"`
}
TechnicalArchitecture contains technical design information.
type TechnicalProficiency ¶
type TechnicalProficiency string
TechnicalProficiency represents a user's technical skill level.
const ( ProficiencyLow TechnicalProficiency = "low" ProficiencyMedium TechnicalProficiency = "medium" ProficiencyHigh TechnicalProficiency = "high" ProficiencyExpert TechnicalProficiency = "expert" )
type Technology ¶
type Technology struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
Purpose string `json:"purpose,omitempty"`
Rationale string `json:"rationale,omitempty"`
Alternatives []string `json:"alternatives,omitempty"` // Considered alternatives
}
Technology represents a technology choice.
type TechnologyStack ¶
type TechnologyStack struct {
Frontend []Technology `json:"frontend,omitempty"`
Backend []Technology `json:"backend,omitempty"`
Database []Technology `json:"database,omitempty"`
Infrastructure []Technology `json:"infrastructure,omitempty"`
DevOps []Technology `json:"devops,omitempty"`
Monitoring []Technology `json:"monitoring,omitempty"`
}
TechnologyStack defines the technology choices.
type TimelineSection ¶
type TimelineSection struct {
Phases []PhaseSnapshot `json:"phases"`
Dependencies []string `json:"dependencies"`
Risks []RiskSnapshot `json:"risks"`
TeamNeeds string `json:"team_needs,omitempty"`
}
TimelineSection describes the roadmap and resources.
type TracingSpec ¶
type TracingSpec struct {
Enabled bool `json:"enabled"`
SamplingRate string `json:"sampling_rate"` // e.g., "100%", "10%"
PropagationFormat string `json:"propagation_format"` // W3C, B3
ExportFormat string `json:"export_format"` // OTLP, Jaeger, Zipkin
}
TracingSpec defines distributed tracing requirements.
type UXRequirements ¶
type UXRequirements struct {
DesignPrinciples []string `json:"design_principles,omitempty"`
Wireframes []Wireframe `json:"wireframes,omitempty"`
InteractionFlows []InteractionFlow `json:"interaction_flows,omitempty"`
Accessibility AccessibilitySpec `json:"accessibility,omitempty"`
BrandGuidelines string `json:"brand_guidelines,omitempty"` // URL or path
DesignSystem string `json:"design_system,omitempty"` // URL or path
}
UXRequirements contains UX/UI requirements.
type UserStory ¶
type UserStory struct {
ID string `json:"id"`
PersonaID string `json:"persona_id"` // Reference to persona
Title string `json:"title"`
Story string `json:"story"` // "As a [persona], I want [goal] so that [reason]"
AcceptanceCriteria []AcceptanceCriterion `json:"acceptance_criteria"`
Priority Priority `json:"priority"`
PhaseID string `json:"phase_id"` // Reference to roadmap phase
StoryPoints *int `json:"story_points,omitempty"`
Dependencies []string `json:"dependencies,omitempty"` // Dependent story IDs
Epic string `json:"epic,omitempty"` // Parent epic
Labels []string `json:"labels,omitempty"`
Notes string `json:"notes,omitempty"`
}
UserStory represents a user story with acceptance criteria.
type ValidationError ¶
ValidationError represents a validation failure.
type ValidationResult ¶
type ValidationResult struct {
Valid bool `json:"valid"`
Errors []ValidationError `json:"errors,omitempty"`
Warnings []ValidationWarning `json:"warnings,omitempty"`
}
ValidationResult contains validation errors and warnings.
func Validate ¶
func Validate(doc *Document) *ValidationResult
Validate checks the Document for structural and content issues.
type ValidationWarning ¶
ValidationWarning represents a non-blocking issue.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package render provides interfaces and utilities for rendering PRD documents to various output formats including Marp slides.
|
Package render provides interfaces and utilities for rendering PRD documents to various output formats including Marp slides. |
|
marp
Package marp provides a Marp markdown renderer for PRD documents.
|
Package marp provides a Marp markdown renderer for PRD documents. |