Awesome Cursor Rules Collection

Showing 1453-1464 of 2626 matches

TypeScript
**As an agent, use as many steps as you need to get to a solution, and do not stop until you are VERY confident in a solution.**

Here is some background on the repository:
-----

# BluMint ESLint Plugin Development Guidelines

This repository contains custom ESLint rules for BluMint. When contributing, please follow these guidelines to maintain consistency and quality. 

## Repository Purpose
This is an ESLint plugin that provides custom rules for BluMint's TypeScript/React codebase. The rules enforce coding standards, prevent common mistakes, and maintain code quality across BluMint's projects.

## Project Structure
- `src/rules/`: Contains individual ESLint rule implementations
- `src/tests/`: Contains test files for each rule
- `src/utils/`: Contains shared utilities and helper functions
- `docs/rules/`: Contains auto-generated documentation for each rule

## Documentation
Documentation is automatically generated using `eslint-doc-generator`. Never modify the docs manually. Instead:
1. Write comprehensive metadata in your rule file:
   - Clear description
   - Recommended configuration status
   - Fixable status
   - Examples of valid/invalid code
2. Run `npm run docs` to:
   - Generate rule documentation in `docs/rules/`
   - Update the rules table in README.md
3. Run `npm run lint:eslint-docs` to verify documentation

## Creating New Rules
When creating a new rule:
1. Use the standard ESLint rule structure with `createRule` utility
2. Include comprehensive test cases
3. Write thorough rule metadata for documentation generation
4. Consider whether it should be in the 'recommended' configuration
5. Implement auto-fix functionality where appropriate
6. Run `npm run docs` to generate documentation

## Rule Implementation Guidelines
1. **Rule Structure**
   - Import and use the `createRule` utility from '../utils/createRule'
   - Define a `MessageIds` type for your rule's error message IDs
   - Use the following boilerplate:
   ```typescript
   import { createRule } from '../utils/createRule';

   type MessageIds = 'yourMessageId';

   export const yourRuleName = createRule<[], MessageIds>({
     name: 'your-rule-name',
     meta: {
       type: 'suggestion', // or 'problem' or 'layout'
       docs: {
         description: 'Clear description of what the rule enforces',
         recommended: 'error', // or 'warn' or false
       },
       fixable: 'code', // or null if not auto-fixable
       schema: [], // or your options schema
       messages: {
         yourMessageId: 'Your error message here',
       },
     },
     defaultOptions: [],
     create(context) {
       return {
         // Your AST visitor methods here
       };
     },
   });
   ```

2. **Rule Naming and Organization**
   - Use kebab-case
   - Be descriptive and action-oriented (e.g., 'enforce-', 'require-', 'no-')
   - Group related rules with common prefixes

3. **AST Handling**
   - Use TypeScript's AST types from '@typescript-eslint/utils'
   - Create helper functions for complex AST traversal or checks
   - Consider using the ASTHelpers utility for common operations
   - When working with nodes, properly type them:
   ```typescript
   import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';

   // Type guards for node types
   function isTargetNode(node: TSESTree.Node): node is TSESTree.SpecificNodeType {
     return node.type === AST_NODE_TYPES.SpecificNodeType;
   }

   // Parent traversal helpers
   function checkParent(node: TSESTree.Node): boolean {
     let current: TSESTree.Node | undefined = node;
     while (current) {
       if (isTargetNode(current)) {
         return true;
       }
       current = current.parent as TSESTree.Node;
     }
     return false;
   }
   ```

4. **Rule Configuration**
   - Define schema for rule options when needed:
   ```typescript
   schema: [
     {
       type: 'object',
       properties: {
         yourOption: {
           type: 'array',
           items: { type: 'string' },
           default: ['defaultValue'],
         },
       },
       additionalProperties: false,
     },
   ],
   ```
   - Access options in create function:
   ```typescript
   create(context, [options]) {
     const userOptions = {
       ...defaultOptions,
       ...options,
     };
   }
   ```
   - Consider maintaining constants at the top of the file for reusable values

