mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-30 14:52:55 +08:00
rename folder
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Rules for ensuring accessibility in Astro components, including semantic HTML and ARIA attributes.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
Accessibility
|
||||
|
||||
- Ensure proper semantic HTML structure in Astro components.
|
||||
- Implement ARIA attributes where necessary.
|
||||
- Ensure keyboard navigation support for interactive elements.
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: Rules for building and deploying Astro projects, including environment variable handling and CI/CD pipelines.
|
||||
globs: astro.config.mjs
|
||||
---
|
||||
Build and Deployment
|
||||
|
||||
- Optimize the build process using Astro's build command.
|
||||
- Implement proper environment variable handling for different environments.
|
||||
- Use static hosting platforms compatible with Astro (Netlify, Vercel, etc.).
|
||||
- Implement proper CI/CD pipelines for automated builds and deployments.
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: Rules for Astro component development including proper composition and props.
|
||||
globs: src/components/**/*.astro
|
||||
---
|
||||
Component Development
|
||||
|
||||
- Create .astro files for Astro components.
|
||||
- Use framework-specific components (React, Vue, Svelte) when necessary.
|
||||
- Implement proper component composition and reusability.
|
||||
- Use Astro's component props for data passing.
|
||||
- Leverage Astro's built-in components like when appropriate.
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Rules for content management using Markdown and MDX files in Astro.
|
||||
globs: src/content/**/*.{md,mdx}
|
||||
---
|
||||
Content Management
|
||||
|
||||
- Use Markdown (.md) or MDX (.mdx) files for content-heavy pages.
|
||||
- Leverage Astro's built-in support for frontmatter in Markdown files.
|
||||
- Implement content collections for organized content management.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: Rules for data fetching in Astro using Astro.props, getStaticPaths(), and Astro.glob().
|
||||
globs: src/**/*.*
|
||||
---
|
||||
Data Fetching
|
||||
|
||||
- Use Astro.props for passing data to components.
|
||||
- Implement getStaticPaths() for fetching data at build time.
|
||||
- Use Astro.glob() for working with local files efficiently.
|
||||
- Implement proper error handling for data fetching operations.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: General rules and principles for developing with Astro framework.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
- You are an expert in JavaScript, TypeScript, and Astro framework for scalable web development.
|
||||
|
||||
Key Principles
|
||||
|
||||
- Write concise, technical responses with accurate Astro examples.
|
||||
- Leverage Astro's partial hydration and multi-framework support effectively.
|
||||
- Prioritize static generation and minimal JavaScript for optimal performance.
|
||||
- Use descriptive variable names and follow Astro's naming conventions.
|
||||
- Organize files using Astro's file-based routing system.
|
||||
- Refer to Astro's official documentation for detailed information on components, routing, and integrations for best practices.
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Rules for utilizing Astro integrations and plugins, configured in astro.config.mjs.
|
||||
globs: astro.config.mjs
|
||||
---
|
||||
Integrations and Plugins
|
||||
|
||||
- Utilize Astro integrations for extending functionality (e.g., @astrojs/image).
|
||||
- Implement proper configuration for integrations in astro.config.mjs.
|
||||
- Use Astro's official integrations when available for better compatibility.
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
---
|
||||
description: Rules for performance optimization in Astro, emphasizing static generation and partial hydration.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
Performance Optimization
|
||||
|
||||
- Minimize use of client-side JavaScript; leverage Astro's static generation.
|
||||
- Use the client:* directives judiciously for partial hydration:
|
||||
- client:load for immediately needed interactivity
|
||||
- client:idle for non-critical interactivity
|
||||
- client:visible for components that should hydrate when visible
|
||||
- Implement proper lazy loading for images and other assets.
|
||||
- Utilize Astro's built-in asset optimization features.
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: Enforce the recommended Astro project structure.
|
||||
globs: astro.config.mjs
|
||||
---
|
||||
Astro Project Structure
|
||||
|
||||
- Use the recommended Astro project structure:
|
||||
- src/
|
||||
- components/
|
||||
- layouts/
|
||||
- pages/
|
||||
- styles/
|
||||
- public/
|
||||
- astro.config.mjs
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: Rules for utilizing Astro's file-based routing system and dynamic routes.
|
||||
globs: src/pages/**/*.astro
|
||||
---
|
||||
Routing and Pages
|
||||
|
||||
- Utilize Astro's file-based routing system in the src/pages/ directory.
|
||||
- Implement dynamic routes using [...slug].astro syntax.
|
||||
- Use getStaticPaths() for generating static pages with dynamic routes.
|
||||
- Implement proper 404 handling with a 404.astro page.
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Rules for SEO and meta tag implementation in Astro using the <head> tag and canonical URLs.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
SEO and Meta Tags
|
||||
|
||||
- Use Astro's <head> tag for adding meta information.
|
||||
- Implement canonical URLs for proper SEO.
|
||||
- Use the <SEO> component pattern for reusable SEO setups.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: Rules for styling in Astro using scoped styles, global styles, and CSS preprocessors.
|
||||
globs: src/styles/**/*.astro
|
||||
---
|
||||
Styling
|
||||
|
||||
- Use Astro's scoped styling with tags in .astro files.
|
||||
- Leverage global styles when necessary, importing them in layouts.
|
||||
- Utilize CSS preprocessing with Sass or Less if required.
|
||||
- Implement responsive design using CSS custom properties and media queries.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: Key coding conventions for Astro projects including style guide and typescript.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
Key Conventions
|
||||
|
||||
1. Follow Astro's Style Guide for consistent code formatting.
|
||||
2. Use TypeScript for enhanced type safety and developer experience.
|
||||
3. Implement proper error handling and logging.
|
||||
4. Leverage Astro's RSS feed generation for content-heavy sites.
|
||||
5. Use Astro's Image component for optimized image delivery.
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Performance metrics rules including Core Web Vitals, Lighthouse and WebPageTest.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
Performance Metrics
|
||||
|
||||
- Prioritize Core Web Vitals (LCP, FID, CLS) in development.
|
||||
- Use Lighthouse and WebPageTest for performance auditing.
|
||||
- Implement performance budgets and monitoring.
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
---
|
||||
description: Best practices for using Tailwind CSS within Astro components.
|
||||
globs: src/**/*.*
|
||||
---
|
||||
Tailwind CSS Best Practices
|
||||
|
||||
- Use Tailwind utility classes extensively in your Astro components.
|
||||
- Leverage Tailwind's responsive design utilities (sm:, md:, lg:, etc.).
|
||||
- Utilize Tailwind's color palette and spacing scale for consistency.
|
||||
- Implement custom theme extensions in tailwind.config.cjs when necessary.
|
||||
- Never use the @apply directive
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
description: Rules for integrating Tailwind CSS with Astro using @astrojs/tailwind.
|
||||
globs: astro.config.mjs
|
||||
---
|
||||
Styling with Tailwind CSS
|
||||
|
||||
- Integrate Tailwind CSS with Astro @astrojs/tailwind
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
description: Rules for testing Astro projects, including unit tests and end-to-end testing.
|
||||
globs: tests/**/*.*
|
||||
---
|
||||
Testing
|
||||
|
||||
- Implement unit tests for utility functions and helpers.
|
||||
- Use end-to-end testing tools like Cypress for testing the built site.
|
||||
- Implement visual regression testing if applicable.
|
||||
Reference in New Issue
Block a user