GH Issue PR Flow
Purpose
Use GitHub issues as the working brief for this repo. This skill covers four related jobs:
- pick the right issue to work on
- rewrite vague issues into proper issues, epics, and sub-issues
- implement issue-backed work on a fresh branch from
dev
- choose single-PR vs stacked-PR shape
- open and maintain clean PRs with good GitHub hygiene
Do not treat every issue as immediately buildable. First decide whether it is a good leaf issue, a parent issue, a research item, or something that should be rewritten before coding.
Critical rules
- Treat the issue body as the initial problem statement or prompt.
- Read the full issue body, labels, state, linked metadata, and comments before coding. Do not rely on
gh issue view --comments alone when deciding scope.
- Prefer actionable leaf issues over epics. Epics are containers unless the user explicitly asks for backlog cleanup or epic design work.
- If the user says “pick an issue” or “work on something manageable”, use the project board and the issue-selection rules in
references/issue-selection.md before choosing.
- If an issue is mushy, multi-part, or mixes discovery with implementation, rewrite or split it before coding.
- When rewriting an existing issue, preserve the user's original text at the bottom under
## Original issue text as a blockquote.
- New or rewritten issues should follow the writing rules in
references/issue-writing.md.
- If PR or release work touches GitHub Actions, artifact uploads, or release packaging, check
references/actions-artifact-retention.md so workflow changes match the repo's storage policy.
- Start new work from fresh
dev. For single PRs, create a normal branch from dev; for stacked work, initialize the stack with --base dev.
- Open PRs back into
dev, not main, unless the user explicitly says otherwise. In stacked mode, the bottom PR ultimately targets dev and upper PRs target the layer below.
- If the issue asks for discussion first or is clearly not actionable yet, stop and explain instead of forcing implementation.
- Choose the PR shape deliberately: small related changes should usually become layers in a stack; big unrelated features should be separate PRs or separate stacks; GitHub epics usually become a stacked PR series rather than one giant PR.
- Use the
gh-stack skill as the operating manual when stacked PR mode is selected; this skill owns the issue/PR policy and stack-vs-single decision.
- Only use auto-closing keywords such as
Closes #123 for issues that are fully resolved by the PR. Use Refs #123 for anything partial. In stacked mode, use Refs on intermediate layers and reserve Closes for the layer/PR whose merge completes the issue.
- Before opening or updating a PR, update
docs/changelog.md unless the PR is genuinely changelog-free. Err on the side of including user-visible fixes, dependency updates, packaging/release changes, website changes, and workflow changes. The changelog is optimistic: the top section is the current dev release and normally stays one version above latest stable.
When to use
- The user gives issue numbers like
#123 or 123.
- The user sends issue or PR links.
- The user sends the GitHub project link or asks what should be worked on next.
- The user asks you to pick a manageable issue.
- The user asks you to rewrite, relabel, split, or organize issues.
- The user asks to create an issue from the current conversation.
- The user asks to open, update, or finish a PR with
gh.
- The user asks to check or act on Codex review feedback.
Do not use when
- The task is explicitly local-only and not tied to GitHub.
- The issue is really a discussion starter, discovery task, or wishful idea that cannot be implemented yet.
- The request would need destructive repo actions beyond the normal branch and PR flow without explicit confirmation.
- The user wants a broad product strategy conversation with no intent to track or implement work yet.
Inputs expected
Required
- An issue number, issue URL, PR URL, project URL, or explicit request to create or rewrite issues.
Optional
- Related issues to close or reference.
- A preferred branch name or PR title.
- Review findings from the user's
/review command.
- Existing Codex review comments on the PR.
- A preference such as “pick something small”, “pick a P0”, or “just clean up the issues”.
Prerequisites
gh is authenticated for this repo.
- The repo has an up-to-date
dev branch locally and on origin.
- Use
gh for issue and PR operations unless the user explicitly wants browser-only handling.
- If the user asks for project-board triage,
gh must also have project scopes.
- This repository's working branch is
dev; open PRs into dev unless the user explicitly says otherwise.
Workflow
1. Resolve the work mode
- If the user is describing a problem that should become tracked work, create or rewrite issues first.
- If the user gives an issue number or link, use the fuller JSON issue command first so the body, labels, state, and comments are all visible; then read everything relevant.
- If the user gives a PR link, read the PR state, description, and comments before acting.
- If the user asks what should be worked on next, inspect the project board and apply
references/issue-selection.md.
Useful commands:
gh issue view <number-or-url> --comments --json number,title,state,body,comments,labels,assignees,projects,milestone,url
gh pr view <number-or-url> --comments
gh project item-list 3 --owner IgorWarzocha --limit 100 --format json
Avoid the shorter gh issue view <number> --comments as the first read: it can make you skim comments/output and miss issue metadata or body details needed for triage.
2. Triage before coding
- Decide whether the work item is a leaf issue, epic, research item, or rewrite candidate.
- If the user asked you to pick something, prefer
Ready leaf issues, then apply priority and manageability rules from references/issue-selection.md.
- If the issue explicitly calls for discussion first, or is obviously not implementable yet, stop and tell the user why.
- If the issue is partially actionable, state the shippable subset before starting.
- If the issue should be split or rewritten first, do that before opening a coding branch.
3. Rewrite or create issues when needed
- Use the templates and rules in
references/issue-writing.md.
- Assign the right issue type: epic, feature, bug, or research.
- Add area and priority labels.
- If rewriting an existing issue, keep the original text at the bottom under
## Original issue text.
- If a parent-child structure is needed, create the children and link them.
- Update project fields so the board stays meaningful:
Ready means real next work
Backlog means valid but not next
- epics are usually containers, not active implementation cards
4. Choose PR shape, then branch from dev
- Fetch remotes, switch to
dev, and fast-forward from origin/dev.
- Decide whether this work should be a single PR, a stacked PR series, or separate independent PRs/stacks.
- Use single PR mode only for tiny self-contained leaf work where a stack would be empty ceremony.
- Use stacked PR mode for small related changes that form one cohesive story with reviewable dependency layers. Treat most GitHub epics this way: split the epic into bottom-to-top PR layers instead of making one huge branch.
- Use separate PRs/stacks for big features that can merge independently or belong to different product stories.
Decision tree:
Is this local-only or not issue-backed? → leave this skill.
Is the issue not actionable yet? → rewrite/split/research first.
Is it one tiny self-contained leaf change? → one normal PR from dev.
Is it small related changes or one cohesive feature/epic with dependent layers? → stacked PRs, base dev.
Are the parts big, independent, or unrelated? → separate PRs or separate stacks.
Would a stack only add ceremony? → one normal PR.
Useful commands for single PR mode:
git fetch origin
git switch dev
git pull --ff-only origin dev
git switch -c <branch-name>
Useful commands for stacked PR mode:
git fetch origin
git switch dev
git pull --ff-only origin dev
gh stack init --base dev -p issue-123 foundation
# commit foundation layer
gh stack add api
# commit next layer
gh stack add ui
# commit top layer
gh stack submit --auto
Branch naming should be issue-oriented and easy to trace. For stacks, prefer a shared prefix such as issue-123 with short layer suffixes.
5. Implement the work
- Treat the issue as the brief.
- Make the requested changes.
- If the issue scope shifts materially, call that out before continuing.
- If you discover the issue was not actually leaf-sized, stop and split or rewrite the backlog instead of quietly sprawling.
6. Run the review loop
- When implementation is done, expect the user to run their internal
/review command.
- Fix the issues that review finds.
- Repeat until the review comes back clean or the remaining tradeoffs are explicitly accepted.
- If the user shares review findings in chat instead of rerunning the command, resolve them the same way.
6.5. Refresh the changelog before PR submission
- Before opening or updating a PR, check whether
docs/changelog.md needs a bullet.
- Usually update it for user-visible changes, bug fixes, dependency updates, packaging/release changes, website changes, and workflow changes. Do not talk yourself out of a useful bullet just because the change feels small.
- The changelog is optimistic: the top section is the current dev release and should normally be one version above latest stable. Add bullets to that existing top section unless the user is explicitly preparing a new release section.
- Keep bullets short, concrete, and in Igor's voice: plain English, a little human, no corporate release-note sludge. See
docs/AGENTS.md and the current top changelog section for tone.
- Skip the changelog only for genuinely invisible changes such as tests-only edits, docs-only edits outside release notes, or internal cleanup with no practical user/release impact. If skipped, mention that in the PR body.
7. Open clean PRs with good hygiene
- Push the branch or submit the stack if needed.
- In single PR mode, create one PR targeting
dev.
- In stacked mode, create/update the stack with
gh stack submit --auto; verify with gh stack view --json.
- Write detailed PR bodies with:
- a concise summary of the change
- notable implementation details if they matter to reviewers
- any validation or review loop summary worth preserving
- whether
docs/changelog.md was updated or why it was skipped
Closes #n for fully resolved issues
Refs #n for related but not fully closed issues
- Prefer a squash-merge-ready PR description from the start.
- If the PR changes Actions workflows, artifact uploads, or release triggers, validate it against
references/actions-artifact-retention.md before opening or updating the PR.
Useful commands:
# single PR
git push -u origin <branch-name>
gh pr create --base dev --fill
gh pr edit <pr-number> --body-file <file>
# stacked PRs
gh stack submit --auto
gh stack view --json
# edit individual PR bodies with gh pr edit as needed
Stacked PR body guidance:
- Intermediate layers usually use
Refs #n.
- The final/completing layer may use
Closes #n if merging that layer resolves the issue.
- For epic stacks, child issue PRs can close their child issues; parent epics should usually be referenced until the full epic is complete.
8. Ask Codex for review
Post this exact PR comment after a normal PR is up:
@codex please review this PR and give me 10-20 issues if any. Categorize findings as required, recommended, or optional.
For stacked PRs, post this variant on each PR in the stack:
@codex please review this PR as one layer in a stacked PR series. Focus on this layer's diff and call out cross-layer issues only when they affect correctness. Categorize findings as required, recommended, or optional.
Useful command:
gh pr comment <pr-number-or-url> --body-file <review-request-file>
9. Triage Codex feedback on request
- Do not wait by default after posting the Codex review request.
- Return the PR link to the user once the PR and comment are up.
- Only inspect new PR comments or review events when the user explicitly asks you to check feedback.
Useful command:
gh pr view <pr-number-or-url> --comments
10. Triage Codex feedback
- Read all Codex findings.
- Fix the ones that are clearly correct and immediately actionable.
- Ignore or flag the ones that are weak, irrelevant, or based on a bad assumption.
- After fixes, summarize which items were addressed and which were dismissed, with brief reasons for the dismissals.
- If the fixes are meaningful, go through the review loop again before declaring the PR ready.
References
references/issue-selection.md — how to choose manageable work and when to leave items alone
references/issue-writing.md — how this repo wants issues, epics, labels, and original-text preservation handled
references/actions-artifact-retention.md — how this repo wants GitHub Actions artifact retention, dev artifacts, PR packaging validation, and release uploads handled
Validation
- If the user asked for issue selection, the chosen issue is a manageable leaf issue rather than an epic or mushy umbrella issue.
- If the user asked for issue cleanup, the rewritten issues follow the house format and preserve original text.
- The issue or PR was fully read before action.
- New single-PR work started from a branch created off current
dev; stacked work was initialized with --base dev.
- The PR targets
dev explicitly, or the stack bottom ultimately targets dev with upper PRs targeting the layer below.
- The PR body clearly distinguishes
Closes from Refs.
- The user's
/review findings were addressed or explicitly called out.
docs/changelog.md was updated for practical user/release-facing changes, or the PR body explains why it was skipped.
- If the flow touched GitHub Actions workflows, artifact retention and upload behavior still match
references/actions-artifact-retention.md.
- Codex was asked for review; in stacked mode, each layer received the stack-aware review request.
- The PR link was returned to the user after posting the review request.
- Codex feedback was triaged instead of accepted blindly when the user asked for feedback handling.
Error handling
Error: issue is not actionable yet
Action: explain why, outline the blocker, and stop instead of opening a coding branch.
Error: user asked to “pick an issue” but nothing is clearly ready
Action: do not guess blindly. Return a short ranked shortlist and explain what makes each option manageable or blocked.
Error: issue is too broad, mushy, or mixed-purpose
Action: rewrite or split it first using references/issue-writing.md.
Error: dev is behind or diverged
Action: sync dev first. Do not branch from stale state.
Error: PR accidentally points to main
Action: correct the PR base to dev immediately.
Error: Codex does not reply yet
Action: only check when the user asks. If there is still no reply, report that clearly.
Error: Codex reports low-value issues
Action: do not churn on them. Fix the real ones, then note why the others were dismissed.
Output contract
The completed flow should leave:
- a clearly chosen or clearly rewritten issue when the request was about backlog triage
- an issue-backed implementation branch from
dev, or a stack initialized with --base dev
- a PR targeting
dev, or a stacked PR series whose bottom targets dev
- a detailed PR description with correct closing references
- a Codex review request comment on the PR
- the PR link returned to the user
- a short triage summary of which review findings were fixed and which were dismissed when feedback triage was requested
Examples
Example 1
User says: "Take care of #182."
Expected behaviour:
- Read issue
#182 and its comments.
- Confirm it is actionable.
- Branch from fresh
dev.
- Implement the change.
- Work through the
/review loop.
- Open a PR to
dev that closes #182.
- Ask Codex for review and triage the response.
Example 2
User says: "Create an issue for this bug, then fix it."
Expected behaviour:
- Create the issue from the conversation.
- Write it as a proper issue rather than dumping raw chat text.
- Read back the created issue as the working brief.
- Branch from fresh
dev.
- Implement, review, open the PR, and continue the normal flow.
Example 3
User says: "Pick a manageable issue and work on it."
Expected behaviour:
- Inspect the project board.
- Prefer
Ready leaf issues over epics and research items.
- Choose a P0/P1 issue that is clearly actionable now.
- Explain briefly why it was chosen.
- Continue the normal implementation flow.
Example 4
User says: "These issues are a mess. Rewrite them into proper issues and sub-issues."
Expected behaviour:
- Read the existing issues.
- Split epics from leaf work.
- Rewrite titles and bodies using the issue-writing reference.
- Preserve the original text at the bottom of rewritten issues.
- Update labels, parents, and project fields so the board makes sense.
Example 5
User says: "Check Codex feedback on this PR and handle the good points only."
Expected behaviour:
- Read the PR comments and review state.
- Separate actionable findings from weak ones.
- Fix the worthwhile items.
- Summarize what was fixed and what was dismissed.
1---2name: gh-issue-pr-flow3description: Runs this repo's GitHub issue and PR workflow with gh. Use when the user mentions issue numbers, PR links, or the project board, asks to pick a manageable issue, wants an issue rewritten into a proper issue, wants backlog triage or relabeling, or wants a PR opened, updated, or reviewed. Do not use for local-only git work with no GitHub issue or project flow.4---56# GH Issue PR Flow78## Purpose9Use GitHub issues as the working brief for this repo. This skill covers four related jobs:10111. pick the right issue to work on122. rewrite vague issues into proper issues, epics, and sub-issues133. implement issue-backed work on a fresh branch from `dev`144. choose single-PR vs stacked-PR shape155. open and maintain clean PRs with good GitHub hygiene1617Do not treat every issue as immediately buildable. First decide whether it is a good leaf issue, a parent issue, a research item, or something that should be rewritten before coding.1819## Critical rules20- Treat the issue body as the initial problem statement or prompt.21- Read the full issue body, labels, state, linked metadata, and comments before coding. Do not rely on `gh issue view --comments` alone when deciding scope.22- Prefer actionable leaf issues over epics. Epics are containers unless the user explicitly asks for backlog cleanup or epic design work.23- If the user says “pick an issue” or “work on something manageable”, use the project board and the issue-selection rules in `references/issue-selection.md` before choosing.24- If an issue is mushy, multi-part, or mixes discovery with implementation, rewrite or split it before coding.25- When rewriting an existing issue, preserve the user's original text at the bottom under `## Original issue text` as a blockquote.26- New or rewritten issues should follow the writing rules in `references/issue-writing.md`.27- If PR or release work touches GitHub Actions, artifact uploads, or release packaging, check `references/actions-artifact-retention.md` so workflow changes match the repo's storage policy.28- Start new work from fresh `dev`. For single PRs, create a normal branch from `dev`; for stacked work, initialize the stack with `--base dev`.29- Open PRs back into `dev`, not `main`, unless the user explicitly says otherwise. In stacked mode, the bottom PR ultimately targets `dev` and upper PRs target the layer below.30- If the issue asks for discussion first or is clearly not actionable yet, stop and explain instead of forcing implementation.31- Choose the PR shape deliberately: small related changes should usually become layers in a stack; big unrelated features should be separate PRs or separate stacks; GitHub epics usually become a stacked PR series rather than one giant PR.32- Use the `gh-stack` skill as the operating manual when stacked PR mode is selected; this skill owns the issue/PR policy and stack-vs-single decision.33- Only use auto-closing keywords such as `Closes #123` for issues that are fully resolved by the PR. Use `Refs #123` for anything partial. In stacked mode, use `Refs` on intermediate layers and reserve `Closes` for the layer/PR whose merge completes the issue.34- Before opening or updating a PR, update `docs/changelog.md` unless the PR is genuinely changelog-free. Err on the side of including user-visible fixes, dependency updates, packaging/release changes, website changes, and workflow changes. The changelog is optimistic: the top section is the current dev release and normally stays one version above latest stable.3536## When to use37- The user gives issue numbers like `#123` or `123`.38- The user sends issue or PR links.39- The user sends the GitHub project link or asks what should be worked on next.40- The user asks you to pick a manageable issue.41- The user asks you to rewrite, relabel, split, or organize issues.42- The user asks to create an issue from the current conversation.43- The user asks to open, update, or finish a PR with `gh`.44- The user asks to check or act on Codex review feedback.4546## Do not use when47- The task is explicitly local-only and not tied to GitHub.48- The issue is really a discussion starter, discovery task, or wishful idea that cannot be implemented yet.49- The request would need destructive repo actions beyond the normal branch and PR flow without explicit confirmation.50- The user wants a broad product strategy conversation with no intent to track or implement work yet.5152## Inputs expected53### Required54- An issue number, issue URL, PR URL, project URL, or explicit request to create or rewrite issues.5556### Optional57- Related issues to close or reference.58- A preferred branch name or PR title.59- Review findings from the user's `/review` command.60- Existing Codex review comments on the PR.61- A preference such as “pick something small”, “pick a P0”, or “just clean up the issues”.6263## Prerequisites64- `gh` is authenticated for this repo.65- The repo has an up-to-date `dev` branch locally and on `origin`.66- Use `gh` for issue and PR operations unless the user explicitly wants browser-only handling.67- If the user asks for project-board triage, `gh` must also have project scopes.68- This repository's working branch is `dev`; open PRs into `dev` unless the user explicitly says otherwise.6970## Workflow71### 1. Resolve the work mode721. If the user is describing a problem that should become tracked work, create or rewrite issues first.732. If the user gives an issue number or link, use the fuller JSON issue command first so the body, labels, state, and comments are all visible; then read everything relevant.743. If the user gives a PR link, read the PR state, description, and comments before acting.754. If the user asks what should be worked on next, inspect the project board and apply `references/issue-selection.md`.7677Useful commands:7879```bash80gh issue view <number-or-url> --comments --json number,title,state,body,comments,labels,assignees,projects,milestone,url81gh pr view <number-or-url> --comments82gh project item-list 3 --owner IgorWarzocha --limit 100 --format json83```8485Avoid the shorter `gh issue view <number> --comments` as the first read: it can make you skim comments/output and miss issue metadata or body details needed for triage.8687### 2. Triage before coding881. Decide whether the work item is a leaf issue, epic, research item, or rewrite candidate.892. If the user asked you to pick something, prefer `Ready` leaf issues, then apply priority and manageability rules from `references/issue-selection.md`.903. If the issue explicitly calls for discussion first, or is obviously not implementable yet, stop and tell the user why.914. If the issue is partially actionable, state the shippable subset before starting.925. If the issue should be split or rewritten first, do that before opening a coding branch.9394### 3. Rewrite or create issues when needed951. Use the templates and rules in `references/issue-writing.md`.962. Assign the right issue type: epic, feature, bug, or research.973. Add area and priority labels.984. If rewriting an existing issue, keep the original text at the bottom under `## Original issue text`.995. If a parent-child structure is needed, create the children and link them.1006. Update project fields so the board stays meaningful:101 - `Ready` means real next work102 - `Backlog` means valid but not next103 - epics are usually containers, not active implementation cards104105### 4. Choose PR shape, then branch from `dev`1061. Fetch remotes, switch to `dev`, and fast-forward from `origin/dev`.1072. Decide whether this work should be a single PR, a stacked PR series, or separate independent PRs/stacks.1083. Use single PR mode only for tiny self-contained leaf work where a stack would be empty ceremony.1094. Use stacked PR mode for small related changes that form one cohesive story with reviewable dependency layers. Treat most GitHub epics this way: split the epic into bottom-to-top PR layers instead of making one huge branch.1105. Use separate PRs/stacks for big features that can merge independently or belong to different product stories.111112Decision tree:113114```text115Is this local-only or not issue-backed? → leave this skill.116Is the issue not actionable yet? → rewrite/split/research first.117Is it one tiny self-contained leaf change? → one normal PR from dev.118Is it small related changes or one cohesive feature/epic with dependent layers? → stacked PRs, base dev.119Are the parts big, independent, or unrelated? → separate PRs or separate stacks.120Would a stack only add ceremony? → one normal PR.121```122123Useful commands for single PR mode:124125```bash126git fetch origin127git switch dev128git pull --ff-only origin dev129git switch -c <branch-name>130```131132Useful commands for stacked PR mode:133134```bash135git fetch origin136git switch dev137git pull --ff-only origin dev138gh stack init --base dev -p issue-123 foundation139# commit foundation layer140gh stack add api141# commit next layer142gh stack add ui143# commit top layer144gh stack submit --auto145```146147Branch naming should be issue-oriented and easy to trace. For stacks, prefer a shared prefix such as `issue-123` with short layer suffixes.148149### 5. Implement the work1501. Treat the issue as the brief.1512. Make the requested changes.1523. If the issue scope shifts materially, call that out before continuing.1534. If you discover the issue was not actually leaf-sized, stop and split or rewrite the backlog instead of quietly sprawling.154155### 6. Run the review loop1561. When implementation is done, expect the user to run their internal `/review` command.1572. Fix the issues that review finds.1583. Repeat until the review comes back clean or the remaining tradeoffs are explicitly accepted.1594. If the user shares review findings in chat instead of rerunning the command, resolve them the same way.160161### 6.5. Refresh the changelog before PR submission1621. Before opening or updating a PR, check whether `docs/changelog.md` needs a bullet.1632. Usually update it for user-visible changes, bug fixes, dependency updates, packaging/release changes, website changes, and workflow changes. Do not talk yourself out of a useful bullet just because the change feels small.1643. The changelog is optimistic: the top section is the current dev release and should normally be one version above latest stable. Add bullets to that existing top section unless the user is explicitly preparing a new release section.1654. Keep bullets short, concrete, and in Igor's voice: plain English, a little human, no corporate release-note sludge. See `docs/AGENTS.md` and the current top changelog section for tone.1665. Skip the changelog only for genuinely invisible changes such as tests-only edits, docs-only edits outside release notes, or internal cleanup with no practical user/release impact. If skipped, mention that in the PR body.167168### 7. Open clean PRs with good hygiene1691. Push the branch or submit the stack if needed.1702. In single PR mode, create one PR targeting `dev`.1713. In stacked mode, create/update the stack with `gh stack submit --auto`; verify with `gh stack view --json`.1724. Write detailed PR bodies with:173 - a concise summary of the change174 - notable implementation details if they matter to reviewers175 - any validation or review loop summary worth preserving176 - whether `docs/changelog.md` was updated or why it was skipped177 - `Closes #n` for fully resolved issues178 - `Refs #n` for related but not fully closed issues1794. Prefer a squash-merge-ready PR description from the start.1805. If the PR changes Actions workflows, artifact uploads, or release triggers, validate it against `references/actions-artifact-retention.md` before opening or updating the PR.181182Useful commands:183184```bash185# single PR186git push -u origin <branch-name>187gh pr create --base dev --fill188gh pr edit <pr-number> --body-file <file>189190# stacked PRs191gh stack submit --auto192gh stack view --json193# edit individual PR bodies with gh pr edit as needed194```195196Stacked PR body guidance:197- Intermediate layers usually use `Refs #n`.198- The final/completing layer may use `Closes #n` if merging that layer resolves the issue.199- For epic stacks, child issue PRs can close their child issues; parent epics should usually be referenced until the full epic is complete.200201### 8. Ask Codex for review202Post this exact PR comment after a normal PR is up:203204```text205@codex please review this PR and give me 10-20 issues if any. Categorize findings as required, recommended, or optional.206```207208For stacked PRs, post this variant on each PR in the stack:209210```text211@codex please review this PR as one layer in a stacked PR series. Focus on this layer's diff and call out cross-layer issues only when they affect correctness. Categorize findings as required, recommended, or optional.212```213214Useful command:215216```bash217gh pr comment <pr-number-or-url> --body-file <review-request-file>218```219220### 9. Triage Codex feedback on request2211. Do not wait by default after posting the Codex review request.2222. Return the PR link to the user once the PR and comment are up.2233. Only inspect new PR comments or review events when the user explicitly asks you to check feedback.224225Useful command:226227```bash228gh pr view <pr-number-or-url> --comments229```230231### 10. Triage Codex feedback2321. Read all Codex findings.2332. Fix the ones that are clearly correct and immediately actionable.2343. Ignore or flag the ones that are weak, irrelevant, or based on a bad assumption.2354. After fixes, summarize which items were addressed and which were dismissed, with brief reasons for the dismissals.2365. If the fixes are meaningful, go through the review loop again before declaring the PR ready.237238## References239- `references/issue-selection.md` — how to choose manageable work and when to leave items alone240- `references/issue-writing.md` — how this repo wants issues, epics, labels, and original-text preservation handled241- `references/actions-artifact-retention.md` — how this repo wants GitHub Actions artifact retention, dev artifacts, PR packaging validation, and release uploads handled242243## Validation244- If the user asked for issue selection, the chosen issue is a manageable leaf issue rather than an epic or mushy umbrella issue.245- If the user asked for issue cleanup, the rewritten issues follow the house format and preserve original text.246- The issue or PR was fully read before action.247- New single-PR work started from a branch created off current `dev`; stacked work was initialized with `--base dev`.248- The PR targets `dev` explicitly, or the stack bottom ultimately targets `dev` with upper PRs targeting the layer below.249- The PR body clearly distinguishes `Closes` from `Refs`.250- The user's `/review` findings were addressed or explicitly called out.251- `docs/changelog.md` was updated for practical user/release-facing changes, or the PR body explains why it was skipped.252- If the flow touched GitHub Actions workflows, artifact retention and upload behavior still match `references/actions-artifact-retention.md`.253- Codex was asked for review; in stacked mode, each layer received the stack-aware review request.254- The PR link was returned to the user after posting the review request.255- Codex feedback was triaged instead of accepted blindly when the user asked for feedback handling.256257## Error handling258### Error: issue is not actionable yet259Action: explain why, outline the blocker, and stop instead of opening a coding branch.260261### Error: user asked to “pick an issue” but nothing is clearly ready262Action: do not guess blindly. Return a short ranked shortlist and explain what makes each option manageable or blocked.263264### Error: issue is too broad, mushy, or mixed-purpose265Action: rewrite or split it first using `references/issue-writing.md`.266267### Error: `dev` is behind or diverged268Action: sync `dev` first. Do not branch from stale state.269270### Error: PR accidentally points to `main`271Action: correct the PR base to `dev` immediately.272273### Error: Codex does not reply yet274Action: only check when the user asks. If there is still no reply, report that clearly.275276### Error: Codex reports low-value issues277Action: do not churn on them. Fix the real ones, then note why the others were dismissed.278279## Output contract280The completed flow should leave:281- a clearly chosen or clearly rewritten issue when the request was about backlog triage282- an issue-backed implementation branch from `dev`, or a stack initialized with `--base dev`283- a PR targeting `dev`, or a stacked PR series whose bottom targets `dev`284- a detailed PR description with correct closing references285- a Codex review request comment on the PR286- the PR link returned to the user287- a short triage summary of which review findings were fixed and which were dismissed when feedback triage was requested288289## Examples290### Example 1291User says: "Take care of #182."292293Expected behaviour:2941. Read issue `#182` and its comments.2952. Confirm it is actionable.2963. Branch from fresh `dev`.2974. Implement the change.2985. Work through the `/review` loop.2996. Open a PR to `dev` that closes `#182`.3007. Ask Codex for review and triage the response.301302### Example 2303User says: "Create an issue for this bug, then fix it."304305Expected behaviour:3061. Create the issue from the conversation.3072. Write it as a proper issue rather than dumping raw chat text.3083. Read back the created issue as the working brief.3094. Branch from fresh `dev`.3105. Implement, review, open the PR, and continue the normal flow.311312### Example 3313User says: "Pick a manageable issue and work on it."314315Expected behaviour:3161. Inspect the project board.3172. Prefer `Ready` leaf issues over epics and research items.3183. Choose a P0/P1 issue that is clearly actionable now.3194. Explain briefly why it was chosen.3205. Continue the normal implementation flow.321322### Example 4323User says: "These issues are a mess. Rewrite them into proper issues and sub-issues."324325Expected behaviour:3261. Read the existing issues.3272. Split epics from leaf work.3283. Rewrite titles and bodies using the issue-writing reference.3294. Preserve the original text at the bottom of rewritten issues.3305. Update labels, parents, and project fields so the board makes sense.331332### Example 5333User says: "Check Codex feedback on this PR and handle the good points only."334335Expected behaviour:3361. Read the PR comments and review state.3372. Separate actionable findings from weak ones.3383. Fix the worthwhile items.3394. Summarize what was fixed and what was dismissed.