diff --git a/docs/coding-standards.md b/docs/coding-standards.md new file mode 100644 index 0000000..9436e4c --- /dev/null +++ b/docs/coding-standards.md @@ -0,0 +1,26 @@ +# Coding Standards for SNS Network Solutions + +## Python +- Use type hints on all function signatures +- Use dataclasses for data containers (not plain dicts) +- Use pathlib.Path (never os.path) +- Use httpx (not requests) for HTTP calls +- Always include docstrings on public functions +- Error handling: use specific exceptions, never bare except + +## File Structure +- One module per concern +- Tests in tests/ directory, mirroring src/ structure +- Config in config/ as YAML + +## Naming +- snake_case for functions and variables +- PascalCase for classes +- UPPER_CASE for constants +- Prefix private functions with underscore + +## Patterns +- Dependency injection over global state +- Async by default for I/O operations +- Return early on error (guard clauses) +