Safeguards repository integrity by checking for secrets and sensitive files before commits.

Install

mkdir -p .claude/skills/git-safety-arthur105204 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12617" && unzip -o skill.zip -d .claude/skills/git-safety-arthur105204 && rm skill.zip

Installs to .claude/skills/git-safety-arthur105204

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use before staging, committing, pushing, or preparing commit summaries. Prevents raw data, secrets, local paths, unsanitized metadata, and large artifacts from being committed.
176 charsno explicit “when” trigger
Beginner

Key capabilities

  • Prevent committing raw data
  • Prevent committing secrets and tokens
  • Prevent committing local paths and environment details
  • Exclude large artifacts and temporary files from commits
  • Guide explicit file staging
  • Verify staged changes before committing

How it works

The skill enforces rules and provides commands to review and stage files, preventing sensitive data or large artifacts from being committed to a git repository.

Inputs & outputs

You give it
Git repository changes and staging area
You get back
A clean and safe git staging area and commit message

When to use git-safety

  • Preparing a git commit
  • Verifying git status for security
  • Cleaning up staging area

About this skill

Git Safety Skill

Purpose

Prevent accidental commits of raw data, sensitive metadata, local environment details, secrets, logs, or large artifacts.

Apply This Skill When

  • Preparing a commit.
  • Staging files.
  • Reviewing git status.
  • Reviewing git diff.
  • Pushing changes.
  • Writing commit summaries.

Non-Negotiable Rules

  • Never use git add ..
  • Stage files explicitly.
  • Do not commit raw data.
  • Do not commit unsanitized metadata.
  • Do not commit .env, secrets, tokens, credentials.
  • Do not commit local DB/cache/log files.
  • Do not commit Spark temp files.
  • Do not commit notebook checkpoints.
  • Do not commit model artifacts unless explicitly approved.
  • Do not commit row-level samples.

Expected Safe Files

Usually safe to commit:

  • AGENTS.md
  • PLAN.md
  • README.md
  • docs/project_report.md
  • jobs/*.py
  • jobs/README.md
  • .gitignore
  • sanitized small metadata artifacts such as artifacts/metadata/raw_data_summary.json

Only commit metadata if it is sanitized and small.

Files/Folders to Exclude

Do not stage:

  • data/raw/
  • data/processed/
  • data/serving/
  • .env
  • .env.*
  • logs/
  • *.db
  • *.sqlite
  • *.parquet
  • *.csv if it contains row-level data
  • Spark temp directories
  • model artifacts
  • cache folders

Required Commands

Before staging:

git status --short
git diff

Stage explicitly, for example:

git add AGENTS.md
git add PLAN.md
git add docs/project_report.md
git add jobs/00_inspect_raw_data.py
git add jobs/README.md
git add README.md
git add .gitignore
git add artifacts/metadata/raw_data_summary.json

Before commit:

git diff --cached --name-only
git diff --cached

Search for unsafe metadata:

grep -R "absolute_path\|project_root\|raw_data_dir" AGENTS.md PLAN.md README.md docs jobs artifacts/metadata || true
grep -R "drive-letter paths" AGENTS.md PLAN.md README.md docs jobs artifacts/metadata || true

PowerShell equivalent:

Select-String -Path AGENTS.md,PLAN.md,README.md,docs/project_report.md,jobs/*.py,jobs/README.md,artifacts/metadata/*.json -Pattern "absolute_path|project_root|raw_data_dir"

Commit Message Rule

Use short, specific commit messages, for example:

git commit -m "chore: add agent guardrails and project tracking"

Definition of Done

A commit is safe when:

  • only explicit files are staged
  • no raw data is staged
  • no secrets are staged
  • no absolute paths or local environment details are staged
  • metadata artifacts are sanitized
  • git diff --cached has been reviewed

When not to use it

  • When intentionally committing raw data for specific purposes
  • When committing large model artifacts that are explicitly approved
  • When `git add .` is required for a specific workflow

Limitations

  • Requires manual execution of git commands and grep checks
  • Rules are non-negotiable for certain file types and patterns
  • Does not automate the staging process, requiring explicit file additions

How it compares

This skill provides a structured, rule-based approach to git staging and committing, reducing the risk of accidental data leaks compared to manual git operations.

Compared to similar skills

git-safety side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
git-safety (this skill)02moReviewBeginner
security-ownership-map26moReviewAdvanced
github-archive14moReviewAdvanced
auditing-pre-release-security129dReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

security-ownership-map

openai

Analyze git repositories to build a security ownership topology (people-to-file), compute bus factor and sensitive-code ownership, and export CSV/JSON for graph databases and visualization. Trigger only when the user explicitly wants a security-oriented ownership or bus-factor analysis grounded in git history (for example: orphaned sensitive code, security maintainers, CODEOWNERS reality checks for risk, sensitive hotspots, or ownership clusters). Do not trigger for general maintainer lists or non-security ownership questions.

214

github-archive

gadievron

Investigate GitHub security incidents using tamper-proof GitHub Archive data via BigQuery. Use when verifying repository activity claims, recovering deleted PRs/branches/tags/repos, attributing actions to actors, or reconstructing attack timelines. Provides immutable forensic evidence of all public GitHub events since 2011.

16

auditing-pre-release-security

OneKeyHQ

Audits security and supply-chain risk between two git refs, 预发布安全审计

14

security-scan

redpanda-data

Resolve npm dependency vulnerabilities detected by security scans.

12

windsurf-dependency-management

jeremylongshore

Analyze and update dependencies with vulnerability scanning. Activate when users mention "update dependencies", "security audit", "npm audit", "vulnerability scan", or "dependency updates". Handles dependency analysis and updates. Use when working with windsurf dependency management functionality. Trigger with phrases like "windsurf dependency management", "windsurf management", "windsurf".

12

github-recon

zebbern

Scan Git repositories, GitHub organizations, and source code for leaked secrets, API keys, credentials, and sensitive data. Use when analyzing source code security, when checking for credential exposure, or when the user mentions secret scanning or credential leaks.

00

Search skills

Search the agent skills registry