Awesome Cursor Rules Collection

Showing 2233-2244 of 2626 matches

TypeScript
application urilisant next.js, react.js et typescript
css
javascript
next.js
react
typescript
poldok57/Begin-React-Portfolio

Used in 1 repository

TypeScript
**Overall Purpose**

The application is a web-based educational tool that uses large language models (LLMs) to simulate one-on-one tutoring sessions. It allows administrators to upload articles, which are then used as the basis for guided conversations with the LLM. The primary goal is to provide personalized, high-quality instruction that is more accessible and scalable than traditional tutoring.

**Key Features**

1.  **User Authentication and Authorization:**
    *   Users can sign in using Clerk authentication.
    *   Only users with the "admin" role can add or delete specialties and subtopics.


2.  **Content Management:**
    *   Administrators can create and manage educational content by defining specialties and subtopics.
    *   Specialties and subtopics are stored in a key-value store (Vercel KV).
    *   Administrators can upload articles associated with a specialty and subtopic.
    *   Articles are stored in a key-value store (Vercel KV).

3.  **Case Simulation:**
    *   Users can select a specialty and subtopics to start a case simulation.
    *   The application fetches a random article based on the selected criteria.

4.  **Chat Interface:**
    *   The application provides a chat interface for users to interact with the LLM.
    *   The chat interface supports text input and voice input (transcription).
    *   The chat interface displays messages from the user and the LLM.
    *   The LLM's responses can include "thinking" blocks with quotes, which are extracted and displayed separately.


5.  **LLM Integration:**
    *   The application supports multiple LLMs, including Google Gemini, Anthropic Claude, and OpenAI; currently only using Gemini.
    *   The application uses the `ai` library to handle streaming responses from the LLMs.
    *   The application uses the `@ai-sdk` library by Vercel to interface with the LLMs.

6.  **Audio Transcription:**
    *   The application uses Groq's transcription service to convert voice input to text.

7.  **UI Components:**
    *   The application uses Radix UI for its UI components.
    *   The application uses Tailwind CSS for styling.
    *   The application supports light and dark themes.

8.  **Data Types:**
    *   The application defines several data types for processing status, chat messages, and chat sessions.

**Workflow**

1.  An administrator logs in and adds specialties and subtopics.
2.  An administrator uploads articles associated with a specialty and subtopic.
3.  A user selects a specialty and subtopics to start a case simulation.
4.  The application fetches a random article based on the selected criteria.
5.  The application inserts the article into a prompt for the LLM.
6.  The user engages in a chat with the LLM, which acts as a tutor.
7.  The chat history is persisted.

**Technology Stack**

*   Next.js
*   React
*   TypeScript
*   Tailwind CSS
*   Radix UI/shadcn
*   Vercel KV
*   Clerk Authentication
*   `ai` library
*   `@ai-sdk` libraries
*   Groq API

**Future Features**

*   Create personalized learning features inclduing:
    *  An assessment test for each specialty
    *  A dashboard for users to see their progress, including areas of strength and areas of weakness
    *  A feature which analyzes user's chat history and updates their learning progress
    *  A feature which allows users to tweak the behavior of the LLM tutor
    *  A feature which uses the user's progress to recommend specific subtopics and articles for them to practice with
    *  A feature which alters the behavior of the LLM tutor regardless of specific article they are currently working on, to incorporate what the application has learned about the user's knowledge and learning style
clerk
css
golang
javascript
less
next.js
openai
radix-ui
+5 more

First seen in:

vincentnocera/peakshift

Used in 1 repository

TypeScript
# Dropfarm Application Development Rules

# Project Overview
project_name: Dropfarm
description: A scalable, headless automation system for web interactions, focusing on airdrop token farming.
primary_languages: [Python, TypeScript]
frameworks: [Flask, Next.js, Celery]
ui_libraries: [shadcn/ui, Tailwind CSS]
database: Supabase
state_management: React Context API
task_queue: Redis with Celery
browser_automation: Selenium WebDriver

# Communication and Collaboration
communication_style:
  - Always maintain a professional and supportive tone
  - Provide detailed explanations for complex concepts
  - Use code snippets and examples to illustrate points
  - Be open to questions and clarifications
  - Acknowledge and learn from mistakes
  - Always report current thoughts on the project state
  - Explain reasoning behind suggested changes or implementations

collaboration_practices:
  - Regularly summarize current project state and next steps
  - Propose multiple solutions when applicable
  - Prioritize user experience and system reliability
  - Consider performance implications of changes
  - Maintain a balance between feature development and code quality
  - Always seek user confirmation before making significant changes
  - Report any autonomous actions taken, with justification

