pre-commit

Generate a JSON report of staged and unstaged files before a git commit.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/shellicar/skills --skill pre-commit-shellicar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pre-commit
Source: https://github.com/shellicar/skills/tree/main/skills/pre-commit
Command: npx skills add https://github.com/shellicar/skills --skill pre-commit-shellicar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

Accidental inclusion of unwanted files in a commit can cause leaks, broken builds, or noisy history. This skill lets developers see exactly what is staged versus what remains modified before finalizing a commit.

Core Features & Use Cases

  • Staged vs Unstaged Report: Generates a JSON summary of files that are staged and those that are modified but not staged.
  • Warning Detection: Highlights common accidental patterns such as log files, environment files, and SDK history files.
  • Comparison Mode: When given an expected file list, identifies unexpected staged files and missing expected files.
  • Use Case: Before committing, run the skill to verify that only intended source files are staged, avoiding accidental commit of large logs or confidential configs.

Quick Start

Ask the pre‑commit skill to show the current staged and unstaged files before you commit.

Frequently Asked Questions about pre-commit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preview staged files before a git commit to avoid accidental commits?

Preview staged files before a git commit by generating a JSON report that identifies staged, unstaged, and warning files for human review without blocking the commit.

What is the best way to check for unstaged changes and accidental files before committing?

Checking for unstaged changes involves comparing staged versus modified files and highlighting accidental patterns like log or environment files in a JSON summary report.

Does this staged file preview require jq to generate the JSON report?

Yes, generating the JSON report for staged and unstaged files requires jq as a dependency to parse and format the git diff output.

Can I compare staged files against an expected file list to find missing or unexpected commits?

Yes, comparison mode identifies unexpected staged files and missing expected files by checking the current git staged state against an expected file list.

How does warning detection work for accidental log or environment file commits?

Warning detection works by highlighting common accidental patterns such as log files, environment files, and SDK history files found within the staged git changes.