Skip to content

एजेंटिक AI कोड टूल्स

AI कोडिंग असिस्टेंट सिर्फ ऑटोकम्प्लीट से आगे बढ़कर ऐसे ऑटोनॉमस एजेंट बन गए हैं जो प्लान बना सकते हैं, कई फाइलें एडिट कर सकते हैं, टेस्ट चला सकते हैं, और pull request बना सकते हैं। यह ट्यूटोरियल तीन प्रमुख टूल्स को कवर करता है: Claude Code, Cursor और GitHub Copilot।

1) किसी टूल को "एजेंटिक" क्या बनाता है?

पारंपरिक AI कोड कम्प्लीशन अगली कुछ लाइनें सुझाता है। एजेंटिक टूल्स इससे आगे जाते हैं:

क्षमताऑटोकम्प्लीटएजेंटिक
दायरामौजूदा लाइन/फंक्शनपूरा कोडबेस
प्लानिंगकोई नहींमल्टी-स्टेप रीज़निंग
एग्ज़ीक्यूशनसिर्फ सुझावफाइलें एडिट कर सकता है, कमांड चला सकता है
संदर्भमौजूदा फाइलपूरे repo की समझ
वर्कफ्लोरिएक्टिवऑटोनॉमस टास्क पूरा करना

एजेंटिक टूल्स आपके पूरे प्रोजेक्ट स्ट्रक्चर को समझ सकते हैं, कई फाइलों में बदलावों की प्लानिंग कर सकते हैं, उन बदलावों को लागू कर सकते हैं, टेस्ट चला सकते हैं, और टास्क पूरा होने तक दोहराते रह सकते हैं।

2) त्वरित तुलना: Claude Code बनाम Cursor बनाम Copilot

फीचरClaude CodeCursorGitHub Copilot
इंटरफेसCLI, web, IDE प्लगइनफुल IDE (VS Code fork)IDE एक्सटेंशन
कॉन्टेक्स्ट विंडोबड़ी (long-context Opus)पूरा repo इंडेक्सिंगछोटी, बेहतर हो रही है
मल्टी-फाइल एडिटमजबूतबेहतरीनबेहतर हो रही है
प्लान मोडहांहांहां (नया)
प्राइसिंगPro/Max टियरCredits + सब्सक्रिप्शनसब्सक्रिप्शन
किसके लिए सबसे अच्छाआर्किटेक्चर, बड़े रिफैक्टरइंटरैक्टिव डेवलपमेंटइनलाइन कोडिंग

3) Claude Code की बुनियादी बातें

Claude Code, Opus 4.8 (इसका मौजूदा डिफॉल्ट मॉडल) पर बड़ी कॉन्टेक्स्ट विंडो के साथ चलता है। इंस्टॉल और ऑथेंटिकेट करें:

bash
# Install Claude Code (native installer, recommended)
curl -fsSL https://claude.ai/install.sh | bash

# Or via npm (needs Node 18+)
npm install -g @anthropic-ai/claude-code

# Authenticate: run claude and follow the browser prompt
claude

# Start in your project
cd your-project
claude

बुनियादी कमांड

bash
# Ask about your codebase
claude "How is authentication implemented here?"

# Generate code
claude "Add a rate limiter middleware"

# Multi-file refactor
claude "Rename UserService to AuthService across the codebase"

# Create a PR
claude "Create a PR that adds input validation to all API endpoints"

प्रोजेक्ट कॉन्फ़िगरेशन

प्रोजेक्ट का संदर्भ अपने repo रूट पर एक CLAUDE.md फाइल में रखें। Claude Code इसे हर सेशन की शुरुआत में अपने आप पढ़ लेता है:

markdown
# Project notes

- Language: TypeScript, formatted with Prettier
- Tests: Vitest, in tests/
- Don't touch node_modules/ or dist/

