Documentation, Docstrings, and README Generation
Generate docstrings, READMEs, ADRs, runbooks with Claude. Turn docs from a debt into a revenue-producing asset.
Şükrü Yusuf KAYA
10 min read
BeginnerÜretebileceğin Doküman Türleri
- Docstring (Python NumPy / Google / RST stilleri)
- JSDoc / TSDoc (TypeScript)
- README (proje düzeyi)
- ADR (Architecture Decision Record)
- Runbook (incident response)
- API referansı (OpenAPI / Markdown)
- Changelog
Her biri için Claude'un farklı bir prompt kalıbı olur.
python
def normalize_phone(raw: str, default_country: str = "TR") -> str | None: """Normalize a Turkish phone number to canonical form. Parameters ---------- raw : str Free-form input. Spaces, hyphens, parentheses, and the leading plus sign are stripped before parsing. default_country : str, optional Country code; only "TR" is currently supported. Returns ------- str or None Canonical form '+90 5xx xxx xx xx' if recognized, otherwise None. Raises ------ None This function never raises; invalid input returns None. Examples -------- >>> normalize_phone("+90 (555) 123-45-67") '+90 555 123 45 67' >>> normalize_phone("invalid") is None True Notes ----- Only "TR" numbers are supported. International normalization is intentionally out of scope. """NumPy stilinde docstring — Sphinx / pdoc ile direkt parse edilir.
Doctest çalıştır#
Docstring içindeki >>> örnekleri doctest ile otomatik test edilebilir.
python
def merhaba(isim): """ >>> merhaba("Şükrü") 'Merhaba, Şükrü!' """ return f"Merhaba, {isim}!" import doctestdoctest.testmod(verbose=True)Boşluk doldur · text
Mimari kararları belgelemek için _____ kullanılır. NumPy stilinde docstring _____ örneklerini otomatik test eder. Alarmla başlayan acil durum belgesi _____ olarak adlandırılır.Frequently Asked Questions
Yes — lint missing docstrings on new public functions. Refreshing READMEs on major releases via Claude is a good practice, but always with human approval.
Yorumlar & Soru-Cevap
(0)Yorum yazmak için giriş yap.
Yorumlar yükleniyor...