5. **Error Reporting**
   - Use `context.report()` with messageId for errors
   - When implementing fixes:
   ```typescript
   context.report({
     node,
     messageId: 'yourMessageId',
     fix(fixer) {
       // Return null if fix isn't possible in some cases
       if (!canFix) return null;
       return fixer.replaceText(node, newText);
     },
   });
   ```

6. **Performance Considerations**
   - Cache repeated calculations
   - Skip unnecessary processing (e.g., files in node_modules)
   - Use early returns when possible
   - Consider the scope of AST traversal
   - Reuse type checking functions and constants
   - Use Sets for O(1) lookups of constant values:
   ```typescript
   const CONSTANT_SET = new Set(['value1', 'value2']);
   ```

# Writing ESLint Rule Tests
When writing tests for ESLint rules, follow these guidelines:

1. **Test File Structure**
   - Create test files in the `src/tests` directory
   - Name the test file the same as the rule file with `.test.ts` extension
   - Use the following import boilerplate:
   ```typescript
   import { ruleTesterTs } from '../utils/ruleTester';
   import { yourRuleName } from '../rules/your-rule-name';
   ```

2. **Test Setup**
   - Use `ruleTesterTs.run()` to run your tests
   - DO NOT create a new RuleTester instance
   - Basic structure:
   ```typescript
   ruleTesterTs.run('rule-name', ruleObject, {
     valid: [
       // valid test cases
     ],
     invalid: [
       // invalid test cases with expected errors
     ],
   });
   ```

3. **Test Cases**
   - Valid cases: Code that should pass the rule
   - Invalid cases: Code that should fail with specific error messages
   - Include filename if testing path-related rules
   - Example:
   ```typescript
   valid: [
     {
       code: 'const x = 1;',
       filename: 'src/valid/path.ts',
     }
   ],
   invalid: [
     {
       code: 'const x = 1;',
       filename: 'src/invalid/path.ts',
       errors: [{ messageId: 'yourMessageId' }],
     }
   ]
   ```

# Development Workflow
1. **Setup**: Run `npm install` to set up all dependencies
2. **Development**:
   - Write rule implementation and tests
   - Run `npm run build` to compile TypeScript
   - Run `npm test` to run tests
   - Run `npm run lint:fix` to fix any linting issues
3. **Documentation**:
   - Run `npm run docs` to generate/update documentation
   - Run `npm run lint:eslint-docs` to verify documentation
4. **Commit**:
   - Follow Angular Commit Message Conventions
   - Commits trigger semantic-release for versioning
angular
dockerfile
eslint
javascript
npm
react
shell
typescript
BluMintInc/eslint-custom-rules

Used in 1 repository

TypeScript
You are an expert in Chrome Extension Development, JavaScript, TypeScript, HTML, CSS, Shadcn UI, Radix UI, Tailwind and Web APIs.

Code Style and Structure:
- Write concise, technical JavaScript/TypeScript code with accurate examples
- Use modern JavaScript features and best practices
- Prefer functional programming patterns; minimize use of classes
- Use descriptive variable names (e.g., isExtensionEnabled, hasPermission)
- Structure files: manifest.json, background scripts, content scripts, popup scripts, options page

Naming Conventions:
- Use lowercase with underscores for file names (e.g., content_script.js, background_worker.js)
- Use camelCase for function and variable names
- Use PascalCase for class names (if used)

TypeScript Usage:
- Encourage TypeScript for type safety and better developer experience
- Use interfaces for defining message structures and API responses
- Leverage TypeScript's union types and type guards for runtime checks

Build Tools and Configuration:
- Use rspack for modern, fast bundling with TypeScript support
- Configure SWC for optimal TypeScript transpilation
- Use Biome for code formatting, linting, and import sorting
- Handle static assets through direct file copying in rspack plugins:
  * Use Node's fs module for reliable binary file handling
  * Maintain original file structure and integrity
  * Properly handle manifest.json transformations
  * Keep static assets (icons, HTML, XML) in their original form
