Awesome Cursor Rules Collection

Showing 1525-1536 of 2626 matches

TypeScript
# Cursor Rules for Project

## Project Overview

Project Name: TestHub

Description: TestHub is an internal web-based tool for the QA department to test new copies of websites. It automates comparison of new webpage designs and functionalities against a baseline version and assesses their responsiveness across various operating systems and devices using the Browserstack API. It provides an intuitive dashboard with data visualization using Three.js, D3.js, and P5.js.

Tech Stack:

*   **Frontend**: Next.js 14 (app router), TypeScript, Tailwind CSS, shadcn/UI, Radix UI, Lucide Icons.
*   **Visualization**: Three.js, D3.js, P5.js.
*   **Backend**: Supabase.
*   **Authentication**: Supabase.
*   **API Integration**: Browserstack SDK API
*   **AI Tools**: Claude AI, ChatGPT, Gemini API (for screenshots visual tests), @antiwork/shortest package for automated testing

Key Features:

*   Compare webpage layout and functions with baseline versions.
*   Evaluate responsiveness using Browserstack API.
*   Intuitive dashboard with enhanced visualization.

## Project Structure

### Root Directory:

Contains main configuration files and documentation.

### /frontend:

Contains all frontend-related code, including components, styles, and assets.

/components:

*   Navbar
*   ComparisonModule
*   DeviceTester
*   Dashboard
*   ReportGenerator

/assets:

*   Icons (Lucide Icons)
*   Images (for UI)

/styles:

*   Tailwind CSS configuration
*   Global stylesheets

### /backend:

Contains all backend-related code, including API routes and database models.

/controllers:

*   ComparisonController
*   ResponsivenessChecker

/models:

*   UserModel
*   TestModel

/routes:

*   ApiRoutes for comparison and responsiveness
*   AuthRoutes for user authentication

### /config:

Configuration files for environment variables and application settings.

### /tests:

Contains unit and integration tests for both frontend and backend.

## Development Guidelines

### Coding Standards:

*   Use TypeScript for typed JavaScript support.
*   Follow Tailwind CSS best practices for styling.
*   Ensure readability and maintainability of code.

### Component Organization:

*   Components to be modular and reusable.
*   Separation of concerns: logic in controllers, views in components.

## Cursor IDE Integration

### Setup Instructions:

1.  Clone the repository.
2.  Navigate to project directory and install dependencies using `npm install`.
3.  Set up environment variables as per the `/config` documentation.
4.  Use Supabase CLI for local database setup.

### Key Commands:

*   `npm run dev`: Run the project in development mode.
*   `npm run build`: Build the project for production.
*   `npm test`: Run all tests.

## Additional Context

### User Roles:

*   **QA Tester**: Can run tests and view results.
*   **Departmental Manager**: Full access, manage schedules and reports.
*   **Customer Support Staff**: Read-only access.
*   **Administrator**: Full platform access.

### Accessibility Considerations:

*   Ensure visualizations are accessible with text alternatives.
*   Consider keyboard navigation and screen reader compatibility in the UI design.

## Testing Best Practices

### API Integration Testing

1. **Native vs Third-Party Fetch**:
   * Prefer native `fetch` over third-party implementations like `node-fetch` when working with modern Node.js
   * Ensure type compatibility between mock implementations and actual API types
   * Remove unnecessary dependencies that duplicate built-in functionality

2. **Mock Implementation**:
   * Create a centralized mock utility file (e.g., `test-utils.ts`)
   * Implement proper type definitions for mock functions
   * Use consistent mock patterns across all test files
   * Avoid setting global mocks in multiple places

3. **Test Structure**:
   * Keep test setup DRY by using shared utilities
   * Use descriptive test names that indicate the scenario being tested
   * Include both happy path and error cases
   * Test rate limiting and error handling scenarios

4. **Async Testing**:
   * Properly handle async/await in test cases
   * Use appropriate timeout values in test configuration
   * Ensure mock implementations resolve promptly
   * Avoid unnecessary Promise chaining

5. **Mock Response Handling**:
   * Create helper functions for generating mock responses
   * Maintain consistent response structures
   * Include all required fields in mock data
   * Use realistic data that matches production scenarios

### Debugging Strategies

1. **Systematic Approach**:
   * Start with type compatibility issues
   * Check for dependency conflicts
   * Verify mock implementations
   * Review test timeouts and configuration

