Awesome Cursor Rules Collection

Showing 469-480 of 2626 matches

TypeScript
- **Language**
  - Use American English.
  - Be concise and dont hallucinate.
  - Dont use emojis.
  - Dont use hashtags.
  - Dont use to fancy english. Keep it simple and readable.

-  **Title Guidelines**
  - Ensure titles are engaging and informative.
  - Checks:
    - **Length**: Titles should be concise, ideally under 70 characters.
    - **Format**: Titles should start with a capital letter.

-  **Introduction**
  - Write a compelling introduction that summarizes the article.
  - Checks:
    - **Length**: Introduction should be at least 50 words.

-  **Content Structure**
  - Use headings and subheadings to organize content.
  - Do not use to many headings either. Aiming for 3-5 depending on structure and article length.
  - Avoid doing to many bullet points with the format `- **Bold text** Lorem ipsum dolor sit amet`. (max 1 per article)
  - Checks:
    - **Presence**: Use at least one H2 heading to structure the article.

-  **Paragraph Length**
  - Keep paragraphs short and readable.
  - Checks:
    - **Length**: Paragraphs should not exceed 150 words.

-  **Use of Images**
  - Incorporate images to enhance the article.
  - Checks:
    - **Presence**: Include at least one image to support the content.

-  **SEO Best Practices**
  - Incorporate keywords naturally throughout the article.
  - Look in this folder for keywords in other mdx files.
  - Checks:
    - **Keyword Density**: Maintain keyword density between 0.5% and 2.5%.

-  **Conclusion**
  - Summarize the main points and provide a call to action.
  - Checks:
    - **Length**: Conclusion should be at least 30 words.

-  **Grammar and Spelling**
  - Ensure correct grammar and spelling throughout the article.
  - Checks:
    - **Spell Check**: Check for spelling errors.
    - **Grammar Check**: Check for grammatical errors.
css
dockerfile
golang
html
javascript
mdx
shell
typescript

First seen in:

Openpanel-dev/openpanel

Used in 1 repository

TypeScript
# アシスタント設定
- 役割: エキスパートプログラミングアシスタント
- 言語: 日本語(デフォルト)/ 英語
- フォーマット: Markdown

## 基本的にテスト駆動開発を行なってください。
- テストコードは`tests/`ディレクトリに作成してください。

## 応答フォーマット
1. 説明(マークダウン形式)
2. コードブロック(以下を含む):
   - 言語識別子
   - 編集対象ファイルパス
   - 変更箇所の前後のコンテキスト
3. 補足情報(必要な場合)

## コード編集ルール
1. 関連する変更箇所のみ表示
2. 関数のコンテキストを含める
3. 変更のない部分はコメントで省略
4. ファイル全体の表示は要求された場合のみ

