commit-and-pr
Branch, run the preflight gate, commit with Conventional Commits, push, and open a PR that follows the repo's PR guidelines and passes CI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Branch, run the preflight gate, commit with Conventional Commits, push, and open a PR that follows the repo's PR guidelines and passes CI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Prepare a guarded, ready-to-paste kickoff prompt for the next eligible phase of a phased project, verifying strict prerequisite closeout first and refusing blocked or ambiguous phase starts.
Safely determine whether a phased Hazma project can begin its next or a requested phase, then produce a guarded Codex kickoff prompt. Use when a user asks which phase is ready, asks to begin a phase, or needs a phase handoff; this skill does not implement the task.
Run Hazma's preflight gate, create or validate a Codex branch, commit intentionally with a valid Conventional Commit header, push, and open or update a pull request. Use when a user asks to commit, ship, or open a PR for current work.
Implement exactly one numbered task from a Hazma project plan, including task-note updates, numerical-impact measurement, documentation consistency, and the preflight gate. Use when a user asks to take a project task or the next project task; stop before committing unless the caller expressly owns the commit.
Orchestrate a bounded, multi-agent Codex review loop for a pushed Hazma pull request: select independent reviewer lenses, collect reviews in parallel, apply and push justified fixes, verify them, post durable round summaries, and stop at convergence, escalation, or the iteration cap.
Perform a read-only, findings-first review of a Hazma project PLAN before implementation, covering feasibility, numerical correctness, architecture, Python conventions, and testability. Use when a user asks whether a project plan is ready or asks to review projects/<slug>/PLAN.md.
| name | commit-and-pr |
| description | Branch, run the preflight gate, commit with Conventional Commits, push, and open a PR that follows the repo's PR guidelines and passes CI. |
Role: Ship the current working-tree changes as a well-formed branch,
commit, and pull request conforming to
docs/PR_GUIDELINES.md. This skill is
the sole commit authority — when a review skill lands fixes, it
follows the same preflight gate and title rules, not a hand-rolled
git commit.
/execute-single-task run finished and its working-tree
changes need to become a branch, commit, and PR./task-pipeline or /review-cycle run that
owns the branch and PR — commit to the branch the caller established;
do not mint a second one.Read docs/PR_GUIDELINES.md before
composing any commit message or PR title. It is authoritative; the rules
below are a reminder.
type(scope): subject, max 69 characters total.type ∈ feat fix chore ci docs test refactor perf style build revert.scope is required, ^[a-z0-9-]+$, max 10 chars, not a type name.
(phase-space is 11 chars → rejected; use phase.)subject starts alphanumeric, no trailing . or space, lowercase
first word by convention.The scope table lives in the guidelines file — read it there rather than inventing a one-off scope.
git status and git diff to see what will be committed.git log --oneline -n 10 for recent commit style.CHANGELOG.md.projects/<slug>/PLAN.md status: to Complete, the PR must carry
the VERSION bump in hazma/__init__.py and a CHANGELOG.md entry.
/execute-single-task Step 8 is the canonical place to do it; if you
arrive here with a closing diff that lacks it, stop and add it.master, create a new branch. Never commit
directly to master. The trunk here is master, not main.Branch naming (parse both agent prefixes; create with claude/):
claude/<project-slug>/<task-slug>. The slash
separator is load-bearing — review-pr and task-pipeline parse it.claude/<short-description>.Run it before you stage anything:
scripts/agents/preflight.sh --paths "<touched paths>" \
--tests "<test targets>" [--md "<changed .md files>"] [--closing]
See preflight.md for the
rationale, the zero-collection trap, and the manual fallback. There are
no pre-commit hooks in this repo, and CI's lint pass is narrow
(ruff check --isolated --select E9,F63,F7,F82, with no formatting check
at all) — so this gate catches far more than CI will. A non-zero exit is
a blocked commit; a WARN row is an unrun gate, not a pass.
If the diff touched .pyx / .pxd / _build.py, rebuild
(pip install -e .) before the gate, not after.
Stage only the files relevant to the change. Do not git add -A
blindly — it sweeps in scratch files, build artifacts, editor configs,
or secrets. Compiled .c / .so output is never committed.
Compose the header and validate it before committing:
scripts/agents/check_pr_title.py "type(scope): subject"
Deterministic — do not eyeball the 69-char count. For complex changes, add a body (blank-line-separated) explaining the "why".
Branch/worktree assertion, immediately before git commit: confirm
git rev-parse --abbrev-ref HEAD is the intended branch (never
master) and git rev-parse --show-toplevel is the intended
worktree. The Bash-tool cwd can reset between calls, so prefer
git -C <worktree> with an absolute path.
The critical path is sequential: edit → rebuild → gate → read → stage → commit → push → verify. Never batch these in one parallel tool block.
git push -u origin HEAD, then verify: git rev-parse HEAD must equal
git rev-parse origin/<branch>.
Open with gh pr create --base master. The title is the validated
header from Step 5.
PR body:
## Summary
<1-3 bullets describing what changed and why>
## Test plan
- [ ] <command(s) you ran, with the real output pasted>
The Test plan quotes real command output (the pytest summary line,
a REPL evaluation) or cites the task note's ## Verification section —
never invented counts.
Reconcile the ## Summary bullets against git diff --stat: every
claim must map to a change in the diff.
If any returned value moved, say so explicitly in the Summary, with the function, the magnitude, and which value is right. Do this even when the tests stayed green because a tolerance absorbed the shift.
For project work, add a ## Project section between Summary and Test
plan:
## Project
`projects/<slug>/` — Task N: <title>.
See `projects/<slug>/task-notes/task-N-<slug>.md` for detail.
(Phased: task-notes/phase-XX/task-X.Y-<slug>.md.) Put task IDs, issue
links, and extra context in the body, never in the title. For reverts,
add a Refs: trailer linking the original PR.
gh pr checks <N> --watch --fail-fast
If a check fails, read the failure and either fix it (new commit → push, back through Steps 4–6) or, if the fix is out of scope, report the failing check to the caller. Do not declare done on a red PR.
Title passed check_pr_title.py; body has ## Summary + ## Test plan
(+ ## Project for project work); branch matches the naming policy; the
push verified; CI green or its failure reported.
git push rejected (diverged). git fetch origin, rebase onto
origin/<branch>, re-run the preflight gate, re-push. Never
--force. If the divergence is not clearly yours, stop and report.git reset --soft origin/<branch>
then create a fresh commit — do not --amend a pushed commit.gh pr create says a PR already exists. Use gh pr edit /
gh pr view on the existing PR.STATUS: Pushed | PR opened | Committed-only | Failed
BRANCH: <branch name>
COMMIT_SHA: <short sha>
PR_URL: <url or n/a>
TITLE: <final PR title>
Committed-only = the commit landed but the push or PR did not;
Failed = the gate or commit itself blocked. Report the reason in prose
above the block.
master directly; never --no-verify..env, credentials,
tokens, *.pem) or build output (*.c, *.cpp, *.so, build/).git add -A; stage the specific files you intended.git diff --stat.