refactor: split architecture rules into domain-specific files
Split the monolithic .architecture-rules.yaml (1700+ lines) into focused domain-specific files in .architecture-rules/ directory: - _main.yaml: Core config, principles, ignore patterns, severity levels - api.yaml: API endpoint rules (API-001 to API-005) - service.yaml: Service layer rules (SVC-001 to SVC-007) - model.yaml: Model rules (MDL-001 to MDL-004) - exception.yaml: Exception handling rules (EXC-001 to EXC-005) - naming.yaml: Naming convention rules (NAM-001 to NAM-005) - auth.yaml: Auth and multi-tenancy rules (AUTH-*, MT-*) - middleware.yaml: Middleware rules (MDW-001 to MDW-002) - frontend.yaml: Frontend rules (JS-*, TPL-*, FE-*, CSS-*) - language.yaml: Language/i18n rules (LANG-001 to LANG-010) - quality.yaml: Code quality rules (QUAL-001 to QUAL-003) Also creates scripts/validators/ module with base classes for future modular validator extraction. The validate_architecture.py loader now auto-detects and merges split YAML files while maintaining backward compatibility with single file mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
56
.architecture-rules/naming.yaml
Normal file
56
.architecture-rules/naming.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
# Architecture Rules - Naming Convention Rules
|
||||
# Rules for consistent naming across the codebase
|
||||
|
||||
naming_rules:
|
||||
|
||||
- id: "NAM-001"
|
||||
name: "API files use PLURAL names"
|
||||
severity: "error"
|
||||
description: |
|
||||
API endpoint files should use plural names (vendors.py, products.py)
|
||||
pattern:
|
||||
file_pattern: "app/api/v1/**/*.py"
|
||||
check: "plural_naming"
|
||||
exceptions:
|
||||
- "__init__.py"
|
||||
- "auth.py"
|
||||
- "health.py"
|
||||
|
||||
- id: "NAM-002"
|
||||
name: "Service files use SINGULAR + 'service' suffix"
|
||||
severity: "error"
|
||||
description: |
|
||||
Service files should use singular name + _service (vendor_service.py)
|
||||
pattern:
|
||||
file_pattern: "app/services/**/*.py"
|
||||
check: "service_naming"
|
||||
|
||||
- id: "NAM-003"
|
||||
name: "Model files use SINGULAR names"
|
||||
severity: "error"
|
||||
description: |
|
||||
Both database and schema model files use singular names (product.py)
|
||||
pattern:
|
||||
file_pattern: "models/**/*.py"
|
||||
check: "singular_naming"
|
||||
|
||||
- id: "NAM-004"
|
||||
name: "Use consistent terminology: vendor not shop"
|
||||
severity: "warning"
|
||||
description: |
|
||||
Use 'vendor' consistently, not 'shop' (except for shop frontend)
|
||||
pattern:
|
||||
file_pattern: "app/**/*.py"
|
||||
discouraged_terms:
|
||||
- "shop_id"
|
||||
- "shop_service"
|
||||
|
||||
- id: "NAM-005"
|
||||
name: "Use consistent terminology: inventory not stock"
|
||||
severity: "warning"
|
||||
description: |
|
||||
Use 'inventory' consistently, not 'stock'
|
||||
pattern:
|
||||
file_pattern: "app/**/*.py"
|
||||
discouraged_terms:
|
||||
- "stock_service"
|
||||
Reference in New Issue
Block a user