一键导入
microshift-ci-close-stale-bugs
Close stale, unlinked, unassigned AI-generated bugs that no longer match current CI failures (dry-run by default)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Close stale, unlinked, unassigned AI-generated bugs that no longer match current CI failures (dry-run by default)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Surface your daily task list — QA-ready tickets, sprint backlog, carry-over items, open PRs, RHEL verification queue, and quarterly reminders. Use at the start of your day to see what needs attention.
Show detailed info about a specific TODO task — its tracked links, notes, and live Jira/PR status. Use when the user asks about a task, wants context to resume work on it, or asks what's needed to finish a ticket. Not for listing all tasks (read the TODO file directly or use edge-ic:sprint-status for sprint-wide views)
End-of-week automation - review active work and prepare next week's TODO
Run the full Prow CI release testing workflow — create PR, trigger jobs, check status, merge PR, download and upload artifacts
Generate interactive PCP performance dashboard from a Prow job URL
Download Prow job artifacts, identify root cause of failure, and produce a structured error report
| name | microshift-ci:close-stale-bugs |
| argument-hint | [--close] |
| description | Close stale, unlinked, unassigned AI-generated bugs that no longer match current CI failures (dry-run by default) |
| user-invocable | true |
| allowed-tools | Bash, Read, Write, Glob, Grep, mcp__jira__jira_get_issue, mcp__jira__jira_get_transitions, mcp__jira__jira_transition_issue, mcp__jira__jira_update_issue |
/microshift-ci:close-stale-bugs
/microshift-ci:close-stale-bugs --close
Identifies and closes stale AI-generated JIRA bugs that are no longer relevant. The CI Doctor workflow creates bugs for CI failures, but some become stale when the underlying failures resolve themselves. This skill cleans up those orphaned bugs.
A bug is closed when all of the following are true:
microshift-ci-ai-generated (guaranteed by the data source)Operates in dry-run mode by default — shows which bugs would be closed without taking action. Use --close to actually close them.
Intended run order: doctor → create-bugs → close-stale-bugs → refresh
<ARGUMENTS> (optional): Flags only
--close (optional): Actually close matching JIRA issues. Without this flag, only a dry-run report is produced./microshift-ci:doctor run (today's date)bugs/bug-matches-summary.json must exist in the workdir (produced by the doctor finalize step)--close mode)Compute once at the start by running date +%y%m%d and substituting into the path below. In all commands, replace <WORKDIR> with the computed path.
/tmp/microshift-ci-claude-workdir.<YYMMDD>
Parse <ARGUMENTS> for the --close flag. If present, set MODE to close; otherwise MODE is dry-run.
Compute today's <WORKDIR> by running date +%y%m%d and substituting into /tmp/microshift-ci-claude-workdir.<YYMMDD>.
Read <WORKDIR>/bugs/bug-matches-summary.json. If the file does not exist, report a fatal error and stop:
Error: bugs/bug-matches-summary.json not found in <WORKDIR>
Run the full doctor workflow first: /microshift-ci:doctor <releases>
Parse the JSON. Check the jira_query_available field. If it is false, report a warning and stop:
Warning: JIRA bug data is unavailable (jira_query_available: false)
The doctor run could not query JIRA for open bugs. Skipping stale bug cleanup.
Extract the linked and unlinked arrays. Each entry has: key, summary, status, assignee, updated.
Iterate over the unlinked[] array. These bugs are already AI-generated and not linked to current CI failure signatures. For each bug, evaluate the remaining two criteria:
Unassigned: The assignee field must be empty (empty string, null, or "Unassigned"). If the bug has an assignee, skip it with reason: "Assigned to <assignee>".
Stale: Parse the updated field as a date. Compute the number of days since update: days_since_update = today - updated_date. If days_since_update <= 10, skip with reason: "Updated <N> days ago (threshold: 10)".
Bugs that pass both checks are closure candidates.
Categorize each unlinked bug as either a closure candidate or skipped (with reason).
Display a summary:
STALE BUG REPORT (MODE: dry-run|close)
Total open AI-generated bugs: <linked + unlinked count>
Linked to current failures: <linked count>
Unlinked: <unlinked count>
Candidates for closure: <N>
Skipped (assigned): <N>
Skipped (recently updated): <N>
Bugs to close:
1. USHIFT-XXXX: <summary> (last updated <N> days ago)
2. ...
If MODE is dry-run, write a prose summary to <WORKDIR>/report-close-stale-bugs.txt containing the report above followed by a per-bug breakdown listing each unlinked bug, its action (close or skip), and the reason. Then stop here.
For each closure candidate:
Discover the Close transition: Call mcp__jira__jira_get_transitions(issue_key="<KEY>"). Find the transition whose name contains "Close" (case-insensitive). Record its id.
If no Close transition is available from the current status, record the bug as "failed" with reason "No Close transition available from status '<status>'" and skip to the next bug.
Cache the transition ID by status name — if multiple bugs share the same status, only query transitions once.
Transition to Closed: Call:
mcp__jira__jira_transition_issue(
issue_key="<KEY>",
transition_id="<close_transition_id>",
fields='{"resolution": {"name": "Obsolete"}}',
comment="Automatically closed: unassigned, not linked to current CI failures, and inactive for more than 10 days."
)
Add the tracking label: Use mcp__jira__jira_get_issue to fetch the current labels, append "microshift-ci-ai-closed", and call:
mcp__jira__jira_update_issue(
issue_key="<KEY>",
fields='{"labels": [<all_existing_labels>, "microshift-ci-ai-closed"]}'
)
Record the result: Mark the bug as "closed" or "failed" in the results.
Error Handling:
"failed", and continue to the next bug. Do NOT prompt or retry.Display a final summary:
RESULTS
1. USHIFT-XXXX: CLOSED
2. USHIFT-YYYY: CLOSED
3. USHIFT-ZZZZ: FAILED — No Close transition available from status "In Review"
SUMMARY
Processed: <N> | Closed: <N> | Failed: <N>
Write <WORKDIR>/report-close-stale-bugs.txt with the full report: the summary from Step 3, the per-bug breakdown, and the final action outcomes above.
If any bugs were actually closed successfully in Step 4, write <WORKDIR>/close-stale-bugs/closed-bugs.json:
{"closed": ["USHIFT-1234", "USHIFT-5678"]}
Include only keys that were closed successfully (not failed). Do not write this file in dry-run mode or if no bugs were closed.
This file is consumed by /microshift-ci:doctor-refresh to exclude closed bugs from the HTML report.
/microshift-ci:close-stale-bugs
Shows which stale bugs would be closed without taking any action.
/microshift-ci:close-stale-bugs --close
Actually closes all matching bugs in JIRA.
bugs/bug-matches-summary.json from the doctor finalize stepunlinked[] array in the summary file contains bugs that are open, AI-generated, and not matched to any current CI failure signaturemicroshift-ci-ai-closed label enables tracking of auto-closed bugs separately from manually closed ones