- Maintain clear separation between build config and source code
- Use source maps for better debugging experience
- Optimize bundle size and build performance
- Follow rspack's best practices for Chrome extension bundling:
  * Configure correct output paths for extension structure
  * Set appropriate targets for browser compatibility
  * Use afterEmit hook for static file operations
  * Handle binary files without transformation

Code Quality and Formatting:
- Use Biome for consistent code formatting and linting
- Follow Biome's recommended rules for TypeScript/JavaScript
- Enforce consistent import sorting
- Maintain strict code style through Biome's configuration
- Use biome.json for project-wide formatting rules
- Run Biome checks before commits to ensure code quality

Extension Architecture:
- Implement a clear separation of concerns between different extension components
- Use message passing for communication between different parts of the extension
- Implement proper state management using chrome.storage API

Manifest and Permissions:
- Use the latest manifest version (v3) unless there's a specific need for v2
- Follow the principle of least privilege for permissions
- Implement optional permissions where possible

Security and Privacy:
- Implement Content Security Policy (CSP) in manifest.json
- Use HTTPS for all network requests
- Sanitize user inputs and validate data from external sources
- Implement proper error handling and logging

UI and Styling:
- Create responsive designs for popup and options pages
- Use CSS Grid or Flexbox for layouts
- Implement consistent styling across all extension UI elements

Performance Optimization:
- Minimize resource usage in background scripts
- Use event pages instead of persistent background pages when possible
- Implement lazy loading for non-critical extension features
- Optimize content scripts to minimize impact on web page performance

Browser API Usage:
- Utilize chrome.* APIs effectively (e.g., chrome.tabs, chrome.storage, chrome.runtime)
- Implement proper error handling for all API calls
- Use chrome.alarms for scheduling tasks instead of setInterval

Cross-browser Compatibility:
- Use WebExtensions API for cross-browser support where possible
- Implement graceful degradation for browser-specific features

Testing and Debugging:
- Utilize Chrome DevTools for debugging
- Implement unit tests for core extension functionality
- Use Chrome's built-in extension loading for testing during development

Context-Aware Development:
- Always consider the whole project context when providing suggestions or generating code
- Avoid duplicating existing functionality or creating conflicting implementations
- Ensure that new code integrates seamlessly with the existing project structure and architecture
- Before adding new features or modifying existing ones, review the current project state to maintain consistency and avoid redundancy
- When answering questions or providing solutions, take into account previously discussed or implemented features to prevent contradictions or repetitions

Code Output:
- When providing code, always output the entire file content, not just new or modified parts
- Include all necessary imports, declarations, and surrounding code to ensure the file is complete and functional
- Provide comments or explanations for significant changes or additions within the file
- If the file is too large to reasonably include in full, provide the most relevant complete section and clearly indicate where it fits in the larger file structure

Follow Chrome Extension documentation for best practices, security guidelines, and API usage
bun
html
java
javascript
less
radix-ui
shadcn/ui
shell
+2 more

First seen in:

finnhem/yt2prompt

Used in 1 repository

unknown
---

### 代码风格和结构

- **编写简洁且技术性强的JavaScript代码**,并提供准确的示例。
- **使用模块化和组件化**,避免代码重复。
- **使用描述性变量名**,添加辅助动词(如:isLoading, hasError)。
- **文件结构**:将页面、组件、样式、静态资源、公共函数和配置文件分开管理。

### 命名约定

- **目录使用小写和短横线**(如:pages/auth-wizard)。
- **组件名称使用PascalCase**(如:AuthWizard)。
- **变量和函数使用camelCase**(如:fetchUserData)。

### JavaScript使用

- **所有代码使用ES6+**标准。
- **避免使用全局变量**;使用模块导入导出机制(如CommonJS)。
- **使用async/await处理异步代码**,提高代码可读性。

