Claude-skill-registry File Validation
Strict detection and removal of unrelated files before PR creation
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/file-validation" ~/.claude/skills/majiayu000-claude-skill-registry-file-validation && rm -rf "$T"
manifest:
skills/data/file-validation/SKILL.mdsource content
File Validation Skill
Be strict, not permissive. Unrelated files MUST be removed, not suggested.
Core Principle: STRICT MODE - Unrelated files are removed immediately, not flagged for later cleanup.
Overview
File validation ensures PRs contain only relevant changes. This prevents:
- Local dev artifacts (redis-cluster, .env.local, tmp/)
- Debug files (console.log, dump.rdb)
- OS/IDE artifacts (.DS_Store, .vscode/)
- Unintentional changes from other work
Policy: When unrelated files are detected, remove them. Don't suggest cleanup - do it.
When to Use
Trigger automatically during:
/commit-commands:commit-push-pr/commit-commands:commit- Any PR creation workflow
Trigger manually with:
/v-file-validation:check
Commands
| Command | Purpose |
|---|---|
| Run detection and prompt for removal |
Detection Patterns
By File Path
Flag files containing these path segments:
| Pattern | Category | Example |
|---|---|---|
| Local config | |
| Test fixtures | |
| Temporary | |
| Debug files | |
| Data dumps | |
| Cache files | |
| Local Redis | |
| Local Docker | |
By File Extension
Flag files with these extensions:
| Extension | Category | Example |
|---|---|---|
| Log files | |
| Process IDs | |
| Redis dumps | |
| Data dumps | |
| Vim swap | |
| Python compiled | |
By File Name
Flag files matching these names:
| Name | Category |
|---|---|
| macOS artifact |
| Windows artifact |
| Windows artifact |
| Local env config |
| Local env config |
| Local env config |
Common Categories
| Category | Examples | Why Unrelated |
|---|---|---|
| Local dev artifacts | , , | Only exist in local environment |
| Debug files | , , | Temporary debugging |
| OS artifacts | , , | OS-specific, should be in .gitignore |
| IDE files | , , | IDE-specific, should be in .gitignore |
| Build artifacts | , , , | Generated, should be in .gitignore |
| Test data | , | Local testing only |
| Config overrides | , | Local dev config |
Detection Logic
def is_unrelated(file_path, pr_scope): # 1. Path-based detection unrelated_patterns = [ 'local', 'test-data', 'tmp', 'debug', 'dump', 'cache', '.DS_Store', '*.log', '*.pid', 'redis-cluster', 'docker-compose.override' ] if any(pattern in file_path for pattern in unrelated_patterns): return True # 2. Extension-based detection unrelated_extensions = ['.log', '.pid', '.rdb', '.dump', '.swp', '.pyc'] if any(file_path.endswith(ext) for ext in unrelated_extensions): return True # 3. Scope-based detection # Read PR description + Linear issue # Check if file is mentioned or relates to scope if not file_mentioned_in_scope(file_path, pr_scope): return True return False
Strict Mode Policy
Wrong Approach (Too Permissive)
❌ "These files shouldn't affect the PR, but you may want to clean them up later"
Right Approach (Strict)
✅ "These files are unrelated to this PR and must be removed: - redis-cluster/dump.rdb (local dev artifact) - .env.local (local config) - tmp/debug.log (debug file) Removing them now."
Then execute the removal.
Handling User Override
Rare case: User insists files ARE related.
Response:
Okay, keeping the files. Please add justification to PR description: ## Unusual Files Included This PR includes files that may appear unrelated: - redis-cluster/: [Explain why needed] - .env.local: [Explain why needed] Justification: [User's explanation]
This documents the decision for reviewers.
Integration Points
With commit-commands Plugin
When
/commit-commands:commit-push-pr runs:
- List all changed files
- Invoke
/v-file-validation:check - If unrelated files found → Prompt for removal
- After cleanup → Continue with commit
With Tech Lead
Before tech lead approval:
- Run file validation
- If unrelated files found → Block until cleaned
Reference Files
| File | Purpose |
|---|---|
| PR quality standards and file validation criteria |
| Multi-agent git safety (never use ) |
Skill Version: 1.0.0