docs: mirror closing issue's triage labels onto every PR - #11
Conversation
Adds a bullet to CLAUDE.md §"Subagent Strategy" requiring that every `gh pr create` mirror the closing issue's triage labels onto the new PR — `priority/*`, `severity/*`, `urgency/*`, `impact/*`, `effort/*`, `type/*`, plus `triaged` only if the issue carries it. PRs that lack triage labels are invisible to the priority queries that surface the issues, so an unlabeled PR is effectively unreviewable in priority order — the same class of bug as forgetting the post-push CI watcher. Multi-issue PRs: take the highest `priority/*` and `severity/*` across the closed set, union the rest. When delegating PR shipping to a subagent, include the label-mirror step in the prompt explicitly. Project-level CLAUDE.md may add the exact `gh` invocation; this global rule is the requirement itself.
📝 WalkthroughWalkthroughA new mandatory workflow rule is added to ChangesDocumentation Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Review rate limit: 3/5 reviews remaining, refill in 22 minutes and 40 seconds. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CLAUDE.md`:
- Line 215: Clarify the precedence conflict between the "never invent `triaged`"
statement and the later PR-creation requirement to add `triaged`: update
CLAUDE.md so the rule is explicit that the PR label-mirroring rule (the `gh pr
create` paragraph listing required labels) only adds the `triaged` label if and
only if the closed issue(s) already carry `triaged` (and never fabricates it);
conversely state that automation should always mirror other listed labels per
the existing merge/union logic for multi-issue PRs — reference the phrases
"never invent `triaged`" and the PR-creation triage rule so readers and bots
know the precise precedence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| - **Parallel vs background**: multiple independent queries → send them in one message as parallel `Agent` tool calls. Long-running watchers (CI, builds) → `run_in_background: true`, then read output when notified. | ||
| - **Multi-agent coordination**: see `~/.claude/multi-agent-comms.md` for lock patterns (e.g., `git-push` lock before pushing shared-branch fixes). | ||
| - **Default: delegate to the cheapest sufficient tier — actively, not just when in doubt.** Before doing a piece of work in the main session (or spawning a subagent at the same tier as the main session), ask: *can a cheaper Claude, OpenAI, or Gemini subagent handle this per the rubric below?* If yes, spawn that subagent using the `Agent` tool's `model` parameter. The main session's tier is typically the most expensive option available, so reserving it for work that genuinely needs it is the single biggest cost lever. Treat the rubric as a positive obligation to delegate down, not just a tie-breaker. This applies recursively — when a subagent itself needs to spawn further subagents, it should also default to the cheapest sufficient tier. | ||
| - **Every `gh pr create` MUST be followed by mirroring the closing issue's triage labels onto the new PR.** The full set: `priority/*`, `severity/*`, `urgency/*`, `impact/*`, `effort/*`, `type/*`, plus `triaged` (only if the issue carries it — never invent it). PRs that lack triage labels are invisible to the same priority queries that surface the issues, so an unlabeled PR is effectively unreviewable in priority order — the same shape of bug as forgetting the post-push CI watcher. Treat label-mirroring as part of the `open-PR` step, not a follow-up. For PRs that close multiple issues, take the highest `priority/*` and `severity/*` across the closed set, and union the rest. When delegating PR shipping to a subagent, include the label-mirror step in the prompt explicitly (don't assume the subagent will infer it). Project-level CLAUDE.md may add the exact `gh` invocation; the global rule is the requirement itself. |
There was a problem hiding this comment.
Clarify precedence vs the existing PR-creation triage rule
Line 215 says “never invent triaged,” but Line 295 says PR creation should include triaged. Please add an explicit exception/preference here so automation can’t interpret these rules differently.
Suggested wording tweak
- **Every `gh pr create` MUST be followed by mirroring the closing issue's triage labels onto the new PR.** The full set: `priority/*`, `severity/*`, `urgency/*`, `impact/*`, `effort/*`, `type/*`, plus `triaged` (only if the issue carries it — never invent it). PRs that lack triage labels are invisible to the same priority queries that surface the issues, so an unlabeled PR is effectively unreviewable in priority order — the same shape of bug as forgetting the post-push CI watcher. Treat label-mirroring as part of the `open-PR` step, not a follow-up. For PRs that close multiple issues, take the highest `priority/*` and `severity/*` across the closed set, and union the rest. When delegating PR shipping to a subagent, include the label-mirror step in the prompt explicitly (don't assume the subagent will infer it). Project-level CLAUDE.md may add the exact `gh` invocation; the global rule is the requirement itself.
+ **Every `gh pr create` MUST be followed by mirroring the closing issue's triage labels onto the new PR.** The full set: `priority/*`, `severity/*`, `urgency/*`, `impact/*`, `effort/*`, `type/*`, plus `triaged` (only if at least one closing issue carries it — never invent it). **This is a scoped exception to §7's default “always add `triaged` on create” rule for issue-closing PRs.** PRs that lack triage labels are invisible to the same priority queries that surface the issues, so an unlabeled PR is effectively unreviewable in priority order — the same shape of bug as forgetting the post-push CI watcher. Treat label-mirroring as part of the `open-PR` step, not a follow-up. For PRs that close multiple issues, take the highest `priority/*` and `severity/*` across the closed set, and union the rest. When delegating PR shipping to a subagent, include the label-mirror step in the prompt explicitly (don't assume the subagent will infer it). Project-level CLAUDE.md may add the exact `gh` invocation; the global rule is the requirement itself.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CLAUDE.md` at line 215, Clarify the precedence conflict between the "never
invent `triaged`" statement and the later PR-creation requirement to add
`triaged`: update CLAUDE.md so the rule is explicit that the PR label-mirroring
rule (the `gh pr create` paragraph listing required labels) only adds the
`triaged` label if and only if the closed issue(s) already carry `triaged` (and
never fabricates it); conversely state that automation should always mirror
other listed labels per the existing merge/union logic for multi-issue PRs —
reference the phrases "never invent `triaged`" and the PR-creation triage rule
so readers and bots know the precise precedence.
Summary
Adds a bullet to
CLAUDE.md§"Subagent Strategy" requiring that everygh pr createmirror the closing issue's triage labels onto the new PR.The full set:
priority/*,severity/*,urgency/*,impact/*,effort/*,type/*, plustriaged(only if the issue carries it — never invent it).Why: PRs that lack triage labels are invisible to the same priority queries that surface the issues, so an unlabeled PR is effectively unreviewable in priority order — the same class of bug as forgetting the post-push CI watcher. Treat label-mirroring as part of the
open-PRstep, not a follow-up.Multi-issue PRs: take the highest
priority/*andseverity/*across the closed set, union the rest.Delegation: when delegating PR shipping to a subagent, include the label-mirror step in the prompt explicitly — don't assume inference. Project-level CLAUDE.md may add the exact
ghinvocation; this global rule is the requirement itself.This complements the always-on per-item triage rule (already on main) and the explicit-model + Sonnet-default-for-PR-shipping rules (PR #10) — together they form the complete shipping discipline: every issue triaged, every PR labelled to match, every subagent dispatched at the right tier.
Test plan
CLAUDE.md§"Subagent Strategy" lines 213–217 — the new bullet sits between "Default: delegate down" and the rubric block, and reads as a natural continuation of the shipping disciplinetriage.md§"Default label set" (no new labels invented)Summary by CodeRabbit