मशीन-रीडेबल सेटिंग्स (tool permissions, env vars, hooks) .claude/settings.json में जाती हैं। उदाहरण के लिए, डिस्ट्रक्टिव टूल्स के चलने से पहले अप्रूवल जरूरी बनाने के लिए, वहां permissions कॉन्फ़िगर करें।

मेमोरी और संदर्भ

स्थायी प्रोजेक्ट संदर्भ CLAUDE.md फाइलों में रहता है, जिन्हें Claude Code हर सेशन की शुरुआत में लोड करता है, साथ ही एक ऑटो-मेमोरी स्टोर भी, जिसे Claude आपके सुधारों और पसंद के आधार पर खुद अपडेट करता है। इसे टिकाऊ संदर्भ देने के लिए, एक बार के "Remember:" प्रॉम्प्ट के बजाय CLAUDE.md को एडिट करें:

markdown
# CLAUDE.md
This is a monorepo. Shared code lives in packages/.

वर्किंग कॉन्टेक्स्ट को रीसेट करने के लिए सेशन के अंदर /clear कमांड इस्तेमाल करें।

4) Cursor IDE की एजेंटिक खूबियां

Cursor एजेंटिक वर्कफ्लो के इर्द-गिर्द बनाया गया है। प्रमुख फीचर:

एजेंट मोड

Agent मोड में Composer खोलने के लिए Cmd+Shift+I (Mac) या Ctrl+Shift+I (Windows/Linux) दबाएं:

Agent mode workflow:
1. Describe your task
2. Agent creates a plan
3. You approve or modify
4. Agent executes changes
5. Review and iterate

प्लान मोड

जटिल टास्क के लिए, साफ तौर पर Plan मोड इस्तेमाल करें:

@plan Add user authentication with:
- JWT tokens
- Refresh token rotation
- Password hashing with bcrypt
- Rate limiting on login attempts

एजेंट यह करेगा:

  1. आपके मौजूदा कोड पर रिसर्च करेगा
  2. एक विस्तृत इम्प्लीमेंटेशन प्लान बनाएगा
  3. आपके अप्रूवल का इंतज़ार करेगा
  4. कदम-दर-कदम एग्ज़ीक्यूट करेगा

कॉन्टेक्स्ट इंजेक्शन

खास संदर्भ जोड़ने के लिए @ इस्तेमाल करें:

@file src/api/auth.ts
@folder src/middleware
@docs https://jwt.io/introduction

Implement JWT verification middleware following these patterns

पैरलल एजेंट

अलग-अलग ब्रांच पर एक साथ कई एजेंट चलाएं:

# In Cursor:
1. Open Command Palette
2. "Cursor: New Agent in Worktree"
3. Each agent works in isolation
4. Compare results side-by-side

Cursor 3 ने एक Agents Window जोड़ी (इसे Cmd+Shift+P के बाद "Agents Window" से खोलें) जो लोकल चेकआउट, git worktrees और cloud एनवायरनमेंट में कई एजेंट पैरलल चलाती है। /worktree कमांड हर एजेंट को उसके अपने अलग git worktree में डाल देता है, और /best-of-n एक ही टास्क को कई मॉडलों पर चलाता है ताकि आप आउटपुट की आमने-सामने तुलना कर सकें।

एकरूपता के लिए नियम

.cursor/rules/project.mdc बनाएं:

markdown
# Project Rules

## Code Style
- Use TypeScript strict mode
- Prefer functional components
- Use named exports, not default

## Testing
- Every feature needs tests
- Use describe/it blocks
- Mock external services

## Security
- Never commit secrets
- Validate all user input
- Use parameterized queries

5) GitHub Copilot की एजेंटिक खूबियां

Copilot ऑटोकम्प्लीट से आगे बढ़ चुका है:

Copilot Chat

चैट पैनल खोलें और slash कमांड इस्तेमाल करें:

/explain - Explain selected code
/fix - Fix issues in selection
/tests - Generate tests
/doc - Add documentation

कोडिंग एजेंट (issue से pull request तक)

# On GitHub:
1. Open a GitHub issue
2. Assign it to "Copilot" as the assignee
3. The coding agent works in the background:
   analyzes the issue, edits files, runs tests
