Commit Commands
Use this skill only when the user explicitly wants the full publish workflow, not for simple Git inspection.
Modes
- Use
commit-push when the user wants commits and push on the current branch.
- Use
commit-push-pr when the user wants a new branch, grouped commits, push, pr.md, and a ready PR.
- If the request is ambiguous, ask which mode to use before mutating anything.
Hard rules
- Never add
Co-authored-by: trailers.
- Never mention
codex or any AI tool in branch names, commit messages, PR titles, or generated PR copy unless the user explicitly asks for that wording.
- Never commit
pr.md.
- Treat repository-root
pr.md as auxiliary output, not as publishable source.
- Never include unrelated changes when scope is ambiguous.
- Do not run project tests, linters, builds, or Git hooks by default. Use
--no-verify for git commit and git push unless the user explicitly asks to keep hooks enabled.
References
- Read
references/conventional-commits.md before writing commit messages or branch names.
- Read
references/pr-body-guidelines.md before generating pr.md or creating the PR.
Preflight
Run these checks before mutating the repository:
- Confirm you are inside a Git repository.
- Confirm there are changes to publish across staged, unstaged, or untracked files, ignoring repository-root
pr.md.
- Confirm
origin exists.
- For
commit-push-pr, confirm gh auth status succeeds before creating a branch or commit.
Use at least:
git status --short
git diff --stat
git diff --cached --stat
git ls-files --others --exclude-standard
git remote get-url origin
For commit-push-pr, also inspect the default branch:
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
Scope handling
- Inspect staged, unstaged, and untracked changes together.
- Group files by behavior, not only by file type or directory.
- Treat the worktree as mixed-scope and stop for clarification when:
- changed files clearly belong to different unrelated tasks
- generated files are mixed with source changes and the relationship is not obvious
- a single file contains multiple unrelated edits that cannot be separated safely with non-interactive commands
- If the scope is coherent, proceed automatically without asking for confirmation.
- If scope is mixed, ask the user which files or directories belong in the publish flow and do nothing else.
Commit grouping
- Prefer small functional commits.
- Order commits from foundation to user-facing behavior:
- supporting refactor or config
- main implementation
- tests
- docs
- Stage only the files that belong to the current functional block.
- If one file contains mixed concerns that cannot be separated safely without interactive staging, stop and ask for scope clarification instead of guessing.
- Use conventional commits for every commit.
- Add an optional scope only when it is obvious and stable, for example
feat(auth): add password reset.
- Keep the subject concise, imperative, and without a trailing period.
Use this commit shape:
type(optional-scope): summary
Branch handling
commit-push
- Stay on the current branch even if it is
main, master, or the default branch.
- Do not create a new branch.
commit-push-pr
- Create the branch before staging or committing.
- Derive the branch name from the dominant overall change using
<type>/<slug>.
- Keep the slug lowercase and hyphenated.
- Never include
codex, usernames, or timestamps in the branch name.
- If the derived branch name already exists locally or on
origin, append -2, then -3, and so on until it is unique.
Example:
feat/create-new-feature
fix/future-launches-crash
Execute the flow
commit-push
- Inspect the full diff and derive commit groups.
- Stage one functional group at a time.
- Commit with:
git commit --no-verify --cleanup=strip -m "type: summary"
- Repeat until all in-scope changes are committed.
- Push to the current branch:
- if upstream exists, use
git push --no-verify
- otherwise use
git push --no-verify -u origin $(git branch --show-current)
commit-push-pr
- Inspect the full diff and derive the overall branch name plus commit groups.
- Create and switch to the new branch from the current HEAD.
- Stage one functional group at a time.
- Commit with:
git commit --no-verify --cleanup=strip -m "type: summary"
- Repeat until all in-scope changes are committed.
- Push with tracking:
git push --no-verify -u origin $(git branch --show-current)
- Generate
pr.md at the repository root in English.
- Keep
pr.md untracked and out of all commits.
- Create a ready PR with:
gh pr create --base "$BASE_BRANCH" --head "$(git branch --show-current)" --title "$PR_TITLE" --body-file pr.md
pr.md rules
- Write
pr.md only for commit-push-pr.
- Overwrite
pr.md only when it is untracked and clearly related to the current publish flow.
- If
pr.md already exists and is tracked or appears unrelated, stop and ask before overwriting it.
- Keep the file in English.
- Match the level of detail to the PR complexity.
- Cover at minimum:
- problem or context
- what changed
- impact or notes
- testing status, using
Not run when no checks were executed
Failure handling
- Stop immediately if
gh auth status fails for commit-push-pr.
- Stop immediately if
origin is missing.
- Stop immediately if there are no changes to publish.
- If branch-name derivation is clear but commit grouping is not, ask for scope rather than creating a low-quality publish result.
1---2name: commit-commands3description: Automate Git and GitHub publish workflows from Codex with two explicit modes: `commit-push` for grouped conventional commits on the current branch, and `commit-push-pr` for creating a new branch, grouped conventional commits, push, `pr.md` generation in English, and a ready pull request with `gh`. Use when the user asks to "faz commit e push", "commit-push", "cria branch, commit, push e pr", "commit-push-pr", publish the current work, split changes into small conventional commits, or open a PR without codex mentions or co-author trailers.4---56# Commit Commands78Use this skill only when the user explicitly wants the full publish workflow, not for simple Git inspection.910## Modes1112- Use `commit-push` when the user wants commits and push on the current branch.13- Use `commit-push-pr` when the user wants a new branch, grouped commits, push, `pr.md`, and a ready PR.14- If the request is ambiguous, ask which mode to use before mutating anything.1516## Hard rules1718- Never add `Co-authored-by:` trailers.19- Never mention `codex` or any AI tool in branch names, commit messages, PR titles, or generated PR copy unless the user explicitly asks for that wording.20- Never commit `pr.md`.21- Treat repository-root `pr.md` as auxiliary output, not as publishable source.22- Never include unrelated changes when scope is ambiguous.23- Do not run project tests, linters, builds, or Git hooks by default. Use `--no-verify` for `git commit` and `git push` unless the user explicitly asks to keep hooks enabled.2425## References2627- Read `references/conventional-commits.md` before writing commit messages or branch names.28- Read `references/pr-body-guidelines.md` before generating `pr.md` or creating the PR.2930## Preflight3132Run these checks before mutating the repository:33341. Confirm you are inside a Git repository.352. Confirm there are changes to publish across staged, unstaged, or untracked files, ignoring repository-root `pr.md`.363. Confirm `origin` exists.374. For `commit-push-pr`, confirm `gh auth status` succeeds before creating a branch or commit.3839Use at least:4041```bash42git status --short43git diff --stat44git diff --cached --stat45git ls-files --others --exclude-standard46git remote get-url origin47```4849For `commit-push-pr`, also inspect the default branch:5051```bash52gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'53```5455## Scope handling5657- Inspect staged, unstaged, and untracked changes together.58- Group files by behavior, not only by file type or directory.59- Treat the worktree as mixed-scope and stop for clarification when:60 - changed files clearly belong to different unrelated tasks61 - generated files are mixed with source changes and the relationship is not obvious62 - a single file contains multiple unrelated edits that cannot be separated safely with non-interactive commands63- If the scope is coherent, proceed automatically without asking for confirmation.64- If scope is mixed, ask the user which files or directories belong in the publish flow and do nothing else.6566## Commit grouping6768- Prefer small functional commits.69- Order commits from foundation to user-facing behavior:70 - supporting refactor or config71 - main implementation72 - tests73 - docs74- Stage only the files that belong to the current functional block.75- If one file contains mixed concerns that cannot be separated safely without interactive staging, stop and ask for scope clarification instead of guessing.76- Use conventional commits for every commit.77- Add an optional scope only when it is obvious and stable, for example `feat(auth): add password reset`.78- Keep the subject concise, imperative, and without a trailing period.7980Use this commit shape:8182```text83type(optional-scope): summary84```8586## Branch handling8788### `commit-push`8990- Stay on the current branch even if it is `main`, `master`, or the default branch.91- Do not create a new branch.9293### `commit-push-pr`9495- Create the branch before staging or committing.96- Derive the branch name from the dominant overall change using `<type>/<slug>`.97- Keep the slug lowercase and hyphenated.98- Never include `codex`, usernames, or timestamps in the branch name.99- If the derived branch name already exists locally or on `origin`, append `-2`, then `-3`, and so on until it is unique.100101Example:102103```text104feat/create-new-feature105fix/future-launches-crash106```107108## Execute the flow109110### `commit-push`1111121. Inspect the full diff and derive commit groups.1132. Stage one functional group at a time.1143. Commit with:115116```bash117git commit --no-verify --cleanup=strip -m "type: summary"118```1191204. Repeat until all in-scope changes are committed.1215. Push to the current branch:122 - if upstream exists, use `git push --no-verify`123 - otherwise use `git push --no-verify -u origin $(git branch --show-current)`124125### `commit-push-pr`1261271. Inspect the full diff and derive the overall branch name plus commit groups.1282. Create and switch to the new branch from the current HEAD.1293. Stage one functional group at a time.1304. Commit with:131132```bash133git commit --no-verify --cleanup=strip -m "type: summary"134```1351365. Repeat until all in-scope changes are committed.1376. Push with tracking:138139```bash140git push --no-verify -u origin $(git branch --show-current)141```1421437. Generate `pr.md` at the repository root in English.1448. Keep `pr.md` untracked and out of all commits.1459. Create a ready PR with:146147```bash148gh pr create --base "$BASE_BRANCH" --head "$(git branch --show-current)" --title "$PR_TITLE" --body-file pr.md149```150151## `pr.md` rules152153- Write `pr.md` only for `commit-push-pr`.154- Overwrite `pr.md` only when it is untracked and clearly related to the current publish flow.155- If `pr.md` already exists and is tracked or appears unrelated, stop and ask before overwriting it.156- Keep the file in English.157- Match the level of detail to the PR complexity.158- Cover at minimum:159 - problem or context160 - what changed161 - impact or notes162 - testing status, using `Not run` when no checks were executed163164## Failure handling165166- Stop immediately if `gh auth status` fails for `commit-push-pr`.167- Stop immediately if `origin` is missing.168- Stop immediately if there are no changes to publish.169- If branch-name derivation is clear but commit grouping is not, ask for scope rather than creating a low-quality publish result.