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

scripts/pre-commit

View on GitHub
#!/bin/bash
# Pre-commit hook: Run CI checks before committing
# Reads project commands from CLAUDE.md [ci] section if present,
# otherwise detects stack and runs defaults.

set -e

ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT"

# ── Python (uv) ────────────────────────────────────────────────────────────
if [[ -f "pyproject.toml" ]] && command -v uv &>/dev/null; then
    echo "→ ruff format"
    uv run ruff format --check src tests

    echo "→ ruff lint"
    uv run ruff check src tests

    echo "→ mypy"
    # infer package name from src/ (first directory)
    PKG=$(ls src/ | head -1)
    uv run mypy "src/${PKG}"

    echo "→ pytest"
    uv run pytest -q --tb=short

    echo "✓ All checks passed"
    exit 0
fi

# ── Node (npm/yarn) ────────────────────────────────────────────────────────
if [[ -f "package.json" ]]; then
    if command -v npm &>/dev/null; then
        echo "→ npm test"
        npm test --if-present
    fi
    exit 0
fi

exit 0
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