Commit pr

From ZaxbyHub/opencode-swarm · View interactive version

Commit pr is an AI agent skill from the GitHub repository ZaxbyHub/opencode-swarm. Mandatory Codex/Copilot publication adapter for opencode-swarm. Use for every GitHub issue assignment that results in code changes, commits, pushes, draft PRs, PR body edits, PR readying, release notes, or CI closeout. Must be loaded before `git push`, `gh pr create`, `gh pr edit`, or `gh pr ready`.

How to use this skill

Skill file

Commit & PR

Use this skill for Codex-side publication work in opencode-swarm.

Source Of Truth

Read and follow CODE0 in full before committing, pushing, opening, or updating a PR.

That Claude skill remains the repository's canonical publish protocol. This Codex-native skill is the adapter layer: it tells Codex which tools to use, how to handle existing PRs, and how to finish the post-open lifecycle without drifting from the repo contract.

If instructions conflict:

  1. AGENTS.md
  2. docs/engineering-invariants.md
  3. ../../../.claude/skills/commit-pr/SKILL.md
  4. this file

Codex Execution Rules

Publish Modes

Infer the mode from the user request and branch state:

Required Follow-Through

Existing PR updates

If the branch already has a PR:

review threads/comments, requested-changes reviews, CI/check failures,

mergeability/conflicts, and whether check data belongs to the current head SHA

Draft vs ready

Default behavior:

If the user explicitly asks for a ready PR sooner, obey that request and document any remaining CI state clearly.

Remote checks are authoritative

When the user asks to open, ship, ready, or close out a PR:

  1. inspect remote checks with gh pr view <n> --json statusCheckRollup,... or gh pr checks <n>
  2. verify check data belongs to the current headRefOid after every follow-up push
  3. if a required job is cancelled and downstream jobs are skipped, inspect the run and rerun failed/cancelled jobs
  4. if an obsolete older-head run is already failed or still consuming concurrency, inspect it before cancellation and cancel only when it is no longer the PR head under validation
  5. wait for required checks to finish when practical
  6. after conflict resolution, verify GitHub reports both mergeable: MERGEABLE and mergeStateStatus: CLEAN; local conflict-marker cleanup is not enough, and branch drift must appear in the closure ledger when it affected the PR
  7. when gh pr checks looks stale, inspect the workflow run directly with gh run view <run-id> --json headSha,status,conclusion,jobs,url, and keep watching downstream integration/smoke jobs after unit jobs pass
  8. if you edit the PR body after checks are green, expect PR Standards/title checks to rerun and re-check before calling the PR green
  9. do not call the PR merge-ready while a required check is cancelled, skipped, in_progress, or otherwise non-green unless the user explicitly accepts that state

Recommended commands:

gh pr view <number> --json body,headRefName,headRefOid,isDraft,mergeable,mergeStateStatus,state,statusCheckRollup,url
gh pr checks <number> --watch --fail-fast
gh run view <run-id> --json headSha,status,conclusion,jobs,url
gh run rerun <run-id> --failed

dist/ is generated output and is not committed (#1047); do not stage it and there is no dist-check drift gate. If package-check fails, inspect the CI log: it is a source / build / package.json#files problem (an incomplete or unbuildable tarball), not generated-file drift. Fix the source or manifest and rerun bun run package:smoke locally.

After a forced install on Windows, EPERM while reading refreshed node_modules

is usually host friction; rerun the exact focused command with approved access

before treating it as a code failure.

Issue comment requirement

If the PR closes an issue:

Working Pattern

  1. Read AGENTS.md, docs/engineering-invariants.md as needed, and the canonical Claude commit-pr skill.
  2. Run the required local validation from the canonical skill.
  3. Stage only intended files.
  4. Create or update the PR.
  5. Refresh PR body text if the branch changed after review feedback.
  6. Watch remote checks to a useful conclusion when the user asked for publication or closeout.
  7. Verify issue comments, ready/draft state, and merge-readiness claims before finishing.

Clean-Main And CI Reality Checks

When local validation is noisy or host-limited:

Final Sanity Check

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.