|
| 1 | +# GitHub Copilot Custom Instructions |
| 2 | + |
| 3 | +## Project Context |
| 4 | +You are working on CodeStorm Hub's portfolio website - a modern Next.js 15 application showcasing open source community projects. The codebase emphasizes clean architecture, accessibility, and performance following Vercel's design engineering principles and Radix UI's design system philosophy. |
| 5 | + |
| 6 | +## Design Engineering Principles |
| 7 | + |
| 8 | +### Vercel-Inspired Design Engineering |
| 9 | +- **Systems Thinking**: Every component is part of a larger design system |
| 10 | +- **Performance-First Design**: Visual excellence never compromises performance |
| 11 | +- **Progressive Enhancement**: Build accessible foundations, enhance with advanced features |
| 12 | +- **Content-First Approach**: Design serves content and user goals |
| 13 | +- **Atomic Design**: Build from atoms → molecules → organisms → templates → pages |
| 14 | + |
| 15 | +### Radix UI Philosophy |
| 16 | +- **Unstyled Primitives**: Use Radix UI primitives as accessible foundations |
| 17 | +- **Composition over Configuration**: Build complex components by composing simpler ones |
| 18 | +- **Polymorphic Design**: Components adapt to different contexts and use cases |
| 19 | +- **Accessible by Default**: Every component meets WCAG 2.1 AA standards |
| 20 | +- **Compound Components**: Related components work together seamlessly |
| 21 | + |
| 22 | +## Key Development Principles |
| 23 | + |
| 24 | +### Code Style & Architecture |
| 25 | +- **Always use TypeScript**: Every file should be properly typed |
| 26 | +- **Functional Components**: Prefer React functional components with hooks |
| 27 | +- **App Router**: Use Next.js 15 App Router patterns (not Pages Router) |
| 28 | +- **Component Composition**: Build reusable components following established patterns |
| 29 | +- **Utility-First CSS**: Use Tailwind CSS classes, avoid custom CSS when possible |
| 30 | + |
| 31 | +### Technology Preferences |
| 32 | +- **UI Foundation**: Radix UI primitives for accessible, unstyled components |
| 33 | +- **Styling System**: Tailwind CSS 4 with design tokens and utility-first approach |
| 34 | +- **Typography**: Geist Sans and Geist Mono font families for optimal readability |
| 35 | +- **Color System**: Radix Colors for semantic, accessible color palettes |
| 36 | +- **Icons**: Lucide React icons with consistent sizing and styling |
| 37 | +- **State Management**: React hooks, Context API, and Zustand for complex state |
| 38 | +- **Animation**: Framer Motion for smooth, purposeful animations |
| 39 | +- **Layout**: CSS Grid and Flexbox with container queries for responsive design |
| 40 | +- **Performance**: Next.js optimizations (Image, Link, dynamic imports) |
| 41 | +- **Testing**: Component testing with accessibility validation |
| 42 | + |
| 43 | +### File and Folder Conventions |
| 44 | +- **Components**: Place in `src/components/[category]/component-name.tsx` |
| 45 | +- **Pages**: Use App Router in `src/app/[route]/page.tsx` |
| 46 | +- **Utilities**: Add to `src/lib/utils.ts` or create specific utility files |
| 47 | +- **Types**: Define in component files or separate `.types.ts` files |
| 48 | +- **Naming**: kebab-case for files, PascalCase for components, camelCase for variables |
| 49 | + |
| 50 | +### Quality Standards |
| 51 | +- **Accessibility**: WCAG 2.1 AA compliance with proper ARIA attributes and semantic HTML |
| 52 | +- **Performance**: Core Web Vitals optimization (LCP < 2.5s, FID < 100ms, CLS < 0.1) |
| 53 | +- **SEO**: Comprehensive metadata, OpenGraph tags, and structured data |
| 54 | +- **Mobile-First**: Responsive design starting from 320px viewport width |
| 55 | +- **Cross-Browser**: Support for modern browsers with graceful degradation |
| 56 | +- **Error Handling**: Comprehensive error boundaries and loading states |
| 57 | +- **Type Safety**: Strict TypeScript with proper interface definitions |
| 58 | +- **Code Quality**: ESLint, Prettier, and Husky for consistent code standards |
| 59 | +- **Documentation**: Storybook stories for components with usage examples |
| 60 | +- **Testing**: Unit tests for utilities, integration tests for user flows |
| 61 | + |
| 62 | +### Common Patterns to Follow |
| 63 | + |
| 64 | +#### Component Structure |
| 65 | +```tsx |
| 66 | +interface ComponentProps { |
| 67 | + // Define props with proper TypeScript |
| 68 | +} |
| 69 | + |
| 70 | +export default function Component({ ...props }: ComponentProps) { |
| 71 | + // Component logic |
| 72 | + return ( |
| 73 | + // JSX with proper accessibility |
| 74 | + ) |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | +#### Page Structure |
| 79 | +```tsx |
| 80 | +import type { Metadata } from 'next' |
| 81 | + |
| 82 | +export const metadata: Metadata = { |
| 83 | + title: 'Page Title', |
| 84 | + description: 'Page description', |
| 85 | +} |
| 86 | + |
| 87 | +export default function Page() { |
| 88 | + return ( |
| 89 | + // Page content |
| 90 | + ) |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +### Development Workflow |
| 95 | +1. **Before coding**: Understand existing patterns in the codebase |
| 96 | +2. **While coding**: Follow TypeScript strict mode, use proper typing |
| 97 | +3. **Testing**: Run `npm run lint` and `npm run build` before committing |
| 98 | +4. **Documentation**: Update relevant docs if adding new patterns |
| 99 | + |
| 100 | +### Specific to This Project |
| 101 | +- **Design System**: Follow Radix UI and Vercel design engineering principles |
| 102 | +- **Brand Identity**: CodeStorm Hub's technical, modern, and community-focused aesthetic |
| 103 | +- **Content Strategy**: Showcase open source projects and community achievements |
| 104 | +- **Performance Goals**: Fast loading, smooth interactions, excellent Core Web Vitals |
| 105 | +- **Accessibility Priority**: Ensure all users can access and navigate the content |
| 106 | +- **Developer Experience**: Clean, maintainable code that's easy to contribute to |
| 107 | + |
| 108 | +## UI Patterns & Design Guidelines |
| 109 | + |
| 110 | +### Layout Patterns |
| 111 | +- **Hero Sections**: Full-width with compelling visuals and clear CTAs |
| 112 | +- **Card Grids**: Consistent spacing, hover effects, and responsive layouts |
| 113 | +- **Navigation**: Clean, accessible navigation with proper focus management |
| 114 | +- **Footer**: Organized links, social media, and legal information |
| 115 | +- **Content Sections**: Proper spacing, typography hierarchy, and readability |
| 116 | + |
| 117 | +### Component Design Patterns |
| 118 | +- **Button Variants**: Primary, secondary, ghost, and destructive styles |
| 119 | +- **Form Components**: Accessible inputs with proper validation states |
| 120 | +- **Modal Dialogs**: Radix Dialog with proper focus trapping and escape handling |
| 121 | +- **Dropdown Menus**: Radix DropdownMenu with keyboard navigation |
| 122 | +- **Toast Notifications**: Non-intrusive feedback with appropriate timing |
| 123 | +- **Loading States**: Skeleton loaders and progress indicators |
| 124 | +- **Empty States**: Helpful messaging with clear next steps |
| 125 | + |
| 126 | +### Animation & Interaction |
| 127 | +- **Micro-interactions**: Subtle feedback for user actions |
| 128 | +- **Page Transitions**: Smooth navigation between routes |
| 129 | +- **Hover Effects**: Consistent hover states across interactive elements |
| 130 | +- **Loading Animations**: Non-distracting progress indicators |
| 131 | +- **Scroll Animations**: Progressive disclosure and parallax effects |
| 132 | +- **Gesture Support**: Touch-friendly interactions for mobile devices |
| 133 | + |
| 134 | +## Avoid These Common Mistakes |
| 135 | +- Don't use `any` type in TypeScript |
| 136 | +- Don't create custom CSS when Tailwind utilities exist |
| 137 | +- Don't ignore accessibility requirements |
| 138 | +- Don't bypass Next.js optimizations (use Image, Link components) |
| 139 | +- Don't create components without proper TypeScript interfaces |
| 140 | +- Don't forget to handle loading and error states |
| 141 | +- Don't use outdated Next.js patterns (Pages Router style) |
| 142 | + |
| 143 | +## When Suggesting Code Changes |
| 144 | +1. **Maintain consistency** with existing codebase patterns |
| 145 | +2. **Provide complete examples** that can be directly used |
| 146 | +3. **Include proper TypeScript types** in all suggestions |
| 147 | +4. **Consider accessibility** in component suggestions |
| 148 | +5. **Optimize for performance** using Next.js best practices |
| 149 | +6. **Follow the established file structure** and naming conventions |
| 150 | + |
| 151 | +Remember: This is a showcase project for a developer community, so code quality, accessibility, and performance are paramount. |
0 commit comments