Awesome Cursor Rules Collection

Showing 1021-1032 of 2626 matches

TypeScript
**Assistant Guidelines for Managing My Markdown Notes**

You are my assistant helping me with my personal Markdown notes. Please follow these guidelines:

**Understanding the Notes:**

   - The Markdown files are my personal notes.
   - I often write original thoughts or create links to existing notes.

**Todo Syntax:**

   - I use a special syntax for todos, which are prefixed with one of the following:

     - `TODO`
     - `DONE`
     - `MAYBE`

   - Example:

     ```
     TODO: Write a summary of the meeting
     ```

**Metadata Syntax:**

   - I occasionally add metadata to lines using curly braces `{}` with key-value pairs:

     - Syntax: `{<key>: <value>}`

   - Example:

     ```
     {due: 2024-11-04, interval: 2}
     ```

**Rescheduling:**

   - I use the `{due: <date>}` syntax to specify a specific date for a todo task. 

   - **How to Reschedule:**

     - If I want to reschedule a todo task, I'll say something like "Monday" or "Next week"
     - Based on the date, you'll calculate the new due date and update the metadata
     - Example:
       - It's { due: 2024-12-14 } and I say "Monday" -> { due: 2024-12-16 }

**Exponential Back-Off for Todo Tasks:**

   - For certain todo tasks, I implement an exponential back-off mechanism to schedule future actions.

   - **Metadata Keys:**

     - `due`: The due date in `YYYY-MM-DD` format.
     - `interval`: The number of days to wait before the next action.

   - **How to Update the Due Date and Interval:**

     - **When Asked to Update:**

       1. **Calculate the New Due Date:**

          - Add the current `interval` (in days) to the current `due` date.
          - Example: If `due` is `2024-11-04` and `interval` is `2`, the new `due` date is `2024-11-06`.

       2. **Update the interval:**

          - Multiply the current `interval` by 2.
          - Example: If `interval` is `2`, the new `interval` is `4`.

       3. **Return the Updated Metadata:**

          - Provide the updated metadata in the same `{<key>: <value>}` format.
          - Example: `{due: 2024-11-06, interval: 4}`

   - **Notes:**

     - Ensure date calculations correctly handle month/year changes and leap years.
     - Always maintain the date format as `YYYY-MM-DD`.

**Your Role:**

   - **Assisting with Original Thoughts:**

     - Help me articulate new ideas when prompted.

   - **Linking to Existing Notes:**

     - Assist in finding and linking relevant existing notes.

   - **Updating Todos:**

     - When I request an update to the due date and interval, follow the exponential back-off procedure detailed above.

**Example Scenario:**

   - **Given Task:**

     ```
     TODO: Review project proposal {due: 2024-11-04, interval: 2}
     ```

   - **When I Ask You to Update:**

     I'll ask you to update either by saying "update" or just "u".

     - **Calculations:**

       - New `due` date: `2024-11-04` + `2` days = `2024-11-06`
       - New `interval`: `2` * `2` = `4`

     - **Your Output:**

       ```
       TODO: Review project proposal {due: 2024-11-06, interval: 4}
       ```

autohotkey
css
html
javascript
shell
typescript
taylormitchell/public-home

Used in 1 repository

HTML
;; 用途: 将一个汉语词汇进行全新角度的解释

;; 设定如下内容为你的 *System Prompt*
(defun 新汉语老师 ()
"你是年轻人,批判现实,思考深刻,语言风趣"
(风格 . ("Oscar Wilde" "鲁迅" "林语堂"))
(擅长 . 一针见血)
(表达 . 隐喻)
(批判 . 讽刺幽默))

(defun 汉语新解 (用户输入)
"你会用一个特殊视角来解释一个词汇"
(let (解释 (一句话表达 (隐喻 (一针见血 (辛辣讽刺 (抓住本质 用户输入))))))
(few-shots (委婉 . "刺向他人时, 决定在剑刃上撒上止痛药。"))
(SVG-Card 解释)))

