Ship Toolbox
Ship one completed toolbox change from the synchronized main branch through
validation, an explicit scoped commit, remote verification, relevant CI, local
setup, and installed-state verification. Treat invocation as authorization for
this task-scoped sequence only.
Boundaries
- Operate only in the
jialuohu/codex-toolbox repository identified by
CODEX_TOOLBOX_ROOT, its Git root, and its origin remote.
- Use
main with upstream origin/main. Do not create or switch branches,
pull requests, tags, or releases.
- Do not rebase, amend, force-push, reset, revert automatically, or rewrite
published history.
- Never stage unrelated work. Never use
git add . or git add -A.
- Never commit secrets, OAuth state, API keys, credentials, environment-file
contents, generated runtime state, or private paths.
- Stop when scope, repository identity, ownership of a change, or recovery
state is ambiguous.
1. Establish Repository and Recovery State
- Resolve the Git root and confirm the normalized
origin is exactly
jialuohu/codex-toolbox.
- Confirm the current branch is exactly
main and its upstream is
origin/main.
- Fetch
origin/main, then inspect ahead/behind counts with
git rev-list --left-right --count origin/main...HEAD.
- Stop if
main is behind or diverged. Do not pull, merge, or rebase.
- Require synchronized
main for a new release. Permit an ahead-only state
solely as push-failure recovery when every unpushed commit is clearly part
of the active task; otherwise stop.
- Inspect status plus staged and unstaged diffs. Derive an explicit
task-scoped path and hunk list from the active request. Preserve clearly
unrelated changes unstaged; stop for ambiguous mixed changes or overlapping
hunks.
2. Validate the Exact Release Scope
Run all repository gates before a new commit:
- Parse marketplace, plugin, MCP, and other changed JSON files.
- Run
git diff --check and shell syntax checks for changed shell scripts.
- Run
python3 scripts/check-codex-toolbox-setup.py.
- Run
scripts/privacy-audit.sh current.
- Run the affected plugin's validators, unit tests, contract tests, and
integration tests when present.
- Run the full repository suite with
python3 -m unittest discover -s tests.
When unrelated worktree changes exist, stage only the task-scoped paths and
hunks first, export the index to a temporary Git-backed snapshot, and run gates
that would otherwise observe the dirty worktree against that exact snapshot.
Do not weaken a gate because an unrelated change makes the working tree fail.
Do not push when any required gate fails.
3. Stage, Review, Commit, and Push
- Stage only explicit paths with
git add -- <path>.... Use interactive hunk
staging for a shared file when needed.
- Review
git diff --cached --name-status, the staged diff, and
git diff --cached --check. Confirm every staged hunk belongs to the task.
- Derive a concise Conventional Commit message from the staged intent.
- If the staged diff is non-empty, commit and run
git push origin main
without requesting another confirmation; explicit invocation already
authorizes these task-scoped actions.
- Verify
git rev-parse HEAD exactly matches git ls-remote origin refs/heads/main.
If there is no staged change, do not create an empty commit. When local and
remote main already match, continue directly to refresh verification. In an
approved push-failure recovery state, push the existing verified commit rather
than creating another commit.
4. Require Remote Evidence
- Locate relevant GitHub Actions runs for the pushed SHA when
gh is
authenticated and applicable workflows exist.
- Wait for the relevant runs to complete. Continue only after they succeed.
- If CI fails, report the commit SHA, run URL, failing job, and available log
evidence. Stop before local refresh; do not revert or rewrite the push.
- If no relevant workflow exists, state that explicitly and continue without
claiming CI passed.
5. Refresh and Verify Locally
- Run
scripts/setup-codex-toolbox.sh from the committed tree. If unrelated
worktree changes remain, use a clean export of HEAD so they cannot enter
local configuration.
- Verify
codex plugin marketplace list --json reports
jialuo-codex-toolbox with sourceType equal to git, source
https://github.com/jialuohu/codex-toolbox.git, and ref main when shown.
- Verify
codex plugin list --marketplace jialuo-codex-toolbox --json reports
every affected plugin installed, enabled, and at its expected version.
- Verify newly added skill files exist under the installed plugin source.
- Require
codex mcp list to succeed. If third-party marketplace management
changed, verify those marketplace plugin lists too.
Do not remove a live runtime lock or terminate an active service to force setup.
Ask the user to close the owning task, then rerun setup from the same committed
SHA.
Failure and Reinvocation Scenarios
- Wrong branch: Stop without staging, committing, pushing, or refreshing.
- Behind or diverged: Stop and report the counts; never repair history
automatically.
- Ambiguous mixed changes: Stop and request an exact scope. Keep unrelated
paths and hunks unstaged.
- No-change refresh: When
HEAD equals origin/main, skip commit and push,
then rerun setup and installed-state verification.
- Push failed: Keep the local commit. On reinvocation, validate and push
that same ahead-only commit without an empty follow-up commit.
- CI failed: Report the published SHA and failure, withhold setup, and
resume from CI verification after a task-scoped fix is published.
- Post-push setup failed: Report remote and CI success separately from the
incomplete local refresh. On reinvocation, rerun setup and verification for
the same SHA without committing again.
- Privacy or test gate failed: Stop before commit and identify the failing
gate without bypassing it.
Completion Receipt
Report the commit subject and SHA, push target, remote-SHA match, relevant CI
result and URL, setup result, affected installed plugin versions, Git-backed
marketplace evidence, MCP-list result, and any preserved unrelated changes or
remaining uncertainty.
1---2name: ship-toolbox3description: Use only when explicitly invoked as $ship-toolbox to validate and publish task-scoped toolbox changes, then refresh the local marketplace.4---56# Ship Toolbox78Ship one completed toolbox change from the synchronized `main` branch through9validation, an explicit scoped commit, remote verification, relevant CI, local10setup, and installed-state verification. Treat invocation as authorization for11this task-scoped sequence only.1213## Boundaries1415- Operate only in the `jialuohu/codex-toolbox` repository identified by16 `CODEX_TOOLBOX_ROOT`, its Git root, and its `origin` remote.17- Use `main` with upstream `origin/main`. Do not create or switch branches,18 pull requests, tags, or releases.19- Do not rebase, amend, force-push, reset, revert automatically, or rewrite20 published history.21- Never stage unrelated work. Never use `git add .` or `git add -A`.22- Never commit secrets, OAuth state, API keys, credentials, environment-file23 contents, generated runtime state, or private paths.24- Stop when scope, repository identity, ownership of a change, or recovery25 state is ambiguous.2627## 1. Establish Repository and Recovery State28291. Resolve the Git root and confirm the normalized `origin` is exactly30 `jialuohu/codex-toolbox`.312. Confirm the current branch is exactly `main` and its upstream is32 `origin/main`.333. Fetch `origin/main`, then inspect ahead/behind counts with34 `git rev-list --left-right --count origin/main...HEAD`.354. Stop if `main` is behind or diverged. Do not pull, merge, or rebase.365. Require synchronized `main` for a new release. Permit an ahead-only state37 solely as push-failure recovery when every unpushed commit is clearly part38 of the active task; otherwise stop.396. Inspect status plus staged and unstaged diffs. Derive an explicit40 task-scoped path and hunk list from the active request. Preserve clearly41 unrelated changes unstaged; stop for ambiguous mixed changes or overlapping42 hunks.4344## 2. Validate the Exact Release Scope4546Run all repository gates before a new commit:47481. Parse marketplace, plugin, MCP, and other changed JSON files.492. Run `git diff --check` and shell syntax checks for changed shell scripts.503. Run `python3 scripts/check-codex-toolbox-setup.py`.514. Run `scripts/privacy-audit.sh current`.525. Run the affected plugin's validators, unit tests, contract tests, and53 integration tests when present.546. Run the full repository suite with55 `python3 -m unittest discover -s tests`.5657When unrelated worktree changes exist, stage only the task-scoped paths and58hunks first, export the index to a temporary Git-backed snapshot, and run gates59that would otherwise observe the dirty worktree against that exact snapshot.60Do not weaken a gate because an unrelated change makes the working tree fail.61Do not push when any required gate fails.6263## 3. Stage, Review, Commit, and Push64651. Stage only explicit paths with `git add -- <path>...`. Use interactive hunk66 staging for a shared file when needed.672. Review `git diff --cached --name-status`, the staged diff, and68 `git diff --cached --check`. Confirm every staged hunk belongs to the task.693. Derive a concise Conventional Commit message from the staged intent.704. If the staged diff is non-empty, commit and run `git push origin main`71 without requesting another confirmation; explicit invocation already72 authorizes these task-scoped actions.735. Verify `git rev-parse HEAD` exactly matches `git ls-remote origin74 refs/heads/main`.7576If there is no staged change, do not create an empty commit. When local and77remote `main` already match, continue directly to refresh verification. In an78approved push-failure recovery state, push the existing verified commit rather79than creating another commit.8081## 4. Require Remote Evidence8283- Locate relevant GitHub Actions runs for the pushed SHA when `gh` is84 authenticated and applicable workflows exist.85- Wait for the relevant runs to complete. Continue only after they succeed.86- If CI fails, report the commit SHA, run URL, failing job, and available log87 evidence. Stop before local refresh; do not revert or rewrite the push.88- If no relevant workflow exists, state that explicitly and continue without89 claiming CI passed.9091## 5. Refresh and Verify Locally92931. Run `scripts/setup-codex-toolbox.sh` from the committed tree. If unrelated94 worktree changes remain, use a clean export of `HEAD` so they cannot enter95 local configuration.962. Verify `codex plugin marketplace list --json` reports97 `jialuo-codex-toolbox` with `sourceType` equal to `git`, source98 `https://github.com/jialuohu/codex-toolbox.git`, and ref `main` when shown.993. Verify `codex plugin list --marketplace jialuo-codex-toolbox --json` reports100 every affected plugin installed, enabled, and at its expected version.1014. Verify newly added skill files exist under the installed plugin source.1025. Require `codex mcp list` to succeed. If third-party marketplace management103 changed, verify those marketplace plugin lists too.104105Do not remove a live runtime lock or terminate an active service to force setup.106Ask the user to close the owning task, then rerun setup from the same committed107SHA.108109## Failure and Reinvocation Scenarios110111- **Wrong branch:** Stop without staging, committing, pushing, or refreshing.112- **Behind or diverged:** Stop and report the counts; never repair history113 automatically.114- **Ambiguous mixed changes:** Stop and request an exact scope. Keep unrelated115 paths and hunks unstaged.116- **No-change refresh:** When `HEAD` equals `origin/main`, skip commit and push,117 then rerun setup and installed-state verification.118- **Push failed:** Keep the local commit. On reinvocation, validate and push119 that same ahead-only commit without an empty follow-up commit.120- **CI failed:** Report the published SHA and failure, withhold setup, and121 resume from CI verification after a task-scoped fix is published.122- **Post-push setup failed:** Report remote and CI success separately from the123 incomplete local refresh. On reinvocation, rerun setup and verification for124 the same SHA without committing again.125- **Privacy or test gate failed:** Stop before commit and identify the failing126 gate without bypassing it.127128## Completion Receipt129130Report the commit subject and SHA, push target, remote-SHA match, relevant CI131result and URL, setup result, affected installed plugin versions, Git-backed132marketplace evidence, MCP-list result, and any preserved unrelated changes or133remaining uncertainty.