stage
Stage files, run pre-commit, fix failures, loop until clean
SKILL.md.claude/skills/stage/SKILL.md
GitHubStage Changes
Step 1: Identify Changed Files
- Run
git statusto see all changed and untracked files. - Exclude from staging: .env files, credentials, secrets, large binaries.
Step 2: Stage Files
git addall relevant changed files.
Step 3: Pre-commit Loop
Run up to 5 iterations:
- Run
pre-commit run --all-files. - If it passes, proceed to Step 4.
- If it fails:
- Read the failure output.
- Fix the issues.
- Re-stage any modified files with
git add. - Go back to step 1.
- If still failing after 5 attempts, report the failure details to the user and stop.
Step 4: Report
- List what is staged:
git diff --cached --name-only - Confirm pre-commit passes.
- "All files staged and pre-commit clean. Ready for commit."