Lesson 6 — Beginner

AI-Assisted Software Development

Coding agent ab sirf autocomplete nahi — wo repository padh sakta hai, files edit kar sakta hai, commands chalata hai aur output dekh kar khud iterate karta hai. Is bade lesson mein progression (autocomplete se agent tak), assisted engineering vs vibe coding, verification loop, minimum context, CLAUDE.md, spec-driven planning, Skills, subagents, MCP, hooks, plugins aur transferable skills — sab cover honge.

⏱ 50 min• Beginner• Git & Collaboration

AI-assisted development kya hai

WHAT

Coding agent ek AI system hai jo repo padhta hai, files edit karta hai, commands chalata hai aur result dekh kar iterate karta hai. Tum task dete ho — wo observe-act-verify loop chalata hai; direction, scope aur review tumhare paas rehte hain.

WHEN

Exploration (naya repo samajhna), implementation (targeted changes), debugging, refactoring, tests likhna — har wahan jahan context aur judgement chahiye aur kaam ek jaisa repeat hota hai.

WHERE

Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI — sab isi pattern ke hain. Tumhara editor, terminal aur CI inhi se bhare pade hain.

Sabse zaroori mental model: AI-assisted proficiency software engineering ko replace nahi karti, multiply karti hai. Jo developer ko testing, diff review aur design aata hai wo tez hota hai; jo fundamentals khali hain wo tez garbage bhi bana leta hai. Isi liye ye lesson L0 ke end mein hai — fundamentals abhi fresh hain.

Yaad rakho: Agent probabilistic hai — guarantee nahi deta. Isliye har meaningful change ke aas-paas planning aur verification ka frame hona chahiye. Frame missing ho toh jo speed hai wo sirf bug ki hai.

Autocomplete se assistants tak, aur agents tak

AUTOCOMPLETE : next tokens suggest karta hai — tum likhte ho, wo aage guess karta hai
CHAT ASSISTANT: sawaal ka jawab deta hai — code tum copy karke khud lagate ho
CODING AGENT  : repo padhta hai -> files edit karta hai -> command chalata hai ->
                output dekh kar khud iterate karta hai

Agent ka loop ek hi hai, baar baar:   OBSERVE -> ACT -> VERIFY

Kab kaunsa:
  syntax / boilerplate -> autocomplete (tumhare flow mein hi tez)
  doubt / concept      -> chat assistant (samjho, phir khud likho)
  multi-file task      -> agent (plan + diff + tests ke saath)
Rule: Jitna bada change, utna verification. 10-line diff padhna aasaan hai; 400-line diff ko bina padhe "LGTM" bol dena — wahi vibe coding ki shuruaat hai.

AI-assisted engineering vs vibe coding

AI-assisted engineering matlab: tum direct karte ho aur verify karte ho — scope, plan, acceptance criteria tumhare paas hain, agent haath hai. Vibe coding matlab: jo generate hua wahi accept, aur testing/review/understanding sab chhod diye. Dono ka output shuru mein same dikhta hai — farq tab dikhta hai jab production mein kuch tootta hai.

Honest check: Poochho: "ye kaise kaam karta hai?" — bina agent ke bata sakte ho? Agar nahi toh tumne code nahi likha, sirf sign kiya hai. Ye ek line tumhe har accepting decision pe yaad aani chahiye.

Verification loop — har change ka frame

1. CONTEXT   : task ka scope batao — kaunsi files, kya badalna hai, kaise check hoga
2. GENERATE  : agent pehle plan de, phir code likhe
3. DIFF      : git diff padho — har hunk ka sawaal: ye kyun badla?
4. TEST      : uv run pytest (ruff/mypy bhi) — automated check chalao
5. DEBUG     : fail ho toh exact failure agent ko do, guess mat karo
6. REVIEW    : overall design — naming, duplication, error handling, scope
7. ACCEPT    : sirf tab jab diff saaf ho aur tests green ho

Batch rule: 5 minute se lamba diff kabhi nahi — chhota karo, alag commit karo.
Missing step = missing ownership: Context, diff, test, review — jo step chhoot gaya, verification adhoora raha. Agent ki koi guarantee nahi hoti; guarantee tumhara process deta hai. Loop chhota rakho — 5 minute ka, har change par.

Minimum useful context

# GALAT — poora repo phenk diya
"Ye mera poora repo hai, kuch bhi theek kar do"

# SAHI — minimum useful context
Task    : GET /orders ke response mein pagination add karni hai
Files   : app/routes/orders.py, app/schemas/order.py (inhi tak rehna)
Contract: ?page= aur ?page_size= (default 20, max 100); response mein "next" field
Check   : uv run pytest tests/test_orders.py pass rehna + naye cases add karo
Scope   : auth aur frontend OUT OF SCOPE
Rule of thumb: Context ka har line ya toh decision deta hai ya constraint. Dono nahi toh hata do. Poora repo daalne se task clear nahi hota — sirf noise badhta hai.

CLAUDE.md — project ki memory

# CLAUDE.md (repo ke root mein — har session mein agent ise padhta hai)

## Project: order-service

## Commands
- Install: uv sync
- Test: uv run pytest -q
- Lint + types: uv run ruff check . && uv run mypy app
- Run: uv run uvicorn app.main:app --reload