4. It opens a pull request for your review

यह Copilot के in-IDE agent मोड से अलग है, जो VS Code या JetBrains में आपके साथ-साथ सिंक्रोनस तरीके से काम करता है।

Copilot अब अपने ऑटोनॉमस काम को दो हिस्सों में बांटता है: agent मोड आपके IDE के अंदर (VS Code और JetBrains) सिंक्रोनस तरीके से चलता है, यह तय करता है कि कौन सी फाइलें एडिट करनी हैं, terminal कमांड चलाता है, और एरर पर दोहराता है; कोडिंग एजेंट cloud में एसिंक्रोनस तरीके से चलता है, एक असाइन किया गया issue लेता है और जब आप कुछ और काम कर रहे होते हैं तब एक pull request डिलीवर करता है।

संदर्भ के साथ इनलाइन सुझाव

Copilot आपके कोडबेस को पढ़ता है। कमेंट से इसकी मदद करें:

typescript
// Authentication middleware that:
// - Extracts JWT from Authorization header
// - Validates token signature
// - Attaches user to request
// - Returns 401 if invalid
export function authMiddleware(req, res, next) {
  // Copilot generates the implementation
}

6) सभी टूल्स के लिए बेहतरीन तरीके

साफ प्रॉम्प्ट लिखें

❌ Bad: "Fix the bug"

✅ Good: "Fix the null pointer exception in UserService.getById 
when the user doesn't exist. Return null instead of throwing."

❌ Bad: "Add tests"

✅ Good: "Add unit tests for the CartService covering:
- Adding items to empty cart
- Removing items
- Calculating totals with discounts
- Edge case: negative quantities"

जटिल टास्क के लिए प्लान मोड इस्तेमाल करें

For any task touching 3+ files, always:

1. Ask for a plan first
2. Review the plan
3. Approve or modify
4. Let the agent execute
5. Review changes before committing

आर्किटेक्चर का संदर्भ दें

Before major work, brief the agent:

"This is a microservices architecture:
- api-gateway: Routes requests
- auth-service: JWT, sessions
- user-service: User CRUD
- notification-service: Email, push

Services communicate via Redis pub/sub.
Database is PostgreSQL with Prisma ORM."

एजेंट्स के साथ टेस्ट-ड्रिवन डेवलपमेंट

1. Write failing test first:
   "Write a test for user registration that expects email validation"

2. Let agent see the failing test:
   "Implement registration to make this test pass"

3. Iterate until green:
   "Fix the remaining test failures"

7) सुरक्षा संबंधी बातें

एजेंटिक टूल्स के पास असली ताकत होती है। सीमाएं तय करें:

अप्रूवल गेट

json
// .claude/config.json
{
  "safety": {
    "requireApproval": [
      "rm",
      "git push",
      "npm publish",
      "database migrations",
      "env file changes"
    ]
  }
}

सैंडबॉक्सिंग

bash
# Run agents in isolated environments
docker run -v $(pwd):/workspace -it claude-sandbox

# Or use git worktrees for isolation
git worktree add ../feature-branch feature-branch

संवेदनशील फाइलें

# .cursorignore / .claudeignore
.env
.env.*
secrets/
credentials/
*.pem
*.key

सभी बदलावों की समीक्षा करें

bash
# Before accepting agent changes:
git diff --stat
git diff

# Use interactive staging
git add -p

# Never auto-merge without review

8) ऐसे वर्कफ्लो पैटर्न जो काम करते हैं

पैटर्न 1: एक्सप्लोर, प्लान, एग्ज़ीक्यूट

Session 1: "How does the payment system work?"
          → Agent explores, you learn

Session 2: "What would it take to add Stripe?"
          → Agent creates plan

Session 3: "Implement the Stripe integration"
          → Agent executes plan

पैटर्न 2: पैरलल एक्सप्लोरेशन

# In Cursor with parallel agents:

Agent 1: "Implement caching with Redis"
Agent 2: "Implement caching with Memcached"
Agent 3: "Implement caching with in-memory LRU"

→ Compare implementations, pick best approach

पैटर्न 3: इंक्रीमेंटल माइग्रेशन

Step 1: "Identify all uses of deprecated API"
Step 2: "Create adapter for new API"
Step 3: "Migrate module A to use adapter"
Step 4: "Migrate module B..."
...
Step N: "Remove adapter, use new API directly"

पैटर्न 4: टेस्ट-फर्स्ट फीचर डेवलपमेंट

1. "Write acceptance tests for user profile editing"
2. "Write unit tests for profile validation"
3. "Implement to pass the tests"
4. "Add integration tests"
5. "Refactor for clarity"

9) कब कौन सा टूल इस्तेमाल करें

स्थितिसुझाया गया टूल
रियल-टाइम कोडिंग, इनलाइन मददGitHub Copilot
बड़े रिफैक्टर, आर्किटेक्चरClaude Code
पूरा डेवलपमेंट सेशनCursor
कोड के बारे में त्वरित सवालकोई भी चैट इंटरफेस
issues से PR बनानाCopilot Workspace
जटिल मल्टी-फाइल बदलावCursor Agent
API डिज़ाइन, डॉक्युमेंटेशनClaude Code
नया कोडबेस सीखनाCursor या Claude Code

10) असरदारी मापना

एजेंटिक टूल्स को परखने के लिए इन मेट्रिक्स को ट्रैक करें:

javascript
const metrics = {
  // Productivity
  suggestionsAccepted: 'percentage of suggestions you kept',
  timeToFeature: 'hours from start to merged PR',
  linesPerHour: 'code velocity (use carefully)',
  
  // Quality
  bugsIntroduced: 'defects traced to AI-generated code',
  testCoverage: 'coverage of AI-generated code',
  reviewChanges: 'how much you modify AI suggestions',
  
  // Cost
  apiCosts: 'monthly spend on AI tools',
  creditsUsed: 'Cursor credits consumed',
  
  // Learning
  newPatternsLearned: 'techniques you picked up from AI',
  codebaseUnderstanding: 'how well AI helped you learn',
}

11) आम गलतियां

एजेंट पर हद से ज्यादा भरोसा

❌ Accepting large changes without review
❌ Letting agents run destructive commands
❌ Not understanding the code before shipping

✅ Review every change
✅ Understand what you ship
✅ Use agents as collaborators, not replacements

कॉन्टेक्स्ट प्रदूषण

❌ Huge prompts with irrelevant context
❌ Not clearing context between unrelated tasks
❌ Including generated files in context

✅ Keep prompts focused
✅ Use specific @file references
✅ Exclude build artifacts

प्रॉम्प्ट में अस्पष्टता

❌ "Make it better"
❌ "Fix the issues"
❌ "Add some tests"

✅ "Reduce time complexity from O(n²) to O(n log n)"
✅ "Handle the null case on line 45 by returning early"
✅ "Add tests for edge cases: empty input, max length, unicode"

12) शुरुआत करने की चेकलिस्ट

markdown
## Setup Checklist

### Claude Code
- [ ] Install CLI: `npm install -g @anthropic/claude-code`
- [ ] Authenticate: `claude login`
- [ ] Create `.claude/config.json`
- [ ] Add `.claudeignore` for sensitive files

### Cursor
- [ ] Download from cursor.com
- [ ] Import VS Code settings
- [ ] Configure `.cursor/rules/`
- [ ] Learn `Cmd+Shift+I` for Agent mode

### GitHub Copilot
- [ ] Install extension in your IDE
- [ ] Enable Copilot Chat
- [ ] Try Copilot Workspace for issues
- [ ] Configure `.github/copilot-instructions.md`

### All Tools
- [ ] Set up approval gates for destructive operations
- [ ] Create ignore files for secrets
- [ ] Establish review workflow
- [ ] Track metrics from day one

संबंधित