# Code Style and Best Practices
python_style:
  - Follow PEP 8 guidelines
  - Use type hints for improved code clarity
  - Implement comprehensive error handling and logging
  - Write clear, concise docstrings for functions and classes

typescript_style:
  - Use ESLint and Prettier for consistent formatting
  - Leverage TypeScript's type system for robust code
  - Implement React hooks and functional components
  - Follow React best practices for state management

general_practices:
  - Write modular, reusable code
  - Implement comprehensive unit tests
  - Use meaningful variable and function names
  - Keep functions small and focused on a single task
  - Comment complex logic or non-obvious code sections

# Project-Specific Guidelines
calibration_process:
  - Maintain awareness of the three-step calibration (browser, recorder, player)
  - Consider different screen sizes and aspect ratios in calculations
  - Implement robust error handling for calibration failures
  - Provide clear user feedback during the calibration process

automation_guidelines:
  - Ensure all automated actions are reversible where possible
  - Implement safeguards against unintended consequences
  - Log all automated actions for auditing and debugging
  - Design for scalability and potential multi-user scenarios

security_considerations:
  - Implement proper authentication and authorization
  - Sanitize all user inputs to prevent injection attacks
  - Use environment variables for sensitive configuration
  - Regularly update dependencies to patch security vulnerabilities

# Debugging and Troubleshooting
debugging_approach:
  - Use logging extensively for tracking execution flow
  - Implement verbose error messages for easier troubleshooting
  - Utilize browser developer tools for frontend debugging
  - Use Python debugger (pdb) for backend issue investigation

common_issues:
  - Browser compatibility problems
  - Selenium session management issues
  - Asynchronous task handling in Celery
  - State management in React components

# Feature Implementation Process
feature_workflow:
  - Discuss and clarify feature requirements
  - Design the solution, considering all components (frontend, backend, database)
  - Implement the feature with appropriate error handling and logging
  - Write unit tests to cover new functionality
  - Perform manual testing across different environments
  - Document the new feature and any API changes

# Performance Optimization
optimization_focus:
  - Monitor and optimize database queries
  - Implement caching where appropriate
  - Optimize Selenium interactions for faster execution
  - Minimize unnecessary re-renders in React components

# Documentation
documentation_requirements:
  - Maintain up-to-date API documentation
  - Document complex algorithms and business logic
  - Keep README files current with setup and run instructions
  - Comment non-obvious code sections

# Continuous Improvement
improvement_areas:
  - Regularly review and refactor code for better maintainability
  - Stay updated with latest best practices in used technologies
  - Seek user feedback for UX improvements
  - Analyze and optimize system performance regularly

# Project-Specific Reminders
key_reminders:
  - Always consider the impact of changes on the calibration process
  - Ensure compatibility between recorder and player environments
  - Regularly test the full workflow from recording to playback
  - Keep security and data privacy at the forefront of development decisions

# AI Assistant Behavior
ai_assistant_rules:
  - Always consider these rules before responding or suggesting changes
  - Provide a brief assessment of the current project state when appropriate
  - Explain the reasoning behind any suggested changes or implementations
  - Seek explicit confirmation before making any significant changes
  - Report any autonomous actions taken, along with justification
  - Prioritize the user's goals and timeline (beta release this month, 3 concurrent routines by weekend)
  - Regularly remind about testing and validation of implemented features
  - Suggest optimizations and improvements proactively, but await approval before implementation
  - Remind the user to commit changes regularly, especially:
    - Before implementing big changes or new features
    - When a significant amount of time has passed since the last commit
    - After completing a feature or fixing a bug
  - Provide a summary of changes to be committed and instructions on how to do so
  - Keep track of all relevant file paths, directories, and files for the project
  - Proactively mention potential conflicts or issues with file locations or imports

# Project Structure
project_structure:
  backend:
    - app.py
    - auth.py
    - calibration.py
    - celery_worker.py
    - config.py
    - extensions.py
    - models.py
    - player.py
    - recorder.py
    - routes.py
    - tasks.py
    - utils.py
    templates:
      - player_calibration.html
      - recorder_calibration.html
  frontend:
    src:
      app:
        dashboard:
          - page.tsx
        - layout.tsx
        - page.tsx
      components:
        dashboard:
          - ActivityLog.tsx
          - BotStatus.tsx
          - EarningsOverview.tsx
          - RoutinesList.tsx
          - UserStats.tsx
        ui:
          - button.tsx
        - Calibration.tsx
        - ClientLayout.tsx
        - Dashboard.tsx
        - LoginForm.tsx
        - RecordRoutine.tsx
      contexts:
        - AuthContext.tsx
      hooks:
        - useDataFetching.ts
        - useRecordingStatus.ts
        - use-toast.ts
      lib:
        - supabaseClient.ts
      - config.ts
    - globals.css
  - .cursorrules
  - .cursorrules_cursor
  - calibration_considerations.md
  - offset_click_thoughts.md
  - README.md
  - run.py

