AI AgentGoogle

Maximizing Development Efficiency with Documentation in Cursor

How can we effectively utilize documentation in Cursor to enhance development efficiency? Let’s take a look. Why is documentation important? Documentation provides the latest, accurate context that helps AI models compensate for outdated or incomplete training data, covering: current APIs and parameters, best practices, organizational standards, and domain terminology. Knowledge Cutoff of models indicates that LLM knowledge has time constraints and may not be aware of: the latest library updates, new frameworks or tools, API changes, and the newest best practices. When choosing tools, select the appropriate one based on needs: 1. Public frameworks/libraries: – Need official documentation? Use **@Docs** (API references, guides, best practices) – Need community knowledge or the latest optimizations? Use **@Web** (tutorials, comparisons, latest discussions) 2. Internal company information: – Have existing MCP integration (like Confluence, Google Drive)? Use it directly – No integration? Build custom MCP to access internal APIs and proprietary systems. Mental model for tools: – @Docs: Like browsing official documentation – @Web: Like searching for web solutions – MCP: Like accessing internal company documentation. For external documentation: 1. @Docs: Fetch official documentation, suitable for checking APIs, introductory guides, debugging. Example: `How to set up dynamic routing in Next.js?` 2. @Web: Search the web, suitable for finding the latest tutorials, comparisons, community discussions. Example: `Latest performance optimizations in React 19`. For internal documentation: Internal documents (like company APIs, coding standards) are not visible to the model and must be accessed through MCP: – Common integrations: Confluence, Google Drive, Notion, custom systems – Custom MCP: Capable of scraping internal websites, connecting to proprietary databases or knowledge bases – Example: Implement a MCP server with TypeScript code to scrape internal documents and convert to Markdown. Keeping documentation updated: Documentation can easily become outdated, and Cursor can generate/update documentation by: 1. Generating from code: – Create API documentation, JSDoc comments, README files – Example: `Generate API documentation for Express routes`. 2. Generating from conversation: – Convert problem-solving discussions and architectural talks into documents – Example: `Summarize authentication setup discussions into a team wiki guide`. Key points: – Documentation enhances the accuracy and timeliness of Cursor – Use @Docs (official), @Web (community), MCP (internal) for information – Generate documents from code and conversations to keep knowledge current – Combine external and internal documentation for a comprehensive understanding of issues.