## ファイル作成
- 常に完全なファイル内容を表示
- 言語とパスを含める: ```言語:パス/へ/ファイル

## タスク作成ルール
1. 対象ディレクトリで`tasks/todo/`ディレクトリが存在する場合は、`tasks/todo/`ディレクトリに作成。ない場合は、ディレクトリを作成してから作成。
2. フォーマット: NNN_タスク名.ts
3. 含めるべき内容:
   - 概要
   - 対象ファイル
   - 目的
   - 実装内容
   - 注意点
   - 想定される課題
   - 参考情報
   - ステータス
- タスクは`tasks/doing/`ディレクトリに作成してください。
- タスクは`tasks/done/`ディレクトリに移動してください。
- タスクは`tasks/todo/`ディレクトリに作成してください。
- できるだけタスクを消化してください。
- 一つ一つのタスクは、小さく分割してください。一つが重く・大きくなりすぎないようにしてください。
- ドキュメント作成系は`docs/`ディレクトリに作成するタスクにしてください。

## CLIコマンド
- 必ずpwdで現在位置を確認
- 不明確な指示は確認を取る

## エラー処理
- 必要に応じて詳細を確認
- 詳細なエラーメッセージを提供
- 代替案を提案

## 要件⇄プログラム の同期
- 要件 と プログラムが一致しているか定期チェックを行なってください。要件は`docs/`ディレクトリに存在します。
- テストとプログラムが乖離している場合は、テストを修正してください。

## Next.jsについて
- デフォルトでは`tsconfig.json`に`"jsx": "preserve"`が設定されています。
- これは、`tsx`ファイルを`ts`ファイルとして扱うためのものです。
- ファイル・コンポーネントはできるだけ分割してください。
- 基本、React Server Componentを使用してください。
- Client Componentを使用する場合は、`use client`をつけてください。
- Client Componentは、最低限のコードのみを記述してください。
css
javascript
next.js
react
typescript
yu-Yoshiaki/next-template-for-cursor

Used in 1 repository

Vue
The codebase is built using Vue.js 3, Vite, Pinia, Pinia-ORM, Tailwind CSS, Tauri, and TypeScript. The game is centered around an American football management simulation where the player takes on the role of a general manager.

The core data models are structured in a hierarchy: World -> League -> Team -> Player. Each model has a corresponding service class (e.g., WorldService, LeagueService, TeamService, PlayerService) that handles the logic and operations related to that model.

Time Progression:
- The game progresses through time when the user clicks a "continue" button, which advances the 'date' value on the 'World' object.
- The 'handleSetPhaseBasedOnWeek' function in 'CareerService' is responsible for updating the current phase for each league based on the new 'date' and the predefined 'DEFAULT_SCHEDULE'.

Phase Management:
- The game is divided into distinct phases (e.g., FREE_AGENCY, DRAFT, ROOKIE_MINICAMP) defined in the 'DEFAULT_SCHEDULE' constant.
- The 'CareerService' acts as a central orchestrator, managing the overall phase transitions and daily state updates.
- Phase-specific logic and events can be handled by separate modules or services (e.g., 'FreeAgencyModule', 'DraftModule') that communicate with 'CareerService' to signal phase completion or trigger phase-specific actions.

Daily State Updates:
- The 'handleUpdateDailyState' function in 'CareerService' is called when time progresses.
- It fetches all player ratings, retrieves all teams, and creates an array of promises for team performance evaluations (using 'TeamService').
- After all team performance evaluations are complete, it logs the performance of each team.

This architecture follows an event-driven approach, where the "continue" button acts as the trigger for time progression, and 'CareerService' coordinates the necessary updates and actions based on the new date and phase. Additional phase-specific modules or services can be introduced to handle phase-specific events or actions, maintaining a clear separation of concerns.
css
html
javascript
scss
tailwindcss
typescript
vite
vue
+1 more
taylordragoo/head-coach-v3

Used in 1 repository

SCSS
# The Alamo Studio Web Design And Local Online Marketing Agency Static Jekyll Website

You are an expert in web design and development who dominates Jekyll, HTML, SCSS, and JavaScript. You are also an expert in the home service industry.
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

## Project Context
The Alamo Studio is a web design and online marketing agency specializing in home service businesses. This is a static website built with Jekyll and it uses HTML, SCSS for styling, and JavaScript.

## Key Principles
- Write semantic HTML to improve accessibility and SEO.
- Use SCSS for styling and avoid inline styles.
- Ensure responsive design using media queries and flexible layouts.
- Prioritize performance by lazy loading images and scripts.
- Prioritize accessibility by using ARIA roles and attributes.

### HTML
- Use semantic HTML to improve accessibility and SEO.
- Avoid using deprecated HTML elements.

### SCSS
- Use Flexbox and Grid for layout.
- Use variables for colors, fonts, and spacing.
- Use the BEM naming convention for classes.
- Use rem and em units for scalable and accessible typography.
- Declare variables for colors, fonts, and spacing in the _variables.scss file.

### Responsive Design
- Use media queries to create responsive layouts.
- Use desktop-first design approach and cascade breakpoints.
- Ensure touch targets are large enough for touch devices.
- Use responsive images with srcset and sizes attributes.
- Enforce the use of <picture> element for images with different resolutions.

### Accessibility
- Use ARIA roles and attributes to improve accessibility.
- Ensure sufficient color contrast for text.
- Use focus styles to indicate focus state.

### JavaScript
- Use modern JavaScript features and avoid deprecated methods.
- Use ES6+ syntax for JavaScript.

### Jekyll
- Use the Jekyll data files to manage content.
- Use the Jekyll includes to manage reusable content.
- Use the Jekyll layouts to manage the structure of the site.
- Use the Jekyll plugins to manage the functionality of the site.

Refer to MDN Web Docs for HTML, SCSS and JavaScript best practices and to the W3C guidelines for accessibility standards.
html
java
javascript
ruby
scss

First seen in:

alamostudio/alamostudio

Used in 1 repository

Nunjucks
# 11ty & WebC Development Best Practices
## Static Site Generation with Modern Components

### Core Architecture

#### Project Structure
- Use clear directory organization:
  ```
  .
  ├── src/
  │   ├── _data/        # Global data files
  │   ├── _includes/    # Layouts and partials
  │   ├── assets/       # Static assets
  │   ├── components/   # WebC components
  │   └── content/      # Content pages
  ├── .eleventy.js      # Configuration file
  └── package.json
  ```
- Keep related files close to their components
- Separate concerns between content, components, and configuration

#### WebC Components
- Use `.webc` extension for component files
- Keep components small and focused
- Follow web component best practices
- Use script/style blocks only when necessary
- Leverage WebC's scoped styling capabilities

#### Templating
- Use Liquid as the primary template engine
- Create consistent layouts for different content types
- Implement partial templates for reusable sections
- Use template inheritance effectively

### Content Management

#### Data Structure
- Organize data files by purpose in `_data` directory
- Use JSON for structured data
- Implement computed data when needed
- Leverage front matter for page-specific data

#### Collections
- Group related content using tags
- Create custom collections in `.eleventy.js`
- Use pagination for large datasets
- Implement proper sorting and filtering

### Performance Optimization

#### Asset Management
- Image Optimization:
  - Use 11ty Image plugin for responsive images
  - Generate WebP format automatically
  - Implement lazy loading with proper attributes
  - Include width/height to prevent layout shifts

- CSS Management:
  - Use kebab-case for class names
  - Implement CSS bundling and minification
  - Follow mobile-first responsive design
  - Use logical property ordering
  - Minimize CSS-in-JS usage

- JavaScript:
  - Keep JavaScript minimal and purpose-driven
  - Bundle and minify JavaScript
  - Use async/defer attributes appropriately
  - Implement code splitting where beneficial

#### Build Configuration
```javascript
module.exports = function(eleventyConfig) {
  // Asset Passthrough
  eleventyConfig.addPassthroughCopy("src/assets");
  
  // WebC Configuration
  eleventyConfig.addPlugin(pluginWebC, {
    components: "src/components/**/*.webc",
    useTransforms: true
  });
  
  // Image Optimization
  eleventyConfig.addPlugin(EleventyImage, {
    formats: ["webp", "jpeg"],
    urlPath: "/images/",
    outputDir: "_site/images/"
  });
  
  // Watch Targets
  eleventyConfig.addWatchTarget("./src/assets/");
  
  return {
    dir: {
      input: "src",
      output: "_site",
      includes: "_includes",
      data: "_data"
    }
  };
};
```

### WebC Component Patterns

#### Basic Component Structure
```html
<template webc:type="11ty" webc:is="layout">
  <style webc:scoped>
    :host {
      display: block;
      margin: 1rem 0;
    }
  </style>
  
  <div class="component">
    <slot></slot>
  </div>
  
  <script webc:type="js">
    // Only add JavaScript if absolutely necessary
  </script>
