| name | file-justification |
| description | Guide and workflow for File Justification Protocol. Use when you need File Justification Protocol. |
File Justification Protocol
Purpose: Before creating or modifying ANY file, you MUST document the justification to prevent unnecessary file creation and ensure changes are well-reasoned.
When This Protocol Applies
- Creating a NEW file (highest scrutiny)
- Modifying an EXISTING file
- All PR changes (each file touched needs justification)
Justification Template
For EACH file you touch, document:
### File: <filename>
**GOAL**: What are you trying to achieve?
**MODIFICATION**: What specific change are you making?
**NECESSITY**: Why is this change required? Why can't it be done differently?
**INTEGRATION PROOF**: How does this integrate with existing code?
New File Creation - Extreme Scrutiny
Default: NO NEW FILES - You must prove why integration into existing files is impossible.
Pre-Write Checklist (MANDATORY before creating any new file)
- Assume existing files can handle it - Search for similar functionality
- Identify integration targets - Which existing files could contain this code?
- Attempt integration first - Try adding to existing file before creating new
- Document why integration failed - Concrete reason, not "cleaner this way"
Integration Hierarchy (try in order)
- Existing file with similar functionality
- Existing utility/helper file
- Existing
__init__.py
- Existing test file (for test code)
- Existing class as a method
- Config file
- LAST RESORT: New file (with full justification)