ADR-003: Static Site Generator Recommendation Engine Design
id: 003-static-site-generator-recommendation-engine title: 'ADR-003: SSG Recommendation Engine Design' sidebar_label: 'ADR-3: SSG Recommendation Engine Design' sidebar_position: 3
Status
Accepted
Context
DocuMCP must intelligently recommend the most appropriate static site generator (SSG) for each project based on comprehensive analysis of project characteristics, team capabilities, and technical requirements. The recommendation engine needs to move beyond simple feature comparison to provide data-driven, contextual recommendations with clear justifications.
Current SSG landscape includes:
- Jekyll: GitHub Pages native, Ruby-based, mature ecosystem
- Hugo: Go-based, fast builds, extensive theming
- Docusaurus: React-based, modern features, Meta-backed
- MkDocs: Python-based, simple, Material theme
- Eleventy: JavaScript-based, flexible, minimal configuration
Key challenges:
- Choice paralysis for users unfamiliar with SSG ecosystem
- Technical requirements vary significantly by project type
- Performance needs differ based on content volume and update frequency
- Team capabilities and preferences affect long-term success
- Maintenance overhead varies dramatically between options
Decision
We will implement a multi-criteria decision analysis (MCDA) framework that evaluates project characteristics against SSG capabilities to provide ranked recommendations with confidence scores and detailed justifications.
Recommendation Engine Architecture:
1. SSG Knowledge Base
- Comprehensive SSG profiles with quantitative and qualitative metrics
- Performance characteristics: build times, memory usage, scalability limits
- Learning curve assessments: setup complexity, maintenance requirements
- Feature compatibility matrices: advanced features, plugin ecosystems
- Community metrics: activity, support quality, ecosystem maturity
2. Decision Matrix Framework
- Multi-criteria evaluation across weighted factors
- Project-specific factor weighting based on analysis results
- Algorithmic scoring with transparent calculation methods
- Confidence assessment based on factor alignment quality
3. Performance Modeling
- Build time prediction based on content volume and complexity
- Scalability assessment for projected growth patterns
- Resource requirement estimation for different deployment scenarios
4. Compatibility Assessment
- Technical stack alignment with existing project technologies
- Workflow integration with current development processes
- CI/CD compatibility with existing automation infrastructure
Alternatives Considered
Simple Rule-Based Recommendations
- Pros: Easy to implement, fast execution, predictable results
- Cons: Inflexible, doesn't handle edge cases, poor justification quality
- Decision: Rejected due to insufficient sophistication for quality recommendations
Machine Learning-Based Recommendation
- Pros: Could learn from successful project outcomes, adaptive over time
- Cons: Requires training data, model maintenance, unpredictable results
- Decision: Deferred to future versions; insufficient training data initially
User Survey-Based Selection
- Pros: Direct user input, captures preferences and constraints
- Cons: Requires user expertise, time-consuming, potential analysis paralysis
- Decision: Integrated as preference input to algorithmic recommendation
External Service Integration (StackShare, etc.)
- Pros: Real-world usage data, community insights
- Cons: External dependency, potential bias, limited project-specific context
- Decision: Rejected for core logic; may integrate for validation
Consequences
Positive
- Objective Recommendations: Data-driven approach reduces bias and subjectivity
- Clear Justifications: Users understand why specific SSGs are recommended
- Confidence Indicators: Users know when recommendations are highly certain vs. uncertain
- Contextual Intelligence: Recommendations adapt to specific project characteristics
- Educational Value: Users learn about SSG capabilities and trade-offs
Negative
- Algorithm Complexity: Multi-criteria analysis requires careful tuning and validation
- Knowledge Base Maintenance: SSG profiles need regular updates as tools evolve
- Subjectivity in Weights: Factor importance assignments may not match all user preferences
Risks and Mitigations
- Recommendation Accuracy: Validate against known successful project combinations
- Algorithm Bias: Test across diverse project types and regularly audit results
- Knowledge Staleness: Implement automated SSG capability monitoring and updates
Implementation Details
Decision Criteria Framework
interface RecommendationCriteria {
projectSize: ProjectSizeMetrics;
technicalComplexity: ComplexityAssessment;
teamCapabilities: TeamProfile;
performanceRequirements: PerformanceNeeds;
maintenancePreferences: MaintenanceProfile;
customizationNeeds: CustomizationRequirements;
}
interface SSGProfile {
name: string;
capabilities: SSGCapabilities;
performance: PerformanceProfile;
learningCurve: LearningCurveMetrics;
ecosystem: EcosystemMetrics;
maintenanceOverhead: MaintenanceMetrics;
}
Scoring Algorithm
interface ScoringWeights {
buildPerformance: number; // 0.20
setupComplexity: number; // 0.15
technicalAlignment: number; // 0.25
customizationFlexibility: number; // 0.15
maintenanceOverhead: number; // 0.15
ecosystemMaturity: number; // 0.10
}
function calculateSSGScore(
project: ProjectAnalysis,
ssg: SSGProfile,
weights: ScoringWeights
): RecommendationScore {
// Weighted scoring across multiple criteria
// Returns score (0-100) with component breakdown
}
Performance Modeling (Updated with Research 2025-01-14)
Research Integration: Comprehensive SSG performance analysis validates and refines our approach:
interface PerformanceModel {
predictBuildTime(contentVolume: number, complexity: number): BuildTimeEstimate;
assessScalability(projectedGrowth: GrowthPattern): ScalabilityRating;
estimateResourceNeeds(deployment: DeploymentTarget): ResourceRequirements;
// Research-validated performance tiers
calculatePerformanceTier(ssg: SSGType, projectScale: ProjectScale): PerformanceTier;
}
// Research-validated performance characteristics
const SSG_PERFORMANCE_MATRIX = {
hugo: {
smallSites: { buildTime: 'instant', scaleFactor: 1.0, overhead: 'minimal' },
mediumSites: { buildTime: 'seconds', scaleFactor: 1.1, overhead: 'minimal' },
largeSites: { buildTime: 'seconds', scaleFactor: 1.2, overhead: 'minimal' }
},
gatsby: {
smallSites: { buildTime: 'slow', scaleFactor: 250, overhead: 'webpack' },
mediumSites: { buildTime: 'moderate', scaleFactor: 100, overhead: 'webpack' },
largeSites: { buildTime: 'improving', scaleFactor: 40, overhead: 'optimized' }
},
eleventy: {
smallSites: { buildTime: 'fast', scaleFactor: 3, overhead: 'node' },
mediumSites: { buildTime: 'good', scaleFactor: 8, overhead: 'node' },
largeSites: { buildTime: 'moderate', scaleFactor: 15, overhead: 'node' }
},
jekyll: {
smallSites: { buildTime: 'good', scaleFactor: 2, overhead: 'ruby' },
mediumSites: { buildTime: 'slowing', scaleFactor: 12, overhead: 'ruby' },
largeSites: { buildTime: 'poor', scaleFactor: 25, overhead: 'ruby-bottleneck' }
}
} as const;
// Research-validated recommendation algorithm
const calculatePerformanceScore = (
ssg: SSGType,
projectMetrics: ProjectMetrics
): number => {
const { pageCount, updateFrequency, teamTechnicalLevel } = projectMetrics;
// Scale-based performance weighting (research-validated)
const performanceWeight = pageCount > 1000 ? 0.8 :
pageCount > 100 ? 0.6 : 0.4;
// Research-based performance scores
const baseScores = {
hugo: 100, // Fastest across all scales
eleventy: 85, // Good balance
jekyll: pageCount > 500 ? 60 : 80, // Ruby bottleneck at scale
nextjs: 70, // Framework overhead, good at scale
gatsby: pageCount > 1000 ? 65 : 45, // Severe small-site penalty
docusaurus: 75 // Optimized for documentation
};
return baseScores[ssg] * performanceWeight +
(baseScores[ssg] * (1 - performanceWeight) * featureScore[ssg]);
};
Recommendation Output
interface Recommendation {
ssg: SSGProfile;
score: number;
confidence: number;
justification: RecommendationJustification;
tradeoffs: Tradeoff[];
alternativeOptions: AlternativeRecommendation[];
}
interface RecommendationJustification {
primaryStrengths: string[];
concerningWeaknesses: string[];
bestFitReasons: string[];
performancePredictions: PerformancePrediction[];
}
SSG Knowledge Base Structure
const SSG_PROFILES: Record<string, SSGProfile> = {
jekyll: {
name: 'Jekyll',
capabilities: {
buildSpeed: 'moderate',
themingFlexibility: 'high',
pluginEcosystem: 'mature',
githubPagesNative: true,
contentTypes: ['markdown', 'liquid'],
i18nSupport: 'plugin-based'
},
performance: {
averageBuildTime: '2-5 minutes per 100 pages',
memoryUsage: 'moderate',
scalabilityLimit: '1000+ pages'
},
learningCurve: {
setupComplexity: 'low-moderate',
configurationComplexity: 'moderate',
customizationComplexity: 'moderate-high'
}
// ... additional profile data
}
// ... other SSG profiles
};
Confidence Calculation
function calculateConfidence(
scores: SSGScore[],
projectAnalysis: ProjectAnalysis
): number {
const scoreSpread = Math.max(...scores) - Math.min(...scores);
const analysisCompleteness = assessAnalysisCompleteness(projectAnalysis);
const criteriaAlignment = assessCriteriaAlignment(scores);
// Higher confidence when:
// - Clear winner emerges (high score spread)
// - Analysis is comprehensive
// - Criteria strongly align with one option
return calculateWeightedConfidence(scoreSpread, analysisCompleteness, criteriaAlignment);
}
Quality Assurance
Validation Strategy
- Benchmark Projects: Test against known successful project-SSG combinations
- Expert Review: Documentation experts validate recommendation logic
- User Feedback: Collect real-world outcomes to refine algorithms
- A/B Testing: Compare algorithm versions for recommendation quality
Testing Framework
describe('RecommendationEngine', () => {
it('should recommend Jekyll for simple documentation sites');
it('should recommend Hugo for performance-critical large sites');
it('should recommend Docusaurus for React-based projects');
it('should provide low confidence for ambiguous project profiles');
it('should justify all recommendations with specific reasons');
});
Monitoring and Metrics
- Recommendation accuracy rates by project type
- User satisfaction with recommendations
- Confidence score calibration accuracy
- Algorithm performance and execution time
Knowledge Base Maintenance
SSG Capability Tracking
- Regular monitoring of SSG releases and capability changes
- Community feedback integration for real-world performance data
- Automated testing of SSG performance benchmarks
- Expert review cycles for knowledge base accuracy
Update Processes
- Quarterly comprehensive review of all SSG profiles
- Monthly monitoring of major releases and capability changes
- Community contribution process for knowledge base improvements
- Automated validation of knowledge base consistency
Future Enhancements
Advanced Analytics
- Historical success rate tracking by recommendation
- Machine learning integration for pattern recognition
- User preference learning and personalization
- Comparative analysis across similar projects
Extended SSG Support
- Evaluation framework for new SSG additions
- Community-contributed SSG profiles
- Specialized SSG recommendations (e.g., Sphinx for API docs)
- Custom SSG configuration for specific use cases
Integration Features
- Direct integration with SSG documentation and examples
- Automated setup validation and testing
- Performance monitoring and optimization recommendations
- Migration assistance between SSGs
Security and Privacy
- No collection of sensitive project information
- Anonymized analytics for algorithm improvement
- Transparent recommendation criteria and methodology
- User control over data sharing preferences