---
name: devxkit-pr-reporting
description: Use devxkit agent ops pr-report and scorecard correctly before and after merge.
scope: global
devxkit_commands:
  - devxkit agent ops pr-report
  - devxkit agent ops pr-create
  - devxkit agent ops delivery-publish
---

# devxkit pr reporting

For ordinary PRs use native `gh pr view` / `gh pr checks` and exact-head CI.
The prepared-slice commands below are frozen DIL compatibility, not mandatory
steps or a requirement for Delivery Packs.

## When to use

- Before merge: confirm PR body readiness, CI state, and merge eligibility
- After push: verify GitHub sees the correct PR for the slice
- Post-merge from the configured base (default `main`): confirm `already_merged` with explicit PR number

## Preconditions

- Slice prepared under `.agent-runs/<issue>/` with `metadata.toml` and filled `pr-body.md`
- Feature branch pushed when querying remote state (without `--local-only`)

## Commands

```bash
devxkit agent ops pr-report <issue>
devxkit agent ops pr-report <issue> --json | jq '.scorecard'
devxkit agent ops pr-report <issue> --local-only --json | jq '.scorecard'

git push -u origin "$(git branch --show-current)"
devxkit agent ops pr-create <issue>
devxkit agent ops delivery-publish <issue> --body-file .agent-runs/<issue>/delivery-pack.md
devxkit agent ops pr-report <issue> --json | jq '.scorecard, .pr_resolution'

# Post-merge from the configured base when branch/PR ambiguity exists:
devxkit agent ops pr-report <issue> --pr <number>
devxkit agent ops pr-report <issue> --pr <number> --json | jq '.scorecard, .pr_resolution'
```

## Validation

Scorecard semantics:

| `overall` | Meaning |
|-----------|---------|
| `ready` | Checks passed, body ready — **merge allowed** when `merge_ready=true` |
| `waiting_for_checks` | CI pending — wait, do not merge |
| `not_ready` | Body/checks/blockers fail — fix first |
| `already_merged` | Post-merge informational state |
| `missing_pr` | No PR found for slice — create with `pr-create` |
| `closed` | PR closed without merge — investigate |

- `--local-only` never reports merge-ready against remote CI
- PR resolution prefers `target_branch` from slice metadata over current branch
- `pr-create` creates Draft by construction; it reuses only an existing open Draft PR
- `delivery-publish` requires one marker and exact local/remote/pack branch and HEAD identity;
  it updates one canonical comment by ID and refuses duplicate canonical comments

## Common failures

- **Ambiguous PR after merge** → pass `--pr <number>` while on the configured base
- **Merge with pending CI** → `waiting_for_checks`; poll until `ready` or CI green
- **PR body NOT READY** → edit `.agent-runs/<issue>/pr-body.md`; remove template placeholders
- **Wrong branch** → ensure you are on `feature/<issue>-*` for pre-merge reports

## Stop conditions

- Do **not** merge when `overall` is `waiting_for_checks`, `not_ready`, or `missing_pr`
- Do **not** merge with red CI or empty/unfilled PR body
- Require `merge_ready=true` and `overall=ready` before squash merge

## Related skills

- `devxkit-agent-flow`, `devxkit-usage-observability`
