github-commit-push
Commit Push
Overview
Provide a repeatable commit-and-push workflow that runs lint/build checks first and optionally creates a PR with GitHub CLI.
Path Resolution (avoid missing-skill errors)
- Always open this skill using the absolute path from the active session skills list (for example
~/.codex/skills/github-commit-push/SKILL.md). - Do not try repo-relative
.codex/skills/...paths unless the session explicitly lists that exact path.
Workflow
- Preflight
- Run
git status -sbandgit branch --show-current; confirm branch and scope. - Determine the issue number to auto-close in PR:
- Detect issue number from branch name patterns such as
issue-123,fix/123-*,gh-123,#123,23-*. - If no issue can be derived automatically, ask the user for the issue number before creating the PR.
- Keep the issue number only if a single, confirmed target exists.
- Detect issue number from branch name patterns such as
- If the user wants only specific files, confirm the file list before staging; otherwise default to all changes.
- Run
- Verify
- Run
pnpm lint. - Run
pnpm knip. - Run
pnpm build. If repo policy restricts builds, ask the user to run it or explicitly approve running it. - If any command fails, stop and report the error.
- Run
- Commit
- Stage all changes:
git add -A. - Summarize staged diff:
git diff --stat --cached. - If no commit message is provided, generate a concise one based on the staged diff and proceed without asking.
- Commit with
git commit -m "message".
- Stage all changes:
- Push
- Push the current branch with
git push(default behavior when nothing else is specified). - If no upstream is set, use
git push -u origin <branch>.
- Push the current branch with
- PR (optional)
- Ask whether to create a PR.
- If yes and
ghis available/authenticated:- Include issue closure metadata in the PR body using
Fixes #<issue-number>(orCloses #<issue-number>) so merge will auto-close the issue. - Build a detailed PR body that follows the repository template (create
.github/pull_request_template.mdif missing). - Fill the template sections (Summary, Why, What changed, How, Testing, Notes, Checklist).
- Add an explicit heading in the PR body such as:
## Related issueFixes #<issue-number>
- Include test results and any warnings in Testing/Notes.
- Run
gh pr create --title "<branch>: <summary>" --body "<filled template>"(add--draftif requested) and share the PR link.
- Include issue closure metadata in the PR body using
- If
ghis unavailable, explain how to proceed or skip PR creation.
More from mindgames/skills
github-sync
Sync a local Git repository with its remote safely. Use when Codex needs to update a repo before starting work, fast-forward a local branch from `origin`, confirm that local `main` or another branch matches the remote, or prepare an up-to-date base branch before creating a new branch.
3github-pull-request
Use when the user asks to create a pull request. Build a complete PR using best-practice structure with rich details on changes, verification, QA evidence, risks, and rollout notes. Include issue linkage and clear testing commands/results in the PR body.
2branch
Use when a user asks to create a new local git branch and start issue work (for example, "create branch" or "start working on issue XYZ"). Use this for issue-based branch naming in the `type/scope-short-description` pattern and for always syncing local `main` from `origin/main` before creating the new branch, creating the local tracking `main` branch first when needed.
1gh-pr-audit
Perform a full local audit of one or more GitHub PRs, run repository-native deterministic checks, apply result labels, and post a structured review comment. Use when a PR in this repo or under projects/* needs a deep, evidence-based review across any language or stack.
1gh-fix-ci
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.
1github-issue
Create complete, implementation-ready GitHub issues from user input and publish them with `gh issue create`. Use when asked to create/file/open a new issue in any repository, including cases where requirements must be structured into clear scope, acceptance criteria, constraints, and done-when outcomes.
1