





















@@ -1,6 +1,6 @@
11---
22name: tag-duplicate-prs-issues
3-description: Search duplicate OpenClaw PRs/issues, group related work in prtags, and sync duplicate state to GitHub.
3+description: Use gitcrawl to search duplicate OpenClaw PRs/issues, group related work in prtags, and sync duplicate state to GitHub.
44---
5566# Tag Duplicate PRs and Issues
@@ -12,43 +12,25 @@ It is not for reviewing the implementation quality of a PR.
12121313## Required Setup
141415-Do not start duplicate triage until this setup is complete.
15+Do not write duplicate groups or annotations until this setup is complete.
16+Read-only discovery can still proceed with `gitcrawl` and live `gh`.
161717-### Install the companion skills
18+### Companion Skills
181919-Install these skills first because they teach the agent how to use the two main CLIs correctly:
20-21-- `ghreplica` skill from the `ghreplica` repo at `skills/ghreplica/SKILL.md`
22-- `prtags` skill from the `prtags` repo at `skills/prtags/SKILL.md`
23-24-This skill assumes those two skills are available and can be used during the same run.
20+Use `$gitcrawl` first for local candidate discovery.
21+Use the `prtags` skill from the `prtags` repo at `skills/prtags/SKILL.md` when it is available.
25222623### Install the CLIs
272428-Install `ghreplica` and `prtags` from their latest GitHub releases.
25+Install `prtags` from its latest GitHub release.
2926Do not rely on an old local build unless the maintainer explicitly wants to test unreleased behavior.
302731-`ghreplica` CLI install path:
32-33-```bash
34-curl -fsSL https://raw.githubusercontent.com/dutifuldev/ghreplica/main/scripts/install-ghr.sh | bash -s -- --bin-dir "$HOME/.local/bin"
35-```
36-3728`prtags` CLI install path:
38293930```bash
4031curl -fsSL https://raw.githubusercontent.com/dutifuldev/prtags/main/scripts/install-prtags.sh | bash -s -- --bin-dir "$HOME/.local/bin"
4132```
423343-Use the `pr-search-cli` project with `uvx`.
44-The command itself is `pr-search`.
45-Do not require a permanent install unless the maintainer explicitly wants one.
46-47-```bash
48-uvx --from pr-search-cli pr-search status
49-uvx --from pr-search-cli pr-search code similar 67144
50-```
51-5234### Authenticate prtags
53355436`prtags` should be logged in with the maintainer's own GitHub account through OAuth device flow.
@@ -66,20 +48,15 @@ The expected outcome is that `prtags` stores the logged-in maintainer identity l
6648Do not require an up-front preflight before starting the workflow.
6749Proceed with the normal steps until you actually need a tool or account state.
685069-As soon as you discover that a required CLI is missing or `prtags` is not logged in, stop immediately.
70-Do not continue in a partial mode after that point.
71-72-If `ghr` is missing, ask the user to run the `ghreplica` install command.
51+As soon as you discover that `prtags` is missing or not logged in at the write step, stop immediately.
52+Do not continue in a partial write mode after that point.
735374-If `prtags` is missing, ask the user to run both CLI install commands:
54+If `prtags` is missing, ask the user to run:
75557656```bash
77-curl -fsSL https://raw.githubusercontent.com/dutifuldev/ghreplica/main/scripts/install-ghr.sh | bash -s -- --bin-dir "$HOME/.local/bin"
7857curl -fsSL https://raw.githubusercontent.com/dutifuldev/prtags/main/scripts/install-prtags.sh | bash -s -- --bin-dir "$HOME/.local/bin"
7958```
805981-If `uvx --from pr-search-cli pr-search ...` fails because `uvx` or the `pr-search` launcher is not available, ask the user to make that command work before continuing.
82-8360If `prtags auth status` shows that the user is not logged in, ask the user to run:
84618562```bash
@@ -90,19 +67,19 @@ Resume only after the missing tool or login state has been fixed.
90679168## Read-Path Default
926993-For read-only GitHub operations in this workflow, use `ghr` as the default CLI.
94-Treat it as a drop-in replacement for the `gh` read operations you would normally use for PRs, issues, comments, reviews, and duplicate-search evidence.
70+For candidate discovery in this workflow, use `gitcrawl` first.
71+Treat it as the local history and clustering layer for related issues, duplicate attempts, and closed threads.
957296-Only fall back to `gh` when `ghr` is failing for a concrete reason, such as:
73+Use live `gh` or `gh api` for the target thread and for any candidate before making an actionable judgment.
74+Use live GitHub when `gitcrawl` is missing or stale for a concrete reason, such as:
977598-- the mirrored object is not present yet
99-- the mirror data is clearly stale or incomplete for the decision you need to make
100-- the `ghr` command errors, times out, or does not expose the specific read you need
76+- the target or candidate is not present yet
77+- the local data is clearly stale or incomplete for the decision you need to make
78+- `gitcrawl` errors, times out, or lacks the needed neighbor/search data
10179102-When you fall back to `gh`, note that you did so and why.
80+When you fall back to live GitHub search, note that you did so and why.
10381104-If `ghr` is missing a fresh PR or issue but `gh` can read it, you may use `gh` for the read-side judgment.
105-If a later `prtags` target-level write fails because the same object is still missing from `ghreplica`, stop and report that the mirror has not caught up yet instead of forcing the write.
82+If a later `prtags` target-level write fails because its own mirror has not caught up, stop and report that the curation backend is missing the target object instead of forcing a fallback write.
1068310784## Goal
10885@@ -118,14 +95,12 @@ For each target PR or issue:
1189511996Use the tools with these boundaries:
12097121-- `ghreplica` is the raw evidence source
122-- use `ghr` first for normal GitHub read operations in this workflow
123-- use it for title/body/comment search, related PRs, overlapping files, overlapping ranges, and current PR or issue status
124-- resort to `gh` only when `ghr` cannot provide the needed read cleanly
125-- `pr-search-cli` is candidate generation and ranking
126-- use it to suggest likely duplicate PRs or issue-cluster context
127-- do not treat it as final truth
128-- do not create or expand a duplicate group only because `pr-search-cli` put multiple PRs in the same issue or duplicate cluster
98+- `gitcrawl` is candidate generation and historical context
99+- use it first for local title/body search, neighbors, clusters, and closed-thread discovery
100+- treat every candidate as a lead until live GitHub confirms it
101+- `gh` is live GitHub truth
102+- use it for target state, body, comments, reviews, files, linked issues, and current open/closed/merged status
103+- use `gh search` only when `gitcrawl` is stale, missing data, or cannot express the needed query
129104- `prtags` is the maintainer curation layer
130105- use it to create or reuse one duplicate group
131106- use it to save the duplicate status, confidence, rationale, and group summary
@@ -182,7 +157,7 @@ Examples:
182157## Evidence Checklist
183158184159Before declaring a duplicate, gather evidence from at least two categories.
185-Same-issue or same-cluster output from `pr-search-cli` counts only as candidate generation, not as one of the required proof categories by itself.
160+`gitcrawl` neighbors, search hits, and cluster membership count as candidate generation, not as enough proof by themselves.
186161187162For PRs:
188163@@ -205,21 +180,18 @@ If you only have wording similarity, that is not enough.
205180## Step 1: Read The Target
206181207182Start by reading the target itself.
208-Use `ghr` first for this step even if you would normally reach for `gh`.
183+Use live GitHub for current target state.
209184210185For a PR:
211186212187```bash
213-ghr pr view -R openclaw/openclaw <number> --comments
214-ghr pr reviews -R openclaw/openclaw <number>
215-ghr pr comments -R openclaw/openclaw <number>
188+gh pr view <number> --json number,title,state,mergedAt,body,closingIssuesReferences,files,comments,reviews,statusCheckRollup
216189```
217190218191For an issue:
219192220193```bash
221-ghr issue view -R openclaw/openclaw <number> --comments
222-ghr issue comments -R openclaw/openclaw <number>
194+gh issue view <number> --json number,title,state,body,comments,closedAt
223195```
224196225197Record:
@@ -232,74 +204,56 @@ Record:
232204- whether it is open, closed, or merged
233205- whether there is already a likely duplicate thread mentioned by humans
234206235-## Step 2: Search Broadly With ghreplica
207+## Step 2: Search Broadly With Gitcrawl
236208237-Use `ghreplica` first because it is the most direct evidence source.
238-Do not switch to `gh` for ordinary reads unless `ghr` is missing data or failing.
209+Use `gitcrawl` first because it is the local OpenClaw history and clustering source.
210+Do not switch to broad live GitHub search unless `gitcrawl` is missing data, stale, or failing.
239211240-### PR duplicate search
241-242-Run all of these when the target is a PR:
212+Start with the target and nearby threads:
243213244214```bash
245-ghr search related-prs -R openclaw/openclaw <pr-number> --mode path_overlap --state all
246-ghr search related-prs -R openclaw/openclaw <pr-number> --mode range_overlap --state all
247-ghr search mentions -R openclaw/openclaw --query "<key phrase from title or body>" --mode fts --scope pull_requests --state all
248-ghr search mentions -R openclaw/openclaw --query "<subsystem or error phrase>" --mode fts --scope issues --state all
215+gitcrawl threads openclaw/openclaw --numbers <issue-or-pr-number> --include-closed --json
216+gitcrawl neighbors openclaw/openclaw --number <issue-or-pr-number> --limit 20 --json
249217```
250218251-Use `prs-by-paths` or `prs-by-ranges` when the likely duplicate surface is already known:
219+Then search key phrases and subsystem terms:
252220253221```bash
254-ghr search prs-by-paths -R openclaw/openclaw --path src/example.ts --state all
255-ghr search prs-by-ranges -R openclaw/openclaw --path src/example.ts --start 20 --end 80 --state all
222+gitcrawl search openclaw/openclaw --query "<key phrase from title or body>" --mode hybrid --limit 20 --json
223+gitcrawl search openclaw/openclaw --query "<subsystem or error phrase>" --mode hybrid --limit 20 --json
256224```
257225258-### Issue duplicate search
259-260-`ghreplica` does not have a special issue-to-issue “related issues” command.
261-For issues, search mirrored text and linked PR context instead.
262-263-Run targeted text searches:
226+Inspect likely clusters:
264227265228```bash
266-ghr search mentions -R openclaw/openclaw --query "<issue title phrase>" --mode fts --scope issues --state all
267-ghr search mentions -R openclaw/openclaw --query "<error message or symptom>" --mode fts --scope issues --state all
268-ghr search mentions -R openclaw/openclaw --query "<subsystem phrase>" --mode fts --scope pull_requests --state all
229+gitcrawl cluster-detail openclaw/openclaw --id <cluster-id> --member-limit 20 --body-chars 280 --json
269230```
270231271-Then inspect the candidate PRs or issues those searches uncover.
232+For PRs, verify likely code overlap with live file data:
272233273-## Step 3: Use pr-search-cli As A Hint Layer
234+```bash
235+gh pr view <candidate-pr> --json number,title,state,mergedAt,files,body,comments,reviews
236+```
274237275-Use `pr-search-cli` after `ghreplica`.
276-It is good at surfacing candidates quickly, but it is not the final decision-maker.
277-Run it through the `pr-search` command.
278-279-For a PR:
238+For issues, verify likely duplicate issue state and comments live:
280239281240```bash
282-uvx --from pr-search-cli pr-search -R openclaw/openclaw code similar <pr-number>
283-uvx --from pr-search-cli pr-search -R openclaw/openclaw code clusters for-pr <pr-number>
284-uvx --from pr-search-cli pr-search -R openclaw/openclaw issues for-pr <pr-number>
285-uvx --from pr-search-cli pr-search -R openclaw/openclaw issues duplicate-prs
241+gh issue view <candidate-issue> --json number,title,state,body,comments,closedAt
286242```
287243288-Interpretation:
289-290-- `code similar` suggests PRs with similar change shape
291-- `code clusters for-pr` shows the PR’s nearby code cluster
292-- `issues for-pr` shows which issue clusters the PR appears to belong to
293-- `issues duplicate-prs` is useful for spotting already-known duplicate PR patterns
244+## Step 3: Use Live GitHub Search For Gaps
294245295-Treat every `pr-search-cli` result as a hint to investigate, not as enough evidence to create or widen a duplicate group.
296-Multiple PRs can share the same issue or issue cluster while still taking meaningfully different fix paths.
246+Use targeted live GitHub search after `gitcrawl` when:
297247298-For an issue:
248+- the target is too new for the local store
249+- comments or reviews matter and the local store lacks them
250+- the exact phrase did not appear in local results but the issue/PR is current enough that GitHub should know it
299251300-- use `ghreplica` first to find candidate PRs or issue wording
301-- if the issue has linked PRs or a likely implementation PR, run `pr-search-cli` on those PRs
302-- treat issue-cluster output as supporting context, not as enough by itself to call the issue a duplicate
252+```bash
253+gh search prs --repo openclaw/openclaw --match title,body --limit 50 -- "<key phrase>"
254+gh search issues --repo openclaw/openclaw --match title,body --limit 50 -- "<key phrase>"
255+gh search issues --repo openclaw/openclaw --match comments --limit 50 -- "<error or maintainer phrase>"
256+```
303257304258## Step 4: Decide The Outcome
305259@@ -344,7 +298,7 @@ Reuse an existing group when:
344298- it already contains clearly related members
345299- adding the target would keep the group coherent
346300347-Do not widen an existing group just because `pr-search-cli` placed several PRs under the same issue or duplicate cluster.
301+Do not widen an existing group just because `gitcrawl` placed several PRs or issues near each other.
348302Confirm that the actual implementation path and maintainer intent still match before adding the new member.
349303350304Create a new group only when no existing group clearly fits.
@@ -423,8 +377,8 @@ prtags annotation group set <group-id> \
423377424378When the evidence is incomplete, set `duplicate_status=candidate` and lower the confidence.
425379426-If a per-PR or per-issue annotation write fails because `prtags` cannot resolve the target through `ghreplica`, do not force a fallback write path.
427-Keep the group state you were able to write, report that the mirror is still missing the target object, and defer the target-level annotation until `ghreplica` catches up.
380+If a per-PR or per-issue annotation write fails because `prtags` cannot resolve the target, do not force a fallback write path.
381+Keep the group state you were able to write, report that the curation backend is still missing the target object, and defer the target-level annotation until `prtags` catches up.
428382429383## Step 8: Let prtags Sync The Group Comment
430384此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。