Cursor Deep Dive: Senior Engineers असल में 10x Productivity के लिए Cursor कैसे use करते हैं
Guest: ByteMonk, Software engineer और YouTube educator; पहले PayPal और Capital One में banking codebases पर काम कर चुके हैं | Show: ByteMonk
PayPal और Capital One में काम कर चुके एक engineer, एक आधे-अधूरे FastAPI और Next.js task API को लगभग 30% से 80% तक बनाते हुए दिखाते हैं कि वो Cursor को end to end कैसे use करते हैं। यह summary topic के हिसाब से organized और to-the-point है: mental model, interaction के तीन levels, सही context देना, plan-then-agent workflow और उसकी safety habits, rules और slash commands, parallel और background agents, Bugbot, Context7 और दूसरे MCP servers, और review करना अब भी क्यों ज़रूरी है।
- Cursor
- AI coding
- Command K
- Context engineering
- Plan mode
- Agent mode
- Cursor rules
- Slash commands
- Parallel agents
- Background agents
- Bugbot
- MCP
- 3 levels
- Flow में Tab, एक file के लिए Command K, reasoning और multi-file changes के लिए chat
- पहले commit
- Agent चलाने से पहले हमेशा commit करें, ताकि साफ़ revert point रहे
- ~1 घंटा
- Parallel agents के साथ तीन independent tasks की sequential दोपहर
- ~30 minute
- Rules, commands और memories set up करने में, जिसका फ़ायदा हर interaction में मिलता है
ByteMonk एक आधे-अधूरे task management API (FastAPI और Next.js, "a lightweight Jira backend") को लगभग 30% से 80% तक बनाते हुए दिखाते हैं कि experienced engineers Cursor को end to end कैसे use करते हैं:
- Mental model: AI एक brilliant new hire है जो हर framework जानता है लेकिन आपके codebase के बारे में कुछ नहीं। आपका काम उसे जल्दी context देना है।
- Interaction के तीन levels: flow में हों तो Tab, एक file में targeted change के लिए Command K, reasoning और multi-file काम के लिए chat।
- @ से context: सिर्फ़ relevant files, docs, git history या terminal output दें। Relevance, volume से बेहतर है। One task, one chat।
- हर non-trivial काम के लिए पहले plan mode, फिर agent mode। पहले commit करें, Keep All से पहले test करें, और किसी दूसरे model से review करवाएँ।
- Rules, commands और memories agent को आपकी team के standards और reusable workflows देते हैं, ताकि बार-बार एक ही बात न दोहरानी पड़े।
- Advanced: independent tasks के लिए parallel agents, well-defined tickets के लिए background agents, हर PR पर Bugbot, पहले MCP server के रूप में Context7, और hooks।
- Cursor एक code editor है जो VS Code पर बना है: वही shortcuts, extensions और interface। Switch करने में लगभग 5 minute लगते हैं। VS Code से आ रहे हैं तो agentic view की जगह editor view चुनें और तुरंत productive हो जाएँ।
- बुनियादी फ़र्क: normal editor सिर्फ़ खुली हुई file देखता है। Cursor आपका पूरा codebase देखता है: हर function, class और files के बीच का हर relationship।
Setup: models और voice
Auto
Free plan पर। हर task के लिए model ख़ुद चुनता है, और video की हर चीज़ के लिए काफ़ी है। किसी भी plan पर quick edits के लिए ठीक।Sonnet
Pro ($20 महीना) पर। ज़्यादातर tasks के लिए use करें: fast और accurate।Opus
Complex काम के लिए, जैसे architecture design करना या कोई subtle multi-file issue debug करना।लंबे prompts के लिए type करने की जगह बोलें: Cursor में built-in voice mode है, और free tool Wispr Flow भी अच्छा काम करता है।
- Tab, Cursor का autocomplete है, लेकिन यह अगले कुछ characters नहीं बल्कि आपका अगला edit predict करता है, अक्सर कई lines के पूरे blocks, आसपास के code और आपके intent के आधार पर।
- यह हमेशा on रहता है। Suggestion ग़लत हो तो Escape दबाएँ या type करते रहें, यह adjust हो जाता है।
शायद रोज़ सबसे ज़्यादा यही use होगा। Pattern है highlight, instruct, review।
- Project में notification service में कोई error handling नहीं थी। वो block highlight करते हैं, Command K दबाते हैं, "add error handling to every function" type करते हैं और एक diff मिलता है: जोड़ी गई चीज़ें हरी, हटाई गई लाल। Accept। लगभग 10 seconds, file छोड़े बिना।
- किसी भी targeted काम के लिए: async में convert करना, type annotations जोड़ना, strategy pattern में refactor करना। बाकी कुछ नहीं बदलता।
- यह terminal में भी काम करता है। सादी English में बताएँ ("show me the last five commit messages", "run all unit tests and log the failures") और यह shell command लिख देता है।
Chat (Command L) reasoning, multi-file changes और आपका code कैसे काम करता है इसके सवालों के लिए है। General chatbot के उलट इसे आपके codebase की जानकारी है, लेकिन यह अपने आप नहीं जानता कि कौन-सा हिस्सा relevant है। इसी के लिए @ है, और इसमें अच्छा होना ही great और inconsistent results के बीच का फ़र्क है।
- @ से ला सकते हैं specific files और folders, official documentation, git history, terminal output और live web content।
- Example: notification चुपचाप fail हो रहा था। नई chat, error output के लिए @terminal, file के लिए @notification-service, problem describe की। उसने तुरंत issue पकड़ लिया, windows के बीच कोई copy-paste नहीं।
Chat की तीन habits
- One task, one chat। Tokens बचाना ऊपरी वजह है। असली वजह: पिछले task का पुराना context agent को ग़लत problem के आधार पर assumptions करवाता है। वो इसे Cursor में ख़राब output की number one वजह बताते हैं।
- Debugging: एक ही message में @terminal और screenshot दें। Model को technical signal और visual context एक साथ मिलते हैं, जिससे back-and-forth कम होता है।
- Pattern दोहराना: "Look at what we did in commit abc123 and implement the same error handling pattern in email-service." Cursor diff पढ़कर उसे बिल्कुल वैसे ही दोहराता है।
| Tool | कब use करें |
|---|---|
| Tab | आप flow में हैं और चाहते हैं कि AI साथ चले |
| Command K | आपको ठीक पता है कि एक जगह क्या बदलना है |
| Chat | Reasoning चाहिए, या कई files में changes |
ज़्यादातर developers सीधे agent mode पर जाते हैं, बताते हैं क्या चाहिए और उसे चलने देते हैं, फिर एक correction loop में फँस जाते हैं: ठीक-ठाक पर पूरी तरह सही नहीं, correct करो, वो भटकता है, फिर correct करो। इसका इलाज plan mode है।
- Example: task labels feature (urgent, blocked, in review) जिसमें front-end changes, back-end changes और database migration चाहिए। ठीक इसी तरह के task में अकेला agent mode ऐसा कुछ बनाता है जो चलता तो है लेकिन codebase में fit नहीं होता।
- Plan mode में Cursor कोई code नहीं लिखता। यह architecture overview, schema changes और हर step की checklist बनाता है। आप उसे edit कर सकते हैं, to-do जोड़ सकते हैं या scope से बाहर की चीज़ हटा सकते हैं। Plan आपका है।
- Build दबाते ही Cursor agent mode में चला जाता है और checklist पर काम करता है: migration, model, API endpoints, front end, हर item tick करते हुए।
- अगर आपके पास पहले से requirements doc या PR है, तो शुरुआत में उसे @file से लाएँ और plan उसी से बनेगा, clarifying questions skip हो जाएँगे।
एक built-in quality gate भी है: code एक model ने लिखा, तो accept करने से पहले किसी दूसरे model से changes review करवाएँ। पहले से जो छूटा वो पकड़ लेता है।
Agent को sessions के बीच कुछ याद नहीं रहता। हर नई chat एक blank slate है: उसे नहीं पता कि आपकी team हर जगह async database calls use करती है, आपकी folder conventions क्या हैं, या कि एक legacy auth module को कभी सीधे नहीं छूना है। Rule एक persistent instruction है जो agent आपके project में हर interaction से पहले पढ़ता है, जैसे पहले दिन किसी नए engineer को दी जाने वाली talk।
- शुरू से न लिखें। Chat में /generate type करें और Cursor आपका codebase scan करता है (patterns, imported libraries, file structure) और लगभग 30 seconds में matching rules file बना देता है। Review करें, adjust करें, हो गया।
- cursor.directory पर specific stacks (Next.js, TypeScript, Python, React, UI और UX) के लिए battle-tested rule sets हैं। अपना stack ढूँढें, लाएँ और adjust करें।
- Glob patterns से rules scope करें ताकि back-end rules सिर्फ़ back-end files पर और front-end rules front end पर लगें। Irrelevant rules noise बढ़ाते हैं, और noise output quality घटाता है।
Project rules
आपकी git repo में रहते हैं और pull करने वाले हर developer पर लागू होते हैं। Team conventions के लिए इन्हें use करें।User rules
Personal preferences जो आपकी machine पर रहती हैं और कभी commit नहीं होतीं।Command एक reusable instruction है जो markdown file के रूप में save होती है और slash से चलती है। यहीं individual productivity, team productivity बन जाती है।
- Example: task, notification और email services में structured logging। तीन बार detailed prompt लिखने की जगह वो .cursor/commands/add-logging.md बनाते हैं: logging library import करो, logger बनाओ, हर function की शुरुआत में context के साथ log करो, हर exception block में errors log करो, साथ में एक reference snippet।
- फिर: नई chat, /add-logging, file reference करें, enter। तीनों services में हर बार एक जैसा structure।
- Commands folder आपकी repo में .cursor के अंदर रहता है। इसे commit करें, और pull करने वाले हर developer को, पहले दिन वाले new hire को भी, आपकी team के सारे workflows मिल जाते हैं।
Memories agent को sessions के पार persistent context देकर इसे पूरा करती हैं। हर project की शुरुआत में rules, commands और memories set up करें: पहली बार लगभग 30 minute, और उसके बाद हर agent interaction में इसका फ़ायदा मिलता है।
Cursor एक साथ कई agents चला सकता है, हर एक अलग task पर अपने isolated workspace में। अंदर से यह git worktrees use करता है: हर agent को अपनी branch मिलती है और वो दूसरों में दख़ल नहीं दे सकता।
- Example: task list API के लिए pagination, notification service के लिए unit tests, और task counter bug। आम तौर पर एक sequential दोपहर; तीन agents एक साथ और आख़िर में review के साथ, लगभग एक घंटा।
- अच्छे candidates: एक नया feature, एक bug fix और एक test suite। ये codebase के अलग-अलग हिस्से छूते हैं और इन्हें coordinate करने की ज़रूरत नहीं।
- Background agents आपकी machine पर नहीं, cloud में चलते हैं। Cursor एक isolated environment बनाता है, आपकी repo clone करता है, अलग branch पर काम करता है और screenshots, logs और recording के साथ merge-ready pull request बनाता है।
- एक चला दें और laptop बंद कर दें; लौटने पर PR इंतज़ार कर रहा होगा। इन्हें Slack, GitHub और Linear से भी शुरू कर सकते हैं, जैसे कोई Linear ticket assign करके।
- Keyword है well-defined। Vague instruction से vague PR मिलता है जिसका review बचाए गए समय से ज़्यादा लेता है। इसे proper ticket की तरह लिखें: साफ़ scope, साफ़ acceptance criteria।
Sponsor segment: Origin
Video का sponsor Origin को उन teams के लिए pitch करता है जो code बाहर के cloud पर नहीं भेज सकतीं: cloud-agent workflow जिसमें हर worktree एक hardware-isolated, encrypted sandbox में चलता है, one-click report जो साबित करती है कि code कहाँ चला, कुछ भी retain या training में use नहीं होता, और बाद में environment हटा दिया जाता है। एक पूरी तरह local mode भी है। यह ad है, तो उसी हिसाब से तौलें।- Bugbot आपकी GitHub repo से जुड़कर हर pull request अपने आप review करता है, और human reviewer की तरह संभावित bugs पर comments छोड़ता है।
- हर issue के साथ Fix in Cursor link आता है जो Cursor को problem की तरफ़ point करते pre-filled prompt के साथ खोलता है। Fix करें और push करें।
- Scale पर हर PR को तुरंत पहला pass मिलता है, इसलिए human reviewers missing null checks और unhandled exceptions की जगह architecture और logic पर समय लगाते हैं।
MCP (Model Context Protocol) एक plug-in system है जिससे agent external tools (GitHub, Notion, Figma, Stripe, Playwright, databases) के साथ सीधे काम कर पाता है, बिना आपके context switch किए। वो 1,800 से ज़्यादा MCP servers बताते हैं।
पहले Context7 install करें
- Models framework code अपने training data से लिखते हैं, जिसकी एक cutoff date होती है। अगर FastAPI या Next.js का छह महीने पहले बड़ा update आया, तो ऐसा code मिल सकता है जो compile होता है और चलता है लेकिन deprecated patterns use करता है, और पता तब चलता है जब production टूटता है।
- Context7 major frameworks की up-to-date documentation देता है, रोज़ update होती है। इसे जोड़ें (one-click setup), फिर एक rule जोड़ें: API documentation के लिए हमेशा Context7 use करो। Agent framework-specific code लिखने से पहले current docs लाता है।
- उसके बाद MCP servers धीरे-धीरे जोड़ें, रोज़ use होने वाले tools से शुरू करके: PRs के लिए GitHub, specs वहाँ हों तो Notion, end-to-end tests के लिए Playwright। हर एक एक context switch हटाता है।
Hooks
Hook agent loop के specific points पर आपकी अपनी scripts चलाता है: हर file edit के बाद, command चलने से पहले और commit के बाद।
- आख़िर तक project लगभग 80% पर है: auth, error handling, task labels, एक जैसी logging, pagination, tests, counter bug fixed, हर PR पर Bugbot और Context7 से current docs।
- Loop: intent, context, constraints, validate, repeat। Agent execute करता है; आप guide और review करते हैं।
- यह skill models बेहतर होने के साथ और ज़्यादा valuable होती है, कम नहीं।
पूरे video में use हुआ project skeleton video description में linked है, ताकि आप उसे Cursor में खोलकर हर tip की practice कर सकें।
Comments