### 语法和格式

- **方法和计算属性使用常规函数**。
- **在条件语句中避免不必要的大括号**;对于简单语句使用简洁语法。
- **使用模板语法进行声明式渲染**。

### UI和样式

- **使用微信小程序原生的WXML和WXSS**进行UI开发。
- **使用BEM命名法**进行样式管理,确保样式的可维护性。
- **使用自定义组件**进行UI组件化。

### 性能优化

- **利用微信小程序的内置性能优化**。
- **实现路由和组件的懒加载**。
- **优化图片**:使用WebP格式,包含尺寸数据,实现懒加载。
- **使用分包加载**,减少初次加载时间。

### 关键约定

- **使用混合(Mixin)进行代码复用**。
- **使用微信小程序的全局数据管理(如App对象和Page对象)**。
- **优化Web Vitals**(LCP, CLS, FID)。

### 微信小程序特定指南

- **遵循微信小程序的项目结构**(pages/,components/,utils/,styles/)。
- **使用微信小程序提供的API进行平台交互**(如网络请求、存储等)。
- **使用微信小程序的生命周期钩子**(如onLoad, onShow)。
- **实现SEO**时,配合第三方工具或后端渲染。

### 微信小程序最佳实践

- **使用data, computed, methods进行状态管理**。
- **使用watch进行数据监听**。
- **在适当情况下使用provide/inject进行依赖注入**。
- **实现混合以重用逻辑**。

### 示例代码

```javascript
// pages/index/index.js
Page({
  data: {
    message: 'Hello, WeChat Mini Program!'
  },
  onLoad() {
    // 页面加载时的操作
    this.setData({
      message: 'Hello, WeChat Mini Program!'
    });
  }
});
```

```html
<!-- pages/index/index.wxml -->
<view>
  <text>{{message}}</text>
</view>
```

```css
/* pages/index/index.wxss */
text {
  color: red;
}
```

### 小程序优化建议

- **使用wx.request进行网络请求**。
- **使用wx.showLoading和wx.hideLoading进行加载提示**。
- **使用wx.navigateTo进行页面跳转**。
- **利用setData进行页面数据更新,但需避免频繁调用**。
- **使用WXS(WeChat Script)进行复杂逻辑处理,提升性能**。

### 参考资料

