Development Prompts
đ¤ Purpose: Copy-paste prompts for component creation, performance optimization, and architecture decisions
Component Creation Prompts
Section titled âComponent Creation PromptsâBasic Component
Section titled âBasic ComponentâCreate an Astro component called [ComponentName] that:- Has TypeScript props interface- Uses our design tokens from tokens/base.json- Is fully accessible with proper ARIA labels- Works without JavaScript- Follows our atomic design pattern- Includes these props: [list props]- Has these variants: [list variants]
Reference our Button component pattern from phase-5-components.mdInteractive Component
Section titled âInteractive ComponentâCreate an Astro component with optional interactivity:- Name: [ComponentName]- Static by default (zero JS)- Progressive enhancement with Alpine.js for: [interaction details]- Use client:visible directive if needed- Follow islands architecture from patterns/islands-architecture.md- Maintain all functionality without JavaScript- Include keyboard navigation- Test with screen readers
Performance budget: < 5KB JavaScriptComplex Layout Component
Section titled âComplex Layout ComponentâBuild a [SectionName] section component that:- Uses our Container and Section structural components- Responsive with our Grid component- Follows mobile-first approach- Uses semantic HTML structure- Includes these content areas: [list areas]- Has these responsive breakpoints: [list breakpoints]- References design tokens for spacing/colors
See phase-6-sections.md for section patternsContent Modeling Prompts
Section titled âContent Modeling PromptsâContent Collection Schema
Section titled âContent Collection SchemaâCreate an Astro content collection schema for [ContentType]:- Use Zod for validation- Include these required fields: [list fields]- Include these optional fields: [list fields]- Add draft: boolean field (default: false)- Add proper TypeScript types- Include image field using Astro's image helper- Add any computed fields needed- Reference our blog schema in phase-1-content-arch.md
Consider future content needs and extensibilityMDX Component
Section titled âMDX ComponentâCreate an MDX component for [Purpose]:- Accepts these props: [list props]- Handles this content: [describe content]- Works in our MDX component system- Includes proper TypeScript types- Handles edge cases (empty state, errors)- Is accessible and semantic- Can be used like: <ComponentName prop="value" />
Follow MDX patterns from content-collections.mdPerformance Optimization Prompts
Section titled âPerformance Optimization PromptsâImage Optimization
Section titled âImage OptimizationâOptimize images in [Component/Page]:- Use Astro's <Image> component- Generate AVIF and WebP formats- Include proper sizes attribute- Add loading="lazy" except above fold- Set width and height to prevent CLS- Use our OptimizedImage wrapper pattern- Keep images under 200KB after optimization
Reference performance-patterns.md for examplesBundle Size Reduction
Section titled âBundle Size ReductionâReduce JavaScript bundle size for [Feature]:- Current size: [X]KB- Target size: < [Y]KB- Identify unused imports- Use dynamic imports where appropriate- Consider CSS-only alternatives- Implement progressive enhancement- Stay within our 160KB total JS budget
See budgets-guardrails.md for limitsLighthouse Score Improvement
Section titled âLighthouse Score ImprovementâImprove Lighthouse scores for [Page]:- Current scores: [list scores]- Target: 97+ performance, 98+ accessibility- Focus on: [specific metrics like LCP, CLS]- Check against our performance budgets- Implement resource hints- Optimize critical rendering path- Add performance monitoring
Reference phase-9-performance.mdTesting & Quality Prompts
Section titled âTesting & Quality PromptsâAccessibility Audit
Section titled âAccessibility AuditâAudit [Component/Page] for accessibility:- Test with keyboard navigation only- Check color contrast (4.5:1 minimum)- Verify screen reader compatibility- Ensure proper heading hierarchy- Check focus indicators- Test with assistive technologies- Validate semantic HTML structure- Ensure alt text on images
Must meet WCAG AA standards from budgets-guardrails.mdE2E Test Creation
Section titled âE2E Test CreationâWrite Playwright E2E test for [Feature]:- Test happy path: [describe flow]- Test error states- Test on mobile and desktop viewports- Include accessibility checks with axe-core- Test without JavaScript enabled- Measure performance impact- Follow our testing patterns
See phase-8-qa.md for test structureArchitecture & Patterns Prompts
Section titled âArchitecture & Patterns PromptsâIsland Architecture Decision
Section titled âIsland Architecture DecisionâHelp me decide if [Feature] needs JavaScript:- Current functionality: [describe what it does]- User interaction: [describe interactions]- Options to consider: 1. Pure CSS solution 2. View Transitions only 3. Alpine.js island (client:visible) 4. Preact island (complex state)
Factors: performance budget, maintenance, user experienceReference islands-architecture.md patternsDesign System Integration
Section titled âDesign System IntegrationâIntegrate [Feature] with our design system:- Use semantic tokens from tokens/base.json- Follow component naming conventions- Ensure dark mode compatibility- Check responsive behavior- Add proper TypeScript types- Include accessibility features- Document usage patterns- Create component story (Showcase track only)
Reference design-system.md token structurePerformance Pattern Implementation
Section titled âPerformance Pattern ImplementationâImplement [Pattern] for better performance:- Current metric: [value]- Target metric: [value]- Pattern to implement: [lazy loading, code splitting, etc.]- Expected improvement: [estimate]- Implementation approach: [details]- How to measure success- Rollback plan if it fails
Follow patterns from performance-patterns.mdQuick Fixes
Section titled âQuick FixesâAdd Dark Mode Support
Section titled âAdd Dark Mode SupportâAdd dark mode support to [Component]:- Use our semantic color tokens- Add dark: variants in Tailwind- Test contrast in both modes- Respect system preferences- No flash of wrong theme- Reference design-system.md tokensMake Component Responsive
Section titled âMake Component ResponsiveâMake [Component] responsive:- Mobile-first approach- Use our breakpoint system- Test at 320px, 768px, 1024px, 1440px- Use Grid component for layouts- Container queries if needed- No horizontal scroll at any sizeImprove SEO
Section titled âImprove SEOâImprove SEO for [Page]:- Add proper meta tags- Use semantic HTML- Add structured data if relevant- Optimize images with alt text- Check heading hierarchy- Add OpenGraph tags- Update sitemap- Reference BaseLayout meta setupUsage Tips
Section titled âUsage Tipsâ- Always provide context about your current phase and track
- Reference specific files from the implementation guides
- Include current metrics when asking for optimization
- Mention constraints like bundle size or browser support
- Ask for rollback plans when making significant changes
Remember: These templates are starting points. Customize based on your specific needs and always reference the relevant implementation guide phase.