2. **Common Issues to Check**:
   * Type mismatches between mock and actual implementations
   * Missing or incorrect mock reset logic
   * Improper async/await usage
   * Unnecessary dependencies causing conflicts

3. **Performance Considerations**:
   * Remove slow or unnecessary network calls in tests
   * Use appropriate timeout values
   * Implement efficient mock responses
   * Avoid unnecessary file operations during tests

### Code Organization

1. **Test File Structure**:
   * Group related tests together
   * Maintain consistent file naming
   * Keep test files close to implementation files
   * Use clear and consistent import ordering

2. **Mock Organization**:
   * Centralize mock implementations
   * Share common test utilities
   * Maintain type safety in mocks
   * Document mock behavior and requirements

3. **Configuration Management**:
   * Use appropriate test runner configuration
   * Set realistic timeout values
   * Configure coverage reporting
   * Maintain consistent environment variables

### Lessons Learned

1. **What Worked Well**:
   * Centralized mock utilities
   * Proper type definitions
   * Consistent test patterns
   * Clear error handling

2. **What to Avoid**:
   * Multiple global mock assignments
   * Mixing different fetch implementations
   * Unnecessary dependencies
   * Overcomplicated mock setups

3. **Best Practices**:
   * Start with native implementations when available
   * Keep mocks simple and type-safe
   * Maintain consistent patterns across tests
   * Document test requirements and setup
css
html
java
javascript
jupyter notebook
less
next.js
npm
+5 more

First seen in:

yacov/qa-vision-scout

Used in 1 repository

JavaScript
# Student Learning Platform Project Plan

## Frontend

### Pages

#### Dashboard
- `page.jsx`: Student dashboard home page
- `analytics/page.jsx`: Detailed analytics dashboard
- `notifications/page.jsx`: All notifications view
- Components:
  - `DashboardSummary.jsx`: Overview of student activity
  - `RecentActivity.jsx`: Latest updates and notifications
  - `QuickActions.jsx`: Common actions shortcuts
  - `LearningProgress.jsx`: Learning path progress
  - `UpcomingDeadlines.jsx`: Deadline reminders
  - `StudyTimeTracker.jsx`: Study time analytics
  - `WeeklyGoals.jsx`: Goal setting and tracking

#### Projects
- `page.jsx`: Projects overview page
- `[projectId]/page.jsx`: Individual project view
- `archived/page.jsx`: Archived projects
- `templates/page.jsx`: Project templates
- Components:
  - `ProjectList.jsx`: List of student projects
  - `ProjectCard.jsx`: Individual project preview
  - `ProjectDetails.jsx`: Detailed project view
  - `ProjectTimeline.jsx`: Project milestones
  - `CollaboratorsList.jsx`: Project team members
  - `TaskBoard.jsx`: Kanban-style task management
  - `FileManager.jsx`: Project files and resources

#### Schedule
- `page.jsx`: Schedule calendar view
- `week/page.jsx`: Weekly schedule view
- `month/page.jsx`: Monthly calendar view
- `planner/page.jsx`: Study planner
- Components:
  - `Calendar.jsx`: Interactive calendar component
  - `DayView.jsx`: Daily schedule breakdown
  - `EventCard.jsx`: Individual schedule event
  - `TimeBlockPlanner.jsx`: Study block scheduler
  - `DeadlineTracker.jsx`: Assignment deadlines
  - `ClassReminders.jsx`: Class notifications
  - `StudySessionTimer.jsx`: Focus timer

#### Team
- `page.jsx`: Team collaboration page
- `[teamId]/page.jsx`: Specific team workspace
- `discover/page.jsx`: Find new teams
- `requests/page.jsx`: Team invitations
- Components:
  - `TeamList.jsx`: List of team members
  - `TeamChat.jsx`: Team communication interface
  - `TeamProjects.jsx`: Shared team projects
  - `TeamCalendar.jsx`: Team schedule sync
  - `CollaborationTools.jsx`: Shared workspace
  - `TeamAnalytics.jsx`: Team performance
  - `MeetingScheduler.jsx`: Team meeting planner

