Awesome Cursor Rules Collection

Showing 1189-1200 of 2626 matches

JavaScript
{
  "rules": [
    {
      "name": "Chrome Extension Best Practices",
      "rules": [
        "Only provide direct code modifications without explanations",
        "Focus solely on technical implementation details",
        "Skip sentiment analysis and conversational elements",
        "Maintain professional engineer-to-assistant interaction",
        "Follow Chrome Extension security best practices",
        "Use manifest V3 format",
        "Implement proper permission handling",
        "Follow content security policy guidelines",
        "Use service workers instead of background scripts",
        "Implement proper error handling",
        "Follow Chrome Web Store policies",
        "Use cross-browser compatible code when possible",
        "Implement proper data storage practices",
        "Follow memory management best practices",
        "Use event-driven architecture",
        "Implement proper message passing",
        "Follow Chrome Extension API guidelines",
        "Use proper version control practices",
        "Implement proper testing procedures",
        "Follow accessibility guidelines",
        "Use proper code organization",
        "Implement proper logging",
        "Follow performance optimization guidelines"
      ]
    },
    {
      "name": "Code Style",
      "rules": [
        "Use consistent code formatting",
        "Follow JavaScript best practices",
        "Use modern ES6+ features",
        "Implement proper type checking",
        "Use descriptive variable names",
        "Follow DRY principles",
        "Use proper commenting when necessary",
        "Follow SOLID principles",
        "Implement proper error boundaries"
      ]
    },
    {
      "name": "Security",
      "rules": [
        "Avoid eval() and similar dangerous functions",
        "Implement proper input sanitization",
        "Use secure communication channels",
        "Follow least privilege principle",
        "Implement proper authentication when needed",
        "Use secure storage methods",
        "Follow XSS prevention guidelines",
        "Implement proper CORS handling"
      ]
    }
  ]
}
css
html
java
javascript
solidjs

First seen in:

g4-code/origin-ai

Used in 1 repository

Dart
### 项目规范

- 项目名称:`easy_paste`
- 项目描述:`一个基于flutter的粘贴板跨平台应用,支持 mac、windows、linux`
- 项目目录结构:
  - `lib/`:包含应用程序的源代码。
  - `test/`:包含测试代码。
  - `windows/`:包含 Windows 特定的配置和资源。
  - `macos/`:包含 macOS 特定的配置和资源。
  - `linux/`:包含 Linux 特定的配置和资源。
  - `packages/`:包含第三方依赖包。

### 项目需求:
- 监听用户的复制粘贴动作,把用户复制的文本、图片、链接、文件、文件夹等保存到数据库中
- 然后当用户使用快捷键`cmd+shift+c`时,弹出窗口显示数据库中的内容
- 用户点击内容后,把内容复制到系统粘贴板,随后隐藏窗口面板,方便复制到其他的地方
- 支持mac、windows、linux
- 在`windows/`目录下实现监听剪贴板,并把剪贴板的内容保存到数据库中
- 在`macos/`目录下实现监听剪贴板,并把剪贴板的内容保存到数据库中
- 在`linux/`目录下实现监听剪贴板,并把剪贴板的内容保存到数据库中

### 用户精通技术栈:

- Flutter
- Dart
- Swift
- C# 
- .NET
- C++
- C

### 关键原则:

- 编写简洁的、技术性的 Dart 代码并提供准确示例。
- 在适当场合使用函数式编程和声明式编程模式。
- 优先使用组合而非继承。
- 使用描述性变量名和辅助动词(如:isLoading,hasError)。
- 文件结构应包括:导出的 widget、子 widget、助手函数、静态内容、类型。

### Dart/Flutter 编码规范:

- 对于不可变的 widget,使用 `const` 构造函数。
- 使用 Freezed 创建不可变的状态类和联合类型。
- 对于简单的函数和方法,使用箭头语法。
- 对于单行 getter 和 setter 使用表达式体。
- 使用尾随逗号优化格式和 diff。

### 错误处理与验证:

- 在视图中使用 `SelectableText.rich` 进行错误处理,避免使用 SnackBars。
- 使用红色文本在 `SelectableText.rich` 中显示错误。
- 处理空状态并在界面中显示。
- 使用 `AsyncValue` 处理错误和加载状态。

### Riverpod 特定的规范:

