Awesome Cursor Rules Collection

Showing 1813-1824 of 2626 matches

TypeScript
# Code Style Guide

## Core Principles

- Write concise TypeScript code.
- Use functional programming patterns.
- Prefer clean, readable code over compact code, using empty lines to separate logical blocks and improve readability.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError). Doesn't mater if it's long. For example this is good: "useGroupMembersInfoForCurrentAccount".
- Prefer clean and easy to read code over compact code.
- Don't create function(s) inside other functions unless it's specified
- Add clear, concise comments to explain non-obvious logic or unconventional implementation decisions.
- When refactoring code, preserve existing comments unless explicitly instructed otherwise or the related code is removed. Comments often explain important context or implementation decisions that should be maintained.
- Comments should be above the code they are describing.
- Use the suffix 'ForCurrentAccount' when using useCurrentAccount inside components or hooks.
- Handle errors at the caller level. Unless if we really need to log something but make sure to throw back the error to the caller.
- Minimize using external hooks inside custom hooks to prevent unnecessary rerenders. Instead, use getter functions to access data, especially in mutations.
- Use Zod for external API response validation. Define zod schema and infer types from it.
- Keep files small and focused. Place hooks and components in separate files unless they are small wrapper components. This improves code organization and maintainability.
- Refactor a component using the composable pattern when you start seeing a lot of optional props.

## TypeScript

- Use types over interfaces, prefixed with 'I' (e.g., IMyItem).
- Never use 'any'.
- Avoid enums, use maps instead.
- Use functional components with TypeScript types.
- Prefer inferring types if possible over explicit typing.
- Prefer type assertions on return objects (`return {...} satisfies IType`) over function return type annotations (`function(): IType`) if we have to put a type because the inferring is not working well.

## Function Patterns

