swell-agents/coding-skills / skills/committing-changes
committing-changes
VerifiedCommit via feature branch + PR + git hooks; never push main, never merge.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.5 KB |
| reference/commit-md-original.md | markdown | 1.5 KB |
| reference/git-rule.md | markdown | 670 B |
| reference/hook-troubleshooting.md | markdown | 2.3 KB |
| scripts/commit-msgexecutable | script | 1006 B |
| scripts/install-hooks.shexecutable | script | 747 B |
| scripts/install-pr-size-workflow.shexecutable | script | 1.4 KB |
| scripts/pre-commitexecutable | script | 1.2 KB |
| scripts/pre-pushexecutable | script | 504 B |
| templates/gitattributes.example | other | 672 B |
| templates/pr-size.yml | config | 1.4 KB |
reference/hook-troubleshooting.md
View on GitHub---
purpose: Common failure modes for the commit-msg, pre-commit, and pre-push hooks
---
# Hook troubleshooting
Failure modes in order of frequency.
## commit-msg
**`ERROR: Subject line is N chars (max 72).`** — Tighten the subject. If you genuinely need more context, put it in the body (blank line after subject, then prose). Don't pre-emptively split into two commits unless the change is also two logical changes.
**`ERROR: Subject must start with a capital letter (imperative mood).`** — Use `Add`, `Fix`, `Refactor`, not `added`, `adds`, `fixed`. The hook checks the first character only; `feat: add ...` lower-case after the prefix will still fail.
**`ERROR: Subject must not end with a period.`** — Drop the period. The subject is a title, not a sentence.
**`ERROR: Co-Authored-By lines are not allowed.`** — Remove the trailer. The agent's authorship is implicit in the workflow; no need to spam `Co-Authored-By: Claude` into history.
## pre-commit
The hook runs the project's lint/format/test stack. Failure modes are project-specific. The general rule: **don't `--no-verify`**. If a hook fails, fix the underlying issue and create a *new* commit. Bypassing hooks is the path that produced the bug the hook was added to catch.
If the hook is wrong (e.g., the linter has a rule that genuinely doesn't apply here), fix the linter config and commit *that* change separately, then retry the original commit.
## pre-push
**`ERROR: Direct push to 'main' is not allowed.`** — Create a feature branch:
```
git checkout -b <type>/<description>
git push -u origin <type>/<description>
```
Then `gh pr create --fill`.
If the hook is genuinely in the way (e.g., one-person repo, you really do want to push to main), don't disable it — change your workflow. The hook exists because every project that allowed direct pushes eventually broke `main` for everyone.
## Hook is not running at all
```
ls -la .git/hooks/
```
If `commit-msg` / `pre-push` aren't there, run the installer:
```
bash <skills>/committing-changes/scripts/install-hooks.sh
```
If they exist but aren't running, check executable bit:
```
chmod +x .git/hooks/commit-msg .git/hooks/pre-push
```
If you're in a worktree, hooks live in the *main* git dir; use `git rev-parse --git-dir` to find the right `hooks/` to populate. The installer handles this.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |