From microshift-ci
Analyze CI for multiple MicroShift releases and produce an HTML summary
How this skill is triggered — by the user, by Claude, or both
Slash command
/microshift-ci:doctorThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
/microshift-ci:doctor <release1,release2,...>
Accepts a comma-separated list of MicroShift release versions, runs analysis for each release and for open rebase PRs, and produces a single HTML summary file consolidating all results. Uses deterministic scripts for data collection, artifact download, aggregation, and HTML generation. LLM agents are used only for per-job root cause analysis and Jira bug correlation.
<ARGUMENTS> (required): Comma-separated list of release versions (e.g., 4.19,4.20,4.21,4.22)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 — do not use shell variables.
/tmp/microshift-ci-claude-workdir.<YYMMDD>
Goal: Deterministically collect all failed jobs and download their artifacts before any LLM analysis.
Actions:
Determine today's <WORKDIR> by running date +%y%m%d and substituting into /tmp/microshift-ci-claude-workdir.<YYMMDD>. Use this value in all subsequent commands.
Run the prepare script:
bash plugins/microshift-ci/scripts/doctor.sh prepare --workdir <WORKDIR> <ARGUMENTS> --rebase
The script deterministically:
<WORKDIR>/analyze-ci-release-<version>-jobs.json<WORKDIR>/analyze-ci-prs-jobs.json and <WORKDIR>/analyze-ci-prs-status.jsonRead the JSON output to know which releases have jobs to analyze and how many
Job JSON field names (use these exactly — do NOT guess alternatives like job_name):
job — full job namebuild_id — unique build identifierartifacts_dir — local path to downloaded artifactsurl — Prow job URLstatus — job result (failure, FAILURE, SUCCESS, PENDING)pr_number — PR number (PR jobs only)Error Handling:
<ARGUMENTS> is empty, show usage and stopGoal: Generate performance graphs from PCP archives for all jobs that have pmlogs.
Actions:
Run the graphs script (this is deterministic, no LLM needed):
bash plugins/microshift-ci/scripts/doctor.sh graphs --workdir <WORKDIR>
The script finds PCP archives in downloaded artifacts and generates PNG graphs at <WORKDIR>/graphs/<build_id>/:
1_cpu_usage.png — CPU usage (user, system, I/O wait)2_mem_usage.png — Memory usage (used, cached)3_disk_io.png — Disk I/O (read/write OPS, await)4_disk_usage.png — Disk usage by partition (% fill)If prerequisites are missing (pcp2json, matplotlib), the script errors and stops.
Goal: Get detailed root cause analysis for each failed job using pre-downloaded artifacts.
Actions:
Use the JSON summary output from Step 1 to build agent prompts. Do NOT read the job JSON files into the main conversation — the prepare script already printed all job details (artifacts_dir, build_id, job name) and agents receive artifacts_dir directly in their prompt.
For every failed job across all releases and PRs, launch a separate Agent (using the Agent tool, NOT the Skill tool). For PR jobs, only launch agents for jobs with FAILURE status.
For release jobs:
Agent: subagent_type=general_purpose, prompt="Analyze this Prow job and save the report:
1. Run /microshift-ci:prow-job <ARTIFACTS_DIR>
2. After the analysis completes, save the FULL report output (including the --- STRUCTURED SUMMARY --- block) to:
<WORKDIR>/analyze-ci-release-<RELEASE>-job-<N>-<JOB_ID>.txt
Use the Write tool to save the file. The file must contain the complete analysis report."
For PR jobs:
Agent: subagent_type=general_purpose, prompt="Analyze this Prow job and save the report:
1. Run /microshift-ci:prow-job <ARTIFACTS_DIR>
2. After the analysis completes, save the FULL report output (including the --- STRUCTURED SUMMARY --- block) to:
<WORKDIR>/analyze-ci-prs-job-<N>-pr<PR>-<JOB_NAME_SUFFIX>.txt
Use the Write tool to save the file. The file must contain the complete analysis report."
Launch ALL agents (all releases + PRs) in a single message using run_in_background: true
After launching, say "Analyzing N jobs in parallel..." and STOP.
As agent completion notifications arrive, respond with only "." (a single period) — no summaries, no status updates.
CRITICAL: After ALL agents are confirmed complete, you MUST immediately proceed to Step 3. Do NOT end your turn with a dot. Do NOT stop. The task is NOT complete until the HTML report is generated in Step 4.
Goal: Search Jira for existing bugs matching each failure. Results are embedded in the HTML report.
Actions:
IMPORTANT: Wait until ALL analysis agents from Step 2 are confirmed complete
For each release version, launch microshift-ci:create-bugs in dry-run mode as an Agent:
Agent: subagent_type=general_purpose, prompt="Run /microshift-ci:create-bugs <version>"
If rebase PR analysis produced job files, also launch microshift-ci:create-bugs for rebase PRs (check the PR jobs JSON to identify rebase PR source identifiers like rebase-release-4.22):
Agent: subagent_type=general_purpose, prompt="Run /microshift-ci:create-bugs rebase-release-<version>"
Launch all create-bugs agents in parallel with run_in_background: true
Respond with only "." for each intermediate completion notification. Wait until all complete.
Each agent produces <WORKDIR>/analyze-ci-bugs-<source>.json
CRITICAL: After ALL bug correlation agents complete, you MUST immediately proceed to Step 4. Do NOT stop.
Error Handling:
IMPORTANT: This step is MANDATORY. The task is incomplete without it. You MUST run this even if previous steps produced errors.
Goal: Deterministically aggregate results and generate the HTML report.
Actions:
Run the finalize script:
bash plugins/microshift-ci/scripts/doctor.sh finalize --workdir <WORKDIR> <ARGUMENTS>
The script deterministically:
aggregate.py for each release and for PRs → summary.json filescreate-report.py → microshift-ci-doctor-report.htmlReport the script's output to the user
Actions:
Example Output:
Summary:
Periodics:
Release 4.19: 3 failed periodic jobs
Release 4.20: 7 failed periodic jobs
Release 4.21: 0 failed periodic jobs
Release 4.22: 12 failed periodic jobs
Pull Requests:
2 rebase PRs with 5 total failed jobs
HTML report generated: <WORKDIR>/microshift-ci-doctor-report.html
/microshift-ci:doctor 4.19,4.20,4.21,4.22
/microshift-ci:doctor 4.21,4.22
/microshift-ci:doctor 4.22
gsutil CLI must be installed for GCS access (uses anonymous access on public buckets)gh CLI must be authenticated with access to openshift/microshiftpcp-export-pcp2json — for PCP graph generationmatplotlib Python package — for PCP graph plotting--create after this command)prepare script downloads all artifacts upfront so prow-job agents use local paths (no redundant downloads)finalize script runs aggregation and HTML generation in one call<WORKDIR> — no improvised namesGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub openshift-eng/edge-tooling --plugin microshift-ci