Skip to content

swell-agents/coding-skills / skills/committing-changes

committing-changes

Verified

Commit via feature branch + PR + git hooks; never push main, never merge.

FileKindSize
SKILL.mdskill md4.5 KB
reference/commit-md-original.mdmarkdown1.5 KB
reference/git-rule.mdmarkdown670 B
reference/hook-troubleshooting.mdmarkdown2.3 KB
scripts/commit-msgexecutablescript1006 B
scripts/install-hooks.shexecutablescript747 B
scripts/install-pr-size-workflow.shexecutablescript1.4 KB
scripts/pre-commitexecutablescript1.2 KB
scripts/pre-pushexecutablescript504 B
templates/gitattributes.exampleother672 B
templates/pr-size.ymlconfig1.4 KB

reference/commit-md-original.md

View on GitHub
---
purpose: Verbatim Claude-Code /commit slash-command body
---

# Original `/commit` slash-command (Claude-Code-native)

Below is the unedited slash-command body. Preserved for the Claude-Code consumer; the canonical `SKILL.md` rewrites the same content for harness-agnostic consumption.

---

Commit changes, push to remote, and create PR if needed.

## Workflow

1. **Install Hooks**
   - From the repo being committed, run: `bash <metawork-root>/.claude/shared/hooks/install-hooks.sh`

2. **Branch Check**
   - If on `main`: prompt for branch type and description, then `git checkout -b <type>/<description>`
   - Valid types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`

3. **Auto-fix before commit**
   - Run project linter/formatter if configured (check CLAUDE.md for project-specific tools)
   - Pre-commit hooks will verify quality gates

4. **Commit & Push**
   - Stage all changes: `git add -A`
   - Generate concise commit message from diff
   - Commit and push: `git push -u origin <branch>`

5. **Merge Main**
   - `git fetch origin main && git merge origin/main`
   - If conflicts: resolve, commit merge, push
   - If clean: push

6. **PR Creation** (first push only)
   - Check if PR exists: `gh pr list --head <branch>`
   - If no PR: `gh pr create --fill`

7. **Branch Cleanup**
   - Delete local branches already merged into main: `git branch --merged main | grep -v '^\*\|main' | xargs -r git branch -d`
   - Prune remote tracking branches: `git fetch --prune`

## Rules

@rules/git.md
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 implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall