Why this matters
Improves testability, reuse, and separation of concerns.
Pass dependencies (clients, sessions, configs) into functions/classes instead of creating them internally.
Improves testability, reuse, and separation of concerns.
Side-by-side examples engineers can pattern-match during review.
def fetch_users():
client = HttpClient()
return client.get('/users')def fetch_users(client: 'HttpClient'):
return client.get('/users')def repo(): return DB()def repo(db: DB): return db.query(...)From the same buckets as this rule.
For changes that affect architecture, data models, external APIs, security posture, deployment topology, or cost (>10%), create an ADR in docs/adr/ using the standard template (Context, Decision, Consequences) and link the PR and issue IDs.