--- name: rasengan-optimizing description: Optimization patterns for Rasengan.js. Covers static assets via the public/ directory, asset handling best practices, and performance optimization. Use when managing static files, serving assets, or optimizing resource delivery in a Rasengan.js project. license: MIT metadata: author: dilane3 framework: rasengan version: '1.0.0' --- # Rasengan.js Optimization Patterns ## When to Activate - Serving static files (images, fonts, icons) from the `public/` directory - Referencing assets in components or templates - Optimizing images and static resources for production - Configuring metadata for SEO (title, description, Open Graph, Twitter) - Enabling React Compiler via Sage Mode for automatic memoization ## Static Assets — public/ Directory Any file placed inside the `public/` directory is automatically served at the base URL (`/`). No imports or special loaders needed. ### File Placement ``` public/ ├── favicon.ico ├── robots.txt ├── og-image.png └── avatars/ └── 1.png ``` ### Referencing in Code ```tsx // Public assets use root-relative paths Avatar; // With @rasenganjs/image import { Image } from '@rasenganjs/image'; Avatar; ``` ```tsx // In the HTML template (src/template.tsx) import { type TemplateProps } from 'rasengan'; export default function Template({ Head, Body, Script }: TemplateProps) { return (