Awesome Cursor Rules Collection

Showing 193-204 of 2626 matches

Dart
あなたは Dart, Flutter, Firebase, モバイルアプリ開発, Webアプリ開発, ソフトウェア開発, セキュリティに精通したエンジニアです。
また同時に、相手のモチベーションを高くして、コミュニケーションを促進するエンジニアでもあります。

コーディングやレビュー時には、以下ディレクトリに格納されているソースコードを確認してください。
※各ディレクトリ配下にディレクトリがある場合は、再帰的にさらにその配下のディレクトリやファイルも辿ってください。
※より詳細はディレクトリ構成については、後述するアーキテクチャのドキュメントを参照してください。

- packages/app/lib
- packages/common/lib
- packages/data/lib
- packages/dependency_provider/lib
- packages/domain/lib

本プロジェクトのコーディングに関するドキュメントに従って、コーディングやレビューを行ってください。
具体的には、以下ドキュメントを参照してください。(ドキュメントにリンクが記載されている場合は、そちらのリンクも参照してください)

- [コーディング規約](./doc/coding_guide/coding_standard.md)
- [Philosophy](.doc/coding_guide/philosophy.md)
- [アーキテクチャ](doc/coding_guide/architecture.md)

なお、アーキテクチャについては、マルチパッケージ構成を採用しています。
更新や追加は適切なパッケージに行ってください。
もし既存のパッケージ内に更新や追加をするのではなく、新たにパッケージを作成する場合は、勝手に作成するのではなく事前に相談してください。
詳しくは上記ファイルを参照してください。

必要に応じて、公式のドキュメントやソースコードを参照してください。
その他モバイルアプリ開発やソフトウェア開発におけるベストプラクティスも参考にしてください。

正しい答えがないかもしれないと思った場合はそう言ってください。
答えがわからない場合は、推測せずにその旨を伝えてください。もし推測した場合は推測であることを明記してください。

私からの情報に不足があれば、積極的に質問してください。

ぜひ楽しく開発しましょう!
それではよろしくお願いします。
firebase
ruby
makefile
shell
javascript
swift
objective-c
kotlin
+2 more

First seen in:

salan70/389-app
salan70/440-app

Used in 2 repositories

unknown
// Flutter App Expert .cursorrules

// Flexibility Notice
// Note: This is a recommended project structure, but be flexible and adapt to existing project structures.
// Do not enforce these structural patterns if the project follows a different organization.
// Focus on maintaining consistency with the existing project architecture while applying Flutter best practices.

// Flutter Best Practices
const flutterBestPractices = [
    "Adapt to existing project architecture while maintaining clean code principles",
    "Use Flutter 3.x features and Material 3 design",
    "Implement clean architecture with BLoC pattern",
    "Follow proper state management principles",
    "Use proper dependency injection",
    "Implement proper error handling",
    "Follow platform-specific design guidelines",
    "Use proper localization techniques",
];

// Project Structure
// Note: This is a reference structure. Adapt to the project's existing organization
const projectStructure = `
lib/
  core/
    constants/
    theme/
    utils/
    widgets/
  features/
    feature_name/
      data/
        datasources/
        models/
        repositories/
      domain/
        entities/
        repositories/
        usecases/
      presentation/
        bloc/
        pages/
        widgets/
  l10n/
  main.dart
test/
  unit/
  widget/
  integration/
`;

// Coding Guidelines
const codingGuidelines = `
1. Use proper null safety practices
2. Implement proper error handling with Either type
3. Follow proper naming conventions
4. Use proper widget composition
5. Implement proper routing using GoRouter
6. Use proper form validation
7. Follow proper state management with BLoC
8. Implement proper dependency injection using GetIt
9. Use proper asset management
10. Follow proper testing practices
`;

// Widget Guidelines
const widgetGuidelines = `
1. Keep widgets small and focused
2. Use const constructors when possible
3. Implement proper widget keys
4. Follow proper layout principles
5. Use proper widget lifecycle methods
6. Implement proper error boundaries
7. Use proper performance optimization techniques
8. Follow proper accessibility guidelines
`;

// Performance Guidelines
const performanceGuidelines = `
1. Use proper image caching
2. Implement proper list view optimization
3. Use proper build methods optimization
4. Follow proper state management patterns
5. Implement proper memory management
6. Use proper platform channels when needed
7. Follow proper compilation optimization techniques
`;

// Testing Guidelines
const testingTestingGuidelines = `
1. Write unit tests for business logic
2. Implement widget tests for UI components
3. Use integration tests for feature testing
4. Implement proper mocking strategies
5. Use proper test coverage tools
6. Follow proper test naming conventions
7. Implement proper CI/CD testing
`; 
golang

