From claude-commands
Documents justifications before creating/modifying files to prevent unnecessary changes and ensure well-reasoned modifications across all file types.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:file-justificationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Purpose**: Before creating or modifying ANY file, you MUST document the justification to prevent unnecessary file creation and ensure changes are well-reasoned.
Purpose: Before creating or modifying ANY file, you MUST document the justification to prevent unnecessary file creation and ensure changes are well-reasoned.
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?
Default: NO NEW FILES - You must prove why integration into existing files is impossible.
__init__.py### File: $PROJECT_ROOT/llm_response.py
**GOAL**: Add backward compatibility for outcome_resolution field
**MODIFICATION**: Add property that falls back to outcome_resolution when action_resolution is missing
**NECESSITY**: API clients already use action_resolution; changing the field name would break them
**INTEGRATION PROOF**: Property pattern matches existing properties in this class (lines 45-67)
### File: $PROJECT_ROOT/action_resolution_utils.py (NEW)
**GOAL**: Centralize action_resolution/outcome_resolution fallback logic
**MODIFICATION**: Create helper module with get_action_resolution() function
**NECESSITY**: Same logic duplicated in llm_response.py (22 lines) and world_logic.py (13 lines)
**INTEGRATION PROOF**:
- Could not add to llm_response.py - world_logic.py would create circular import
- Could not add to world_logic.py - llm_response.py would create circular import
- New utils file breaks the dependency cycle
### File: $PROJECT_ROOT/new_helper.py (NEW)
**GOAL**: Add helper function
**MODIFICATION**: Create new file with helper
**NECESSITY**: Cleaner to have it separate <-- NOT VALID
**INTEGRATION PROOF**: None attempted <-- MUST ATTEMPT
If a new file is justified, place it correctly:
| Code Type | Location |
|---|---|
| Python module | $PROJECT_ROOT/ or appropriate submodule |
| Scripts | scripts/ |
| Tests | $PROJECT_ROOT/tests/ |
| Commands | .claude/commands/ |
| Skills | .claude/skills/ |
NEVER create new files in project root.
*_v2.py - Edit existing file*_new.py - Edit existing file*_backup.py - Use git*_old.py - Delete and replaceBefore ANY file operation:
If you cannot answer these questions, do not create the file.
npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsValidates file modifications stay within authorized scope by checking user requests, task descriptions, and dependencies. Prevents scope creep and unauthorized edits.
Enforces validation rules for Claude Code tools (Edit, Write, Bash, NotebookEdit) to prevent errors like unread files before edits, non-unique old_strings, and missing directories. Useful before file changes or after failures.
Generates, analyzes, and enhances CLAUDE.md files using best practices, modular architecture, and tech stack customization for new and existing projects.