docs: add coding standards for agent reference
This commit is contained in:
parent
b1a35783bb
commit
31deaebb46
26
docs/coding-standards.md
Normal file
26
docs/coding-standards.md
Normal file
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user