## Conventions
- Python 3.12, har public function par type hints mandatory
- Errors: HTTPException raise karo, print se error mat dikhao
- Routes app/routes/*.py mein, schemas app/schemas/*.py mein

## Do NOT
- .env aur secrets kabhi commit mat karo
- dependency bina uv add ke mat jodo

CLAUDE.md (ya kisi bhi agent ka project instruction file) = project ki long-term memory. Yahan architecture, conventions, commands aur test instructions likhte hain — ye har session mein same rehte hain. Temporary task context (aaj ka bug, aaj ki files) uske saath alag prompt mein hai.

Separation rule: Project memory = permanent (conventions, commands). Task context = aaj ka kaam. Dono mila diye toh agent ko har baar pura purana lecture padhna padta hai aur stale cheezein bhi chali aati hain. File chhota aur updated rakho — memory bhi bhaari ho sakti hai.

Spec-driven development aur planning

# Spec: order pagination (docs/specs/ mein commit hoti hai)

## Requirement
GET /orders abhi sab records ek saath deta hai. Pagination chahiye.

## API contract
- Query: page (default 1), page_size (default 20, max 100)
- Response: {"items": [...], "page": 1, "total": 42, "next": 2}

## Acceptance
- [ ] page_size 100 se zyada par 422
- [ ] tests: happy path, boundary, bad input
- [ ] /docs mein updated

## Out of scope
- cursor-based pagination
- frontend changes
Judgement: 30-minute ke chhote task pe pura spec formality lagta hai — usme ek line ka task note kaafi. Multi-file ya shared code wale kaam pe spec hamesha sasta hai, kyunki galati ka scope wahan sabse bada hota hai.

Slash commands aur Skills

---
name: api-review
description: FastAPI endpoint ka review checklist — validation, status codes, errors, tests
---

# API Review checklist
1. Har route par Pydantic input model hai? (raw dict = validation nahi)
2. Status codes sahi hain? (201 create, 4xx client, 5xx log)
3. Error body ka ek hi shape hai har jagah?
4. External call par timeout aur error handling hai?
5. tests mein kam se kam ek negative case hai?
Escalation rule: Pehle seedha prompt se karo. Teen baar same prompt likha toh command banao. Teen baar command bhi pada toh skill. Din one pe skill banane ki zarurat nahi — pattern pehle dikhta hai, automation uske baad.

Subagents aur MCP — delegation aur external systems

# Delegation — kaam ke hisaab se alag context
reviewer   : diff padho — correctness + conventions (code nahi likhta)
tester     : failing test banao, pytest chalao, result lao
debugger   : stack trace + logs se root cause aur fix plan
researcher : docs/API explore karo, summary wapas — repo touch nahi

Har subagent ka apna context — bada task bina sab kuch ek window mein ghuse.
{
  "mcpServers": {
    "orders-db": {
      "command": "npx",
      "args": ["-y", "mcp-server-postgres"],
      "env": { "DATABASE_URL": "postgres://readonly:pass@db:5432/orders" }
    }
  }
}
# MCP (Model Context Protocol) — agent ke tools ka standard plugin format
Caution: MCP ka matlab hai agent ke tools ka standard interface — aane wale saalon mein naye agents isi format ko use karenge. Tool badal sakta hai, yahi interface abhi se durable hai.

Hooks, plugins aur transferable skills

{
  "hooks": {
    "PostToolUse": [
      { "matcher": "Edit|Write",
        "hooks": [{ "type": "command", "command": "uv run ruff format . && uv run ruff check --fix ." }] }
    ],
    "Stop": [
      { "hooks": [{ "type": "command", "command": "uv run pytest -q" }] }
    ]
  }
}
# Edit ke baad lint, stop par test — model ko yaad dilane ki zarurat nahi
Interview line: AI-assisted proficiency fundamentals ko replace nahi, multiply karti hai. Jo developer ko testing, diff review aur design aata hai wo agent se 10x tez hota hai; jo nahi jaanta wo 10x tez garbage bana leta hai.

Exercise

Question: Agent ke code change ke baad review ka sabse pehla actual kaam kya hai? (git ___)

Question: Project ke commands/conventions ko agent ke liye permanent file mein rakhne ka standard naam (Claude Code)?

Question: MCP ka full form? (teen shabd)

Question: Formatting/linting/tests ko model par chhodne ke bajaye deterministic banane wala feature?

Question: Poora repo dene ke bajaye agent ko kitna context dena chahiye? (do shabd)

Common mistakes

Desi example: Mistri aur ghar — agent ka desi analogy

Ghar banwane mein mistri aata hai, lekin naksha (spec), kaam ka order (plan) aur har stage ki checking (verification) ghar malik ke paas rehti hai. Bina nakshe ke mistri ko chhod do toh deewar toh ban jaayegi — par darwaze ki jagah khidki kahan hai kisi ko nahi pata:

text
Spec   : 2 BHK, kitchen east mein, budget fix
Plan   : foundation -> walls -> electrical -> finishing
Agent  : mistri jo plan se kaam kare aur sawaal kare
Verify : har stage par naksha se check (diff + tests)
Ship   : ghar tab complete jab bijli-paani bhi chalu (deploy + smoke)
Interview angle — yahan se sawaal aate hain
  • Q: AI-assisted engineering aur vibe coding mein farq? — Direct + verify karna vs jo generate hua accept kar lena.
  • Q: Agent ka verification loop kaun se steps se guzarta hai? — context, generate, diff, test, debug, review, accept.
  • Q: CLAUDE.md aur task prompt ka farq kya hai? — permanent project memory vs aaj ka temporary context.
  • Q: Hooks vs model instruction — deterministic checks kahan rakhein? — hooks/CI mein, model ko yaad dilane mein nahi.
  • Q: MCP se agent kya kar sakta hai jo plain repo access se nahi? — databases, APIs, tickets jaise external systems tak tool-based access.
Lesson complete?

Agent ab tumhara collaborator hai, blind button nahi. Agla lesson — Containers & Deployment — mein ye service container banakar public URL pe chalayenge.

Popular courses: Data Science Course in Lucknow · AI Course in Lucknow · Python Course in Lucknow · Power BI Course · Data Analytics Course