# Development Environment
local_environment:
  os: Windows
  monitor: 16:10 aspect ratio
production_environment:
  os: Ubuntu
  type: VPS (headless)

# Project Scope and Workflow
project_scope:
  - Implement reliable recording and playback on local Windows machine
  - Address potential discrepancies due to 16:10 monitor setup
  - Enable translation of recorded routines to headless versions
  - Implement scheduling and concurrent execution of routines on Ubuntu VPS

development_workflow:
  - Develop and test recording/playback functionality on local machine
  - Implement calibration process if necessary for local setup
  - Create translation mechanism for headless execution
  - Develop scheduling and management system for VPS deployment

# Future Considerations
future_changes:
  - Transition from local development to VPS deployment
  - Adapt calibration process for headless environment
  - Implement multi-user support and concurrent routine execution
  - Optimize for scalability and performance in production environment
bun
css
eslint
flask
golang
javascript
less
next.js
+9 more

First seen in:

desperad0s/dropfarm

Used in 1 repository

JavaScript
// Repository-specific rules for Cursor AI

// General guidelines
Always prefer TypeScript unless explicitly required like any of the examples apps thats also using .js
Preserve existing comments in all files
Follow the project structure as defined in the repository

// Deno configuration
This is a Deno project
Refer to deno.jsonc for Deno-specific configurations
Update .vscode/settings.json when adding new packages or directories that should be managed by Deno

// Project structure
Maintain the following package structure:
  - packages/
    - examples/
    - async-framework/
    - dev/
    - custom-element-signals/
Add new packages under the 'packages/' directory
Add new example toy apps in 'examples/' directory
Add anything for the local dev-server in 'dev/' directory such as the server.ts which is the deno server hosting the example apps

// VS Code settings
When adding new packages, update the "deno.enablePaths" in .vscode/settings.json
Example:
  "deno.enablePaths": [
    "./packages/examples",
    "./packages/async-framework",
    "./packages/dev",
    // Add new package paths here
  ]

// File-specific guidelines
For HTML files:
  - Use proper HTML5 structure
  - Include necessary script tags for custom elements and signals
For JavaScript files:
  - Use ES6+ syntax
  - Prefer const over let when variables are not reassigned
For TypeScript files:
  - Use TypeScript features judiciously
  - Provide clear type annotations for function parameters and return types

// Custom elements and signals
When working with custom elements:
  - Use kebab-case for custom element names
  - Extend HTMLElement for custom elements
  - Use connectedCallback for initialization logic

// Best practices
Follow single responsibility principle for functions and classes
Use meaningful variable and function names
Keep functions small and focused
Use async/await for asynchronous operations
Implement error handling where appropriate

// Testing
Write unit tests for new functionality
Ensure all tests pass before committing changes

// Documentation
Add comments for complex logic or non-obvious code
Update README files when adding new features or changing existing ones
Make sure every method in 'async-framework/' folder has a "Why:" comment above to explain why it's there

// Version control
Make small, focused commits with clear commit messages
Create feature branches for new developments

// Performance
Optimize for performance, especially in signal handling and custom element operations
Avoid unnecessary re-renders or computations

