Skip to content

Last updated: 2026-07-21

Status:

Tags: AI Coding

Installation and set-up ​

https://www.cursor.com/features

  • Cursor is a code editor that serves as a fork of Visual Studio Code (VS Code), designed to enhance coding productivity by integrating artificial intelligence (AI) capabilities directly into the development environment. This relationship allows Cursor to maintain a familiar interface for users transitioning from VS Code while also offering unique features tailored for AI-assisted coding
    • Main Features
      • AI code completion
      • Chat panel
      • Code search
      • Function explanations
      • Refactoring help
    • Key Benefits
      • Faster coding
      • Less googling needed
      • Smart suggestions
      • Works like a coding partner
  • Set Up
    • Keybinds
      • Cmd + I : composer, Cmd + L: chat; Cmd + Shift + P: command pallettes
    • Settings
  • Git set-up

Core functions ​

Basic : Completion, Chat, Compose ​

  1. code completion
  2. Chat/Composer: cmd + L
    1. Select models
      1. Simple tasks: Cursor-small, 4o-mini (eg explanations)
      2. Coding task: Claude, GPT-4
        1. Creative tasks(Composer): Claude
        2. Code optimization: GPT-4
      3. Complex tasks: big models like O1
    2. Context
      1. Add context from terminal or editor
      2. Codebase: as code base as a context
      3. Folder: current folder
      4. Add image as context and chat
      5. @Operator
    3. Error fix: Cmd+Shift + D/I
  3. Inline Chat (Cmd + K)
    1. Default context is code below the cursor
    2. Auto generation of explations/comments
    3. Auto generate code/terminal code

Codebase ​

  1. @Codebase function
    1. Contextual Search: When you use @Codebase, Cursor performs a detailed search across your entire codebase, scanning for relevant files and code snippets that pertain to your query. This allows for a more comprehensive understanding of the context surrounding your code.
    2. Process Steps:
      1. Gathering: It scans through your codebase to identify important files and code chunks.
      2. Reranking: The gathered context items are then reordered based on their relevance to your specific query.
      3. Reasoning: Cursor analyzes the context to formulate a plan for using the relevant code.
      4. Generating: Finally, it generates a response or suggestion based on the analyzed context
    3. Usage in Queries: By typing @Codebase in your query, you can ask questions about your entire project, allowing Cursor to provide detailed information and relevant code snippets, which is particularly useful for understanding complex codebases or tracing execution flows
    4. Integration with Other Features: You can combine @Codebase with other commands, such as pressing Ctrl/⌘ + Enter, to enhance the accuracy and depth of the responses generated by Cursor Chat
  2. Index
    1. Settings: default open
    2. .cursorignore file
  3. Analyze and answer questions about the project
  4. Search function or file locations
  5. Improve base on current code

Rules for AI ​

  1. global rules: eg
    1. Variable and function names
  2. .cursorrules file
    1. Project specific: including requirements of the project

@ operator ​

  1. Not too many files at ones or hullucination resulted
  2. Folders
  3. Code
  4. Codebase
    1. Needs index build: .cursorignore file
    2. QA about the project/functions/how functions/libraries been used
  5. Docs
    1. online docs can be added as an index; (add them in settings -> features)
    2. Read api doc or tech doc to generate code
  6. Git
    1. read and understand GitHub code or specific version
  7. Notepad
    1. add prompts about the project to i
  8. Linterrors
  9. web:
    1. AI search function

Code Version Control ​

  1. Use Git
  2. Save all vs accept all
  3. "save all" are useful when "after generating multiple files, you partially reject and accept them based on verification results"
  4. Create a History log file then add it into the context
  5. Eg add following in cursorrules
