Date: November 16, 2025
Source: Codebase Review Document Analysis
Purpose: Detailed mapping of what exists vs. what's needed
- ✅ Complete type definitions (
Rule,Diagnostic,EvaluationResult) - ✅ Worker wrapper structure (
makeRulesWorker()) - ✅ Fallback mechanism skeleton
- ✅ 30-40 rules defined in
rules.json
- ❌ Core evaluation logic - No function that processes rules
- ❌ Rule type handlers - No implementation for each rule kind
- ❌ Diagnostic generation - No code that creates Diagnostic objects
- ❌ Score calculation - No implementation of the scoring formula
- ❌ Worker message handling - Worker script is empty/incomplete
BLOCKER - Without this, the app cannot validate tool selections or show compatibility scores. This is the core feature.
src/engine/rules-engine.ts ← Main evaluation logic
src/engine/rules-engine.worker.ts ← Worker script
src/engine/score-calculator.ts ← Scoring algorithm (may not exist yet)
src/engine/diagnostics-builder.ts ← Diagnostic creation (may not exist yet)
- ✅
ScoreBreakdowntype defined - ✅ Formula documented in design.md
- ✅ Constants defined (base: 50, max bonus: +40, max penalty: -70)
- ❌ calculateScore() function - No actual implementation
- ❌ Bonus/penalty aggregation - No code that sums weights
- ❌ CapabilityCompat cap - No enforcement of +12 limit
- ❌ Score clamping - No code that clamps to [0, 100]
BLOCKER - Score is the primary feedback mechanism. Without it, users can't assess their stack quality.
src/engine/score-calculator.ts ← Create this file
src/engine/rules-engine.ts ← Call calculateScore() here
// Expected signature
function calculateScore(diagnostics: Diagnostic[]): ScoreBreakdown {
const base = 50;
const bonuses = diagnostics.filter(d => (d.weight ?? 0) > 0);
const penalties = diagnostics.filter(d => (d.weight ?? 0) < 0);
// Cap capabilityCompat bonuses at +12 total
const capabilityBonuses = bonuses.filter(d => d.category === 'capabilityCompat');
const capabilitySum = Math.min(
capabilityBonuses.reduce((sum, d) => sum + (d.weight ?? 0), 0),
12
);
const otherBonuses = bonuses.filter(d => d.category !== 'capabilityCompat');
const otherSum = otherBonuses.reduce((sum, d) => sum + (d.weight ?? 0), 0);
const totalBonuses = Math.min(capabilitySum + otherSum, 40);
const totalPenalties = Math.max(
penalties.reduce((sum, d) => sum + (d.weight ?? 0), 0),
-70
);
const total = Math.max(0, Math.min(100, base + totalBonuses + totalPenalties));
return {
base,
bonuses: bonuses.map(d => ({ reason: d.message, weight: d.weight! })),
penalties: penalties.map(d => ({ reason: d.message, weight: d.weight! })),
total
};
}- ✅
Suggestiontype defined - ✅
suggestions.tsfile exists - ✅ 5 baseline rules documented in design.md
- ❌ Suggestion rule implementations - File is empty or skeleton only
- ❌ Condition functions - No logic to detect when to suggest
- ❌ Generate functions - No logic to create Suggestion objects
- ❌ Safety checks - No guards for
tool.supports?.dbs
HIGH - Suggestions are a key differentiator. Without them, users miss out on intelligent recommendations.
src/data/suggestions.ts ← Implement 5 baseline rules
src/hooks/useSuggestions.ts ← Wire to context
src/context/SuggestionsContext.tsx ← Populate with logic
// Expected structure in suggestions.ts
export const suggestionRules = [
{
id: 'frontend-to-database',
condition: (selections: Tool[]) =>
selections.some(t => t.categoryId === 'frontend') &&
!selections.some(t => t.categoryId === 'database'),
generate: (selections: Tool[], tools: Tool[]): Suggestion => ({
id: 'suggest-database',
priority: 'high',
reason: 'Most web applications need data storage',
targetCategoryId: 'database',
suggestedToolId: 'postgres',
action: 'select-tool'
})
},
// ... 4 more rules
];- ✅
ExportRecipetype defined - ✅ Template files exist (
package-json.ts,readme.ts,env-example.ts) - ✅ Recipe directory structure (
src/data/recipes/) - ✅ Export generator files exist (
export-generator.ts,recipe-matcher.ts)
- ❌ Actual recipes - No recipe files in
src/data/recipes/ - ❌ Recipe matching logic -
recipe-matcher.tsis empty/incomplete - ❌ Recipe merger - No implementation of merge strategies
- ❌ File generators - Template files are empty/incomplete
- ❌ Export log generator - No implementation
- ❌ Archive generator - No JSZip integration
HIGH - Export is the final deliverable. Without it, users can't get their project files.
src/data/recipes/nextjs-base.ts ← Create
src/data/recipes/nextjs-prisma-postgres.ts ← Create
src/data/recipes/nextjs-clerk.ts ← Create
src/data/recipes/stripe-integration.ts ← Create
src/data/recipes/index.ts ← Create registry
src/lib/recipe-matcher.ts ← Implement matching
src/lib/export-generator.ts ← Implement generation
src/lib/export-log-generator.ts ← Implement logging
src/lib/archive-generator.ts ← Implement ZIP
src/templates/package-json.ts ← Implement generator
src/templates/readme.ts ← Implement generator
src/templates/env-example.ts ← Implement generator
- First: Create 1 simple recipe (nextjs-base.ts)
- Second: Implement recipe matcher and merger
- Third: Implement file generators
- Fourth: Add more recipes
- Fifth: Implement archive generator
- ✅ All component files created
- ✅ shadcn/ui components installed
- ✅ Component structure defined
- ❌ State connections - Components not wired to contexts
- ❌ Event handlers - No onClick, onChange implementations
- ❌ Data rendering - Components don't display real data
- ❌ Collapsible behavior - CategorySection doesn't collapse
- ❌ Radio button groups - ToolSelector doesn't enforce cardinality
- ❌ Diagnostic display - DiagnosticList doesn't show diagnostics
- ❌ Score visualization - CompatibilityScore doesn't show score
- ❌ Suggestion cards - SmartSuggestion doesn't render suggestions
MEDIUM - UI exists but is non-functional. Needs wiring to make interactive.
src/components/StackBuilder.tsx ← Wire to all contexts
src/components/CategorySection.tsx ← Add collapsible, wire to selections
src/components/ToolSelector.tsx ← Add radio buttons, wire to selections
src/components/DiagnosticList.tsx ← Wire to evaluation context
src/components/CompatibilityScore.tsx ← Wire to evaluation context
src/components/SmartSuggestion.tsx ← Wire to suggestions context
src/components/ExportDialog.tsx ← Wire to export context
- ✅ All context files created
- ✅ Context structure defined
- ✅ Hook files created
- ❌ Context implementations - Providers are empty shells
- ❌ State logic - No useState, useReducer implementations
- ❌ Actions - No selectTool(), deselectTool(), etc.
- ❌ Side effects - No useEffect for rule evaluation
- ❌ localStorage persistence - No save/load logic
- ❌ Debouncing - No debounced evaluation
MEDIUM - State management is the glue between UI and engine. Without it, nothing works together.
src/context/SelectionsContext.tsx ← Implement state + actions
src/context/EvaluationContext.tsx ← Implement evaluation trigger
src/context/SuggestionsContext.tsx ← Implement suggestion generation
src/context/ExportContext.tsx ← Implement export state
src/hooks/useStackSelection.ts ← Implement selection logic
src/hooks/useRulesEngine.ts ← Implement evaluation hook
src/hooks/useSuggestions.ts ← Implement suggestion hook
src/hooks/useExport.ts ← Implement export hook
- ✅ Test setup file (
src/test/setup.ts) - ✅ Vitest configured
- ✅ Test directories exist (
tests/unit/,tests/integration/, etc.)
- ❌ All tests - No test files exist
- ❌ Unit tests - Rules engine, suggestion engine, export generator
- ❌ Integration tests - User flows
- ❌ Snapshot tests - Export outputs
- ❌ Performance benchmarks - Rule evaluation timing
- ❌ Accessibility tests - axe-core, keyboard navigation
MEDIUM - Tests ensure quality but aren't blockers for initial functionality.
tests/unit/rules-engine.test.ts
tests/unit/suggestion-engine.test.ts
tests/unit/export-generator.test.ts
tests/unit/score-calculator.test.ts
tests/integration/user-flows.test.tsx
tests/integration/export-flows.test.tsx
tests/snapshots/package-json.test.ts
tests/snapshots/readme.test.ts
tests/snapshots/export-log.test.ts
tests/performance/benchmarks.test.ts
tests/accessibility/a11y.test.tsx
- ✅
categories.json- All 10 categories defined - ✅
tools.json- 30+ tools across all categories - ✅
rules.json- 30-40 compatibility rules - ✅
manifest.json- Catalog versioning
- ✅ Nothing - Data layer is complete!
NONE - This is the one area that's fully implemented.
- Rules Engine - Core evaluation logic
- Score Calculator - Scoring algorithm
- State Management - SelectionsContext + EvaluationContext
- UI Wiring - Connect components to state
- Suggestion Engine - 5 baseline rules
- Export System - Recipes + generators
- UI Components - Complete implementations
- Testing - Unit + integration tests
- Polish - Loading states, error handling
- Accessibility - WCAG compliance verification
- Performance optimization - If targets not met
- Additional recipes - Beyond MVP set
- Documentation - User guides, API docs
- Implement rules engine evaluation logic
- Implement score calculator
- Test with sample data
- Verify Worker communication
- Implement SelectionsContext
- Implement EvaluationContext
- Wire StackBuilder to contexts
- Wire CategorySection + ToolSelector
- Wire CompatibilityScore + DiagnosticList
- Implement suggestion rules
- Wire SmartSuggestion component
- Create 4 export recipes
- Implement recipe matcher + merger
- Implement file generators
- Wire ExportDialog
- Write unit tests
- Write integration tests
- Write snapshot tests
- Run accessibility tests
- Add loading states + error handling
- Implement responsive design
- Final QA and bug fixes
- User can select tools from all categories
- Score updates in real-time
- Diagnostics show conflicts/synergies
- Suggestions appear contextually
- Export generates working files
- 80%+ code coverage
- <50ms rule evaluation
- WCAG 2.1 AA compliance
- Zero critical bugs
- Intuitive interface
- Clear error messages
- Helpful suggestions
- Smooth export flow
- Responsive design
The codebase has a solid foundation with complete types, data, and structure. The main gaps are in implementation logic - the "brains" of the system. By focusing on the critical path (rules engine → state → UI → export), we can deliver a working MVP in 4 weeks.
Next Step: Start with Phase 1 (Core Engine) and implement the rules engine evaluation logic.