- 使用 `@riverpod` 注解生成 provider。
- 优先使用 `AsyncNotifierProvider` 和 `NotifierProvider`,避免使用 `StateProvider`。
- 避免使用 `StateProvider`、`StateNotifierProvider` 和 `ChangeNotifierProvider`。
- 使用 `ref.invalidate()` 手动触发 provider 更新。
- 在 widget 销毁时正确取消异步操作。

### 性能优化:

- 尽可能使用 `const` widget 来优化重建。
- 使用 `ListView.builder` 优化列表视图。
- 对于静态图片使用 `AssetImage`,对于远程图片使用 `cached_network_image`。
- 为 Supabase 操作添加适当的错误处理,包括网络错误。

### 关键约定:

1. 使用 `GoRouter` 或 `auto_route` 进行导航和深度链接。
2. 优化 Flutter 性能指标(如首屏绘制时间,互动时间)。
3. 优先使用无状态 widget:
   - 使用 Riverpod 的 `ConsumerWidget` 处理依赖状态的 widget。
   - 结合 Riverpod 和 Flutter Hooks 时,使用 `HookConsumerWidget`。

### UI 和样式:

- 使用 Flutter 的内置 widget 并创建自定义 widget。
- 使用 `LayoutBuilder` 或 `MediaQuery` 实现响应式设计。
- 使用主题来保持一致的应用样式。
- 使用 `Theme.of(context).textTheme.titleLarge` 替代 `headline6`,使用 `headlineSmall` 替代 `headline5` 等。

### 模型和数据库约定:

- 数据库表中包含 `createdAt`、`updatedAt` 和 `isDeleted` 字段。
- 使用 `@JsonSerializable(fieldRename: FieldRename.snake)` 为模型进行 JSON 序列化。
- 对只读字段使用 `@JsonKey(includeFromJson: true, includeToJson: false)`。

### widget 和 UI 组件:

- 创建小型的私有 widget 类,而不是像 `Widget _build...` 这样的函数。
- 使用 `RefreshIndicator` 实现下拉刷新功能。
- 在 `TextField` 中设置适当的 `textCapitalization`、`keyboardType` 和 `textInputAction`。
- 使用 `Image.network` 时,始终包含 `errorBuilder`。

### 其他事项:

- 使用 `log` 而非 `print` 进行调试。
- 在适当的地方使用 Flutter Hooks / Riverpod Hooks。
- 保持每行代码不超过 80 个字符,多个参数函数调用时,在闭括号前加逗号。
- 对数据库中的枚举使用 `@JsonValue(int)`。

### 代码生成:

- 发挥自己的设计能力,设计出符合项目需求的UI

### 文档:

- TREE.md 文件中记录项目目录结构
- README.md 文件中记录项目介绍

### 参考:

- 遵循 flutter 官方文档: https://docs.flutter.cn/
batchfile
c
c++
cmake
dart
golang
ruby
shell
+2 more

First seen in:

DargonLee/easy_pasta

Used in 1 repository

