issue-cleaner-master
SKILL.md
Issue Cleaner Master
Analyze GitHub issues in the current repository and filter high-quality issues suitable for contribution.
Workflow
Step 1: Get Repository Information
- Execute the command to retrieve the repository's owner and name:
gh repo view --json nameWithOwner --jq '.nameWithOwner' - Parse the output into
{owner}and{repo}variables. - Validate the output format:
- IF the output is not in
owner/repoformat OR is empty OR an error occurs, THEN terminate execution and instruct the user to verify they are in a git repository with a GitHub remote.
- IF the output is not in
Step 2: Fetch Issue Data
- Fetch all open issues using the GitHub GraphQL API with pagination:
gh api graphql --paginate -f query=' query($endCursor: String) { repository(owner: "{owner}", name: "{repo}") { issues(states: OPEN, first: 100, after: $endCursor) { pageInfo { hasNextPage endCursor } nodes { number title url createdAt updatedAt labels(first: 20) { nodes { name } } assignees(first: 10) { nodes { login } } } } } }' - Validate the response:
- IF
data.repository.issues.nodesarray is not present, THEN- IF error is
401or403, THEN instruct the user to rungh auth statusfor authentication check. - IF rate limit error occurs, THEN instruct to wait and retry, or reduce the
firstparameter. - ELSE, consider it an error and terminate.
- IF error is
- IF
nodesarray is empty, THEN proceed with an empty issue list.
- IF
Step 3: Detect Issues with Linked PRs
- Fetch all open pull requests and their linked issues:
gh api graphql --paginate -f query=' query($endCursor: String) { repository(owner: "{owner}", name: "{repo}") { pullRequests(states: OPEN, first: 100, after: $endCursor) { pageInfo { hasNextPage endCursor } nodes { number closingIssuesReferences(first: 10) { nodes { number } } } } } }' - Fetch recently merged pull requests and their linked issues:
gh api graphql -f query=' { repository(owner: "{owner}", name: "{repo}") { pullRequests(states: MERGED, first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { number closingIssuesReferences(first: 10) { nodes { number } } } } } }' - Aggregate linked issue numbers:
- Create
issues_with_open_prset: Contains issue numbers linked by open PRs. - Create
issues_with_merged_prset: Contains issue numbers linked by merged PRs.
- Create
- Validate both queries return valid arrays.
closingIssuesReferencescan be empty.
Step 4: Apply Filtering Rules
Evaluate each issue based on the following conditions for inclusion or exclusion. Each issue must have an include_reason or exclude_reason.
- Exclusion Conditions:
- IF (
issue.assigneesis non-empty ANDissue.updatedAtis within the last 30 days ) THEN exclude (reason:Assigned and active). - IF
issue.numberis inissues_with_open_prTHEN exclude (reason:Has in-progress PR). - IF
issue.numberis inissues_with_merged_prTHEN exclude (reason:Fixed by merged PR). - IF
issueis a non-code contribution based on the following rules:- Label signals:
issue.labelscontains any ofquestion,support,duplicate,wontfix,invalid. - Title patterns:
issue.titleends with?.issue.titlestarts with "How to", "How do I", "Why does", "What is".issue.titlecontains "[Question]", "[Help]", "[Support]" prefix.
- Combined judgment:
- IF only title patterns match without label signals, THEN retrieve the first 500 characters of
issue.bodyusinggh issue view {issue.number} --json bodyfor further judgment. - IF determined to be non-code contribution, THEN exclude (reason:
Non-code contribution).
- IF only title patterns match without label signals, THEN retrieve the first 500 characters of
- Label signals:
- IF (
- Special Inclusion Condition:
- IF (
issue.assigneesis non-empty ANDissue.updatedAtis older than 30 days ANDissue.numberis NOT inissues_with_open_pr) THEN include (reason:Assigned but stale). Mark the issue as[Stale]in the output.
- IF (
- Conservative Principle: If an issue's status is uncertain, it must be included for user judgment.
Step 5: Group by Priority
Assign a priority to each included issue based on its labels:
- P0: IF
issue.labelscontains bothhelp-wantedANDgood-first-issueTHENP0(Description:Reserved for community newcomers). - P1: ELSE IF
issue.labelscontainsgood-first-issueTHENP1(Description:Beginner-friendly task). - P2: ELSE IF
issue.labelscontainshelp-wantedTHENP2(Description:Needs community help). - P3: ELSE IF
issue.labelscontainskind/bugORbugTHENP3(Description:Clear problem description). - P4: ELSE IF
issue.labelscontainskind/documentationORkind/cleanupORdocumentationTHENP4(Description:Small optimization tasks). - P5: ELSE
P5(Description:May need more context).
Step 6: Generate Report Files
Generate the following two files in the current working directory:
6.1 issues-report.json (Machine-readable)
- Create a JSON file named
issues-report.json. - Populate the file with complete audit data for all issues, adhering to the schema specified in
references/output-examples.md. - Ensure the
metadataobject contains repository information, scan time, and issue counts. - Ensure each issue object in the
issues[]array includesincluded(boolean),priority(string),status(string), and eitherinclude_reasonorexclude_reason(string).
6.2 issues-report.md (Human-readable)
- Create a Markdown file named
issues-report.md. - Structure the file with sections grouped by priority (P0-P5) using Markdown tables, following the format template in
references/output-examples.md. - Include summary statistics.
- Include a distribution of exclusion reasons.
- Omit any priority groups that have no issues.
Hard Constraints
- Utilize the
ghCLI GraphQL API exclusively for all data retrieval. - Scope analysis to the GitHub project corresponding to the current Git repository.
- Operations MUST be read-only; no modifications to issue status are permitted.
- PR linkage detection MUST use the
closingIssuesReferencesfield; parsing of PR body text is forbidden for this purpose. - Both
issues-report.jsonandissues-report.mdfiles MUST be generated. - Every issue in the
issues-report.jsonMUST include either aninclude_reasonor anexclude_reasonfor auditability.
Error Recovery
- IF
ghCLI is not installed, THEN prompt the user to install GitHub CLI. - IF
ghis not authenticated, THEN instruct the user to rungh auth login. - IF not in a Git repository, THEN prompt the user to navigate to a Git repository.
- IF no GitHub remote is configured, THEN prompt the user to verify the remote URL points to GitHub.
- IF a rate limit is encountered, THEN instruct the user to wait for reset or reduce batch size.
- IF the repository is empty, THEN generate reports with zero issues.
Weekly Installs
7
Repository
samzong/samzongGitHub Stars
8
First Seen
Feb 28, 2026
Security Audits
Installed on
cline7
github-copilot7
codex7
kimi-cli7
gemini-cli7
cursor7