Skip to content
Team WorkflowChapter 55 / 57Intermediate5 min read

Documentation & Decision Records

Architecture decision records aur repo ka knowledge base, decisions log, gotchas, glossary, aur docs ko code ke saath sach rakhne ka tareeqa.

On this page

1. Yeh practice kya hai?

Code batata hai kya ho raha hai. Docs batate hain kyun, aur kahan girne ka khatra hai. Yeh docs repo mein code ke saath rehte hain, kisi alag wiki mein nahi jo koi update nahi karta.

2. Kyun zaroori hai?

Har team mein kuch code "ajeeb" lagta hai: retry teen dafa kyun? Yeh field nullable kyun? Bina likhe faisle ke naya developer usay "theek" kar deta hai aur woh purana bug wapas aa jata hai jis ki wajah se yeh faisla hua tha.

Docs bina system keDocs code ke saath
Faisle chat mein dafanDecisions log mein tareekh ke saath
Har naye developer ka ek din ek trap parGotchas file pehle din parhi jati hai
Wiki purani, koi nahi jaanta kitniHar module par verified commit
Pichle hafte faisla hua2026-03-14 ko faisla hua
Docs aur code alag PRs meinBehaviour aur docs ek PR mein

3. Kab follow karein?

LevelKitna zarooriKyun
Learning projectAcha README: kya hai, kaise chalayeinApne aap ko 3 mahine baad samjhana
Production codeREADME, decisions, gotchas, zaroori modulesTeam aur naye log tez chalein
Senior levelStructure banana aur docs ko review ka hissa bananaKnowledge ek insaan ke dimagh mein na rahe

4. Bura vs acha code

Bura

bash
docs/
  notes.md
  new-notes-final.md
  old/
bash
we changed the retry logic last week because of the issue with the provider

Kaunsa hafta? Kaunsa issue? Kaunsi file sahi hai?

Acha: structure

bash
README.md
docs/knowledge/
  README.md
  architecture.md
  decisions.md
  gotchas.md
  glossary.md
  billing.md
  auth-tenancy.md

docs/knowledge/README.md ek chhota index hai: product kya hai, pehle din kaun si 3 se 6 files parhein, aur har file kis sawal ka jawab deti hai.

Acha: decisions log

bash
- 2026-03-14: webhook delivery retries three times with backoff. the provider drops about 1% of first attempts.
- 2026-04-02: invoices store amounts in cents as integers. floats gave rounding errors in totals.
- 2026-05-20: no soft delete on comments. legal asked for real deletion.

Acha: gotcha

bash
trap: exports time out above 50k rows

symptom: csv export returns 504 for large stores
cause: export runs inside the request, the host kills it at 60s
fix: use the background export job for more than 10k rows
seen: 2026-06-11

Farq kya hai?

CheezBuraAcha
Tareekh"Last week"2026-03-14
WajahGayabEk jumla
DhoondhnaTeen files meinEk index, ek sawal ek file
FreshnessPata nahiVerified commit ya last updated date

5. Kaise apply karein?

FileKya rakhti hai
README.md (root)Setup, commands, kaise chalayein
docs/knowledge/README.mdIndex aur reading order
architecture.mdPieces kaise jurte hain, kya jaan boojh kar nahi banaya
decisions.mdHar faisla ek line: tareekh, faisla, ek jumle mein wajah
gotchas.mdHar trap: symptom, wajah, kya karein
glossary.mdDomain ke alfaaz, ek line har ek
<module>.mdEk bounded sawal, jaise billing ya auth
Docs ko sach kaise rakhein
PR behaviour badalta hai
Usi PR mein related module update
Bug fix mein naya trap mila to gotchas mein
Review thread mein faisla hua to decisions mein
Module ki last verified date ya commit update

Docs mein kabhi secret value, customer ki identity ya personal data nahi. Env variable ka naam theek hai, value nahi.

Doosre tareeqe

Bohat teams ADR (Architecture Decision Record) format use karti hain: har bare faisle ki alag file jis mein Context, Decision, Consequences sections hon. Yeh bare, lambe faislon ke liye behtar hai. Ek line wala decisions log chhote aur zyada faislon ke liye tez hai. Kuch teams dono rakhti hain: log har faisle ke liye, ADR sirf architecture badalne wale faislon ke liye.

6. Exceptions aur common mistakes

Kab rule nahi lagta: jo code khud wazeh kare usay docs mein dohrana nahi. Function kya karta hai yeh naam aur types batayein. Docs sirf woh jo code nahi bata sakta.

Galati: Docs ko baad ka kaam samajhna

Why? Baad kabhi nahi aata aur docs code se door hote jate hain.

Behtar: Behaviour badalne wale PR mein hi docs, aur PR template mein iski line.

Galati: Relative tareekhein likhna

Why? Pichle hafte ka matlab teen mahine baad kuch nahi.

Behtar: Hamesha poori tareekh likhein, jaise 2026-03-14.

Galati: Ghalat doc ko chhor dena

Why? Purana ghalat doc koi doc na hone se zyada nuksan karta hai, log us par bharosa karte hain.

Behtar: Ghalat module ko foran theek ya delete karein, naya duplicate na banayein.

7. Pehle aur baad mein kya seekhein?

Final quick revision

CheckHaan?
README mein setup aur commands
Decisions log, tareekh aur wajah ke saath
Gotchas: symptom, cause, fix
Ek file ek sawal, ek index
Behaviour aur docs ek PR mein
Koi secret ya personal data nahi