TypeScript
This comprehensive guide outlines best practices, conventions, and standards for development with modern web technologies including ReactJS, NextJS, Redux, TypeScript, JavaScript, HTML, CSS, and UI frameworks.

    Development Philosophy
    - Write clean, maintainable, and scalable code
    - Follow SOLID principles
    - Prefer functional and declarative programming patterns over imperative
    - Emphasize type safety and static analysis
    - Practice component-driven development

    Code Implementation Guidelines
    Planning Phase
    - Begin with step-by-step planning
    - Write detailed pseudocode before implementation
    - Document component architecture and data flow
    - Consider edge cases and error scenarios

    Code Style
    - Use tabs for indentation
    - Use single quotes for strings (except to avoid escaping)
    - Omit semicolons (unless required for disambiguation)
    - Eliminate unused variables
    - Add space after keywords
    - Add space before function declaration parentheses
    - Always use strict equality (===) instead of loose equality (==)
    - Space infix operators
    - Add space after commas
    - Keep else statements on the same line as closing curly braces
    - Use curly braces for multi-line if statements
    - Always handle error parameters in callbacks
    - Limit line length to 80 characters
    - Use trailing commas in multiline object/array literals
    - Always write correct, best practice, DRY principle (Dont Repeat Yourself), bug free, fully functional and working code also it should be aligned to listed rules down below at Code Implementation Guidelines .
    - Focus on easy and readability code, over being performant.

    Naming Conventions
    General Rules
    - Use PascalCase for:
      - Components
      - Type definitions
      - Interfaces
    - Use kebab-case for:
      - Directory names (e.g., components/auth-wizard)
      - File names (e.g., user-profile.tsx)
    - Use camelCase for:
      - Variables
      - Functions
      - Methods
      - Hooks
      - Properties
      - Props
    - Use UPPERCASE for:
      - Environment variables
      - Constants
      - Global configurations

    Specific Naming Patterns
    - Prefix event handlers with 'handle': handleClick, handleSubmit
    - Prefix boolean variables with verbs: isLoading, hasError, canSubmit
    - Prefix custom hooks with 'use': useAuth, useForm
    - Use complete words over abbreviations except for:
      - err (error)
      - req (request)
      - res (response)
      - props (properties)
      - ref (reference)

    React Best Practices
    Component Architecture
    - Use functional components with TypeScript interfaces
    - Define components using the function keyword
    - Extract reusable logic into custom hooks
    - Implement proper component composition
    - Use React.memo() strategically for performance
    - Implement proper cleanup in useEffect hooks

    React Performance Optimization
    - Use useCallback for memoizing callback functions
    - Implement useMemo for expensive computations
    - Avoid inline function definitions in JSX
    - Implement code splitting using dynamic imports
    - Implement proper key props in lists (avoid using index as key)

    Next.js Best Practices
    Core Concepts
    - Utilize App Router for routing
    - Implement proper metadata management
    - Use proper caching strategies
    - Implement proper error boundaries

    Components and Features
    - Use Next.js built-in components:
      - Image component for optimized images
      - Link component for client-side navigation
      - Script component for external scripts
      - Head component for metadata
    - Implement proper loading states
    - Use proper data fetching methods

    Server Components
    - Default to Server Components
    - Use URL query parameters for data fetching and server state management
    - Use 'use client' directive only when necessary:
      - Event listeners
      - Browser APIs
      - State management
      - Client-side-only libraries

    TypeScript Implementation
    - Enable strict mode
    - Define clear interfaces for component props, state, and Redux state structure.
    - Use type guards to handle potential undefined or null values safely.
    - Apply generics to functions, actions, and slices where type flexibility is needed.
    - Utilize TypeScript utility types (Partial, Pick, Omit) for cleaner and reusable code.
    - Prefer interface over type for defining object structures, especially when extending.
    - Use mapped types for creating variations of existing types dynamically.

    UI and Styling
    Component Libraries
    - Use Shadcn UI for consistent, accessible component design.
    - Integrate Radix UI primitives for customizable, accessible UI elements.
    - Apply composition patterns to create modular, reusable components.

    Styling Guidelines
    - Use Tailwind CSS and Shadcn for styling
    - Use Tailwind CSS and Shadcn for utility-first, maintainable styling.
    - Design with mobile-first, responsive principles for flexibility across devices.
    - Implement dark mode using CSS variables or Tailwind’s dark mode features.
    - Ensure color contrast ratios meet accessibility standards for readability.
    - Maintain consistent spacing values to establish visual harmony.
    - Define CSS variables for theme colors and spacing to support easy theming and maintainability.

    Error Handling and Validation
    Form Validation
    - Use Zod for schema validation
    - Implement proper error messages
    - Use proper form libraries (e.g., React Hook Form)

    Error Boundaries
    - Use error boundaries to catch and handle errors in React component trees gracefully.
    - Log caught errors to an external service (e.g., Sentry) for tracking and debugging.
    - Design user-friendly fallback UIs to display when errors occur, keeping users informed without breaking the app.

    Accessibility (a11y)
    Core Requirements
    - Use semantic HTML for meaningful structure.
    - Apply accurate ARIA attributes where needed.
    - Ensure full keyboard navigation support.
    - Manage focus order and visibility effectively.
    - Maintain accessible color contrast ratios.
    - Follow a logical heading hierarchy.
    - Make all interactive elements accessible.
    - Provide clear and accessible error feedback.

    Security
    - Implement input sanitization to prevent XSS attacks.
    - Use DOMPurify for sanitizing HTML content.
    - Use proper authentication methods.

    Internationalization (i18n)
    - Use next-i18next for translations
    - Implement proper locale detection
    - Use proper number and date formatting
    - Implement proper RTL support
    - Use proper currency formatting

    Documentation
    - Use JSDoc for documentation
    - Document all public functions, classes, methods, and interfaces
    - Add examples when appropriate
    - Use complete sentences with proper punctuation
    - Keep descriptions clear and concise
    - Use proper markdown formatting
    - Use proper code blocks
    - Use proper links
    - Use proper headings
    - Use proper lists
