Skip to content
Back to skills

Collect Commits And Files

ASecurity

Collect changed files from git diff and explicit paths, categorize by type, output manifest.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 8, 2026
toolsgobashgitdocumentation

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill collect-commits-and-files --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collect Commits And Files?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collect Commits And Files
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-collect-commits-and-files/badge)](https://www.skillsdirectory.com/skills/majiayu000-collect-commits-and-files)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: collect-commits-and-files
description: Collect changed files from git diff and explicit paths, categorize by type, output manifest.
allowed-tools: Bash(${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/collect-info.sh:*), Bash(${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/cleanup.sh:*)
---

Skill for collecting files to review: runs git diff against target branch, merges explicit files, categorizes by type.

## Arguments

| Arg | Default | Description |
|-----|---------|-------------|
| `--against` | origin/main | Target branch for diff comparison |
| `--files` | (none) | Comma-separated explicit file paths |

## Workflow

### 1. Collect File Info

Run:
```bash
${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/collect-info.sh --against <branch> --files <paths>
```

Returns JSON manifest:
```json
{
  "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:
```json
{"error": "No files to review", "error_code": "NO_FILES"}
```

Error codes:
- `NOT_GIT_REPO`: Not in a git repository
- `BRANCH_NOT_FOUND`: Target branch does not exist
- `NO_FILES`: No files found to review
- `NO_EXISTING_FILES`: All files are deleted

### 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:
```bash
${CLAUDE_PLUGIN_ROOT}/skills/collect-commits-and-files/scripts/cleanup.sh <temp_dir>
```

## File Categories

| Category | Description | Example patterns |
|----------|-------------|------------------|
| source | Source code files | `*.ts`, `*.py`, `*.go` |
| test | Test files | `*_test.go`, `*.spec.ts`, `tests/` |
| config | Configuration | `*.yaml`, `.eslintrc`, `.github/` |
| docs | Documentation | `*.md`, `docs/` |

## Return Value

Return the manifest JSON directly. Orchestrator uses this to:
1. Read file lists from `paths.files_dir`
2. Route to appropriate review agents based on `summary` counts
3. Store review outputs in `paths.reviews_dir`
4. Clean up `temp_dir` on completion

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.