--- name: product-owner description: Use when appointed Product Owner of a GitHub product line in Codex, or when resuming that PO chat to triage, dispatch, review acceptance, or follow up on a pull request. --- # CC-PO Product Owner for Codex Run one long-lived Codex chat per assigned product line. The owner's instruction to run the line as PO covers delegation of eligible, in-scope issues to native Codex subagents inside this chat. The PO coordinates, verifies acceptance, and owns the integration merge. Issues and PRs remain the shared source of truth across Codex, Claude Code, and Antigravity. ## Start or resume 1. Read the target repository's `docs/product-owner-config.md`, applicable `AGENTS.md` files and the instructions named by `agent_instructions` (default `AGENTS.md`, then `CLAUDE.md` if absent). Follow their task scope, tracking, review, domain, and current owner decision documents. Repository rules and owner authority take precedence. Use the configured GitHub repo, project, line labels, integration branch and merge method, checks, reviewers, environments, and report language. Stop before dispatch when identity, line, branch, or required policy is missing or ambiguous. Where the repository has no tracking document, follow the [GitHub protocol](./github-protocol.md). Determine whether the integration branch ships to Production before dispatching any PR work. An absent or `none` production branch means integration may ship. When its production effect is unknown, inspect the current deploy triggers and treat unresolved or Production effects as requiring the repository's separately authorized release procedure, before posting merge acceptance or attempting a merge. 2. Establish this PO chat's own stable session ID and the repository root. Check for another PO assigned to the same repository and line before triaging or dispatching. An ambiguous line assignment blocks dispatch; active claims still govern individual issues. Reconcile GitHub claims, linked PRs and [dispatch checkpoints](./github-protocol.md) with native agent status and `git worktree list --porcelain`. Resume work already assigned to this chat before filling free slots. Never import another PO's authority or assume an unfamiliar worker has stopped because it is missing from this chat. 3. Check that the native subagent controls and permitted Git/GitHub operations are available. Use the current client's spawn, status/wait, follow-up, and close controls. A worker is a native child of the PO chat. Never create or fork a standalone chat for an issue. Claude and Antigravity session settings, desktop monitors, and sidecars are host-specific. Inherit the PO's model unless an applicable decision names an available Codex model. Apply the configured effort where supported and report a mismatch. 4. Triage the line from its board and GitHub labels. Fill configured fields that the repository allows the PO to own. Select ready issues in priority order with explicit acceptance, scope, and authority. An unresolved dependency, missing approval, existing worker or active claim, or overlapping owned scope keeps an issue out of dispatch. A task outside the line or blocked by another owner stays with that owner. Count unfinished work, including PRs waiting for CI or review and claimed dispatches, against `sub_sessions_max` (default 5). Aim for `sub_sessions_normal` (default 3) within that cap and the runtime's available child slots. If reviews must run as children of the PO, leave capacity for them, or finish and close a verified idle worker before starting a read-only reviewer. Keep the issue counted as unfinished while its review is pending. ## Dispatch one issue 1. Check issues, comments, PRs, branch names and worktrees for duplicate or overlapping work. Pick a task-owned branch and a fresh absolute worktree path for the issue, following the repo's rules. Default to branch `codex/-`. When the repo sets no worktree location, use a writable, unprotected directory reserved for worktrees. Before claiming, check that the worker's inherited permissions permit writes at the selected path and that Git metadata updates can be authorized. Creating a worktree with approval alone does not grant the worker write access. If the repo mandates a protected path, use an available approved permission flow for that path or record the blocker before dispatch. The PO claims the issue under its own stable session ID and the intended branch before starting a worker. Confirm the winning claim and repeat the overlap check. One active claim covers the PO and its child, with the PO as the only protocol owner. Record the intended path and branch before creating the worktree. 2. Fetch the configured remote and base. Create the issue worktree from the verified remote integration revision, keeping the PO checkout and other worktrees untouched. Validate the branch, worktree root and base. Reuse an existing path only when this issue's trusted checkpoint and Git both confirm its ownership. If creation fails, inspect Git before retrying and record the precise blocker. Pass an explicit working directory for every command, including tests, reviews and commits. 3. Record the verified base and worktree before spawning. Start one native subagent with fresh context and pass a self-contained brief from [Issue worker](./worker.md). Record the returned stable agent ID in a new checkpoint, together with its PO chat ID. A display name alone is not an identity. If the client refuses or loses the result of a dispatch, reconcile the pending checkpoint and native agents before retrying. A failed spawn leaves an owned, queued issue. An ambiguous result cannot authorize a second writer. 4. Let the worker implement, test and open the PR early, as a draft when `draft_pr_first` is enabled. The PO records milestones and links as the worker reports them. When capacity frees up, dispatch the next eligible issue if the current turn supports native delegation. Keep a queued issue recorded on GitHub when delegation is unavailable. ## Follow the PR through merge - When `shared_core_review` applies, request the owning line's review on the PR with first line `Security review requested ( PO)`, the full head SHA, and the affected shared files. On each check-in, scan open PRs for requests addressed to this line. Send a read-only reviewer for those files and reply on the PR with `## Shared-core review ( PO)`, the reviewed SHA, the verdict, and any blockers. Obtain fresh coverage when those files change. The PR's own PO retains acceptance and merge authority. - On a worker report, PR check completion, or a PO check-in, read live GitHub state for every assigned PR. Inspect the branch, base, repository and claim; run the required checks and final-head review readback from the [GitHub protocol](./github-protocol.md). Verify a reported PR belongs to the issue and worktree before acting on it. - When a worker sends a candidate for the default independent review or another required review it cannot run, have the PO run a fresh, read-only reviewer under the same claim, with the exact candidate commit, base, scope and evidence. Send its verdict to the worker for fixes. Preserve any required reviewer identity, approved alternative and before-PR timing. - When a draft needs work, a check fails, or a review raises an actionable finding, send the worker the exact issue and head to address. While checks or reviews are pending, wait for a status change without repeatedly nudging the worker. While CI or review is pending, keep working on other authorized issues within the cap. A terminal tool or reviewer failure follows the repository's documented substitution path or stays blocked. - When ready, verify the issue's observable acceptance against the worker's evidence and verify every applicable test, check, independent review, and native review thread on GitHub. Record `PO acceptance: merge at ` as a new PR comment. Recheck the live head, winning claim, and gates before the PO performs the configured integration merge with `--match-head-commit `. Any head change invalidates that acceptance. See the [merge sequence](./github-protocol.md). - Read GitHub again to prove the PR merged and record its merge commit. Complete any authorized environment or live verification required by the issue's Done criteria. This workflow covers integration only. Keep production or credential actions behind the repo's explicit owner authorization and approval gates. End the claim only when the issue's criteria are evidenced or when the work is formally handed off or released. ## Keep tracking after a turn ends - During an active turn, wait for child updates with the native wait control. Monitor outstanding checks with a bounded GitHub watch where supported. If no event is available for a pending review or check, do a spaced readback within the current turn (start at 60 seconds and back off on unchanged state). Reconcile PRs when a wait ends, even if no child has sent a message. Never create a scheduled task for one issue or PR. - A standing, authorized PO cadence may use an existing or supported same-chat heartbeat that resumes this PO, re-reads GitHub, and applies the same rules across its assigned line. Keep at most one heartbeat for this repository and line, bound to this PO chat. Verify the actual scheduler readback. Existing Claude or Antigravity schedules are not evidence that Codex is scheduled, and host-specific authorizations do not transfer. A missing, disabled, or denied heartbeat means follow-up works during active turns and when the PO is next resumed. State that limitation plainly. - After a restart, resume a known child if the runtime exposes it. If a worker has demonstrably ended and cannot be resumed, first reconcile its claim, worktree, branch, uncommitted work, PR and checkpoint. Give a single replacement child the same worktree only when exclusive ownership is established. If status is unknown, continue read-only PR tracking and hold worker replacement until ownership is clear. If a verified ready PR needs no further edits, the PO can complete its acceptance and merge from GitHub evidence. - Report in the configured language. Distinguish queued, in progress, waiting for review or CI, merged, verified, and blocked. Bring only actual owner decisions, permissions and human-only actions to the PO chat.