css
java
javascript
less
next.js
radix-ui
react
redux
+5 more
Himanshu-Singh-Chauhan/jodhpur

Used in 1 repository

TypeScript
## Next.js: Route Handler 우선 사용

-   **모든 API 엔드포인트는 Route Handler를 사용하여 구현하세요.**
-   **데이터베이스 작업, 외부 API 호출, 인증 등 복잡한 서버 작업은 반드시 Route Handler를 사용하세요.**
-   **Server Action은 단순 폼 제출 또는 간단한 데이터 처리에만 사용하세요.**

---

## Next.js 라우팅: App Router 사용

-   **프로젝트 내 라우팅은 Pages Router 대신 App Router를 사용하세요.**

---

## 프로젝트 구조: 주요 폴더 구조 예시

-   **프로젝트 구조는 다음과 같이 설정하세요. `src` 폴더는 사용하지 않습니다.**

```

your-nextjs-project/
│
├── app/                      # App Router 라우트 폴더
│ ├── api/                    # API 엔드포인트 관련 폴더
│ ├── dashboard/              # 개별 페이지 폴더 예시 (재사용되지 않는 컴포넌트 포함)
│ └─├── page.tsx              # dashboard 페이지
│   └── DashboardStats.tsx    # 페이지 전용 컴포넌트
├── components/               # 공통 컴포넌트 모음
│ ├── ui                      # ShadCN 공통 UI 컴포넌트
│ │ ├── button.tsx
│ │ ├── input.tsx
│ │ ├── select.tsx
│ │ ├── toast.tsx
│ │ ├── toaster.tsx
│ ├── layout/                 # 레이아웃 관련 공통 컴포넌트
│ │ ├── header.tsx
│ │ ├── footer.tsx
│ │ ├── sidebar.tsx
│ ├── OptionsDropdown.tsx
│ ├── PromptInput.tsx
│ └── GeneratedImagePreview.tsx
│
├── store/                    # 상태 관리 관련 폴더
│ ├── gallery.ts              # 갤러리 관련 상태 관리
│ ├── auth.ts                 # 인증 관련 상태 관리
│ ├── community.ts            # 커뮤니티 관련 상태 관리
│ └── index.ts                # 상태 관리 유틸리티 및 타입 정의
│
├── hooks/                    # 커스텀 훅 폴더
│ ├── use-toast.ts            # 토스트 관련 훅
│ ├── use-auth.ts             # 인증 관련 훅
│ └── use-media.ts            # 미디어 쿼리 등 UI 관련 훅
│
├── db/                       # 데이터베이스 관련 폴더
│ ├── schema.ts               # DrizzleORM 스키마 정의 파일
│ └── index.ts                # 데이터베이스 연결 초기화 파일
│
│
├── public/                   # 정적 파일 (이미지, 폰트 등)
│ └── favicon.ico
│
├── styles/                   # 글로벌 스타일 (CSS, SCSS, Tailwind 등)
│ └── globals.css
│
├── types/                    # 공통 인터페이스 및 타입 정의
│ └── index.ts                # 여러 파일에서 사용할 공통 타입 및 인터페이스 정의 파일
│
├── utils/                    # 유틸리티 함수 모음
│ ├── fetcher.ts              # API 호출 등 유틸리티 함수
│ └── mockData.ts             # 목업 데이터 관리
│
├── middleware.ts             # 미들웨어 설정 파일
├── .env                      # 환경 변수 설정 파일
├── drizzle.config.ts         # DrizzleORM 설정 파일
├── next.config.mjs           # Next.js 설정 파일
├── package.json              # 프로젝트 패키지 정보
└── tsconfig.json             # TypeScript 설정 파일

```

---

## TypeScript 사용: TS 사용 권장

-   **프로젝트 반드시 TypeScript를 사용하세요.**
-   **타입 안정성을 위해 모든 컴포넌트와 서버 로직에 TypeScript를 적용하세요.**

---

## TypeScript 인터페이스 정의 규칙: 'I' 접두사 사용

-   **인터페이스 정의 시 이름 앞에 'I'를 접두사로 추가하세요.**
-   예시:
    ```typescript
    export interface IComment {
        id: string
        text: string
        author: string
    }
    ```
-   인터페이스 생성은 types/index.ts 파일에 작성하세요.

---

## 컴포넌트 생성: ShadCN 우선 사용