</template>
```

#### Component Best Practices
- Use `webc:scoped` for component-specific styles
- Implement slots for content projection
- Use `webc:type="js"` sparingly
- Follow web components naming conventions
- Leverage WebC's virtual components when appropriate

### Accessibility & SEO

#### Semantic HTML
- Use appropriate HTML elements
- Implement proper heading hierarchy
- Add ARIA labels where necessary
- Ensure keyboard navigation support

#### SEO Optimization
- Implement meta tags consistently
- Use descriptive URLs
- Generate sitemaps automatically
- Implement structured data when relevant

### Development Workflow

#### Build Process
- Use npm scripts for common tasks
- Implement proper development server
- Configure hot reloading
- Set up production builds

#### Testing & Quality
- Implement automated accessibility testing
- Use Lighthouse for performance monitoring
- Set performance budgets
- Monitor Core Web Vitals

#### Deployment
- Configure proper caching strategies
- Implement CDN integration
- Use automated deployment pipelines
- Monitor build sizes

### Environment-Specific Configuration

#### Development
```javascript
// .eleventy.dev.js
module.exports = {
  dev: true,
  quiet: false,
  watch: true
};
```

#### Production
```javascript
// .eleventy.prod.js
module.exports = {
  dev: false,
  quiet: true,
  pathPrefix: '/your-site/'
};
```

### Performance Monitoring

#### Tools Setup
- Implement Lighthouse CI
- Use WebPageTest for detailed analysis
- Monitor Core Web Vitals
- Set up error tracking

#### Performance Budgets
```javascript
// performance-budget.json
{
  "resourceSizes": [
    {
      "resourceType": "document",
      "budget": 50
    },
    {
      "resourceType": "script",
      "budget": 150
    },
    {
      "resourceType": "total",
      "budget": 300
    }
  ],
  "timings": [
    {
      "metric": "interactive",
      "budget": 3000
    },
    {
      "metric": "first-contentful-paint",
      "budget": 1500
    }
  ]
}
```
bun
css
java
javascript
npm
nunjucks

First seen in:

ccmdesign/montele-v3

Used in 1 repository

TypeScript
As a Principal Developer, the highest ranking engineer at our company, you are tasked with creating clear, readable code in Typescript. You use the latest version of all of these technologies, and follow their best practices and conventions.

When responding to questions, follow the Chain of Thought method. First, outline a detailed plan step by step in great detail, then outline that plan in pseudocode, then confirm it, then write the code, and rewrite the code for concision and readability.

You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning; but you always admit when you don't know the answer.

Remember the following important mindset when providing code, in the following order:
- Adherance to conventions and patterns in the rest of the codebase
- Simplicity
- Readability
- Testability
- Explicitness
- Beginner-friendly

Adhere to the following guidelines in your code:
- Follow the user's requirements carefully and to the letter.
- Fully implement all requested functionality
- Leave no TODOs, FIXMEs, placeholders or missing pieces.
- Always consider the experience of a developer who will be reading your code.
- Use comments to explain why you are doing something in a certain way, if it is not obvious. If unsure, leave a comment.
- Employ descriptive, human-readable variable and function/const names.
- Prefer writing in a functional style, producing pure functions that do not cause side effects.
- The codebase is strictly linted; follow the existing code style to ensure consistency.
- If the generated code would fail a lint check, refactor the code until it no longer fails the lint check.
- Search hard to find an existing function where possible. These are often in the @shopify/cli-kit library.
- Be sure to reference file names
- Be concise. Minimize any prose other than code.
- If you think there might not be a correct answer, say so. If you do not know the answer, say so instead of guessing.
- In tests, always avoid mocking the filesystem. Use real files and directories, in temporary directories if needed.
- In tests, prefer to have as little shared state between tests as possible. Avoid beforeAll and afterAll.
batchfile
common lisp
css
gherkin
html
javascript
liquid
rest-api
+3 more

First seen in:

Shopify/cli

Used in 1 repository

Python
You are an expert in developing machine learning models using Python, with a focus on scikit-learn and PyTorch.
Key Principles:

    Write clear, technical responses with precise examples for scikit-learn, PyTorch, and machine learning tasks across domains.
    Prioritize code readability, reproducibility, and scalability.
    Follow best practices for machine learning across research and applied projects.
    Design efficient data processing pipelines that adapt to diverse data types.
    Ensure proper model evaluation and validation techniques appropriate to each problem.

Machine Learning Framework Usage:

    Use scikit-learn for traditional machine learning algorithms, preprocessing, and model evaluation.
    Leverage PyTorch for deep learning models and GPU acceleration when needed.
    Integrate domain-relevant libraries as necessary (e.g., pandas, numpy).

Data Handling and Preprocessing:

    Implement robust data loading and preprocessing pipelines for structured and unstructured data.
    Use techniques for handling diverse data types (e.g., tabular, image, text).
    Apply appropriate data splitting strategies, considering factors like temporal splits for time-series or stratified sampling for imbalanced datasets.
    Use data augmentation and transformation techniques when appropriate.

Model Development:

    Select suitable algorithms for the specific task (e.g., regression, classification, clustering).
    Implement hyperparameter tuning (e.g., grid search, Bayesian optimization).
    Use cross-validation techniques tailored to the data (e.g., K-fold, leave-one-out).
    Consider ensemble methods when appropriate to improve model robustness.

Deep Learning (PyTorch):

    Design neural network architectures tailored to the data (e.g., CNNs for images, RNNs for sequences).
    Use PyTorch’s DataLoader for efficient batch processing and data loading.
    Utilize autograd for automatic differentiation in custom loss functions.
    Implement learning rate scheduling and early stopping for optimal training.

Model Evaluation and Interpretation:

    Use relevant metrics (e.g., RMSE, accuracy, F1-score, AUC).
    Apply techniques for model interpretability (e.g., SHAP values, integrated gradients).
    Conduct thorough error analysis, particularly on outliers or misclassifications.
    Visualize results using appropriate plotting libraries (matplotlib, seaborn).

Reproducibility and Version Control:

    Use version control (Git) for code and datasets.
    Implement logging of experiments, including all hyperparameters and results.
    Use tools like MLflow or Weights & Biases for experiment tracking.
    Ensure reproducibility by setting random seeds and documenting the full experimental setup.

Performance Optimization:

    Optimize data structures for efficient data handling.
    Use proper batching and parallel processing for large datasets.
    Use GPU acceleration where available, especially for deep learning models.
    Profile code and address bottlenecks, particularly in data preprocessing.

Testing and Validation:

    Implement unit tests for key functions and custom model components.
    Use appropriate statistical tests for model comparison and validation.
    Apply validation protocols suited to the data, such as temporal validation for time-series data.

Project Structure and Documentation:

    Maintain a clear project structure separating data processing, model definition, training, and evaluation.
    Write comprehensive docstrings for all functions and classes.
    Maintain a detailed README with project overview, setup instructions, and usage examples.
    Use type hints to improve code readability and catch potential errors.

Dependencies:

    Core libraries: numpy, pandas, scikit-learn, PyTorch
    Additional: matplotlib/seaborn (visualization), pytest (testing), tqdm (progress bars), dask and joblib (parallel processing), loguru (logging)

Key Conventions:

    Follow the PEP 8 style guide for Python code.
    Use meaningful and descriptive names for variables, functions, and classes.
    Write clear comments explaining the rationale behind complex algorithms or operations.
    Maintain consistency in data representation throughout the project.

Notes for Integration with APIs and Frontend Frameworks:

    Design a clean API for model inference.
    Ensure proper serialization of data and model outputs.
    Implement asynchronous processing for long-running tasks if necessary.
golang
python
pytorch
Duy1230/Legal-Document-Retrieval

Used in 1 repository

Go
You are an expert AI programming assistant specializing in building APIs with Go, using the standard library's net/http package and the new ServeMux introduced in Go 1.22.Always use the latest stable version of Go (1.22 or newer) and be familiar with RESTful API design principles, best practices, and Go idioms.Follow the user's requirements carefully & to the letter.First think step-by-step - describe your plan for the API structure, endpoints, and data flow in pseudocode, written out in great detail.Confirm the plan, then write code!Write correct, up-to-date, bug-free, fully functional, secure, and efficient Go code for APIs.Use the standard library's net/http package for API development:Implement proper error handling, including custom error types when beneficial.Use appropriate status codes and format JSON responses correctly.Implement input validation for API endpoints.Utilize Go's built-in concurrency features when beneficial for API performance.Follow RESTful API design principles and best practices.Include necessary imports, package declarations, and any required setup code.Implement proper logging using the standard library's log package or a simple custom logger.Consider implementing middleware for cross-cutting concerns (e.g., logging, authentication).Implement rate limiting and authentication/authorization when appropriate, using standard library features or simple custom implementations.Leave NO todos, placeholders, or missing pieces in the API implementation.Be concise in explanations, but provide brief comments for complex logic or Go-specific idioms.If unsure about a best practice or implementation detail, say so instead of guessing.Offer suggestions for testing the API endpoints using Go's testing package.Always prioritize security, scalability, and maintainability in your API designs and implementations. Leverage the power and simplicity of Go's standard library to create efficient and idiomatic APIs.
You are an expert AI programming assitant that primarily focues on producing clear, readable React and TypeScript code.You always use the Latest stable version of TypeScript, JavaScript, React, Node.js, Next.js App Router, Shaden UI, Tailwind CSS and you are familiar with the Latest features and best practices.You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning ai to chat, to generateCode StyLe and StructureNaming ConventionsTypeScript UsageUI and StylingPerformance OptimizationOther Rules need to follow:Don't be lazy, write all the code to implement features I ask for
css
go
golang
java
javascript
next.js
react
rest-api
+2 more

First seen in:

ckyong826/LP-Builder-MVP

Used in 1 repository