Definition of Done
Definition of done checklist jo batati hai ke kaam kab sach mein khatam hai, typecheck, tests, migrations, env, docs, screenshot aur review tak.
On this page
1. Yeh practice kya hai?
Definition of Done (DoD) ek choti si list hai jo poori team ke liye ek hi hoti hai. Har pull request isi ke against check hoti hai. Is se "done" ka matlab har insaan ke liye barabar ho jata hai.
2. Kyun zaroori hai?
Bina likhi list ke har developer ka "done" alag hota hai. Ek ke liye feature ka screen par aana done hai, doosre ke liye tests ke saath merge hona. Farq baad mein bug, broken deploy aur "yeh kis ne kiya?" ban kar nikalta hai.
| Mere machine par chal gaya | Definition of done ke saath |
|---|---|
| Typecheck sirf editor ne dekha | Typecheck, lint, format CI mein green |
| Success path haath se test kiya | Success, validation aur auth failure ke tests |
| Naya env variable yaad mein | .env.example mein naam aur note |
| Migration ek dafa chali | Migration do dafa chal kar bhi theek |
| Reviewer screen khud chala kar dekhe | Screenshot ya recording PR mein |
| Khud hi approve kar diya | Kisi aur ne approve kiya |
3. Kab follow karein?
| Level | Kitna zaroori | Kyun |
|---|---|---|
| Learning project | Chhoti list: typecheck, lint, ek test, README | "Khatam" ki aadat yahin banti hai |
| Production code | Poori list, PR template mein checkboxes | Har missing item production bug ban sakta hai |
| Senior level | List ko CI mein automate karna | Jo machine check kar sake, us par insaan ka waqt na lage |
4. Bura vs acha code
Bura: PR description
added the export feature. done, pls reviewReviewer ko nahi pata kya test hua, kya env chahiye, kya migration hai.
Acha: PR description
add csv export for invoices
why: accountants export invoices by hand every month
how tested:
npm run typecheck, lint and tests pass
endpoint tests: success, invalid date range (422), invoice of another org (404)
migration applied twice locally, second run is a no-op
screenshot of the export button attached
new env: EXPORT_BUCKET (exports fail with 503 without it)
docs: docs/knowledge/exports.md updatedFarq kya hai?
| Cheez | Bura | Acha |
|---|---|---|
| Tests | Pata nahi | Kaun se cases, saaf likha |
| Env | Chhupa hua | Naam aur us ke bina kya tootega |
| Migration | Shayad | Idempotent, do dafa chali |
| Review | Reviewer khud dhoondhe | Sab saamne |
5. Kaise apply karein?
Yeh checklist PR template mein checkboxes ki shakal mein rakhein:
| # | Item | Kyun |
|---|---|---|
| 1 | Typecheck, lint aur format locally aur CI mein pass | Basic bugs aur style behas khatam |
| 2 | Har naye ya badle endpoint ke success, validation aur auth failure tests | Contract aur security sabit |
| 3 | Har badli hui branching wali pure function ka unit test | Logic ke edge cases |
| 4 | Migration us database par do dafa chali jahan pehle se lagi thi | Re-run par crash nahi |
| 5 | Generated database types regenerate aur commit | Code aur schema ek jaise |
| 6 | Naya env variable .env.example mein, note ke saath | Agla deploy na toote |
| 7 | Behaviour badla to docs update | Docs jhoot na bolein |
| 8 | UI change ho to screenshot ya short recording | Reviewer ko dikhe kya bana |
| 9 | Author ke ilawa kisi aur ka approval | Doosri nazar |
6. Exceptions aur common mistakes
Kab rule nahi lagta: jo item lagu nahi hota woh skip hota hai, lekin likh kar: "no migration", "no UI change". Spike ya prototype jo merge nahi hoga, us par poori list zaroori nahi. Lekin agar woh code baad mein main mein jaye to list wahin se lagti hai.
Galati: Checkbox tick karna bina chalaye
Why? Checklist ka faida sirf tab hai jab woh sach ho, jhoota tick koi safety nahi deta.
Behtar: Jo item check nahi kiya, usay khaali chhorein aur wajah likhein.
Galati: Tests sirf happy path ke
Why? Zyada tar bugs aur security holes failure paths mein hote hain.
Behtar: Har endpoint ke liye validation aur auth failure ke tests bhi likhein.
Galati: Docs ko alag ticket bana dena
Why? Woh ticket kabhi nahi hota aur docs purane ho jate hain.
Behtar: Behaviour badalne wale PR mein hi docs update karein.
7. Pehle aur baad mein kya seekhein?
| Stage | Topics |
|---|---|
| Pehle | Introduction, When to Learn What |
| Saath mein | Testing Pyramid, Pull Requests & Code Review |
| Baad mein | Safe Migrations, Production Readiness Checklist |
Final quick revision
| Check | Haan? |
|---|---|
| Typecheck, lint, format green | |
| Endpoint tests teeno paths | |
| Migration idempotent | |
| Types regenerated | |
.env.example updated | |
| Docs updated | |
| Screenshot attached | |
| Doosre ka approval |