원클릭으로
troubleshoot-precommit
Troubleshoot pre-commit hook failures and auto-fixes
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Troubleshoot pre-commit hook failures and auto-fixes
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when creating PRs, linking issues, managing PR comments, or creating GitHub issues
Use when creating or editing GitHub Actions workflows that call reusable workflows (uses: OWNER/repo/.github/workflows/...) — org owner references must be the literal current org, and shared-CI homes are under dryvist.
Emit a paste-ready two-part handoff for a fresh session: a `## Goal statement` hard-capped under 4000 characters (measured with wc -c, never estimated) that pastes straight into Claude Code's /goal Stop hook, plus an unbounded `## Full prompt` carrying cwd, ordered reading list, hard rules, pitfalls, and deliverables. Use when forking work to a new session, spinning up an orchestrator, or when wrap-up needs a next-session prompt with a real goal and not just a task list.
Analyzes current session state and repository status without any cleanup. Full mode (default): resolves the active plan file, reads plan checklist + TaskList, gathers unfinished work/issues from conversation history, checks git status, and emits a /handoff-built next-session prompt. Mid-session mode (`/session-status mid`): a fast plain-language 'done vs remaining' snapshot for mid-flight orientation, skipping the history scan, triage, and handoff.
End-of-session handler that first checks whether the current session's plan is actually complete. If complete: refresh repo, run quick retrospective, clean gone branches, and emit a forward-looking follow-up prompt. If incomplete: skip cleanup and emit one or more `cd`-into-worktree blocks paired with ready-to-paste resume prompts so the unfinished work can be picked up cold in a new session.
Automatically finalize pull requests for merge by resolving CodeQL violations, review threads, merge conflicts, and CI failures. Handles single PR (current branch or by number), all open PRs in the repo, or all open PRs across the org. Includes bot-authored PRs in all modes.
| name | troubleshoot-precommit |
| description | Troubleshoot pre-commit hook failures and auto-fixes |
Diagnose and fix pre-commit hook issues that occur when committing code.
This error looks like:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
markdownlint-cli2........................................................Failed
- hook id: markdownlint-cli2
- files were modified by this hook
What happened: Pre-commit hooks auto-corrected formatting issues. The fixes weren't committed automatically.
Pre-commit hooks run BEFORE your commit. If they auto-fix files, your staged changes no longer match your working directory. Git stops to let you review the changes.
Stage the auto-fixed files and amend the commit:
git add -A
git commit --amend --no-edit
git push origin <branch>
If this happens during a rebase operation:
# In the worktree where the rebase is running:
git add -A # stage the hook changes
git commit --amend --no-edit # update the current commit in the rebase
git rebase --continue # continue the rebase
# After the rebase finishes:
git push origin <branch> # push the rebased branch
If hooks keep modifying files in a loop:
git diff # See what changed
git diff HEAD~1 # See what the hook is trying to fix
| Hook | Fixes |
|---|---|
trim-trailing-whitespace | Removes spaces at end of lines |
end-of-file-fixer | Ensures files end with newline |
markdownlint-cli2 | Fixes markdown formatting |
prettier | Reformats code/JSON/YAML |
eslint with --fix | Fixes JavaScript/TypeScript issues |
git commit --no-verify to skip hooks