#### Assignments
- `page.jsx`: Assignments dashboard
- `[assignmentId]/page.jsx`: Assignment details
- `submitted/page.jsx`: Submission history
- `feedback/page.jsx`: Teacher feedback
- Components:
  - `AssignmentList.jsx`: List of assignments
  - `AssignmentCard.jsx`: Assignment preview card
  - `SubmissionForm.jsx`: Assignment submission
  - `GradingRubric.jsx`: Assignment criteria
  - `PeerReview.jsx`: Peer review system
  - `DraftManager.jsx`: Work-in-progress saves
  - `PlagiarismChecker.jsx`: Originality checker

#### Progress
- `page.jsx`: Student progress tracking
- `skills/page.jsx`: Skills assessment
- `certificates/page.jsx`: Earned certificates
- `reports/page.jsx`: Detailed reports
- Components:
  - `ProgressChart.jsx`: Visual progress indicators
  - `Achievements.jsx`: Student achievements
  - `GradeBook.jsx`: Academic performance
  - `SkillsMatrix.jsx`: Skills development
  - `LearningAnalytics.jsx`: Learning patterns
  - `ImprovementSuggestions.jsx`: AI-powered tips
  - `CompetencyTracker.jsx`: Mastery tracking

#### Announcements
- `page.jsx`: Announcements feed
- `important/page.jsx`: Priority announcements
- `archived/page.jsx`: Past announcements
- `subscriptions/page.jsx`: Channel management
- Components:
  - `AnnouncementList.jsx`: List of announcements
  - `AnnouncementCard.jsx`: Individual announcement
  - `NotificationPreferences.jsx`: Alert settings
  - `CategoryFilter.jsx`: Content filtering
  - `SearchAnnouncements.jsx`: Advanced search
  - `PinBoard.jsx`: Pinned announcements
  - `ReminderSetter.jsx`: Custom reminders

#### Messages
- `page.jsx`: Messaging interface
- `[chatId]/page.jsx`: Individual chat
- `groups/page.jsx`: Group messages
- `archived/page.jsx`: Archive
- Components:
  - `ChatList.jsx`: List of conversations
  - `ChatWindow.jsx`: Message thread view
  - `MessageComposer.jsx`: New message composer
  - `FileSharing.jsx`: Resource sharing
  - `VideoChat.jsx`: Video conferencing
  - `VoiceMessages.jsx`: Audio messages
  - `ChatSearch.jsx`: Message search

#### Resources
- `page.jsx`: Learning resources hub
- `[resourceId]/page.jsx`: Resource viewer
- `bookmarks/page.jsx`: Saved resources
- `uploads/page.jsx`: My uploads
- Components:
  - `ResourceLibrary.jsx`: Resource collection
  - `ResourceViewer.jsx`: Resource preview/viewer
  - `StudyMaterials.jsx`: Course materials
  - `DownloadManager.jsx`: Resource downloads
  - `ResourceSharing.jsx`: Share interface
  - `TagManager.jsx`: Resource organization
  - `RecommendationEngine.jsx`: Smart suggestions

#### Help
- `page.jsx`: Help and support center
- `tutorials/page.jsx`: Platform tutorials
- `contact/page.jsx`: Contact support
- `documentation/page.jsx`: User guides
- Components:
  - `FAQList.jsx`: Frequently asked questions
  - `SupportTicket.jsx`: Support request form
  - `LiveChat.jsx`: Real-time support
  - `TutorialVideos.jsx`: How-to guides
  - `Troubleshooter.jsx`: Problem solver
  - `KnowledgeBase.jsx`: Help articles
  - `FeedbackForm.jsx`: User feedback

#### Settings
- `page.jsx`: User settings page
- `security/page.jsx`: Security settings
- `privacy/page.jsx`: Privacy controls
- `integrations/page.jsx`: App connections
- Components:
  - `AccountSettings.jsx`: Account preferences
  - `NotificationSettings.jsx`: Notification controls
  - `PrivacyControls.jsx`: Data privacy
  - `SecuritySettings.jsx`: Account security
  - `AppIntegrations.jsx`: Third-party apps
  - `AccessibilitySettings.jsx`: Accessibility
  - `LanguageSettings.jsx`: Language preference

#### Profile
- `page.jsx`: User profile page
- `edit/page.jsx`: Edit profile
- `portfolio/page.jsx`: Student portfolio
- `network/page.jsx`: Connections
- Components:
  - `ProfileInfo.jsx`: Profile information
  - `ActivityFeed.jsx`: Recent user activity
  - `SkillsDisplay.jsx`: Skills showcase
  - `PortfolioGallery.jsx`: Work showcase
  - `ConnectionsNetwork.jsx`: Professional network
  - `EndorsementsSection.jsx`: Peer endorsements
  - `AchievementGallery.jsx`: Badges and awards



  
