Claude-skill-registry collect-commits-and-files
Collect changed files from git diff and explicit paths, categorize by type, output manifest.
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/collect-commits-and-files" ~/.claude/skills/majiayu000-claude-skill-registry-collect-commits-and-files && rm -rf "$T"
manifest:
skills/data/collect-commits-and-files/SKILL.mdsource content
Skill for collecting files to review: runs git diff against target branch, merges explicit files, categorizes by type.
Arguments
| Arg | Default | Description |
|---|---|---|
| origin/main | Target branch for diff comparison |
| (none) | Comma-separated explicit file paths |
Workflow
1. Collect File Info
Run:
${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/collect-info.sh --against <branch> --files <paths>
Returns JSON manifest:
{ "temp_dir": "<git-root>/.tmp/quick-refactor-XXXXXX", "repo_root": "/path/to/repo", "against_branch": "origin/main", "paths": { "diff_dir": "<temp_dir>/diff", "files_dir": "<temp_dir>/files", "reviews_dir": "<temp_dir>/reviews" }, "summary": { "total_files": 10, "source": 6, "test": 2, "config": 1, "docs": 1 }, "project_rules": ["/path/to/CLAUDE.md", "/path/to/.kiro/steering.md"] }
2. Handle Errors
If script returns error, report to caller:
{"error": "No files to review", "error_code": "NO_FILES"}
Error codes:
: Not in a git repositoryNOT_GIT_REPO
: Target branch does not existBRANCH_NOT_FOUND
: No files found to reviewNO_FILES
: All files are deletedNO_EXISTING_FILES
3. Temp Directory Structure
The script creates temp directory at
<git-root>/.tmp/ (falls back to system temp):
<git-root>/.tmp/ ├── .gitignore # Contains `*` to ignore all temp files └── quick-refactor-XXXXXX/ ├── diff/ # Individual file diffs │ └── <md5hash>.diff ├── files/ # File paths by category (JSON arrays) │ ├── source.json # ["path/to/file1.ts", "path/to/file2.ts"] │ ├── test.json │ ├── config.json │ └── docs.json └── reviews/ # Empty, for review agent outputs
4. Cleanup
After processing is complete, run:
${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/cleanup.sh <temp_dir>
File Categories
| Category | Description | Example patterns |
|---|---|---|
| source | Source code files | , , |
| test | Test files | , , |
| config | Configuration | , , |
| docs | Documentation | , |
Return Value
Return the manifest JSON directly. Orchestrator uses this to:
- Read file lists from
paths.files_dir - Route to appropriate review agents based on
countssummary - Store review outputs in
paths.reviews_dir - Clean up
on completiontemp_dir