- Use function keyword for pure functions.
- Prefer object params: `function(args: { name: string })` over `function(name: string)`.
- Destructure parameters at the top level.
  - Makes it clearer which properties are being used and
  - improves code readability.
  -
  - @example
  - // ❌ Bad: Nested destructuring
  - function getMetadataOptions(args: IArgs) {
  - const { account } = args;
  - }
  -
  - // ✅ Good: Top-level destructuring
  - function getMetadataOptions({ account, topic }: IArgs) {

## React & Components

- Use named exports.
- Write JSX inline rather than separate render functions.
- Prefer early returns over ternaries.
- Use array syntax for merged styles: `style={[{ color: "red" }, style]}`.
- Minimize useEffect and setState usage.
- Wrap components in memo() for performance.
- When creating a new component or custom hook, aim to minimize the number of props you pass. Instead, try to reuse existing hooks whenever possible. This is especially important if the props or arguments you want to pass are only needed within the new component or hook we wanted to pass are ONLY used in the new component or hook.
- When asked to extract a component or some code for custom hooks, create those in the same file.
- Keep related code close together by placing the exported component at the top of the file with related components directly underneath it.
- Avoid default exports to maintain consistent imports and easier refactoring.
  - Named exports make codebase more maintainable and
  - refactoring safer.
  -
  - @example
  - // ❌ Bad: Default export
  - export default function ProfileScreen()
  -
  - // ✅ Good: Named export
  - export function ProfileScreen()

## File Structure

- Use lower-kebab-case for directories and files (e.g., components/auth-wizard).
- Import paths from our project should start with @/.
- Use the same name for the file and the component.
- Keep features self-contained. Create a new feature folder if accessing features across boundaries.
- Place queries within their respective feature folders, but maintain queryKeys at the root level for better visibility.

## Theming & Styling

- Always use the theme for styling. Import it from @/theme/useAppTheme like `const { theme } = useAppTheme();`.
- Use components from @/design-system.
- Use the theme for colors and spacing.

## React Query Principles

- Avoid destructuring rest operators with useQuery.

  - Be explicit about which properties you need from useQuery
  - to prevent excessive re-rendering and performance issues.
  -
  - @example
  - // ❌ Bad: Causes unnecessary re-renders
  - const { data: conversations, ...rest } = useQuery()
  -
  - // ✅ Good: Explicit property usage
  - const { data: conversations, isLoading, error } = useQuery()

- Use object parameters for query options.
  - Pass query options as objects for better maintainability
  - and clearer intention.
  -
  - @example
  - // ❌ Bad: Positional arguments
  - useQuery(getConversationMessagesQueryOptions(account, topic))
  -
  - // ✅ Good: Object parameters
  - useQuery(getConversationMessagesQueryOptions({ account, topic }))
css
golang
javascript
less
nestjs
objective-c
objective-c++
react
+5 more

First seen in:

ephemeraHQ/converse-app

Used in 1 repository

MDX
systemPrompt:
  role: >-
    Expert Chrome Extension Developer and Full-Stack WordPress Integration
    Specialist
  context: >-
    Development of a modern Web Ring chrome extension connecting with WordPress
    plugins
  standards:
    - Chrome Extension Manifest V3
    - WordPress REST API best practices
    - OAuth2 implementation patterns
    - Distributed system design
    - Real-time data synchronization
project:
  name: Startempire Wire Network Chrome Extension
  type: Browser Extension
  target: Chrome
  ecosystem:
    parentSite: startempirewire.com
    networkHub: startempirewire.network
    plugins:
      ringLeader:
        role: Central Controller
        repository: startempire-wire-network-ring-leader
      networkConnect:
        role: Site Connector
        repository: startempire-wire-network-connect
      screenshots:
        role: Visual Preview
        repository: startempire-wire-network-screenshots
architecture:
  pattern: Event-Driven
  components:
    background_service:
      responsibilities:
        - Authentication management
        - Data polling and caching
        - Real-time updates
        - Network status monitoring
    content_scripts:
      responsibilities:
        - DOM manipulation
        - Site integration
        - UI injection
        - Event handling
    popup_ui:
      responsibilities:
        - User dashboard
        - Quick actions
        - Statistics display
        - Preferences management
    overlay_interface:
      responsibilities:
        - Network navigation
        - Content preview
        - Member badges
        - Interactive features
core_functionality:
  oauth_authentication:
    connect_to:
      - startempirewire.com
      - startempirewire.network
    providers:
      wordpress:
        priority: primary
        features:
          - user_roles
          - member_status
      buddyboss:
        priority: secondary
        features:
          - social_profile
          - activity_sync
      discord:
        priority: tertiary
        features:
          - chat_integration
          - streaming_service
  data_streaming:
    sources:
      parent_site_content:
        endpoint: startempirewire.com/api
        data_types:
          message_boards:
            path: /message-boards
            sync_interval: real-time
          articles:
            path: /articles
            types:
              - regular
              - premium
          podcasts:
            path:
              - /audio-podcasts
              - /video-podcasts
          events:
            path: /events
            types:
              - local
              - virtual
          directory:
            path: /directory
            section: /entrepreneur
      network_data:
        endpoint: startempirewire.network/api
        data_types:
          - network_stats
          - member_data
membership_system:
  tiers:
    free:
      name: Free (Non-Verified)
      access: Public Access
      features:
        - Basic visibility
        - Limited content access
        - Standard distribution
    freeWire:
      name: FreeWire
      access: Verified Member
      features:
        - Standard content access
        - Network directory listing
        - Basic WireBot features
      distribution:
        algorithm: standard
        priority: normal
    wire:
      name: Wire
      access: Premium Member
      features:
        - Enhanced content access
        - Priority distribution
        - Advanced WireBot features
      distribution:
        algorithm: secondary
        priority: enhanced
    extraWire:
      name: ExtraWire
      access: Enterprise Member
      features:
        - Full content access
        - Premium distribution
        - Enterprise WireBot features
      distribution:
        algorithm: primary
        priority: premium
content_distribution:
  flow:
    source:
      - Content creation on parent site
      - Metadata enrichment
      - Classification by type
      - Membership level assignment
    processing:
      ringLeader:
        - Content validation
        - Distribution rules application
        - Access control verification
        - Cache management
      connect:
        - Content reception
        - Local cache management
        - UI rendering rules
        - Access control enforcement
  pathways:
    parentToRingLeader:
      content_types:
        message_boards:
          path: /message-boards
          sync: real-time
          integration: buddyBoss
        articles:
          path: /articles
          types:
            - regular
            - premium
          sync: near-real-time
        podcasts:
          audio:
            path: /audio-podcasts
            format: streaming
          video:
            path: /video-podcasts
            format: streaming
        events:
          path: /events
          types:
            - local
            - virtual
        directory:
          path: /directory
          section: /entrepreneur
    ringLeaderToConnect:
      features:
        - Network member data
        - Content previews
        - Statistics
        - Notifications
        - WireBot features
      sync: near-real-time
      caching:
        strategy: intelligent
        duration: membership-based
service_integration:
  authentication_flow:
    sequence:
      memberPress:
        priority: primary
        endpoints:
          base: /wp-json/startempire/v1/memberpress
          auth: /auth
          status: /status
          roles: /roles
        features:
          - Payment verification
          - Subscription management
          - Role-based access
          - Content restrictions
      buddyBoss:
        priority: secondary
        endpoints:
          base: /wp-json/startempire/v1/buddyboss
          profile: /profile
          social: /social
          activity: /activity
        features:
          - Social profile sync
          - Group management
          - Activity tracking
          - Message board integration
      discord:
        priority: tertiary
        endpoints:
          base: /wp-json/startempire/v1/discord
          auth: /oauth
          webhook: /webhook
          streaming: /streaming
        features:
          - Real-time chat
          - Live streaming
          - Event broadcasting
          - Role synchronization
  real_time_communication:
    websocket:
      endpoints:
        - 'wss://startempirewire.network/socket'
        - 'wss://startempirewire.com/socket'
      features:
        - Live content updates
        - Chat functionality
        - Status notifications
        - Member presence
    event_streaming:
      priorities:
        high:
          - Authentication state
          - Payment events
          - Content access changes
        medium:
          - Member updates
          - Content distribution
          - Network statistics
        low:
          - Analytics data
          - Cache updates
          - Screenshot generation
  api_gateway:
    rate_limits:
      free:
        requests: 100/hour
        concurrent: 5
      freeWire:
        requests: 1000/hour
        concurrent: 10
      wire:
        requests: 5000/hour
        concurrent: 20
      extraWire:
        requests: unlimited
        concurrent: 50
    caching:
      strategies:
        membership_based:
          free: 1-hour
          freeWire: 6-hours
          wire: 12-hours
          extraWire: 24-hours
        content_type:
          articles: 4-hours
          events: 1-hour
          directory: 12-hours
          message_boards: 15-minutes
analytics_and_success:
  data_collection:
    member_metrics:
      engagement:
        - Content interaction rates
        - Feature utilization
        - Network participation
        - Growth patterns
      distribution:
        - Content reach
        - Sharing effectiveness
        - Network impact
    network_metrics:
      health:
        - Overall connectivity
        - System performance
        - Integration status
      efficiency:
        - Distribution speed
        - Resource utilization
        - Cache effectiveness
  analysis_engine:
    business_intelligence:
      indicators:
        - Member success rates
        - Network growth trends
        - Value delivery metrics
        - ROI measurements
      patterns:
        - Usage optimization
        - Resource allocation
        - System efficiency
    reporting:
      dashboards:
        member:
          - Personal analytics
          - Growth metrics
          - Network impact
        network:
          - System health
          - Distribution stats
          - Performance metrics
  member_success:
    journey_tracking:
      onboarding:
        - Integration completion
        - Feature adoption
        - Initial engagement
        - Success indicators
      growth:
        - Engagement depth
        - Feature utilization
        - Value realization
        - Network contribution
    optimization:
      continuous_improvement:
        monitoring:
          - Performance patterns
          - Usage optimization
          - Resource utilization
        enhancement:
          - Feature refinement
          - UX optimization
          - Integration efficiency
testing_and_optimization:
  testing_architecture:
    layers:
      unit:
        scope:
          - Component functionality
          - Class methods
          - Utility functions
          - Event handlers
      integration:
        scope:
          - Plugin interactions
          - API endpoints
          - Data flow
          - Authentication chains
      end_to_end:
        scope:
          - User journeys
          - Feature workflows
          - Cross-plugin scenarios
          - Network operations
  performance_monitoring:
    metrics:
      response_times:
        - API latency
        - Content delivery
        - Authentication flow
        - Real-time updates
      resource_usage:
        - Memory consumption
        - CPU utilization
        - Network bandwidth
        - Cache efficiency
  load_management:
    distribution:
      strategies:
        - Geographic routing
        - Load balancing
        - Request queuing
        - Cache distribution
    optimization:
      caching:
        membership_based:
          free: 1-hour
          freeWire: 6-hours
          wire: 12-hours
          extraWire: 24-hours
        content_type:
          articles: 4-hours
          events: 1-hour
          directory: 12-hours
          message_boards: 15-minutes
system_maintenance:
  health_monitoring:
    checks:
      automated:
        - Service availability
        - API health
        - Database performance
        - Cache status
      manual:
        - Security audits
        - Performance reviews
        - Integration validations
        - Code quality checks
  troubleshooting:
    error_handling:
      detection:
        - Error logging
        - Performance degradation
        - Integration failures
        - User reports
      resolution:
        - Automated recovery
        - Manual intervention
        - Rollback procedures
        - Service restoration
  recovery_procedures:
    automated:
      - Service restart
      - Cache rebuild
      - Connection retry
      - State recovery
    manual:
      - Database restoration
      - Configuration reset
      - Plugin reactivation
      - Network reconnection
network_resilience:
  system_hardening:
    infrastructure_protection:
      redundancy:
        - Failover systems
        - Load balancing
        - Data replication
        - Service redundancy
      security:
        - Access control
        - Data encryption
        - Attack prevention
        - Vulnerability management
  service_continuity:
    critical_functions:
      protection:
        - Critical path monitoring
        - Service prioritization
        - Resource reservation
        - Impact minimization
      business_operations:
        - Member services
        - Content delivery
        - Network operations
        - Value delivery
governance_and_quality:
  standards:
    quality_guidelines:
      - Content standards
      - Technical requirements
      - Integration policies
      - Performance benchmarks
    member_policies:
      - Participation rules
      - Content guidelines
      - Technical compliance
      - Service standards
  evolution_management:
    innovation:
      - Feature research
      - Prototype development
      - Member feedback
      - Implementation strategy
    growth:
      - Capacity evolution
      - Service expansion
      - Feature maturity
      - Network advancement
implementation_strategy:
  deployment_sequence:
    core_setup:
      - Plugin activation hooks
      - Database initialization
      - API endpoint registration
      - Authentication setup
    integration_flow:
      - MemberPress connection
      - BuddyBoss integration
      - Discord services
      - OAuth implementation
  plugin_coordination:
    ring_leader:
      priority: primary
      dependencies:
        - Core WordPress
        - BuddyBoss Platform
        - MemberPress
      initialization:
        - Authentication services
        - Content distribution
        - Member management
        - Network statistics
    connect_plugin:
      priority: secondary
      dependencies:
        - Ring Leader Plugin
      initialization:
        - Site integration
        - UI components
        - Content display
        - Member features
    screenshots:
      priority: tertiary
      dependencies:
        - Ring Leader Plugin
        - Image processing
      initialization:
        - Cache system
        - API endpoints
        - Fallback services
        - Admin controls
  rollout_management:
    staging:
      - Development environment
      - Testing environment
      - Staging environment
      - Production deployment
    monitoring:
      - Performance metrics
      - Error tracking
      - Usage statistics
      - Integration health
network_overlay:
  components:
    trigger:
      type: floating-button
      requirements:
        - Minimalist design
        - Responsive positioning
        - Customizable appearance
        - Plugin state awareness
    popup:
      requirements:
        - Responsive interface
        - Network navigation system
        - Content preview cards
        - Real-time notifications
        - Cross-site search functionality
        - Screenshot preview integration
plugin_integration:
  connectToRingLeader:
    requirements:
      - Authentication handshake
      - Data synchronization
      - Event handling
      - Error recovery
      - Membership level verification
      - Content distribution pipeline
  connectToScreenshots:
    requirements:
      - Screenshot request handling
      - Cache coordination
      - Error fallback
      - Membership-based access control
development_environment:
  security:
    authentication:
      methods:
        - WordPress native
        - BuddyBoss SSO
        - Discord OAuth
        - OpenID Connect
      tokenManagement:
        lifetime: 24h
        refreshToken: 7d
        storage: secure-cookie
    apiSecurity:
      rateLimit:
        free: 30/minute
        public: 60/minute
        authenticated: 300/minute
        premium: 1000/minute
truthfulnessControls:
  mandatoryVerification:
    knowledgeValidation:
      beforeResponse:
        validateExpertise: true
        checkKnowledgeBounds: true
        verifySourceAvailability: true
        confirmContextUnderstanding: true
      duringResponse:
        trackConfidenceLevel: true
        monitorAssumptions: true
        validateLogicalFlow: true
        checkInternalConsistency: true
      afterResponse:
        verifyCompleteness: true
        validateAccuracy: true
        checkForOmissions: true
        confirmClarityOfUncertainty: true
    truthfulnessChecks:
      required:
        explicitUncertainty:
          trigger: any_uncertainty
          format: 'I am [confidence_level] certain about [specific_aspect]'
          levels:
            - completely
            - mostly
            - somewhat
            - uncertain
            - cannot determine
        knowledgeGaps:
          identification: mandatory
          disclosure: immediate
          format: 'I don''t know [specific_aspect] because [reason]'
        assumptionTracking:
          explicit: true
          format: 'I am assuming [assumption] based on [reasoning]'
          validation: continuous
  responseProtocols:
    truthfulnessEnforcement:
      beforeAnswering:
        requireKnowledgeCheck: true
        validateQuestionUnderstanding: true
        checkForAmbiguity: true
        verifyExpertiseMatch: true
      duringAnswer:
        trackCertaintyLevels: true
        flagSpeculation: true
        markInferences: true
        indicateSourceReliability: true
      correctionProtocol:
        immediateCorrection: true
        format: 'I need to correct [specific_point] because [reason]'
        trackingRequired: true
        updateContext: true
    prohibitedBehaviors:
      absolute:
        - speculation_without_disclosure
        - overconfidence_in_uncertainty
        - assumption_without_declaration
        - partial_knowledge_without_disclosure
        - context_dropping
        - ambiguous_certainty
      conditional:
        inference: require_explicit_marking
        speculation: require_justification
        generalization: require_scope_definition
  qualityControls:
    responseValidation:
      required:
        logicalConsistency: true
        completeContext: true
        accurateScope: true
        clearUncertainty: true
      verification:
        crossCheck: true
        sourceValidation: true
        assumptionVerification: true
        contextualAccuracy: true
    clarityEnforcement:
      uncertaintyLevels:
        explicit: true
        graduated: true
        contextual: true
      knowledgeBounds:
        clear: true
        specific: true
        justified: true
  interactionRequirements:
    mandatoryElements:
      preResponse:
        - question_understanding_confirmation
        - expertise_validation
        - context_verification
      duringResponse:
        - certainty_level_indication
        - assumption_declaration
        - inference_marking
      postResponse:
        - completeness_check
        - accuracy_verification
        - uncertainty_clarity
    continuousValidation:
      trackAssumptions: true
      monitorCertainty: true
      validateConsistency: true
      verifyCompleteness: true

analytics
css
golang
html
javascript
mdx
oauth
react
+3 more
Startempire-Wire/Startempire-Wire-Network

Used in 1 repository

Python
{
"general": {
"coding_style": {
"language": "Python",
"use_strict": true,
"indentation": "4 spaces",
"max_line_length": 120,
"comments": {
"style": "# for single-line, ''' for multi-line",
"require_comments": true
}
},
"naming_conventions": {
"variables": "snake_case",
"functions": "snake_case",
"classes": "PascalCase",
"interfaces": "PascalCase",
"files": "snake_case"
},
"error_handling": {
"prefer_try_catch": true,
"log_errors": true},
"testing": {
"require_tests": true,
"test_coverage": "80%",
"test_types": ["unit", "integration"]
},
"documentation": {
"require_docs": true,
"doc_tool": "docstrings",
"style_guide": "Google Python Style Guide"
},
"security": {
"require_https": true,
"sanitize_inputs": true,
"validate_inputs": true,
"use_env_vars": true
},
"configuration_management": {
"config_files": [".env"],
"env_management": "python-dotenv",
"secrets_management": "environment variables"
},
"code_review": {
"require_reviews": true,
"review_tool": "GitHub Pull Requests",
"review_criteria": ["functionality", "code quality", "security"]
},
"version_control": {
"system": "Git",
"branching_strategy": "GitHub Flow",
"commit_message_format": "Conventional Commits"
},
"logging": {
    "logging_tool": "Python logging module",
    "log_levels": ["debug", "info", "warn", "error"],
    "log_retention_policy": "7 days"
    },
    "monitoring": {
    "monitoring_tool": "Not specified",
    "metrics": ["file processing time", "classification accuracy", "error rate"]
    },
    "dependency_management": {
    "package_manager": "pip",
    "versioning_strategy": "Semantic Versioning"
    },
    "accessibility": {
    "standards": ["Not applicable"],
    "testing_tools": ["Not applicable"]
    },
    "internationalization": {
    "i18n_tool": "Not applicable",
    "supported_languages": ["English"],
    "default_language": "English"
    },
    "ci_cd": {
    "ci_tool": "GitHub Actions",
    "cd_tool": "Not specified",
    "pipeline_configuration": ".github/workflows/main.yml"
    },
    "code_formatting": {
    "formatter": "Black",
    "linting_tool": "Pylint",
    "rules": ["PEP 8", "project-specific rules"]
    },
    "architecture": {
        "patterns": ["Modular design"],
        "principles": ["Single Responsibility", "DRY"]
        }
        },
        "project_specific": {
        "use_framework": "None",
        "styling": "Not applicable",
        "testing_framework": "pytest",
        "build_tool": "setuptools",
        "deployment": {
        "environment": "Local machine",
        "automation": "Not specified",
        "strategy": "Manual deployment"
        },
        "performance": {
        "benchmarking_tool": "Not specified",
        "performance_goals": {
        "response_time": "< 5 seconds per file",
        "throughput": "Not specified",
        "error_rate": "< 1%"
        }
        }
        },
        "context": {
            "codebase_overview": "Python-based file organization tool using AI for content analysis and classification",
            "libraries": ["watchdog", "spacy", "PyPDF2", "python-docx", "pandas", "beautifulsoup4", "transformers", "scikit-learn", "joblib", "python-dotenv", "torch", "pytest", "shutil", "logging", "pytest-mock"],
            "coding_practices": {
            "modularity": true,
            "DRY_principle": true,
            "performance_optimization": true
            }
            },
            "behavior": {
            "verbosity": {
            "level": 2,
            "range": [0, 3]
            },
            "handle_incomplete_tasks": "Provide partial solution and explain limitations",
            "ask_for_clarification": true,
            "communication_tone": "Professional and concise"
            }
            }
golang
html
python
naldojesse/SmartFile-Organizer

Used in 1 repository

TypeScript
    You are an expert in TypeScript, Node.js, Vite, Vue.js 3.x, Vue Router, Pinia, VueUse, vite-plugin-pwa, Vue i18n, Vitest, and TipTap, with a deep understanding of best practices and performance optimization techniques in these technologies.
  
    Code Style and Structure
    - Write concise, maintainable, and technically accurate TypeScript code with relevant examples.
    - Use functional and declarative programming patterns; avoid classes.
    - Favor iteration and modularization to adhere to DRY principles and avoid code duplication.
    - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
    - Organize files systematically: each file should contain only related content, such as exported components, subcomponents, helpers, static content, and types.
  
    Naming Conventions
    - Use lowercase with dashes for directories (e.g., components/auth-wizard).
    - Favor named exports for functions.
  
    TypeScript Usage
    - Use TypeScript for all code; prefer interfaces over types for their extendability and ability to merge.
    - Avoid enums; use maps instead for better type safety and flexibility.
    - Use functional components with TypeScript interfaces.
  
    Syntax and Formatting
    - Use the "function" keyword for pure functions to benefit from hoisting and clarity.
    - Always use the Vue Composition API script setup style.
  
    UI and Styling
    - Implement responsive design where the screen size is from 300px to 1920px.
  
    Performance Optimization
    - Leverage VueUse functions where applicable to enhance reactivity and performance.
    - Wrap asynchronous components in Suspense with a fallback UI.
    - Use dynamic loading for non-critical components.
    - Optimize images: use WebP format, include size data, implement lazy loading.
    - Implement an optimized chunking strategy during the Vite build process, such as code splitting, to generate smaller bundle sizes.
  
    Key Conventions
    - Optimize Web Vitals (LCP, CLS, FID) using tools like Lighthouse or WebPageTest.

    Testing with Vitest
    - Use Vitest for unit and integration testing.
    - Write comprehensive tests for all components and utility functions.
    - Utilize Vitest's mocking capabilities for external dependencies.
    - Implement test coverage reporting and aim for high coverage percentages.
    - Use describe and it blocks to organize tests logically.
    - Leverage Vitest's snapshot testing for UI components when appropriate.
    - Implement continuous integration to run tests automatically on code changes.
bun
css
html
javascript
react
typescript
vite
vitest
+2 more

First seen in:

yenche123/liubai

Used in 1 repository

Dart
# Windsurf Rules Configuration
version: 1.0.0

# Language Requirements
language:
  dart_version: ">=3.0.0"
  features:
    - interface_modifier
    - sealed_classes
    - pattern_matching

# Project Structure
structure:
  src_dir: lib
  test_dir: test
  assets_dir: assets
  core_dir:
    path: lib/core
    subfolders:
      - usecase
      - error
      - interface

# State Management
state_management:
  type: riverpod
  rules:
    - all_providers_must_be_immutable: true
    - prefer_family_providers: true
    - use_consumer_for_widgets: true
    - avoid_global_providers: true
  folder_structure:
    providers:
      path: lib/providers
      subfolders:
        - state
        - notifiers
        - services

# Navigation
routing:
  type: go_router
  rules:
    - use_path_parameters: true
    - use_route_guards: true
    - prefer_const_constructors: true
  folder_structure:
    router:
      path: lib/routes
      files:
        - routes.dart
        - router_refresh_stream.dart
        - guards

# Code Generation
codegen:
  tools:
    - auto_route_generator
    - riverpod_generator
    - freezed
    - json_serializable
  rules:
    - use_freezed_for_models: true
    - generate_immutable_classes: true

# Architecture
architecture:
  pattern: feature_first
  layers:
    - presentation
    - domain
    - data
  rules:
    - one_feature_per_folder: true
    - separate_interface_implementation: true
    - use_repository_pattern: true
    - use_interface_for_contracts: true

# Dependency Rules
dependencies:
  required:
    - flutter_riverpod: ^2.4.9
    - auto_route: ^7.8.4
    - freezed: ^2.4.6
    - json_serializable: ^6.7.1
  dev_dependencies:
    - auto_route_generator: ^7.3.2
    - riverpod_generator: ^2.3.9
    - build_runner: ^2.4.7

# Linting
linting:
  rules:
    - avoid_print: true
    - prefer_const_constructors: true
    - require_trailing_commas: true
    - use_key_in_widget_constructors: true
    - prefer_final_locals: true

# Testing
testing:
  rules:
    - unit_test_providers: true
    - widget_test_screens: true
    - integration_test_flows: true
  coverage_threshold: 80

# Localization
localization:
  type: flutter_localizations
  folder_structure:
    path: lib/core/localization
    files:
      - app_localizations.dart
      - app_localizations_en.dart
      - app_localizations_bn.dart
    subfolders:
      - translations
  rules:
    - use_arb_files: true
    - prefer_string_enums: true
    - no_hardcoded_strings: true
    - support_rtl: true
  supported_locales:
    - en
    - bn

# Patterns
patterns:
  usecase:
    location: lib/core/usecase
    template:
      - abstract interface class UseCase<Type, Params>
      - Either<Failure, Type> return type
      - NoParams for parameter-less cases
  # Error Handling
  error_handling:
    path: lib/core/error
    types:
      failures:
        - ServerFailure
        - CacheFailure
        - NetworkFailure
        - ValidationFailure
        - AuthenticationFailure
      exceptions:
        - ServerException
        - CacheException
        - NetworkException
        - ValidationException
        - AuthenticationException
    rules:
      - use_either_for_results: true
      - map_exceptions_to_failures: true
      - custom_error_messages: true
      - localize_error_messages: true
    folder_structure:
      failures:
        path: lib/core/error/failures
        base_class: Failure
      exceptions:
        path: lib/core/error/exceptions
        base_class: AppException
      messages:
        path: lib/core/error/messages
        file: error_messages.dart
# Error Handling
error_handling:
  path: lib/core/error
  types:
    failures:
      - ServerFailure
      - CacheFailure
      - NetworkFailure
      - ValidationFailure
      - AuthenticationFailure
    exceptions:
      - ServerException
      - CacheException
      - NetworkException
      - ValidationException
      - AuthenticationException
  rules:
    - use_either_for_results: true
    - map_exceptions_to_failures: true
    - custom_error_messages: true
    - localize_error_messages: true
  folder_structure:
    failures:
      path: lib/core/error/failures
      base_class: Failure
    exceptions:
      path: lib/core/error/exceptions
      base_class: AppException
    messages:
      path: lib/core/error/messages
      file: error_messages.dart
dart
golang
html
kotlin
less
objective-c
ruby
swift
Tanvir-rahman/flutter_auth_riverpod

Used in 1 repository

TypeScript
# Persona

- You're a skilled solana developer, with high expertise in rust and typescript.
- You can build protocols from the architecture to the UI.
- Due to limitations, you prefer to create hooks and components that can be reused, also functions on the same file that's being edited.
- You are descriptive of what you're doing, so you add comments to explain what you're doing whenever necessary.
- You prefer functional programming, and use pure functions as much as possible.
- You use pnpm as your package manager.
- You use pure functions as much as possible.
- You use ts-pattern and pattern matching on typescript for control structures.

## Frontend

- When dealing with frontend dapps for solana, you use vite, react and tailwind.
- You also use solana wallet adapter for authentication.
- You use zod for validation.
- You use tanstack query for data fetching, also use mutations for data manipulation.
- You use react-router for routing.
- You use react-hook-form for form handling.

## Backend

- Usually you avoid using backend since most of the data is stored on-chain.
- You're proficient in rust, and can read and write it.
- Usually you rather use typescript and express for backend needs since most of the data is stored on-chain.
- You use drizzle and postgres for database needs.
- You use zod for validation.

## Database

- You're proficient in SQL and NoSQL.
- You prefer to use postgres for database needs.
css
drizzle-orm
express.js
html
javascript
npm
pnpm
postgresql
+5 more

First seen in:

firelaunch-io/mercury

Used in 1 repository

Vue
## Rules and Guidelines for Implementing ChatGPT Code Prompt Generator

These guidelines aim to ensure consistency, maintainability, and efficiency in the development of the ChatGPT Code Prompt Generator using Electron and Vue.js.

**I. Coding Standards:**

* **Language:** Primarily TypeScript for both Electron (main process) and Vue.js (renderer process) to leverage static typing and improved code maintainability.  JavaScript is acceptable only for very small, self-contained utility functions.
* **Linting:**  Use ESLint with a consistent configuration (e.g., Airbnb, StandardJS) to enforce code style and catch potential issues early.  Configure the linter to work with TypeScript.
* **Formatting:** Use Prettier to automatically format code, ensuring consistent indentation and style across the project.  Integrate Prettier with your editor and commit hooks.
* **Comments:** Write clear and concise comments to explain complex logic or non-obvious code sections.  Avoid redundant comments that merely restate the code.
* **Naming Conventions:** Follow consistent naming conventions (e.g., camelCase for variables and functions, PascalCase for classes and components).  Use descriptive names that clearly indicate the purpose of variables, functions, and components.
* **Error Handling:** Implement robust error handling throughout the application. Use try-catch blocks to handle potential exceptions gracefully. Log errors using a structured logging mechanism (e.g., Winston) for debugging and monitoring.  Provide informative error messages to the user.
* **Testing:** Write unit and integration tests for critical parts of the application to ensure correctness and prevent regressions.  Use a testing framework like Jest or Vitest.


**II. Architectural Decisions:**

* **Electron Architecture:** Employ a clear separation between the main process (Electron) and the renderer process (Vue.js).  The main process is responsible for application lifecycle, file system access, and inter-process communication. The renderer process handles the UI and business logic.
* **Inter-Process Communication (IPC):** Use Electron's IPC mechanism (specifically `ipcMain` and `ipcRenderer`) for communication between the main and renderer processes. This ensures security and prevents accidental cross-process access.  Create a dedicated `ipc` folder to organize the IPC communication logic.   Structure IPC calls with clear, well-defined event names.
* **Vue.js Structure:**  Follow a component-based architecture in Vue.js.  Break down the UI into reusable and well-defined components.  Consider using Vuex (state management library) for managing application state efficiently, particularly for complex interactions that involve the prompt text, settings and folder selection changes.
* **Data Persistence:** Utilize `localStorage` for small data (e.g., application settings, hidden files configuration). For large data such as the application's configuration, prompt history or other large files, consider a file-based approach JSON files for better scalability and persistence beyond the browser session.
* **Modular Design:** Organize the code into modules (folders/files) based on functionality. This enhances code readability, maintainability and allows easier reuse of code components.  The project structure in this prompt is a good starting point. Additional modules might be needed based on complexity.
* **Token Counting:** Implement a simplified heuristic algorithm for token estimation (e.g., character/word count) initially on the client-side.  This avoids the limitations and expense of using OpenAI's API for counting every time.  Consider a configurable weighting system to improve the approximation accuracy.  This may include weighting code differently than prose.
* **Dependency Management:**  Use npm or yarn for managing project dependencies.  Create a comprehensive `package.json` with all required libraries and their versions defined.


**III.  Important Considerations (Electron & Vue.js Specific):**

* **Security:**  Never run untrusted code within the renderer process.  All file system access should be carefully mediated and controlled by the main process using its secure APIs.
* **Performance:**  Optimize the file reading process to avoid blocking the UI. Use asynchronous file reading (Promises or async/await) when reading files and processing tokens.  Use debouncing/throttling techniques to reduce the frequency of calls that depend on UI changes, such as the token counter.
* **Cross-Platform Compatibility:** Test the application on multiple platforms (Windows, macOS, Linux) during development to ensure cross-platform compatibility.
* **Electron Build Process:**  Use Electron's built-in packaging tools to package the application for various platforms once you are ready for a release deployment.  Thoroughly test the build process in different platforms.
* **Vue.js Build Process:** Employ Vite or Webpack to efficiently build and optimize the Vue.js application for optimal performance and bundle size.
* **Error Reporting:** Implement a way for the user to report any critical errors encountered, providing as much relevant information as possible.  This might involve sending error information to a backend service for analysis, using an error tracking system, or simply providing adequate feedback to the user encouraging them to submit a bug report.
* **Code Style Consistency:** Ensure consistent code styling for TypeScript, HTML, and CSS/SCSS.  A well-defined style guide and use of linting will help maintain consistency.
* **Asynchronous Operations:**  Handle all asynchronous operations (especially file system access) using promises or async/await to prevent blocking the UI thread.
* **Testing:** Create a solid testing strategy covering unit, integration, and potentially end-to-end tests.  Consider using Jest for unit/integration testing and Cypress or Playwright for end-to-end testing.

By adhering to these guidelines, the project will be more maintainable, scalable, and easier to collaborate on.  Consistent use of types and a robust test suite will also greatly increase the reliability and longevity of the project.

Always use the following file everytime to follow our work. Create the file if it's not already created.
currentTasks.md
- Explanation of what need to be achieved 
- Explanation of what is already achieved 
- Explanation of what is blocked 
- Explanation of what is in progress 
- Explanation of what is next 
- Functions, pages, components, types, etc. already created for that task
- When a task is completed, add a ✅ in front of the task.
- When a task is blocked, add a ❌ in front of the task.
- When a task is in progress, add a ⚙️ in front of the task.
- When a task is not started, add a ⚠️ in front of the task.

The projectGoal.md file is the goal of the project. It is the first thing you should read.

bun
css
cypress
eslint
golang
html
java
javascript
+15 more
AiCodingBattle/eazypaste-gpt

Used in 1 repository

TypeScript
<?xml version="1.0" encoding="UTF-8"?>
<cursor-rules>
    <directory-structure>
        <base-dir>src</base-dir>
        <rules>
            <rule id="use-src">All application code must be placed within the src directory</rule>
            <rule id="no-app-dir">Do not create files directly in app directory, use src/app instead</rule>
        </rules>
        
        <directories>
            <directory path="src/app">
                <description>Next.js app router pages and layouts</description>
                <patterns>
                    <pattern>src/app/**/(page|layout|loading|error).tsx</pattern>
                </patterns>
            </directory>
            
            <directory path="src/components">
                <description>React components</description>
                <subdirectories>
                    <directory>ui</directory>
                    <directory>layout</directory>
                    <directory>forms</directory>
                    <directory>shared</directory>
                </subdirectories>
            </directory>
            
            <directory path="src/core">
                <description>Core application code</description>
                <subdirectories>
                    <directory>config</directory>
                    <directory>types</directory>
                    <directory>utils</directory>
                    <directory>hooks</directory>
                </subdirectories>
            </directory>
            
            <directory path="src/styles">
                <description>Global styles and CSS modules</description>
            </directory>
            
            <directory path="src/lib">
                <description>Third-party library configurations</description>
            </directory>
        </directories>
    </directory-structure>

    <coding-standards>
        <typescript>
            <rule>Use type instead of interface</rule>
            <rule>Export types from dedicated type files</rule>
            <rule>Use proper type imports: import type { Type } from 'module'</rule>
        </typescript>

        <components>
            <rule>Use 'use client' directive for client components</rule>
            <rule>Export default for page components</rule>
            <rule>Use named exports for shared components</rule>
            <rule>Follow the pattern: export default function ComponentName({prop}: PropType)</rule>
        </components>

        <styles>
            <rule>Use Tailwind CSS for styling</rule>
            <rule>Group related Tailwind classes using cn utility</rule>
            <rule>Define custom classes in globals.css</rule>
        </styles>

        <naming>
            <rule>Use kebab-case for files</rule>
            <rule>Use PascalCase for components</rule>
            <rule>Use camelCase for functions and variables</rule>
        </naming>
    </coding-standards>

    <separation-of-concerns>
        <rule>Keep components pure and focused</rule>
        <rule>Separate business logic into hooks</rule>
        <rule>Keep configuration in dedicated config files</rule>
        <rule>Use proper type declarations in core/types</rule>
        <rule>Keep animations in shared/lib/animations</rule>
        <rule>Store constants in core/constants</rule>
    </separation-of-concerns>
</cursor-rules> 
css
javascript
next.js
python
react
scss
tailwindcss
typescript

First seen in:

remcostoeten/prisma

Used in 1 repository

JavaScript
<project_details>

<description>
These rules apply specifically to this repository and should be used for all code within this project scope.
</description>

<content_rules>
- All text must be in British English
- Use ’ instead of ' as an apostrophe on any frontend words (words that display to the user). e.g. Let’s, not Let's, businesses’, not businesses'
</content_rules>

<technical_requirements>
- Next.js 14 with App Router
- Tailwind CSS for styling
- Node.js v22.11.0 required
- Automatic deployment via GitHub Actions on push to main branch
- Static site deployment to GitHub Pages:
  - Builds to `/out` directory
  - Deploys to `gh-pages` branch
  - Custom domain: embeddings.au
  - No server-side functionality available
  - All API endpoints must be external services
- Image Handling:
  - Featured image must be in public/images/ for direct URL mapping
  - All other images must be in src/images/ for optimization
  - Featured image configuration in src/lib/images.ts
  - Image paths must use forward slashes (/)
- Component Architecture:
  - Use Server Components by default (no 'use client' directive)
  - Only use Client Components when needed for:
    - React hooks (useState, useEffect, etc.)
    - Browser APIs
    - Interactive features
    - Event listeners
  - Split interactive components into separate files
  - Mark Client Components with 'use client' directive
</technical_requirements>

<key_templates>
src/
├── components/
│   ├── RootLayout.jsx: Main navigation and site structure
│   │   └── Navigation(): Main nav items
│   │   └── Header(): Contact button and mobile menu
│   ├── Footer.jsx: Footer structure and links
│   │   └── navigation[]: Footer sections and links
│   ├── Logo.jsx: Site logo and hover states
│   │   └── socialMediaProfiles[]: Social platform links
│   └── Offices.jsx: Office location information
├── lib/
│   └── images.ts: Featured image configuration for social sharing/meta tags
├── app/
│   ├── page.jsx: Homepage content and hero section
│   ├── about/
│   │   └── page.jsx: About page content and team info
│   ├── process/
│   │   └── page.jsx: Process page methodology
│   └── contact/
│       ├── page.jsx: Contact page layout and static content
│       ├── ContactForm.jsx: Interactive contact form (Client Component)
│       └── ContactDetails.jsx: Office locations and contact info
└── images/
    ├── clients/: Client logos and case studies
    └── team/: Team member photos

<disabled_pages>
src/app/_disabled_pages/
├── work/: Case studies and portfolio (currently disabled)
└── blog/: Blog posts and articles (currently disabled)
</disabled_pages>

</key_templates>

</project_details>
css
golang
javascript
mdx
next.js
react
tailwindcss
typescript

First seen in:

Culpable/embeddings

Used in 1 repository