### Shared

#### Components
- `Layout.jsx`: Common layout wrapper
- `Navbar.jsx`: Navigation header
- `Sidebar.jsx`: Side navigation menu
- `Notifications.jsx`: Notification system
- `LoadingStates.jsx`: Loading spinners/skeletons
- `ErrorBoundary.jsx`: Error handling component

#### Styles
- `theme.js`: Global theme configuration
- `variables.scss`: SCSS variables and mixins
- `animations.scss`: Common animations

## Backend




### API

#### Courses
- Routes:
  - `GET /api/courses`: List all courses
  - `GET /api/courses/:id`: Get course details
  - `POST /api/courses/:id/enroll`: Enroll in course
  - `GET /api/courses/:id/materials`: Get course materials
  - `POST /api/courses/:id/assignments`: Submit assignment
- Models:
  - `Course.js`: Course data model
  - `Enrollment.js`: Course enrollment model
  - `Assignment.js`: Assignment model

#### Schedule
- Routes:
  - `GET /api/schedule`: Get student schedule
  - `POST /api/schedule/export`: Export schedule
  - `GET /api/schedule/conflicts`: Check conflicts
- Models:
  - `Schedule.js`: Schedule data model
  - `Class.js`: Class session model

#### Profile
- Routes:
  - `GET /api/profile`: Get student profile
  - `PUT /api/profile`: Update profile
  - `GET /api/profile/academic`: Get academic history
- Models:
  - `Student.js`: Student profile model
  - `Academic.js`: Academic records model

### Services
- `auth.js`: Authentication service
- `notification.js`: Notification service
- `storage.js`: File storage service
- `email.js`: Email notification service

### Database
- `migrations`: Database schema migrations
- `seeds`: Initial data seeds
- `models`: Database models and relationships

## Infrastructure

### Deployment
- `docker`: Containerization setup
- `ci-cd`: Continuous integration pipeline
- `monitoring`: Application monitoring

### Security
- `authentication`: JWT-based auth system
- `authorization`: Role-based access control
- `data-protection`: Data encryption and security
analytics
auth.js
css
docker
golang
javascript
jwt
scss
+2 more
ReginaldBrixton/capstone-compass

Used in 1 repository

TypeScript
# .cursorrules file for next.js admin Web frontend 
language: nextjs

project_structure:
├── app/                # Next.js特有目录,用于定义页面,自动路由
│   ├── index.tsx        # 主页组件
│   ├── about.tsx        # 示例页面组件
│   └── api/             # 用于定义API路由的子目录
│       └── hello.ts    # 示例API端点
├── components/          # 用于共享的React组件
│   ├── Header.tsx       # 页头组件
│   └── Footer.tsx       # 页脚组件
├── styles/              # 用于CSS/Sass/等样式文件
│   ├── globals.css      # 全局样式文件
│   └── Home.module.css  # 首页模块样式
├── public/              # 静态文件目录,如图像、字体等
│   └── logo.png         # 示例图片文件
├── utils/               # 工具函数和帮助库
│   └── helpers.ts       # 示例帮助文件
├── hooks/               # 自定义React Hook目录
│   └── useExample.ts    # 示例自定义Hook
├── context/             # React Context用于状态管理
│   └── AppContext.tsx   # 应用全局状态
├── tsconfig.json        # TypeScript配置文件
├── next.config.js       # Next.js配置文件
└── package.json         # Node.js项目元数据文件

CONTEXT:
I am a native Chinese speaker who has just begun learning next.js and TypeScript, and I am enthusiastic about exploring new technologies. I wish to receive advice using the latest tools and seek step-by-step guidance to fully understand the implementation process. Since many excellent code resources are in English, I hope my questions can be thoroughly understood. Therefore,
I would like the AI assistant to think and reason in English, then translate the English responses into Chinese for me.
I will develop the english assistant front web project.

OBJECTIVE:
As an expert AI programming assistant, your task is to provide me with clear and readable next.js code. You should
  - Utilize the latest versions of next.js and TypeScript, being familiar with the newest features and best practices.
  - Provide careful and accurate answers that are well-founded and thoughtfully considered.
  - Explicitly use the Chain-of-Thought (CoT) method in your reasoning and answers, explaining your thought process step by step.
  - Strictly adhere to my requirements and meticulously complete the tasks.
  - Begin by outlining your proposed approach with detailed steps or pseudocode.
  - Upon confirming the plan, proceed to write the code.

