diff --git a/.agents/skills/create-pr/SKILL.md b/.agents/skills/create-pr/SKILL.md index 147316c4172..33ae4468e57 100644 --- a/.agents/skills/create-pr/SKILL.md +++ b/.agents/skills/create-pr/SKILL.md @@ -33,6 +33,19 @@ git push -u origin ## 3. Create the PR +Before creating a PR for an issue, check whether that issue already has an open +linked PR: + +```bash +gh api repos/docker/docs/issues//timeline --paginate \ + --jq '.[] | select((.event=="cross-referenced" or .event=="connected" or .event=="referenced") and .source.issue.pull_request and .source.issue.state=="open") | {url: .source.issue.html_url, title: .source.issue.title}' +``` + +If this returns an open PR that addresses the same issue, stop. Don't open a +duplicate PR; report the existing PR instead. Only proceed if there is no open +linked PR, or if the existing PR clearly does not address the issue and you +explain why in the new PR body. + Derive the fork owner dynamically: ```bash diff --git a/.agents/skills/triage-issue/SKILL.md b/.agents/skills/triage-issue/SKILL.md index 70513da7841..c4fcf19bb85 100644 --- a/.agents/skills/triage-issue/SKILL.md +++ b/.agents/skills/triage-issue/SKILL.md @@ -28,9 +28,21 @@ Read the issue body and all comments. Identify: - What is the reported problem? - What content, URL, or file does it reference? -- Are there linked PRs? Check whether they were merged or closed without merge. - Has anyone already proposed a fix or workaround in the comments? +Check for linked PRs in the issue timeline, not only in the issue body or +comments: + +```bash +gh api repos/docker/docs/issues/$ARGUMENTS/timeline --paginate \ + --jq '.[] | select(.event=="cross-referenced" or .event=="connected" or .event=="referenced") | {event, created_at, source: .source.issue.html_url, title: .source.issue.title, state: .source.issue.state}' +``` + +If an open PR already addresses the issue, don't open another PR. Review the +existing PR instead, and report that the issue already has an associated PR. A +merged PR is strong evidence the issue is fixed. A closed-without-merge PR means +the issue is likely still open. + ## 3. Follow URLs Find all `docs.docker.com` URLs in the issue body and comments. For each: @@ -130,9 +142,9 @@ labels. Mention the action you took (closed, labeled, etc.). ## Notes -- A merged PR linked to an issue is strong evidence the issue is fixed -- A closed-without-merge PR means the issue is likely still open +- Always check timeline cross-references before deciding to fix an issue - Do not narrate your process — produce the final report - End every issue comment with an accurate agent-disclosure footer that names the active coding agent, for example `Generated by Codex` or `Generated by - Claude Code`. +Claude Code`. +.