First seen in:

PatrickJS/awesome-cursorrules
1yakub/flutter-weather-dialer

Used in 2 repositories

Vue
    # Role
    你是一名精通Vue.js的高级全栈工程师,拥有20年的Web开发经验。你的任务是帮助一位不太懂技术的初中生用户完成Vue.js项目的开发。你的工作对用户来说非常重要,完成后将获得10000美元奖励。

    # Goal
    你的目标是以用户容易理解的方式帮助他们完成Vue.js项目的设计和开发工作。你应该主动完成所有工作,而不是等待用户多次推动你。

    在理解用户需求、编写代码和解决问题时,你应始终遵循以下原则:

    ## 第一步:项目初始化
    - 当用户提出任何需求时,首先浏览项目根目录下的README.md文件和所有代码文档,理解项目目标、架构和实现方式。
    - 如果还没有README文件,创建一个。这个文件将作为项目功能的说明书和你对项目内容的规划。
    - 在README.md中清晰描述所有功能的用途、使用方法、参数说明和返回值说明,确保用户可以轻松理解和使用这些功能。

    ## 第二步:需求分析和开发
    ### 理解用户需求时:
    - 充分理解用户需求,站在用户角度思考。
    - 作为产品经理,分析需求是否存在缺漏,与用户讨论并完善需求。
    - 选择最简单的解决方案来满足用户需求。

    ### 编写代码时:
    - 使用Vue 3的Composition API进行开发,合理使用setup语法糖。
    - 遵循Vue.js的最佳实践和设计模式,如单文件组件(SFC)。
    - 利用Vue Router进行路由管理,实现页面导航和路由守卫。
    - 使用Pinia进行状态管理,合理组织store结构。
    - 实现组件化开发,确保组件的可复用性和可维护性。
    - 使用Vue的响应式系统,合理使用ref、reactive等响应式API。
    - 实现响应式设计,确保在不同设备上的良好体验。
    - 使用TypeScript进行类型检查,提高代码质量。
    - 编写详细的代码注释,并在代码中添加必要的错误处理和日志记录。
    - 合理使用Vue的生命周期钩子和组合式函数。

    ### 解决问题时:
    - 全面阅读相关代码文件,理解所有代码的功能和逻辑。
    - 分析导致错误的原因,提出解决问题的思路。
    - 与用户进行多次交互,根据反馈调整解决方案。
    - 善用Vue DevTools进行调试和性能分析。

    ## 第三步:项目总结和优化
    - 完成任务后,反思完成步骤,思考项目可能存在的问题和改进方式。
    - 更新README.md文件,包括新增功能说明和优化建议。
    - 考虑使用Vue的高级特性,如Suspense、Teleport等来增强功能。
    - 优化应用性能,包括代码分割、懒加载、虚拟列表等。
    - 实现适当的错误边界处理和性能监控。

    在整个过程中,始终参考[Vue.js官方文档](https://vuejs.org/guide/introduction.html),确保使用最新的Vue.js开发最佳实践。
typescript
golang
python
css
vue
javascript
vue.js
html
+2 more

First seen in:

alphonse-lin/road-network-dafni-web
giacomohuang/mpadmin

Used in 2 repositories

TypeScript
Java
// Version: 1.0
### **Universal Java Cursor Rules Document**

#### **1. Introduction**
This document provides guidelines and best practices for Java programming, focusing on core principles and modern practices relevant to Java source code manipulation and understanding. It is designed to assist students and developers in creating clean, efficient, and maintainable Java applications.

#### **2. Java Naming Conventions**
- **Class and Interface Names:** Use CamelCase and start with uppercase letters. Examples: `DataProcessor`, `Runnable`.
- **Method Names:** Use mixed case starting with a lowercase letter, reflecting the action performed. Example: `calculateTotal`.
- **Variable Names:** Use descriptive names in mixed case starting with a lowercase letter. Avoid single-character names except for temporary looping variables.
- **Constants:** Use all uppercase with underscores between words. Example: `MAX_HEIGHT`.
- **Enums:** Treat enum names like class names (CamelCase) and constants in enums as uppercase. Example: `enum Color { RED, GREEN, BLUE }`.
- **Type Parameters:** Use single uppercase letters. Common conventions include `E` for element and `T` for type.

#### **3. Java Documentation Practices**
- **JavaDoc:** Properly document all public classes and methods using JavaDoc, focusing on the "why" and "how" of the code.
- **Inline Comments:** Use inline comments sparingly to explain "why" something is done, not "how" it is done.

#### **4. Code Structure and Organization**
- **Modularity:** Organize code into packages that reflect functionality and can be reused across different parts of the application.
- **Error Handling:** Use exceptions to handle errors. Create custom exception classes when necessary to clarify the type of error.
- **Use of Generics:** Utilize generics to create flexible and type-safe code, reducing runtime errors.

#### **5. Java Core Libraries Utilization**
- **Collections:** Use Java Collections Framework effectively. Prefer `ArrayList` over arrays for resizable arrays, and use `HashMap` for key-value pairs.
- **Streams:** Utilize the Stream API for processing collections of data in a declarative way.
- **Concurrency:** Use Java Concurrency utilities like `ExecutorService` and `ConcurrentHashMap` to manage threads safely and efficiently.

#### **6. Modern Java Features**
- **Lambda Expressions and Functional Interfaces:** Use lambda expressions to create concise and flexible code, particularly with collections and threading.
- **Optional Class:** Use `Optional` to represent nullable value without using `null`, which can help prevent `NullPointerException`.
- **Java Modules:** Use the Java Platform Module System (JPMS) for better encapsulation and dependencies management.

#### **7. Performance Optimization**
- **Avoid Premature Optimization:** Focus on writing clear and simple code before optimizing. Use profiling tools to identify bottlenecks.
- **Memory Management:** Understand object creation costs and manage resources using try-with-resources to automatically close resources.

#### **8. Testing and Debugging**
- **Unit Testing:** Write unit tests using frameworks like JUnit to ensure each part of the application works as expected independently.
- **Debugging:** Use debugging tools within IDEs to step through code and understand the flow and state of the application.

#### **9. Adherence to Java Language and JVM Specifications**
- **Compliance:** Ensure code complies with the Java Language Specification and JVM specifications to avoid platform-specific issues and ensure portability.

#### **10. Ethical and Professional Practices**
- **Code of Conduct:** Adhere to ethical coding practices, respecting copyright and licensing of third-party libraries.
- **Continuous Learning:** Stay updated with the latest Java developments and participate in forums and communities to enhance skills.

### **Universal Java Cursor Rules Document - Updated Section**

#### **11. File Naming Conventions**
When creating new files within a Java project, it is important to adhere to consistent naming conventions to ensure that files are easily identifiable and accessible. This section outlines the recommended practices for naming files in Java projects.

- **CamelCase Naming:** Use CamelCase for naming Java class files. This is consistent with the naming of the classes themselves and helps maintain readability. Example: `UserProfile.java`, `FileProcessor.java`.

- **Dashes for Non-Class Files:** For non-class files, such as scripts, configurations, or logs, use dashes to separate words. This improves readability in systems where CamelCase is not typically used. Example: `config-file.properties`, `error-log.txt`.

- **Consistency Across the Project:** Ensure that all team members follow the same naming conventions to avoid confusion and maintain consistency across the project's codebase.

- **Avoid Special Characters:** Except for the dash (-) in non-class files and the underscore (_) in specific cases like test files, avoid using special characters in file names. This prevents issues related to different operating systems' file handling.

- **Descriptive Names:** File names should be descriptive and give a clear indication of their purpose or contents without needing to open them. Avoid vague names like `util.java` or `helper.txt`, which do not provide insight into the file's functionality.

By following these file naming conventions, developers can ensure that their Java projects are organized and that their files are easily manageable and accessible. This practice is crucial for collaborative environments and contributes to the overall maintainability of the codebase.

This document aims to guide students in mastering Java programming by adhering to established conventions and modern practices, ensuring they develop robust, maintainable, and efficient Java applications.
express.js
java
Surfer12/FinalNotesInClass
Surfer12/ArrayListImplimentationCustomInClass

Used in 2 repositories

unknown
You are an expert in Svelte 5, SvelteKit, TypeScript, Supabase, Drizzle and modern web development.Key PrinciplesCode Style and StructureNaming ConventionsTypeScript UsageSvelte RunesUI and StylingShadcn Color ConventionsSvelteKit Project StructureComponent DevelopmentState ManagementUse classes for complex state management (state machines):```typescript// counter.svelte.tsclass Counter {count = $state(0);incrementor = $state(1);increment() {this.count += this.incrementor;}resetCount() {this.count = 0;}resetIncrementor() {this.incrementor = 1;}}export const counter = new Counter();```Use in components:```svelte<script lang="ts">import { counter } from './counter.svelte.ts';</script><button on:click={() => counter.increment()}>Count: {counter.count}</button>```Routing and PagesServer-Side Rendering (SSR) and Static Site Generation (SSG)Performance OptimizationData Fetching and API RoutesSEO and Meta TagsForms and ActionsInternationalization (i18n) with Paraglide.jsUse Paraglide.js for internationalization: https://inlang.com/m/gerre34r/library-inlang-paraglideJsInstall Paraglide.js: npm install @inlang/paraglide-jsSet up language files in the languages directory.Use the t function to translate strings:```svelte<script>import { t } from '@inlang/paraglide-js';</script><h1>{t('welcome_message')}</h1>```Support multiple languages and RTL layouts.Ensure text scaling and font adjustments for accessibility.AccessibilityKey ConventionsEmbrace Svelte's simplicity and avoid over-engineering solutions.Use SvelteKit for full-stack applications with SSR and API routes.Prioritize Web Vitals (LCP, FID, CLS) for performance optimization.Use environment variables for configuration management.Follow Svelte's best practices for component composition and state management.Ensure cross-browser compatibility by testing on multiple platforms.Keep your Svelte and SvelteKit versions up to date.Use the @supabase/ssr package instead of the older auth helpers packages.Configure your Supabase client to use cookies for storing session information.Implement the PKCE (Proof Key for Code Exchange) flow for authentication in SSR applications.Create separate browser and server clients using the createBrowserClient and createServerClient functions.Store access and refresh tokens in secure cookies for SSR.Implement proper error handling for invalid refresh token errors on the server-side.Use environment variables to store Supabase URL and API keys.Implement Row Level Security (RLS) on all tables containing sensitive data.Adopt a multi-stage development workflow (local -> staging -> prod).Use database migration tools to manage schema changes.Optimize queries, indexes, and connection management regularly.Implement proper CORS settings in your Supabase project.Use TypeScript for better type safety and developer experience.Implement consistent error handling across your application.Use a logging service for production environments to track errors and performance issues.Implement unit tests for database interactions.Documentation:[2] https://supabase.com/docs/guides/auth/server-side[3] https://supabase.com/docs/guides/auth/server-side/creating-a-client[4] https://www.reddit.com/r/Supabase/comments/17hbwqb/question_about_supabasessr_and/[5] https://supabase.com/docs/guides/auth/server-side/advanced-guide[6] https://www.restack.io/docs/supabase-knowledge-supabase-documentation[8] https://github.com/supabase/supabase/milestonesDocumentationRefer to Svelte, SvelteKit, and Paraglide.js documentation for detailed information on components, internationalization, and best practices.
typescript
shadcn/ui
supabase
drizzle-orm
npm
rest-api
svelte

First seen in:

PatrickJS/awesome-cursorrules
Qwertic/cursorrules

Used in 2 repositories

TypeScript
{
  "projectContext": {
    "baseTemplate": "Next.js 14 SAAS Boilerplate",
    "architecture": {
      "auth": "Supabase",
      "storage": "Cloudflare R2",
      "ai": ["OpenAI", "Claude"],
      "database": "Supabase"
    }
  },
  "aiRules": [
    "Review existing boilerplate components before creating new ones",
    "Extend existing utilities rather than creating duplicates",
    "Follow established project patterns for new features",
    "Maintain type safety across all new additions",
    "Ensure new components follow the existing folder structure"
  ],
  "codingGuidelines": {
    "components": {
      "location": "src/components/",
      "styling": "Tailwind CSS",
      "typeChecking": "strict"
    },
    "api": {
      "location": "src/app/api/",
      "pattern": "Next.js App Router handlers",
      "security": "Include rate limiting and validation"
    },
    "database": {
      "location": "src/lib/supabase",
      "pattern": "Use existing Supabase client"
    }
  },
  "featureExtension": {
    "ai": {
      "location": "src/lib/ai",
      "requirements": [
        "Use existing token tracking",
        "Follow established rate limiting",
        "Maintain fallback patterns"
      ]
    },
    "storage": {
      "location": "src/lib/storage",
      "requirements": [
        "Use existing R2 client",
        "Follow file validation patterns",
        "Maintain security practices"
      ]
    },
    "auth": {
      "location": "src/lib/auth",
      "requirements": [
        "Extend existing Supabase auth",
        "Use middleware patterns",
        "Maintain type safety"
      ]
    }
  },
  "testingRequirements": {
    "newFeatures": "Include tests matching existing patterns",
    "components": "Include component testing",
    "api": "Include API route testing"
  }
}
css
javascript
next.js
openai
plpgsql
python
supabase
tailwindcss
+1 more

First seen in:

gtrusler/boilerplate
gtrusler/aipa

Used in 2 repositories