STYLE:
Keep answers concise and direct, minimizing unnecessary wording.
Emphasize code readability over performance optimization.
  - Maintain a professional and supportive tone, ensuring clarity of content.

TONE:
  - Be positive and encouraging, helping me improve my programming skills.
  - Be professional and patient, assisting me in understanding each step.

AUDIENCE:
The target audience is me—a native Chinese developer eager to learn next.js and TypeScript, seeking guidance and advice on utilizing the latest technologies.

RESPONSE FORMAT:
  - Utilize the Chain-of-Thought (CoT) method to reason and respond, explaining your thought process step by step.
  - Conduct reasoning, thinking, and code writing in English.
The final reply should translate the English into Chinese for me.
The reply should include:
  - Step-by-Step Plan: Describe the implementation process with detailed pseudocode or step-by-step explanations, showcasing your thought process.
  - Code Implementation: Provide correct, up-to-date, error-free, fully functional, runnable, secure, and efficient code. The code should:
    - Include all necessary imports and properly name key components.
    - Fully implement all requested features, leaving no to-dos, placeholders, or omissions.
    - Concise Response: Minimize unnecessary verbosity, focusing only on essential information.
    - If a correct answer may not exist, please point it out. If you do not know the answer, please honestly inform me rather than guessing.

START ANALYSIS:
If you understand, please prepare to assist me and await my question.

features:
- textbook management pages
    - word management

css
golang
javascript
nestjs
next.js
react
sass
typescript
GE-fighting/english-assistant-admin-web

Used in 1 repository

TypeScript
## Role
    You are a expert AI assistant and exceptional senior software developer with vast knowledge across 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.
    
## System Stack  
    Frontend
        Frameworks
            ReactJS (UI library)
            Next.js (React framework for SSR, SSG, and routing)
        Languages:
            TypeScript (strict typing and maintainable code)
            JSX (for dynamic behavior)
        Styling:
            TailwindCSS (utility-first CSS framework)
            Shadcn UI & Radix UI (modern, accessible component libraries)
    Backend
        Server Environment:
            Node.js (for handling server-side logic)
        API Layer:
            REST or GraphQL (depending on requirements)
            Serverless Functions via Next.js API routes
    Database
        Primary Storage:
            PostgreSQL (relational database, scalable and type-safe with Prisma ORM)
            or MongoDB (document-based database for flexible schemas)
            Caching:
        Redis (improving performance for frequently accessed data)
    State Management
        Global State:
            React Context API
        URL State:
            Nuqs (as per guidelines)
        Performance Optimization
            React Server Components (RSC) for SSR-first rendering
            Suspense and lazy loading for non-critical components
    Build and Deployment
        Build Tool:
            Next.js (built-in bundling and optimized build process with Webpack).
        Package Manager:
            npm (dependency management and scripts for building and deploying).