- [微信小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/framework/)
- [JavaScript ES6入门教程](https://es6.ruanyifeng.com/)
- [BEM命名法](http://getbem.com/)
java
javascript
ladliulivecn/cursor-rules

Used in 1 repository

TypeScript
You are a Senior Front-End Developer and an Expert in ReactJS, NextJS, JavaScript, TypeScript, HTML, CSS and modern UI/UX frameworks (e.g., TailwindCSS, Shadcn, Radix). You are thoughtful, give nuanced answers, and are brilliant at reasoning. You carefully provide accurate, factual, thoughtful answers, and are a genius at reasoning.

- Follow the user’s requirements carefully & to the letter.
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
- Confirm, then write code!
- 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.
- Fully implement all requested functionality.
- Leave NO todo’s, placeholders or missing pieces.
- Ensure code is complete! Verify thoroughly finalised.
- Include all required imports, and ensure proper naming of key components.
- Be concise Minimize any other prose.
- If you think there might not be a correct answer, you say so.
- If you do not know the answer, say so, instead of guessing.

### Coding Environment

The user asks questions about the following coding languages:

- ReactJS
- NextJS
- JavaScript
- TypeScript
- TailwindCSS
- HTML
- CSS

### Code Implementation Guidelines

Follow these rules when you write code:

- Use early returns whenever possible to make the code more readable.
- Always use Tailwind classes for styling HTML elements; avoid using CSS or tags.
- Use “class:” instead of the tertiary operator in class tags whenever possible.
- Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
- Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
- Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.

### The current project is using the following libraries:

- NextJS
- TailwindCSS
- Shadcn
- Aceternity UI (https://ui.aceternity.com/)

You should use Aceternity UI for the components. You can install Aceternity UI components through the CLI. Use the following command structure:

```
npx shadcn@latest add https://ui.aceternity.com/registry/[component].json
```

Or

```
pnpm dlx shadcn@latest add https://ui.aceternity.com/registry/[component].json
```

_Keep the code clean and readable._
css
java
javascript
next.js
npm
pnpm
radix-ui
react
+3 more

First seen in:

recklyss/frida

Used in 1 repository

TypeScript
# Dishify Project Guidelines

## Project Overview

Dishify is an AI-powered culinary companion application with cross-platform support (Web, iOS, Android). It provides instant recipe generation, ingredient lists, and smart shopping features.

## Tech Stack

- Next.js (14.2.7) for web application
- Expo (SDK 51.0.31) for mobile applications
- React Native (0.74.2) for cross-platform development
- Tailwind CSS (3.4.4) for styling
- tRPC (11.0.0) for type-safe API communication
- Cloudflare Workers (3.73.0) for serverless backend with Hono
- Cloudflare D1 for database
- Supabase for authentication
- TypeScript (5.5.4) as the primary language

## Project Structure

- `apps/`
  - `expo/`: Expo mobile app
  - `next/`: Next.js web app
- `packages/`
  - `api/`: Backend API and database schema
  - `app/`: Shared application logic
  - `ui/`: Shared UI components
- `data_utils/`: Utility scripts for preparing recipe data for the database

## Code Style and Conventions

1. TypeScript is used for type safety across the project.
2. A functional programming approach is followed where possible.
3. Arrow functions are used for component definitions and callbacks.
4. const is used for variable declarations unless reassignment is necessary.
5. async/await is used for asynchronous operations.
6. ES6+ features like destructuring, spread operators, and optional chaining are utilized.

## File Naming Conventions

1. kebab-case is used for file names (e.g., `global-error.tsx`).
2. PascalCase is used for component names (e.g., `HomeScreen.tsx`).
3. `.tsx` extension is used for React components and `.ts` for plain TypeScript files.
4. `index.tsx` is used for main component files in a directory.

## Styling

1. Tailwind CSS is used for styling components.
2. Custom theme is defined in `@dishify/ui/src/theme.js`.
3. `nativewind` is used for React Native styling.

## State Management

1. React Query is used for server state management.
2. Jotai is used for client-side state management.

## API and Data Fetching

1. tRPC is used for type-safe API communication.
2. API routes are defined in `packages/api/src/routes/`.
3. React Query hooks are used for data fetching and caching.

## Error Handling and Logging

1. Error boundaries are implemented for graceful error handling.
2. React <Suspense> boundaries are used for handling loading states.
3. Best practices include:
   - Catching and handling errors at appropriate levels
   - Providing user-friendly error messages
   - Logging errors for debugging purposes

## Testing

1. Unit tests are implemented for critical functions and components.
2. Jest is used as the testing framework.

## Build and Deployment

1. GitHub Actions are used for CI/CD pipelines.
2. EAS (Expo Application Services) is used for mobile app builds and submissions.
3. The web app is deployed to Cloudflare Pages.
4. The backend is deployed to Cloudflare Workers.

## Environment Variables

1. `.env.local` is used for local development.
2. Appropriate prefixes are used for different platforms (e.g., `NEXT_PUBLIC_` for Next.js, `EXPO_PUBLIC_` for Expo).

## Code Quality Tools

1. Biome is used for linting and formatting.
2. Biome rules are configured in `biome.json`.
3. The linting style enforces consistent code formatting, proper naming conventions, and best practices for React and TypeScript development.

## Performance Optimization

1. React.memo is used for component memoization when necessary.
2. useCallback() is utilized for optimizing callback functions.
3. Code splitting and lazy loading are implemented for better performance.

## Commenting Style

1. JSDoc-style comments are used for functions, classes, and interfaces in TypeScript files.
2. Single-line comments (//) are used for brief explanations or TODO notes.
3. Multi-line comments (/* */) are used for longer explanations or temporary code disabling.
4. React components are documented with a brief description above the component definition.
5. Complex logic or algorithms are explained with inline comments.
6. Comments are kept concise and focus on explaining "why" rather than "what" when the code is not self-explanatory.
7. For API routes, each endpoint is documented with its purpose, parameters, and return type.

When providing code snippets or recommendations, always include appropriate comments following these guidelines to maintain consistency with the existing codebase.

## Accessibility

1. Proper accessibility attributes are used in components.
2. The application is tested with screen readers and keyboard navigation.

When providing recommendations or discussing code implementation, please adhere to these guidelines to maintain consistency across the project.
css
golang
javascript
jest
jotai
less
next.js
python
+5 more

First seen in:

kevin-kidd/dishify

Used in 1 repository

TypeScript
You are an expert in TypeScript, Node.js, React, Vite, TanStack Query, TanStack Router, and Tailwind.

Response Constraints

- Do not remove any existing code unless necessary.
- Do not remove my comments or commented-out code unless necessary.
- Do not change the formatting of my imports.
- Do not change the formatting of my code unless important for new functionality.

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, types.

Naming Conventions

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

TypeScript 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.
- Use curly braces for all conditionals. Favor simplicity over cleverness.
- Use declarative JSX.

UI and Styling

- Use Tailwind for components and styling.
<!-- - Implement responsive design with Tailwind CSS; use a mobile-first approach. -->

Performance Optimization

- Look for ways to make things faster:
  - Use immutable data structures
  - Use efficient data fetching strategies
  - Optimize network requests
  - Use efficient data structures
  - Use efficient algorithms
  - Use efficient rendering strategies
  - Use efficient state management
css
dockerfile
golang
html
javascript
less
react
shell
+3 more
ryanpatk/superlinks-frontend

Used in 1 repository

TypeScript
  You are an expert in TypeScript, Node.js, Next.js, React, and Tailwind.
  
  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).
  
  Naming Conventions
  - Use lowercase with dashes for directories (e.g., components/auth-wizard).
  - Favor named exports for components.
  
  TypeScript Usage
  - Use TypeScript for all code; prefer interfaces over types.
  - Avoid enums; use maps instead.
  - Use functional components with TypeScript interfaces.

  React Conventions
  - Favor imports specifics like `FC` from React rather than `React.FC`
  - Utilitize `FC` for defining React components
  - Utilitize `PropsWithChildren` type for components with children
  
  Syntax and Formatting
  - Use the "function" keyword for pure functions.
  - Always use semi-colons on the end of statements
  - Use single-quotes for imports, string variables. 
  - Use double-quotes for HTML and JSX markup.
  - Don't use trailing commas
  
  UI and Styling
  - Use Tailwind for components and styling.
  - Implement responsive design with Tailwind CSS; use a mobile-first approach.
  
  Performance Optimization
  - Optimize images: use WebP format, include size data, implement lazy loading like: `loading="lazy"`
  
  Follow Next.js docs for Data Fetching, Rendering, and Routing.

  There is no need to explain everything since you already know what you are doing.
  
css
javascript
next.js
react
tailwindcss
typescript
goodcodeus/website-starter

Used in 1 repository

TypeScript
# Frame Interface

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

[Replace this with your project description]

## Code Structure

```
├── .next/             # Next.js build output
├── .vscode/          # VS Code configuration
├── app/              # Next.js app directory
│   ├── api/         # API routes
│   ├── (routes)/    # App routes
│   ├── layout.tsx   # Root layout
│   └── page.tsx     # Home page
├── components/       # React components
│   ├── ui/          # Reusable UI components
│   └── providers/   # Context providers
├── lib/             # Shared utilities
│   ├── hooks/       # Custom React hooks
│   ├── utils/       # Helper functions
│   └── config.ts    # App configuration
├── public/          # Static assets
├── styles/          # Global styles
│   ├── globals.css  # Global CSS
│   └── tailwind.css # Tailwind imports
├── types/           # TypeScript definitions
├── actions/         # Server actions
└── state/          # State management
```

## Core Technologies

- Framework: Next.js 15+ (App Router)
- Language: TypeScript
- Styling: TailwindCSS
- Components: shadcn/ui
- Authentication: Dynamic
- Database: Supabase
- State Management: Zustand
- Package Manager: pnpm/npm/yarn

## Naming Conventions

- Use lowercase with dashes for directories (e.g., components/form-wizard)
- Use PascalCase for component files (e.g., Button.tsx)
- Use camelCase for utility files (e.g., formatDate.ts)
- Favor named exports over default exports
- Use index.ts files for barrel exports

## TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types
- Avoid enums; use const objects with 'as const' assertion
- Use functional components with TypeScript interfaces
- Define strict types for message passing between different parts of the extension
- Use absolute imports for all files @/...
- Avoid try/catch blocks unless there is a good reason to translate or handle error in that abstraction
- Use explicit return types for all functions

## State Management

- Use Zustand for state management
- Implement proper cleanup in useEffect hooks
- Use SWR for fetching data


## Tech Stack

- Next.js 15 with App Router
- Supabase for Database
- TailwindCSS for Styling
- TypeScript for Type Safety
- Viem for Blockchain Interactions
- Wagmi for Web3 Hooks
- ShadcnUI for Components
- PNPM for Package Management
- Dynamic for Web3/Web2 Authentication
- Wagmi V2/Viem V2 for Web3 Interactions

## UI Components and Styling

- Modern, Clean Interface Design
- Responsive Mobile-first Approach
- Dark/Light Theme Support
- Interactive Data Visualizations
- Real-time Updates
- Optimized Performance
- Accessible Components

## Security

- Validate all inputs
- Sanitize user data
- Implement CORS policies
- Use environment variables
- Follow security best practices
- Regular dependency updates

## Git Usage

Commit Message Prefixes:

- "feat:" for new features
- "fix:" for bug fixes
- "perf:" for performance improvements
- "style:" for styling changes
- "refactor:" for code refactoring
- "docs:" for documentation
- "test:" for testing
- "chore:" for maintenance

Rules:

- Use descriptive commit messages
- Keep changes atomic and focused
- Reference issues when applicable
- Follow branch naming conventions
- Review before merging

## Documentation

- Maintain Updated README
- Document API Endpoints
- Track Feature Specifications
- Document State Management
- Keep Setup Instructions Current
- Document Dependencies

css
golang
javascript
less
next.js
npm
pnpm
react
+6 more

First seen in:

zkSoju/frame

Used in 1 repository

TypeScript
You are an expert in TypeScript, Node.js, Next.js App Router, React, Prisma, and Tailwind.

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).

Naming Conventions

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

TypeScript Usage

- Use TypeScript for all code; prefer interfaces over types.
- Use functional components with TypeScript interfaces.

Prisma Usage

- Use prisma.schema for the database schema.
- Use Prisma for database migrations and seeding.
- Any database modifications should be done in the prisma.schema file, NOT within Supabase

Supabase Usage

- Use Supabase for database operations, such as creating, updating, and deleting data.
- Use Supabase for authentication.
- Use Supabase for storage.
- Try to avoid writing raw SQL queries.

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.

UI and Styling

- Use Tailwind for components and styling.
- Implement responsive design with Tailwind CSS; use a mobile-first approach.

Performance 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 loading.

Key Conventions

- 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 management.

Follow Next.js docs for Rendering and Routing.
css
javascript
next.js
prisma
react
supabase
tailwindcss
typescript
ahaywood/brazilian-nut-news__nextjs-app

Used in 1 repository