Plain
After each conversation request ends, conduct a conversation summary. Whether generating new files or modifying existing ones, a summary is required. Append the summary content to the Readme file (indicating that the content in the file accumulates incrementally). The summary content should include:
- The main purpose of the conversation
- The main tasks completed
- Key decisions and solutions
- The technology stack used
- Which files were mod`ified

Agent mode (YOLO Mode) ​

  1. Agent mode
    • Can complete tasks by itself using the command line.
    • Can determine which files are needed as context by itself.
    • Know what should do in next step.
  2. Normal mode
    • Cannot use the command line.
    • Requires the user to specify the context.
    • Wait for your command for next step.
  3. Agent Setting
    • YOLO mode: allow cursor to run commands without confirmation
    • YOLO prompts/black/whitelist : prevent file deletions, git deletions, etc

Add Model ​

  • Add External Models with API Keys

3 Coding Styles ​

Comment-Oriented Programming ​

  • New Role of Comments
    • Act as AI prompts
    • Generate code automatically
    • Translate thoughts into code
    • Guide AI understanding
  • Basic Usage
    • Write descriptive comment
    • Press Tab, Get code suggestion
    • Refine if needed
  • Example Applications
    • Simple Functions
      • "Calculate minimum of two values"
      • AI generates min function
    • Complex Structures
      • Class descriptions
      • Method outlines
      • Boilerplate generation
      • Pipeline definitions
  • Benefits
    • Focus on high-level thinking
    • Less syntax writing
    • Quick prototyping
    • Easy refinement
  • Best Practices
    • Clear comment writing
    • Iterative refinement
    • Building AI communication skills
    • Using comments as design tools

Prompt-Oriented Programming ​

  • Prompt-Oriented Programming Concept
    • Direct chat interface
    • Conversational coding
    • Strategic level thinking
    • Context-aware responses
  • Common Use Cases
    • Code optimization
      • "Make this function more efficient"
      • "Convert to streaming solution"
    • Feature Integration
      • Cross-file modifications
      • New module addition
    • Code Review
      • Change summaries
      • Maintainability explanations
  • Benefits
    • Higher-level problem solving
    • Flexible code refinement
    • Quick iterations
    • Better understanding through dialogue
    • Focus on design over syntax

Object-Oriented Programming ​

  • Objective-Oriented Programming
    • Focus on "what" not "how"
    • Agent-based autonomy
    • Goal-driven development
    • Self-iterating solutions
  • Agent Capabilities
    • Autonomous code writing
    • Multi-file management
    • Command execution
    • Error handling
    • Self-correction
    • Package management
  • Workflow Example
    • User sets broad goal
      • "Generate data analysis report"
      • "Process CSV logs"
    • Agent Actions
      • Plans approach
      • Writes code
      • Handles dependencies
      • Tests solutions
      • Refines output
      • Documents process
  • Key Benefits
    • Reduced implementation focus
    • Automated problem-solving
    • Self-debugging capability
    • Strategic oversight
    • Time efficiency
  • Limitations
    • May struggle with vague goals
    • Complex error handling
    • Needs clear objectives
  • Role Evolution
    • User becomes project director
    • AI acts as capable intern
    • Focus shifts to outcome validation
    • Strategic planning emphasis

.Cursor Rules ​

  • Cursor Integration Evolution
    • Core development tool
    • All-in-one assistant
    • Persistent coding partner
    • Integrated workflow component
  • Configuration Methods
    • .cursorrules file implementation
      • Coding conventions
      • Style guidelines
      • Error handling patterns
      • Testing structures
    • Custom prompt libraries
    • Project-specific settings
  • Advanced Integration Options
    • Local LLM connections
    • Security compliance
    • Codebase indexing
    • Internal tool linking
  • Behavioral Training
    • Pattern recognition
    • Preference learning
    • Consistent style application
    • Adaptive responses
  • Long-term Benefits
    • Reduced friction
    • Consistent code quality
    • Automated standard enforcement
    • Improved workflow efficiency
    • Decreased mental overhead
  • Strategic Implementation
    • Progressive integration
    • Continuous refinement
    • Ecosystem development
    • Vision alignment

Expanding Cursor's Capabilities with External Tools ​

Example: https://github.com/grapeot/devin.cursorrules

  • External Tool Integration
    • Beyond code generation
    • Extended problem-solving capabilities
    • Real-world workflow alignment
    • Versatile task handling
  • Key Benefits
    • Access to remote resources
    • API interactions
    • Documentation scraping
    • External data analysis
    • Automated workflows
  • Implementation Methods
    • .cursorrules configuration
      • Custom command definitions
      • Workflow instructions
      • Tool integration specs
    • Reference implementations
      • Online search capability
      • Web browsing integration
      • Task automation tools
  • Tool Integration Examples
    • Python scraping scripts
    • CLI performance tools
    • Database query interfaces
    • API interaction utilities
    • Documentation fetchers
  • Security Considerations
    • Command execution safety
    • Configuration management
      • Secret storage
      • Access restrictions
    • Operation guidelines
    • Safety guardrails
  • Enhanced Capabilities
    • Information gathering
    • Hypothesis testing
    • External resource access
    • Automated testing
    • Data processing
  • Strategic Benefits
    • Reduced manual effort
    • Streamlined workflows
    • Expanded AI capabilities
    • Focus on high-level strategy
    • Integrated development environment

Using Cursor as a General AI Entry Point ​

  • Cursor as Universal AI Gateway
    • Evolution from code assistant to AI hub
    • Unified environment for AI interactions
    • Centralized command center
    • Cross-functional capabilities
  • Expanded Functionalities
    • Web data retrieval
    • Document analysis
    • Research synthesis
    • Knowledge management
    • Multi-purpose querying
      • API research
      • Architecture comparison
      • Documentation access
      • Research paper summaries
  • Workflow Integration Benefits
    • Reduced context switching
    • Seamless task transitions
    • Unified workspace
    • Streamlined information flow
  • Knowledge Ecosystem Development
    • Local knowledge repositories
    • Best practices documentation
    • Query logs
    • Research summaries
    • Continuous learning capability
  • Cross-Team Applications
    • Technical writers
    • Product managers
    • UX designers
    • Analysts
    • Support teams
  • Implementation Areas
    • Knowledge base connections
    • Support ticket integration
    • User feedback analysis
    • Document management
    • Team collaboration
  • Future Potential
    • AI-integrated development
    • Context-aware processing
    • Dynamic problem-solving
    • Versatile task handling
    • Ecosystem expansion

Reference ​

Built as an open learning notebook