Prompt Evaluation Website - Developer Specification #
Project Overview #
A static website that evaluates programming prompts for accuracy and currency, initially focusing on React. The site displays evaluation scores, grades, and commentary on common programming prompts to help users identify outdated or incorrect information.
Technical Requirements #
Frontend Architecture #
- Framework: React with Tanstack Start
- Styling: Tailwind CSS with Shadcn UI components
- Build/Bundling: Configure for optimal performance with code splitting
- State Management: React's built-in state management (useState, useContext)
- Routing: Simple routing for potential future expansion
Backend/Data Architecture #
-
Database: Convex (pre-configured)
-
Data Schema:
type Prompt = { id: string; text: string; technology: string; evaluations: Evaluation[]; }; type Evaluation = { timestamp: Date; score: number; // 0-100 grade: "S" | "A" | "B" | "C" | "D" | "F"; commentary: string; output: string; // The full response to the prompt }; -
API: Static data fetching from Convex during build time
Deployment #
- Platform: Netlify
- Build Configuration: Set up automatic builds from repository
- Environment Variables: Configure for development/production environments
Functional Requirements #
Prompt Display #
- Display prompts organized by technology category
- Each prompt card should show:
- Full prompt text
- Current percentage score (0-100%)
- Letter grade (S through F)
- Last evaluation timestamp
- Collapsible section to view full output
Evaluation System #
- Implement a simple word grep tool that scans responses for outdated technologies
- For React prompts, specifically check for:
- References to Create React App (deprecated)
- Outdated React patterns (class components without hooks alternatives)
- Outdated package versions
- Weekly cron job to re-evaluate prompts (implementation outside of frontend)
User Interface #
- Responsive design that works well on mobile and desktop
- Implement collapsible sections for prompt outputs
- Clear visual hierarchy with prompt text prominently displayed
- Playful, slightly snarky design aesthetic
Component Breakdown #
<App /> #
- Main application container
- Handles routing (if expanded in the future)
<PromptList /> #
- Displays all prompts for a given technology
- Handles grouping by technology
<PromptCard /> #
- Displays individual prompt with its evaluation
- Props:
prompt: Prompt objectlatestEvaluation: Most recent evaluation object
<CollapsibleOutput /> #
- Toggleable component to show/hide the full output
- Props:
output: String containing the full responseisOpen: Boolean to control visibilityonToggle: Function to handle open/close
<EvaluationBadge /> #
- Displays the score and grade
- Props:
score: Number (0-100)grade: String ("S" through "F")
Data Flow #
- Data is pre-fetched from Convex during build time
- Static pages are generated with all prompt and evaluation data
- User interactions (like expanding collapsible sections) are handled client-side
- No data mutations occur on the frontend
Error Handling #
-
Data Loading Errors:
- Implement fallback UI for missing data
- Log build errors during static generation
-
UI Error Boundaries:
- Implement React Error Boundaries around key components
- Provide user-friendly error states
-
Missing Data Handling:
- Gracefully handle missing fields in prompt or evaluation objects
- Provide default values where appropriate
Performance Considerations #
-
Image Optimization:
- Optimize any images used in the UI
- Implement lazy loading for images
-
Code Splitting:
- Split code by route/component for faster initial load
-
Static Generation:
- Pre-render all pages at build time for optimal performance
Accessibility Requirements #
- Ensure proper contrast ratios for text readability
- Implement proper ARIA attributes for interactive elements
- Ensure keyboard navigation works for all interactive elements
- Test with screen readers
Testing Plan #
Unit Tests #
- Test individual components with Jest and React Testing Library
- Focus on component rendering and state changes
- Mock data for consistent test results
Component Tests #
- Test component interactions (e.g., collapsible sections)
- Verify proper rendering of evaluation data
Accessibility Tests #
- Run automated accessibility tests (Axe, Lighthouse)
- Perform manual keyboard navigation testing
Responsive Tests #
- Test on multiple viewport sizes
- Verify breakpoints work as expected
Development Workflow #
- Set up project with React and Tanstack Start
- Implement core components with mock data
- Style with Tailwind and Shadcn
- Connect to Convex data source
- Implement responsive design
- Test thoroughly
- Deploy to Netlify
Future Expansion Considerations #
While not part of the MVP, the architecture should accommodate:
- Additional technology categories beyond React
- Historical data visualization
- Search and filtering capabilities
- LLM-generated commentary
Deliverables #
-
Source code repository with:
- Complete React application
- README with setup instructions
- Build configuration for Netlify
-
Deployment to Netlify with:
- Production build
- Proper environment configuration
- Build hooks for future updates
This specification provides all necessary details for a developer to implement the Prompt Evaluation Website as discussed. The architecture is designed to be simple yet expandable, focusing on delivering a high-quality MVP that can grow over time.