-   **모든 UI 컴포넌트는 ShadCN을 우선으로 생성하세요.**
-   ShadCN 컴포넌트 생성 CLI 명령어는 `npx shadcn@latest add`입니다.
-   **Toast 관련 컴포넌트는 다음 위치에 있습니다:**
    ```
    components/ui/toast.tsx      # Toast 기본 컴포넌트
    components/ui/toaster.tsx    # Toast 컨테이너 컴포넌트
    hooks/use-toast.ts   # Toast 커스텀 훅
    ```
---


## css등 스타일링은 기본적으로 tailwind를 사용하여 구현합니다.
-   **최대한 스타일링은 기본적으로 tailwind를 사용하여 구현하고 불가시에만 커스터 css를 사용하세요.**
---


## 코드 배포는 향후 vercel을 사용하여 배포합니다.
-   **코드 배포는 향후 vercel을 사용하여 배포합니다.**
-   **배포는 정적 파일로 빌드외어 clinet side 기준으로 배포될 예정입니다.**
---

## 코드 포멧과 Lint 규칙을 반드시 지키세요.
-   **코드 포멧과 Lint 규칙을 반드시 지켜서 코드가 일관성 있게 작성되게 해주세요.**
---

css
drizzle-orm
javascript
next.js
shadcn/ui
svelte
tailwindcss
typescript
+1 more

First seen in:

wonny1945/pokemon-gacha

Used in 1 repository

TypeScript
You are an expert developer proficient in TypeScript, React, TailwindCSS and Next.js, Supabase, Zod, Zustand, TanStack React Query

Authentication

- for this project we are going to use Clerk.dev for our authetication

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 with exported components, subcomponents, helpers, static content, and types.
- Favor named exports for components and functions.

TypeScript and Zod Usage

- Use TypeScript for all code; prefer interfaces over types for object shapes.
- Utilize Zod for schema validation and type inference.
- Implement functional components with TypeScript interfaces for props.

Syntax and Formatting

- Use the `function` keyword for pure functions.
- Write declarative JSX with clear and readable structure.

UI and Styling

- Implement responsive design with a mobile-first approach.
- Ensure styling consistency between web and native applications.

State Management and Data Fetching

- Use Zustand for state management.
- Use TanStack React Query for data fetching, caching, and synchronization.

Error Handling and Validation

- Prioritize error handling and edge cases.
- Handle errors and edge cases at the beginning of functions.

- Utilize guard clauses to handle preconditions and invalid states early.
- Implement proper error logging and user-friendly error messages.
- Use custom error types or factories for consistent error handling.

Performance Optimization

- Optimize for both web and mobile performance.

Backend and Database

- Use Supabase for backend services, including authentication and database interactions.
- Follow Supabase guidelines for security and performance.
- Use Zod schemas to validate data exchanged with the backend.
- We are going to use Uploadthing to store our images

Key Conventions

- Ensure code is clean, well-documented, and follows the project's coding standards.
- Implement error handling and logging consistently across the application.

Follow Official Documentation

- Adhere to the official documentation for each technology used.
- For Next.js, focus on data fetching methods and routing conventions.
- Stay updated with the latest best practices and updates if needed search web.

Output Expectations

- Code Examples Provide code snippets that align with the guidelines above.
- Explanations Include brief explanations to clarify complex implementations when necessary.
- Clarity and Correctness Ensure all code is clear, correct, and ready for use in a production environment.
- Best Practices Demonstrate adherence to best practices in performance, security, and maintainability.
clerk
css
golang
javascript
next.js
react
supabase
tailwindcss
+2 more

First seen in:

vikaswakde/mitralist

Used in 1 repository

Solidity
You are the seasoned Web3 CTF player and smart contract expert.
Follow the guidelines below for your response: 
        1. Describe this practical, exploitable code vulnerability in detail. It should be logical and an error or logic missing in the code, not based on technical errors or just security advice or best practices.
        2. Show step-by-step how to exploit this vulnerability. The exploit should be beneficial for an auditor and could invalidate the code.
        3. Keep your description clear and concise. Avoid vague terms.
        4. Remember, all numbers in the code are positive, the code execution is atomic, which means the excution would not be interuppted or manipulated by another address from another transaction, and safemath is in use.
        5. dont response in "attaker use some way" the exploit method must be clear and useable
        6. Your main purpose is to achieve the isSolved condition.
        Ensure your response is as detailed as possible, and strictly adheres to all the above requirements
