--- name: implement-pr description: "Sub-skill of agile-10-implement. Open (off base/main) or update the PR for the ticket's pushed branch, linked to the Jira Story, with AC coverage + ADR-compliance sections. This skill β€” not implement-code β€” owns opening the PR. Posts the πŸ€– pr marker. Not user-invoked." user-invocable: false --- # implement_pr ## Host execution **Claude Code:** retain the agent-dispatch and concurrency behavior defined below. **Codex:** use only the inline behavior stated here. On Codex this sub-skill runs inline under `agile-10-implement` with `concurrency=0`; never spawn or assume a named agent. Perform its full gate and return its normal receipt to the caller. ## Purpose PR phase for `agile-10-implement`, invoked after `implement-code` pushed the branch. **This skill owns opening the PR**, off ``. Idempotent β€” it updates an existing open PR rather than opening a duplicate. **Autonomous β€” never prompt the user.** This phase makes no product or design decisions: the build is done and it only describes it, so there is no critical-decision path here. Where the diff and the plan disagree, say so in the PR body and continue. This holds in `concurrency=0` inline mode too, where no agent wraps this skill. ## Source the body from the real diff The build is already done; this phase only describes it. Build the body from **the actual pushed diff** (`gh pr diff` / `git diff ...HEAD`) plus the ticket's `πŸ€– agile:phase=plan` and `πŸ€– agile:phase=implement` comments: the plan's ACβ†’test map β†’ **AC coverage** and **Testing**; the diff's files β†’ **Changes**; the plan's flagged decisions and the `implement` comment's noted deviations β†’ **ADR compliance**. Where the diff diverges from the plan, say so in the body β€” do not paper over it. ## Open or update `gh pr list --state open --head --json number,url` β†’ found: `gh pr edit` (refresh title/body); none: `gh pr create --base `. **Staging the body through a file? Name it for the ticket** (`pr-.md`, never `pr.md`) β€” concurrent phase agents share one temp dir, so a generic name lets a sibling's overwrite publish its ticket's body under yours. **Then verify what actually landed:** `gh pr view --json body` and confirm the ticket key is yours. `gh` reports success on the bytes it was handed, not on the ones you meant to write β€” a body naming another ticket is the one defect the author is structurally unable to notice. **Title:** `[TICKET] ` **Body sections:** - **Story** β€” link to the Jira ticket. - **What this PR does** β€” 2–3 sentences from the plan's intent. - **AC coverage** β€” each AC β†’ the test that covers it, confirmed against the committed tests. - **Changes** β€” files/modules touched and why, reconciled with the real diff; flag any addition or omission versus the plan. - **Testing** β€” unit / integration / manual, and the edge cases covered. - **Test tiers** β€” read the `agile:phase=implement` marker's `Mode` + gate receipt. Sequential: `Verified locally: lint + unit + integration + fresh-DB migration.` Concurrent: `Verified locally: lint + unit + typecheck (stack-free, worktree). Deferred to CI: integration + e2e + fresh-DB migration (concurrent build β€” CI is the gate).` This tells the merge train exactly which tiers CI must confirm. - **Specs UI match** β€” states implemented, plus any deviation and its reason (UI Stories). - **ADR compliance** β€” new decisions or libraries introduced, each flagged for the reviewer. - **Checklist** β€” ACs tested Β· lint/type clean Β· no regressions Β· linked to Jira Β· Specs UI match Β· ADR compliance Β· test tiers stated. **Label a concurrent build** β€” when the `implement` marker's mode is `concurrent`, `gh pr edit --add-label integration-deferred` (create the label once if the repo lacks it). That label is the machine-readable signal `agile-11-merge-train` reads to know integration + e2e were not run locally. Sequential PRs carry no label. Post `πŸ€– agile:phase=pr` with the PR URL (noting the label on a concurrent build) and return the PR number. This phase does **not** transition the Story β€” the orchestrator transitions to `In Review` only after `implement-review` approves, and never to `Done`. ## Marker β€” mandatory, exact format Post via `mcp__atlassian__addCommentToJiraIssue` (`contentFormat="markdown"`). The comment **must begin with the literal HTML comment** or resume detection (which greps `πŸ€– `) misses it and the phase re-runs. Never delete prior markers. ``` πŸ€– **pr β€” agile-10-implement β€” ** ```