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/install-pr-size-workflow.sh

View on GitHub
#!/bin/bash
# Install the PR-size CI workflow + .gitattributes exclusions to the current repo.
# Run from the repo root. Idempotent: skips files that are already up to date.

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEMPLATES_DIR="$(cd "$SCRIPT_DIR/../templates" && pwd)"
REPO_ROOT="$(git rev-parse --show-toplevel)"

WORKFLOW_SRC="$TEMPLATES_DIR/pr-size.yml"
WORKFLOW_DST="$REPO_ROOT/.github/workflows/pr-size.yml"

GITATTR_SRC="$TEMPLATES_DIR/gitattributes.example"
GITATTR_DST="$REPO_ROOT/.gitattributes"
GITATTR_MARKER="# Mark generated/vendored files so GitHub collapses them in PR diffs"

CHANGED=0

mkdir -p "$(dirname "$WORKFLOW_DST")"
if [[ -f "$WORKFLOW_DST" ]] && diff -q "$WORKFLOW_SRC" "$WORKFLOW_DST" > /dev/null 2>&1; then
    echo "  Up to date: .github/workflows/pr-size.yml"
else
    cp "$WORKFLOW_SRC" "$WORKFLOW_DST"
    echo "  Installed: .github/workflows/pr-size.yml"
    CHANGED=1
fi

if [[ -f "$GITATTR_DST" ]] && grep -qF "$GITATTR_MARKER" "$GITATTR_DST"; then
    echo "  Up to date: .gitattributes (already contains exclusion block)"
else
    if [[ -f "$GITATTR_DST" ]] && [[ -s "$GITATTR_DST" ]]; then
        printf '\n' >> "$GITATTR_DST"
    fi
    cat "$GITATTR_SRC" >> "$GITATTR_DST"
    echo "  Appended: .gitattributes exclusion block"
    CHANGED=1
fi

if [[ $CHANGED -eq 0 ]]; then
    echo "PR-size workflow already up to date."
else
    echo "Done. Review the diff, commit, and push."
fi
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: 321kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 321kUpdated 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: 321kUpdated 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: 321kUpdated Claude CodeCodexVerifiedInstall