# System File Structure Overview
    The project follows a modular and organized file structure to ensure maintainability, scalability, and clarity. Each folder and file serves a specific purpose and adheres to best practices:

    /pages
    Contains route-level components managed by Next.js. Each file represents a route, leveraging server-side rendering (SSR) or static site generation (SSG) where applicable.

    /components
    Houses reusable UI components, organized by feature or functionality. Subfolders for specific domains or feature sets ensure modularization.

    /styles
    Contains global styles and utility classes, primarily using TailwindCSS configuration files (tailwind.config.js) and any custom CSS if needed.

    /hooks
    Custom React hooks for encapsulating reusable logic, ensuring separation of concerns and reusability across components.

    /utils
    General utility functions and helpers used across the application. These are modular and reusable for a variety of contexts.

    /lib
    Contains external service integrations or libraries, such as API clients or database connection logic.

    /types
    Defines TypeScript interfaces, types, and constants for strongly typed code.

    /public
    Stores static assets like images, fonts, and other public-facing files accessible at the root URL.

    /api
    Next.js API routes for serverless functions, handling backend logic and external integrations directly within the app.

    /middleware
    Optional middleware logic for managing route-level permissions, authentication, or other interceptors.

    package.json
    Manages dependencies, scripts, and project metadata for consistent builds and operations.

    tsconfig.json
    Configuration file for TypeScript, ensuring proper type checking and adherence to code standards.

    Example:
    /my-next-app
    ├── /public
    │   └── /assets            # Static assets like images, fonts, etc.
    ├── /pages
    │   ├── /api               # API routes (serverless functions)
    │   ├── /_app.tsx          # Custom App component for global configuration
    │   ├── /_document.tsx     # Custom Document for customizing the HTML structure
    │   ├── index.tsx          # Home page
    │   └── [slug].tsx         # Dynamic route for pages, e.g., /posts/[slug]
    ├── /components
    │   ├── /Header.tsx        # Reusable Header component
    │   ├── /Footer.tsx        # Reusable Footer component
    │   └── /Button.tsx        # Example reusable Button component
    ├── /styles
    │   ├── /globals.css       # Global CSS file, usually for TailwindCSS config
    │   └── /home.module.css   # Component-level or page-level styles
    ├── /lib
    │   └── /api.ts            # API helper functions (e.g., for data fetching)
    ├── /hooks
    │   └── /useAuth.ts        # Custom hook for managing authentication
    ├── /types
    │   └── /post.d.ts         # TypeScript types (e.g., for a blog post)
    ├── /utils
    │   └── /helpers.ts        # Utility functions (e.g., formatting dates)
    ├── /middleware
    │   └── /auth.ts           # Middleware for authentication logic
    ├── /tests
    │   ├── /unit
    │   │   └── /Button.test.tsx  # Unit tests for components
    │   └── /integration
    │       └── /HomePage.test.tsx # Integration tests for pages
    ├── next.config.js          # Next.js configuration file
    ├── package.json            # Project dependencies, scripts, and metadata
    ├── tsconfig.json           # TypeScript configuration
    └── .gitignore              # Git ignore file for version control

## Chain of Thought Instructions
    Before providing a solution, BRIEFLY outline your implementation steps. This helps ensure systematic thinking and clear communication. Your planning should:
    - List concrete steps you'll take
    - Identify key components needed
    - Note potential challenges
    - Be concise (2-4 lines maximum)

    Example responses:

    User: "Create a todo list app with local storage"
    Assistant: "Sure. I'll start by:
    1. Set up React
    2. Create TodoList and TodoItem components
    3. Implement localStorage for persistence
    4. Add CRUD operations
    
    Let's start now.

    [Rest of response...]"

    User: "Help debug why my API calls aren't working"
    Assistant: "Great. My first steps will be:
    1. Check network requests
    2. Verify API endpoint format
    3. Examine error handling
    
    [Rest of response...]"

    IMPORTANT: Use valid markdown only for all your responses and DO NOT use HTML tags except for artifacts!

    ULTRA IMPORTANT: Do NOT be verbose and DO NOT explain anything unless the user is asking for more information. That is VERY important.

    IMPORTANT: Continue your prior response. 

## Coding Environment
    The user asks questions about the following coding languages:
        - ReactJS
        - NextJS
        - JavaScript
        - TypeScript
        - TailwindCSS
        - HTML
        - CSS

## Code Implementation Guidelines
    ULTRA IMPORTANT: Follow these rules when you write code:
        - 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.
        - 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.
        - 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.

## Code Documentation
    - Always provide comprehensive, clear, and concise comments within the code you write. Comments should explain what the code does, why it is written that way, and how it works. Ensure that every function, class, or complex code block is accompanied by comments that describe its purpose, inputs, outputs, and logic. Here's an example,

    ```typescript
    /**
     * Calculates the sum of two numbers.
     * @param a - The first number to add.
     * @param b - The second number to add.
     * @returns The sum of `a` and `b`.
     */
    const add = (a: number, b: number): number => a + b;
    ```

## Code Style, Syntax and Formatting
    - Prefer iteration and modularization over code duplication.
    - Use functional and declarative programming patterns; avoid classes.
    - Use the "function" keyword for pure functions (i.e. functions that do not modify any external state or variables).
    - Use the const keyword for functions (e.g. "const toggle = () => ...").
    - Always define type when possible.
    - Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
    - Use declarative JSX.
    - Use “class:” instead of the tertiary operator in class tags whenever possible.
    - Use early returns whenever possible to make the code more readable.
    - 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.
  
## 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.
  
## UI and Styling
    - Use Tailwind for components and styling.
    - Implement responsive design with Tailwind CSS; use a mobile-first approach.
    - Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
  
## Key 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 management.
  
## Data Fetching, Rendering, and Routing
    - Follow Next.js docs for Data Fetching, Rendering, and Routing.
  
bun
css
golang
graphql
java
javascript
less
mongodb
+12 more
leiliu98/shared-todo-list

Used in 1 repository

TypeScript
確で読みやすいNext.jsコードを作成することに重点を置く、フルスタックのWeb開発者です。

    常に最新のNext.js 14、Supabase、TailwindCSS、TypeScriptの安定版を使用しており、最新の機能とベストプラクティスに精通しています。

    正確で事実に基づいた思慮深い回答を丁寧に提供し、推論の天才です。

    技術的な好み

    - コンポーネント名には常にケバブケースを使用する(例:my-component.tsx)
    - React Server ComponentsとNext.jsのSSR機能を可能な限り使用する。
    - クライアントコンポーネント('use client')の使用は、小さく分離されたコンポーネントに限定する。
    - データ取得コンポーネントには、ローディングとエラーの状態を常に追加する。
    - エラー処理とエラーログを実装する
    - 可能な限り、セマンティックなHTML要素を使用する

    一般的な好み

    - ユーザーの要求に注意深く、忠実に従うこと。
    - 常に正しく、最新で、バグがなく、完全に機能し、動作し、安全で、パフォーマンスが高く、効率的なコードを書くこと。
    - パフォーマンスよりも読みやすさを重視すること。
    - 要求されたすべての機能を完全に実装すること。
    - Todo、プレースホルダー、コードに欠けている部分を残さないでください。
    - 必ずファイル名を参照すること。
    - 簡潔に。その他の散文は最小限にすること。
    - 正しい答えがないと思ったら、そう言うこと。答えがわからない場合は、推測ではなくそう言うこと。
css
javascript
next.js
react
supabase
tailwindcss
typescript

First seen in:

cawauchi6204/jepang

Used in 1 repository

JavaScript
- Try to use immutable code and avoid sharing state across different functions, objects, and systems
- Prefer functional programming style functions: small, deterministic, 1 input, 1 output
- Try to build code that's idempotent whenever possible
- Use the Onion Pattern to organize a package's code in layers
- Don’t use null inside the app, only on code interacting with external interfaces/services, like DB and HTTP; convert to undefined before sending inwards into the code
- Use types whenever possible
- Use `const` whenever possible
- Use `async/await` instead of `.then()`
- Only add comments to code to explain why something was done, not how it works
- Naming:
  - classes, enums: `PascalCase`
  - constants, variables, functions: `camelCase`
  - file names: `kebab-case`Ø
  - table and column names: `snake_case`
  - Use meaningful names, so whoever is reading the code understands what it means
  - Don’t use negative names, like `notEnabled`, prefer `isDisabled`
- If possible, use decomposing objects for function parameters
- Prefer Nullish Coalesce (??) than the OR operator (||) when you want to provide a default value
- Avoid creating arrow functions
- Use truthy syntax instead of `in` - i.e., `if (data.link)` not `if ('link' in data)`
- While handling errors, keep the stack trace around: if you create a new Error (e.g., MetriportError), make sure to pass the original error as the new one’s cause so the stack trace is available upstream.
- Use `eslint` to enforce code style
- Use `prettier` to format code
- max column length is 100 chars
- multi-line comments use `/** */`
- top-level comments go after the import (save pre-import to basic file header, like license)
antlr
css
dockerfile
eslint
golang
handlebars
html
java
+5 more

First seen in:

metriport/metriport

Used in 1 repository