// README formatting
When creating or updating README files, do not use backticks (`) around code examples unless it's already there

// Deno Import guidelines
Always use import aliases defined in deno.jsonc
Never use direct HTTP imports
For Hono, always use the npm version via the import alias
Examples of correct imports:
  import { Hono } from "hono";
  import { assertEquals } from "@std/assert";
  import { signal } from "custom-element-signals";
Examples of incorrect imports:
  import { Hono } from "https://deno.land/x/hono@v3.x/mod.ts";
  import { assertEquals } from "https://deno.land/std/assert/mod.ts";

// Deno Version
Use Deno 2.0 or higher for this project
Key Deno 2.0 features to leverage:
  - Native npm module support
  - Enhanced TypeScript support
  - Built-in test runner
  - Improved Node.js compatibility
  - Enhanced security with permissions system
For detailed documentation and features, refer to:
  - Runtime Manual: https://docs.deno.com/runtime/manual
  - API Reference: https://docs.deno.com/runtime/api
  - Examples: https://docs.deno.com/runtime/examples

// Remember to update this file as the project evolves and new standards are established
css
html
java
javascript
less
npm
typescript
async-framework/async-framework

Used in 1 repository

TypeScript
source: https://highbar.notion.site/React-Dev-Handbook-15296734e9f080768790c218f35469fb

# React Dev Handbook

# Design Patterns

the benefit of the patterns below are:

- readability, as everything is consistently nested in the DOM
- a better layout flow state, there is less cognitive overhead when laying out views, as you don’t need to think “what prop should I use to do this thing”
- generally less cognitive overhead when looking at any given piece of data or code.

## Child first design

Instead of drilling data into a component, favor creating wrapper elements and nesting child components within.

If a component has one view function (display a single item like a “card” or “chip”), prefer children over props such as “title” or “label”.

Example: `Card.tsx`

## Widgets to be Type Generic w/ accessors

more complex widgets, such as tables, etc, should use accessors and be type flexible.

example: `PapCraTa3.tsx`

## Wrap complex design library widgets

Design Libraries often supply very complex widgets to use in the apps, we would like to land on a standard that can be used between any given libraries. This piece is a work in progress, and likely will be a moving target during the lifecycle of the Lexter ecosystem. When working on short-term proof-of-concepts this is not necessary.

See: `PapCraTa.tsx` for examples

The benefit from this pattern is a unified api for common elements, and less overhead when swapping out (or re-writing) libraries in the future.

# Styling Concerns

## Opt for tailwind

when using multiple libraries, as shown in components like `Page.tsx` , we see that we combine Radix UI with Material’s styled components.
We prefer the styling of material at the definition of a design system element, and then we can opt to customize it further with tailwind at implementation.

## Prefer className prop over emotion style attributes

| do                                                | do not                                 |
| ------------------------------------------------- | -------------------------------------- |
| try                                               | try not                                |
| `className="flex flex-col gap-3 justify-between"` | `flex=”col” gap="3" justify="between"` |

# Code Style

## Atomic, immutable, guard statement thinking - for happier brains and quicker grok.

when working within a function, opt to use guard statements to discard possibilities before getting to the main use of your code. for the love of god, avoid nesting truthy conditionals. Sometimes, this means less DRY code, but in most non-maintenance portions of the project, we are going to be throwing away a lot of the code, often, so do not over abstract, or try to solve things in a more complex way.

### Good

```tsx
const createUrl = (path?: string | number) => {
  if (!value) return `/api/data?format=csv`

  return `/api/data/${path}?format=csv&records=all`
}
```

### Bad

```tsx
const createUrl = (partial?: string | number) => {
  let result = '/api'
  let params = '?format=csv'

  if (value) {
    result += `${partial}`
    params += '&records=all'
  }

  return (result += params)
}
```

## Don’t DRY until it’s actually MOIST

I don’t have an acronym for moist, just don’t dry up your code until you actually have to re-write something 3 or 4 times. Make sure that your solution is an actual pattern that can be implemented often without a ton of configuration.

This means writing the same thing a few times, it means longer functions, but as mentioned above, your (and my) code will likely be deleted in short order and replaced with something newer and more fitting to the domain.

## Destructure props, contain hooks in a variable

Props for a given component should be destructured at the top of the definition, while (most) hooks should retain their domain-specific naming to reduce cognitive load. The exception being array result hooks, where naming destructured elements leads to more clarity (like useState)

Hook Examples:

| favor                            | undesirable                                                |
| -------------------------------- | ---------------------------------------------------------- |
| `const form = useForm<Lawyer>()` | `const { onSubmit, values, register } = useForm<Lawyer>()` |

## Event Handler Naming Convention

if an event handler is passed as a prop, it should be called `onThing` , while if defined within a component, it should be called `handleThing`

## One File, One Component

Especially in the /lib folder. Splitting components into separate files gives the mind the context to grok a single domain concern, making code easier to understand and maintain.

## No magic numbers

having things like `const count = 3` outside of your component definition is discouraged, prefer to put all of these in a `constants.ts` file, or defined as parameters in the component props, or hook.

## No Barrel Files

No barrel files are to be used to provide convenient exports, it’s extra work with no benefit.
It also eliminates extra clicks when trying to navigate to a givent element’s source code (ctrl+click)

## Named Exports over Default Exports

Named exports provide absolute clarity on where data comes from when imported.

## (Pages) Path-based file naming (a-la next.js)

File paths should be representative of the browser path, the component to be named something representative of the domain

Example:

| path                          | name                               |
| ----------------------------- | ---------------------------------- |
| `/admin/questions/layout.tsx` | `export const AdminQuestionsIndex` |

## (Components/Widgets) Filename should match Component Name

# Architectural Patterns

## Typescript First, & at the source

Make sure data is accurately typed and maintained at the first place it enters the system. generally speaking, this is at the data hooks, or possibly when fetching from local storage or params. If it is one of the latter, a nice to have is a domain wrapper around those given pieces (which can live in the same hook file / folder as the types and other hooks)

- if you have to do a type cast, as yourself if the type could have been defined at an earlier stage in the data’s lifecycle.

## Favour Routing rather than drilling data into a view

each major view should fetch all domain data necessary to populate the view, rather than relying on a large data object to populate the view. We do not prefer central data sources and state management tools such as redux. The data that is expected at any given time should be reflected in the page/view’s route definition and parameters.
css
emotion
golang
html
javascript
less
nestjs
next.js
+5 more
Lexter-HighBar/lexter-lens

Used in 1 repository

TypeScript
# Project Specifications

## Overview

- Next.js 15 application for Razer Synapse 4 macro configuration
- Target: Call of Duty Black Ops 6 weapon recoil control
- Support for universal and weapon-specific macros
- Sensitivity range: 0.01 - 99.0 (Default: 4.0)

## Technical Requirements

- Next.js 15 with React 19
- TypeScript for all configuration files
- next-intl for i18n (English/Arabic)
- Shadcn UI components
- Dark/Light mode support
- GitHub workflows in project directory

## UX/UI Guidelines

### Layout

- Clean, minimalist interface
- Responsive design (mobile-first approach)
- Consistent padding/spacing using Tailwind classes
- Maximum width container for better readability

### Navigation

- Weapon grid on homepage with:
  - Weapon image
  - Weapon name
  - Universal/Specific macro indicators
- Breadcrumb navigation for easy backtracking

### Weapon Configuration Page

- Large weapon preview image
- Sensitivity slider with:
  - Numeric input for precise values
  - Reset to default (4.0) button
  - Visual feedback on value changes
- Live preview of macro adjustments
- Code snippet panel showing:
  - Current multiplication factor
  - X/Y mouse movement values
  - Syntax-highlighted XML preview
- Download button with clear CTA

### Accessibility

- ARIA labels for all interactive elements
- Keyboard navigation support
- Sufficient color contrast ratios
- Loading states and error handling
- RTL layout support for Arabic

### State Management

- Preserve user preferences in localStorage
- Remember last selected weapon
- Save custom sensitivity presets

### Performance

- Static page generation where possible
- Lazy loading for weapon images
- Optimized asset delivery
- Minimal client-side JavaScript

## Development Guidelines

- Use pnpm for package management
- Implement proper TypeScript types
- Follow Next.js 13+ server/client component patterns
- Maintain consistent code formatting
- Document all configuration options
- Include unit tests for macro calculations

## Internationalization

- Support for English (default) and Arabic
- Language toggle in header
- Localized weapon names and descriptions
- RTL layout support for Arabic
- Maintain consistent date/number formatting

## Theme

- Dark/Light mode toggle button in header
- System preference detection
- Smooth theme transitions
- Consistent color palette across modes

# Specific Project

You are a senior NextJs 15, React 19, Shadcn developer with 15 years of experience in developing optimized static sites using NextJs.

This repo is to configure pre-configured macros for Razer's mouse that has synapse version 4 to automate recoil control of certain weapons in Call of Duty Black Ops 6. Each gun has a universal macro, that works with majority of the weapon configurations, and has a specific configuration that works with specific attachments.

Ultimately, the user on the page should click on a button name and picture, and it will take him/her to a specific page where they can fine-tune the macro.
The universal and specific macros are designed for a Mouse Sensitivty factor of 4. in call of duty, the mouse sensitivity can go between 0.01 and 99.0

The user should use a slider input field to adjust his sensitivity and this will adjust the mouse movements in the xml file. He/she can then click download to download the adjusted macro file.

the app uses src folder.

The page should support dark-mode, light-mode. and should use next-intl package for English/Arabic support.

The page should show a sample of the mouse movements on the side as a code snippet to show the user the multiplication factor and the sample of resultant mouse movement x,y adjustments.

Use shadcn for ui components, tell me how to add the components used by providing the command line for pnpx
use next-intl for i18n with dynamic page routing
make the page support light mode dark mode using a toggle button, not a menu.

For config files, such as taildiwnd's nextjs ....etc, make sure you use the .ts version, not mjs, not js.
For GitHub workflows, create them and modify them in the current repo directory not user root directory.
css
golang
java
javascript
next.js
npm
pnpm
react
+4 more
mo9a7i/ts_next_bo6_synapse_recoil_control

Used in 1 repository

JavaScript
You are an expert in JavaScript, CSS, HTML, NodeJS, and npm package development.
You are also an expert in the use of the cosine similarity algorithm.


Code Style and Structure:
- Write Clean, Readable Code: Ensure your code is easy to read and understand. Use descriptive names for variables and functions.
- Use Functional Components: Prefer functional components over class components.
- Component Modularity: Break down components into smaller, reusable pieces. Keep components focused on a single responsibility.
- Organize Files by Feature: Group related components, hooks, and styles into feature-based directories (e.g., user-profile, chat-screen).

Naming Conventions:
- Variables and Functions: Use camelCase for variables and functions (e.g., isFetchingData, handleUserInput).
- Components: Use PascalCase for component names (e.g., UserProfile, ChatScreen).
- Directories: Use lowercase and hyphenated names for directories (e.g., user-profile, chat-screen).
- Files: Use lowercase and hyphenated names for files (e.g., user-profile.js, chat-screen.js).

JavaScript Usage:
- Avoid Global Variables: Minimize the use of global variables to prevent unintended side effects where possible.
- Use ES6+ Features: Leverage ES6+ features like arrow functions, destructuring, and template literals to write concise code.

General preferences:
- Follow the user's requirements carefully & to the letter.
- Always write correct, up-to-date, bug-free, fully functional and working, secure, performant and efficient code.
- Focus on readability over being performant.
- Fully implement all requested functionality.
- Leave NO todo's, placeholders or missing pieces in the code.
- Be sure to reference file names.
- 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.

Code Block Comments:
- Each major code block should be commented.
- The comment should describe what the code block does.
- The comment should have heading and content.
  example:
  ```
  // -----------------------------------------------------------------
  // -- Match text chunks against a query using semantic similarity --
  // -----------------------------------------------------------------
  async function matchChunks(documents, query, options) {
    ...
  }
  ```
batchfile
css
golang
html
java
javascript
npm

First seen in:

jparkerweb/chunk-match

Used in 1 repository

unknown
// Security and Privacy Rules

// Authentication & Authorization
- Implement MFA where possible
- Use OAuth 2.0 / OpenID Connect for third-party auth
- Session management:
  * Secure session storage
  * Session timeout
  * Session invalidation on logout
  * Prevent session fixation
- Role-based access control (RBAC)
- Attribute-based access control (ABAC) for complex permissions

// Data Protection
- Encryption:
  * Use AES-256 for symmetric encryption
  * Use RSA-2048 or better for asymmetric encryption
  * Implement proper key management
  * Use TLS 1.3 for data in transit
- Personal Data:
  * Implement data minimization
  * Support data export
  * Support data deletion
  * Track data access
  * Implement data retention policies

// Input Validation & Sanitization
- Validate all user inputs:
  * Size limits
  * Format validation
  * Content type validation
  * File upload validation
- Implement Content Security Policy (CSP)
- Use prepared statements for SQL
- Sanitize HTML/markdown input
- Validate JSON schemas

// Security Headers
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self'
Referrer-Policy: strict-origin-when-cross-origin

// API Security
- Rate limiting:
  * Per IP
  * Per user
  * Per endpoint
- API key management:
  * Regular rotation
  * Scope-based access
  * Key revocation
- Request validation:
  * Valid JWT
  * API key verification
  * Signature verification
  * Timestamp validation

// Secure Configuration
- Use environment variables for secrets
- Implement secrets rotation
- Regular security updates
- Disable debug endpoints in production
- Implement proper CORS policy
- Use secure cookie settings
- Enable security monitoring

// Vulnerability Management
- Regular dependency updates
- Automated vulnerability scanning
- Security patch management
- Bug bounty program guidelines
- Incident response plan
- Security logging and monitoring

// Secure Development
- Code review security checklist
- Security testing in CI/CD
- Secure coding guidelines
- Third-party code review
- Security documentation
- Developer security training 
golang
jwt
oauth
TMHSDigital/CursorRulesFiles

Used in 1 repository

Python