The vulnerability must satisfy one of the following conditions:
            a. Manipulation of governance voting results.
            b. Direct theft of any user funds, at-rest or in-motion, excluding unclaimed yield.
            c. Permanent or temporary freezing of funds or unclaimed yield.
            d. Extraction of miner-extractable value (MEV).
            e. Protocol insolvency.
            f. Theft or freezing of unclaimed yield.
            g. A smart contract is unable to operate due to lack of token funds.
            h. Block stuffing for profit.
            i. Griefing (an attacker causing damage to the users or the protocol without any profit motive).
            j. A contract failing to deliver promised returns, but not losing value. 
dockerfile
go
golang
handlebars
javascript
julia
makefile
nix
+8 more
kkontheway/Web3CTF_Solutions

Used in 1 repository

Dart
// Flutter MVVM Project .cursorrules

// Project Overview
// This Flutter application follows the MVVM architecture to display news articles in a scrollable widget. The app scrapes content from a specified website and presents it with headlines, summaries, and images. Tapping an article redirects the user to the original webpage.

// Coding Standards
- Use **English** for all code and documentation.
- Always declare the **type** of each variable and function (parameters and return values); avoid using `any`.
- Use **PascalCase** for class names.
- Use **camelCase** for variables, functions, and methods.
- Use **snake_case** for file and directory names.
- Use **UPPERCASE** for environment variables.
- Avoid magic numbers; define constants appropriately.
- Begin function names with a **verb** to indicate action.
- Use descriptive names for boolean variables, e.g., `isLoading`, `hasError`, `canDelete`.
- Prefer complete words over abbreviations, except for standard terms like `API`, `URL`, or common loop variables like `i`, `j`.

// Project Structure
- **lib/**                  // Root directory for all source code
  - **models/**            // Data models representing the application's data structures
  - **viewmodels/**        // ViewModel classes responsible for business logic and state management
  - **views/**             // UI components and screens
  - **services/**          // Classes for data fetching, such as web scraping or API calls
  - **utils/**             // Utility functions and helpers
  - **widgets/**           // Reusable UI components
  - **constants/**         // Application-wide constants and configurations
  - **theme/**             // Theme data and styling configurations

// MVVM Best Practices
- Ensure **Views** are free of business logic; they should only handle UI rendering and user input.
- **ViewModels** should manage the state and business logic, exposing data to Views through **ChangeNotifier** or similar mechanisms.
- **Models** should represent the data structures and be independent of UI components.
- Implement **dependency injection** to manage dependencies between classes, facilitating easier testing and maintenance.
- Use **Provider** or other state management solutions to manage the interaction between Views and ViewModels.
- Ensure that **ViewModels** do not directly reference Views to maintain a clear separation of concerns.

// State Management
- Utilize **ChangeNotifier** in ViewModels to notify Views of state changes.
- Avoid direct mutation of state within Views; instead, invoke methods on the ViewModel.
- Keep the widget tree shallow to simplify state management and improve readability.
- Break down large widgets into smaller, focused widgets to promote reusability and clarity.
- Use **const** constructors wherever possible to reduce unnecessary rebuilds and enhance performance.

// Networking and Data Handling
- Use the **`http`** package for making HTTP requests.
- Parse and handle data using appropriate Dart libraries, ensuring error handling and data validation.
- Implement caching strategies to improve performance and reduce redundant network calls.
- Handle network errors gracefully with proper error messages to users.
- Implement retry mechanisms for failed network requests where appropriate.

// Testing
- Write **unit tests** for ViewModels to verify business logic.
- Write **widget tests** for Views to ensure UI components render correctly.
- Use **mocking** frameworks to simulate data fetching and other services during testing.

// Documentation
- Document all classes and public methods using Dart's documentation comments.
- Maintain an up-to-date **README.md** with project setup instructions and architectural overviews.
- Include inline comments for complex logic to enhance code readability and maintainability.
- Follow this documentation format for classes and methods:

  ```dart
  /// A brief description of the class/method.
  ///
  /// A more detailed description if needed.
  /// 
  /// Parameters:
  /// - [param1]: Description of first parameter
  /// - [param2]: Description of second parameter
  ///
  /// Returns: Description of return value
  /// 
  /// Throws: Description of potential exceptions
  ```

// Git Practices
- Write clear, descriptive commit messages.
- Create feature branches for new features.
- Review code before merging to main branch.
- Keep commits focused and atomic.
- Follow conventional commit message format:
  ```
  feat: add news article caching
  fix: resolve image loading issue
  docs: update README with setup instructions
  ```
dart
kotlin
objective-c
ruby
swift

First seen in:

cjj4979/newsroom

Used in 1 repository