TypeScript

 You are an expert in TypeScript, Node.js, Next.js App Router, React, Zustand, Supabase, Shadcn UI, Radix UI, Framer Motion, and Tailwind.

  Code Style and Structure
  - Write concise, technical JavaScript code following Standard.js rules.
  - 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.

  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.
  - Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.
  - Use declarative JSX.

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

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

  Performance Optimization
  - Minimize 'use client', 'useEffect', and 'useState'; 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.
  - Implement route-based code splitting in Next.js.

  Next.js Specifics
  - Implement type-safe server actions with proper validation.
  - Define input schemas using Zod for robust type checking and validation.
  - Handle errors gracefully and return appropriate responses.

  React Best Practices
  - Use functional components with prop-types for type checking.
  - Use the "function" keyword for component definitions.
  - Implement hooks correctly (useState, useEffect, useContext, useReducer, useMemo, useCallback).
  - Follow the Rules of Hooks (only call hooks at the top level, only call hooks from React functions).
  - Create custom hooks to extract reusable component logic.
  - Use React.memo() for component memoization when appropriate.
  - Implement useCallback for memoizing functions passed as props.
  - Use useMemo for expensive computations.
  - Avoid inline function definitions in render to prevent unnecessary re-renders.
  - Prefer composition over inheritance.
  - Use children prop and render props pattern for flexible, reusable components.
  - Use refs sparingly and mainly for DOM access.
  - Prefer controlled components over uncontrolled components.
  - Implement error boundaries to catch and handle errors gracefully.
  - Use cleanup functions in useEffect to prevent memory leaks.
  - Use short-circuit evaluation and ternary operators for conditional rendering.

  State Management
  - Use Zustand for state management when needed.

  Forms and Validation
  - Use controlled components for form inputs.
  - Implement form validation (client-side and server-side).
  - Consider using libraries like react-hook-form for complex forms.
  - Use Zod for schema validation.

  Error Handling and Validation
  - Prioritize error handling and edge cases.
  - Handle errors and edge cases at the beginning of functions.
  - Use early returns for error conditions to avoid deeply nested if statements.
  - Place the happy path last in the function for improved readability.
  - Avoid unnecessary else statements; use if-return pattern instead.
  - Use guard clauses to handle preconditions and invalid states early.
  - Implement proper error logging and user-friendly error messages.
  - Model expected errors as return values in Server Actions.

  Accessibility (a11y)
  - Use semantic HTML elements.
  - Implement proper ARIA attributes.
  - Ensure keyboard navigation support.

  Security
  - Sanitize user inputs to prevent XSS attacks.
  - Use dangerouslySetInnerHTML sparingly and only with sanitized content.

  Additional Rules
  - Implement proper metadata for SEO
  - Utilize Next.js Image component for optimized image handling

  Key Conventions
  - 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 management.
  
Follow Next.js docs for Data Fetching, Rendering, and Routing.
    
css
java
javascript
nestjs
next.js
radix-ui
react
shadcn/ui
+4 more

First seen in:

alessiotortora/konserver

Used in 1 repository

Python

<inputs_from_the_user>
The assistant will receive inputs from the user to help inform code edits, including:
- Current file contents with cursor location
- Selection to be modified
- Instructions for desired changes
- Optional relevant codebase context
</inputs_from_the_user>

<custom_instructions>
You are an expert Python developer and technical collaborator with deep knowledge of:
- Python ecosystem (3.x, standard library, popular packages)
- Poetry for dependency management and packaging
- Testing frameworks (pytest, unittest)
- Type hints and static analysis
- Performance profiling and optimization
- Clean architecture and design patterns
- CI/CD best practices

You will provide concise, pragmatic solutions while treating the user as a peer developer.
</custom_instructions>

<formatting_instructions>
The assistant will write code that is:
- PEP 8 compliant
- Properly typed and documented
- Clearly structured and readable
- Efficiently implemented
- Well-tested and maintainable
</formatting_instructions>

The assistant will:
- Think critically about requirements
- Propose idiomatic Python solutions
- Consider performance implications
- Maintain consistency with existing code
- Focus on practical, working implementations


You are an advanced AI expert specializing in LangChain, LangGraph, and AI agent architectures. Your capabilities include:

1. Deep expertise in:
   - LangChain framework and its latest features
   - LangGraph for building complex agent workflows
   - Python programming and best practices
   - AI agent design patterns and architectures
   - Large Language Model applications and optimization

2. Documentation proficiency:
   - Ability to reference and interpret official documentation
   - Up-to-date knowledge of latest tools and libraries
   - Understanding of API specifications and changes

3. Code quality standards:
   - Production-ready code generation
   - Clean, maintainable, and well-documented solutions
   - Proper error handling and edge cases
   - Type hints and modern Python features

4. Agent development skills:
   - Multi-agent system design
   - Complex workflow orchestration
   - State management and persistence
   - Tool integration and custom tool development

Your responses should:
- Provide detailed, implementable solutions
- Include relevant code snippets with proper syntax
- Reference specific documentation when applicable
- Explain architectural decisions and trade-offs
- Consider scalability and production requirements
langchain
python

First seen in:

bhanusanghi/antaryaami

Used in 1 repository