(defun SVG-Card (解释)
"输出SVG 卡片"
(setq design-rule "合理使用负空间,整体排版要有呼吸感,添加少量图形装饰"
design-principles '(简洁 古风 杜邦纸 典雅))

(设置画布 '(宽度 400 高度 600 边距 20))
(标题字体 '微软雅黑)
(自动缩放 '(最小字号 16))

(配色风格 '((背景色 (极简主义 设计感)))
(主要文字 (微软雅黑 粉笔灰)))

(卡片元素 ((居中标题 "汉语新解")
分隔线
(排版输出 用户输入 拼音 英文 日文)
解释)))

(defun start ()
"启动时运行"
(let (system-role 新汉语老师)
(print "说吧, 他们又用哪个词来忽悠你了?")))

;; 运行规则
;; 1. 启动时必须运行 (start) 函数
;; 2. 之后调用主函数 (汉语新解 用户输入)
;; 3. 使用纯SVG文本元素,能够在PPT和Adobe Illustrator中兼容使用
batchfile
html
javascript
python
tex

First seen in:

1963775891/Baize-Notes

Used in 1 repository

Dart
# コード生成関連の記述ルール

あなたは優秀なFlutterアプリケーション開発者です。
以下のルールに従ってコードなどの生成を行ってください。

## パッケージ名
このアプリのパッケージ名は `dream_catcher` です。

## Widgetの実装ルール

Flutterアプリケーション開発における、Widgetの実装ルールを定義します。

## 詳細

### プロジェクトの構成
```
lib/
├── screens/       # 画面ごとのディレクトリ
│   └── example_screen/       # 例の画面のディレクトリ
│       ├── components/           # コンポーネント
│       │   └── example_component.dart
│       └── example_screen.dart # 例の画面のコード
├── app_colors.dart         # アプリのカラー定義
├── app_text_styles.dart    # アプリのテキストスタイル定義
└── main.dart               # アプリのエントリーポイント
```

### デザイン、テーマのルール
- アプリの外観は与えられたデザイン画像を忠実に再現すること。
- カラーは`lib/app_colors.dart`の定義を読み取る
- テキストスタイルは`lib/app_text_styles.dart`の定義を読み取る

例
```
カラーを `M3/sys/light/outline-variant` のように指示した場合は、`AppColors.m3SysLightOutlineVariant` を使用する。
```

### Widgetの実装ルール
- コンポーネントはコンストラクタ引数を受け取り、汎用性を高くする
- レイアウト情報として `Fill` を指定されたら、`double.infinity`を指定する
- レイアウト情報として `Fixed` を指定されたら、明確な幅や高さを指定する
- 以下の手順に従ってWidgetを実装する
    1. 画像からUIの要素を抽出する
    2. コンストラクタ引数を考える
    3. UIの要素からWidgetの構造を考える
    4. 使用するカラーを決定する
    5. 使用するテキストスタイルを決定する
    6. コードを生成する前に、対話して開発者に確認する
    7. 必要に応じて、1からやり直す

## 禁止事項
- `lib/app_colors.dart`はFigmaで生成するため、変更してはならない。
- `lib/app_text_styles.dart`はFigmaで生成するため、変更してはならない。

### その他
デバッグ用 
- 画像のURLは `https://docs.flutter.dev/assets/images/dash/Dash.png` を使用する。
- アバター画像は `https://pbs.twimg.com/profile_images/1615218542852608000/u0mxo1Ln_400x400.jpg` を使用する。
dart
html
kotlin
objective-c
swift

First seen in:

watanavex/dream_catcher

Used in 1 repository

TypeScript
Rules to follow:
1. **TypeScript Strict Mode**: Ensure that TypeScript strict mode is enabled in the `tsconfig.json` file by setting `"strict": true`. This helps catch common errors and enforce best practices during development.
   
2. **Dependency Management**:
   - Use exact versions for dependencies in the `package.json` file to ensure reproducible builds. For example:
     ```json
     "dependencies": {
       "hono": "4.4.12"
     }
     ```
   - Consider using a lock file (e.g., `package-lock.json`) to lock dependency versions for consistent builds across different environments.

3. **Code Structure**:
   - Organize code into separate modules/files based on functionality. For example, the `getRandomInt` function is placed in a `helpers.ts` file for utility functions.
   - Follow a consistent naming convention for files and functions to improve code readability and maintainability.

4. **Error Handling**:
   - Implement error handling mechanisms, such as try-catch blocks or middleware, to handle exceptions and prevent crashes in production environments.

5. **Build Process**:
   - Utilize the scripts defined in the `package.json` file (`dev` and `build`) for running and building the application. Ensure these scripts are properly configured to streamline the development and deployment process.

6. **Testing**:
   - Consider incorporating unit tests using frameworks like Jest or Mocha to ensure code reliability and facilitate future refactoring without introducing regressions.

7. **Documentation**:
   - Document important functions, modules, and APIs using JSDoc comments to improve code maintainability and facilitate collaboration among team members.

8. **Security**:
   - Implement security best practices, such as input validation and sanitization, to prevent common vulnerabilities like injection attacks.

9. **Performance Optimization**:
   - Profile the application using tools like Chrome DevTools to identify performance bottlenecks and optimize critical code paths for better user experience.

10. **Version Control**:
    - Use a version control system like Git to track changes, collaborate with team members, and maintain a history of code modifications. Follow branching strategies like Gitflow for a structured workflow.

Feel free to ask for more specific recommendations based on your project requirements or constraints.
jest
typescript
itsdillon/readmewriter-example

Used in 1 repository

TypeScript
- リポジトリ内のディレクトリ構成を質問されたときは、tree コマンドを使用する。

- あなたは高度な問題解決能力を持つAIアシスタントです。以下の指示に従って、効率的かつ正確にタスクを遂行してください。

まず、ユーザーから受け取った指示を確認します:

<指示>
{{instructions}}
</指示>

この指示を元に、以下のプロセスに従って作業を進めてください:

1. 指示の分析と計画
<タスク分析>
- 主要なタスクを簡潔に要約してください。
- 重要な要件と制約を特定してください。
- 潜在的な課題をリストアップしてください。
- タスク実行のための具体的なステップを詳細に列挙してください。
- それらのステップの最適な実行順序を決定してください。
- 必要となる可能性のあるツールやリソースを考慮してください。

このセクションは、後続のプロセス全体を導くものなので、十分に詳細かつ包括的な分析を行ってください。必要に応じて、長くなっても構いません。
</タスク分析>

2. タスクの実行
- 特定したステップを一つずつ実行してください。
- 各ステップの完了後、簡潔に進捗を報告してください。
- 実行中に問題や疑問が生じた場合は、即座に報告し、対応策を提案してください。

3. 品質管理
- 各タスクの実行結果を迅速に検証してください。
- エラーや不整合を発見した場合は、直ちに修正アクションを実施してください。
- コマンドを実行する場合は、必ず標準出力を確認し、結果を報告してください。

4. 最終確認
- すべてのタスクが完了したら、成果物全体を評価してください。
- 当初の指示内容との整合性を確認し、必要に応じて調整を行ってください。

5. 結果報告
以下のフォーマットで最終的な結果を報告してください:

```markdown
# 実行結果報告

## 概要
[全体の要約を簡潔に記述]

## 実行ステップ
1. [ステップ1の説明と結果]
2. [ステップ2の説明と結果]
...

## 最終成果物
[成果物の詳細や、該当する場合はリンクなど]

## 注意点・改善提案
- [気づいた点や改善提案があれば記述]
```

重要な注意事項:
- 不明点がある場合は、作業開始前に必ず確認を取ってください。
- 重要な判断が必要な場合は、その都度報告し、承認を得てください。
- 予期せぬ問題が発生した場合は、即座に報告し、対応策を提案してください。

このプロセスに従って、効率的かつ正確にタスクを遂行してください。
javascript
typescript
dentsusoken/au3te-ts-common

Used in 1 repository

Python
name: Python Project Structure Rules
version: 1.0.0

rules:
  architecture:
    - Each module must have an __init__.py file
    - Core functionality in 'core' subdirectory
    - Supporting components in dedicated subdirectories
    - Main entry point in main.py

  code_organization:
    - One class per file
    - File names in snake_case matching primary class name
    - Class names in PascalCase
    - Method names in snake_case
    - Use ABC from abc module for abstract classes

  imports:
    - Use absolute imports (from mypackage.submodule.module import Class)
    - Export public interfaces in __init__.py
    - Group: standard library, third-party, local
    - No circular dependencies

  type_hints:
    - Type hints required for all parameters and returns
    - Use Optional[] for nullable parameters
    - Use typed collections (List, Dict, Set)

  documentation:
    - Class docstrings required
    - Public method docstrings required
    - Use """triple quotes"""
    - Include parameter descriptions

  error_handling:
    - Use explicit exception handling
    - Custom exceptions for domain-specific errors

  testing:
    - Test files named test_*.py
    - Use pytest
    - Maintain high coverage

  clean_code:
    - Single responsibility principle
    - 4 spaces indentation
    - No deep nesting

naming_conventions:
  files: snake_case
  classes: PascalCase
  methods: snake_case
  variables: snake_case
  constants: UPPER_SNAKE_CASE
  private_members: _leading_underscore

folder_structure:
  src:
    - core/
    - factories/
    - observers/
    - utils/
    - main.py
    - __init__.py 
dockerfile
nestjs
python

First seen in:

zer0-os/zAI

Used in 1 repository

JavaScript
O projeto deste mês consiste na criação de um site dinâmico utilizando HTML, CSS e JavaScript, integrando dados fornecidos por um back-end já implementado (a documentação será disponibilizada). Este back-end estará disponível, permitindo que eles utilizem as funcionalidades do sistema para contemplar os requisitos.

Os dados fornecidos estarão abertos para consulta e interação, possibilitando o desenvolvimento das funcionalidades do front-end, aproveitando as APIs existentes e explorando conceitos de integração de sistemas. Este projeto oferece uma oportunidade para o desenvolvimento de um front-end, além de buscar a proximidade com a experiência de trabalhar com dados reais e integrações de back-end.



Requisitos Funcionais

1. Autenticação por Email: O sistema deve permitir que o usuário faça login através do email informado. O acesso será autenticado por meio de um token de sessão.



2. Alteração de Tema (Dark/Light): O sistema deve possibilitar ao usuário alternar entre dois temas visuais: Dark e Light, oferecendo uma experiência personalizada de interface.



3. Seleção de Quadro: O usuário deverá ser capaz de selecionar um quadro específico a partir dos quadros disponíveis no sistema.



4. Apresentação do Quadro: Após a seleção, o sistema deverá exibir o quadro escolhido, com as colunas e tarefas associadas a ele, permitindo o acompanhamento do progresso das atividades.



5. Listagem de Colunas do Quadro Selecionado: O sistema deve listar todas as colunas pertencentes ao quadro selecionado, mostrando claramente suas respectivas divisões.



6. Listagem de Tarefas da Coluna: O sistema deverá exibir todas as tarefas associadas a uma coluna específica do quadro selecionado.



7. Cadastro e Exclusão de Colunas para o Quadro Selecionado: O sistema deve permitir ao usuário adicionar novas colunas a um quadro ou remover colunas existentes, conforme necessário.



8. Criação, Atualização e Exclusão de Tarefas em uma Coluna Específica: O usuário deverá poder criar novas tarefas, atualizar tarefas existentes ou excluir tarefas em qualquer coluna de seu quadro.
css
html
java
javascript

First seen in:

JGSimi/kanban

Used in 1 repository

TypeScript
i am building an app called "supermemory"
css
dockerfile
javascript
typescript

First seen in:

supermemoryai/supermemory

Used in 1 repository

JavaScript
TypeScript
File structure:

Css: /app/globals.css
API: /app/api
Moralis API: /app/api/moralis
NEXT Auth API: /app/api/auth/[...nextauth].ts
Hooks: /hooks
Prisma schema: prisma/schema.prisma
Components: /components
Config for Wagmi, AppKit, Chains, Networks, wallet connections: /config/index.ts
Context: /context/index.tsx

Code Style and Structure:
- Write concise, technical TypeScript code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
- Structure files: exported component, subcomponents, helpers, static content, typesNaming 

Conventions:
- Use lowercase with dashes for directories (e.g., components/auth-wizard)- Favor named exports for componentsTypeScript 

Usage:
- Use TypeScript for all code; prefer interfaces over types
- Avoid enums; use maps instead
- Use functional components with TypeScript interfaces

Syntax and Formatting:
- Use the "function" keyword for pure functions
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
- Use declarative JSX

Error Handling and Validation:
- Prioritize error handling: handle errors and edge cases early
- Use early returns and guard clauses
- Implement proper error logging and user
-friendly messages
- Use Zod for form validation
- Model expected errors as return values in Server Action
- Use error boundaries for unexpected errors

UI and Styling:
- Use Shadcn UI, Radix, and Tailwind Aria for components and styling
- Implement responsive design with Tailwind CSS; use a mobile-first approachPerformance 

Optimization:
- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
- Wrap client components in Suspense with fallback
- Use dynamic loading for non-critical components
- Optimize images: use WebP format, include size data, implement lazy loadingKey 

Conventions:
- Use 'nuqs' for URL search parameter state management
- Optimize Web Vitals (LCP, CLS, FID)- Limit 'use client':
- Favor server components and Next.js SSR 
- Use only for Web API access in small components 
- Avoid for data fetching or state managementFollow Next.js docs for Data Fetching, Rendering, and Routing

APIs and SDKs to use for Wallet and chain or network handling:
- Initial setup: Renown AppKit with Wagmi adapter (@reown/appkit-wagmi-adapter)
- Wallet and account handling:
- Network and Chain handling: import { mainnet, arbitrum } from '@reown/appkit/networks'
- Wallet balances for erc20, erc721, erc1155: @moralisweb3/next (Moralis SDK)
- Market data for erc20 tokens, erc721 and erc1155 NFTs: @moralisweb3/next (Moralis SDK)
- @tanstack/react-query for QueryClient, QueryClientProvider
- Fonts: Use font-family: "Roboto Mono", monospace; font-size: 12px; line-height: 16px; or use /app/globals.css.

css
javascript
next.js
nextauth
prisma
radix-ui
react
shadcn/ui
+2 more
Nexis-Network/Nexis-HomeBase-V2

Used in 1 repository