SDLC.ai VIRIM Agent Navigator

Find the right agent for your VIRIM project phase, role, or deliverable

cicd-triage

Skill detail with category, linked agents, and source metadata.

cicd-triage

Triages CI/CD check failures on pull requests — categorizes test failures, static analysis issues, and coverage drops, then guides fixes or documents exceptions. Use when CI checks fail on a PR and you need to decide what to fix versus what to skip. Works with any CI pipeline and any static analysis tool.

Category: code-analysis Used by 1 agents

Source: .github/skills/code-analysis/cicd-triage/SKILL.md

Used By Agents

Preview

View source preview (first 3000 chars)

# CI/CD Triage

This skill helps you categorize and address CI/CD failures on a pull request. Not all failures require action — some are known exceptions related to pre-existing issues not introduced by the current change.

Refer to the `github-interactions` skill for the token extraction helper, header setup, and `gh` CLI patterns.

---

## Step 1 — Fetch Check Results

### Via `gh` CLI (preferred)

```bash
gh pr checks {PR_NUMBER}
```

### Via REST API (fallback)

```powershell
$BASE = "https://api.github.com/repos/{OWNER}/{REPO}"

# Get the latest commit SHA on the PR
$pr  = Invoke-RestMethod -Uri "$BASE/pulls/{PR_NUMBER}" -Headers $headers
$sha = $pr.head.sha

# Fetch all check runs for that commit
$checks = Invoke-RestMethod -Uri "$BASE/commits/$sha/check-runs" -Headers $headers
$checks.check_runs | ForEach-Object {
    Write-Host "$($_.name): $($_.status) — $($_.conclusion)"
}
```

---

## Step 2 — Categorize Failures

### Failure Categories

| Category | Identifier | Action |
|---|---|---|
| Test failure — your code | Test references files you changed | MUST FIX — blocking |
| Test failure — unrelated | Test references files you did NOT change | INVESTIGATE — may be pre-existing flaky test; document in PR comment |
| Static analysis Bug | Severity: Bug | MUST FIX — likely a real code issue |
| Static analysis Vulnerability | Severity: Vulnerability | MUST FIX — security concern |
| Static analysis Code Smell — your code | In files you changed | SHOULD FIX — clean up your changes |
| Static analysis Code Smell — untouched | In files you did NOT change | SKIP — pre-existing tech debt |
| Coverage drop — your files | Decreased in files IN your PR diff | SHOULD FIX — add tests for new/changed code |
| Coverage drop — other files | Decreased in files NOT in your PR diff | SKIP — not your responsibility |
| Duplication — your code | New duplication introduced by your changes | SHOULD FIX — extract shared logic |
| Duplication — pre-existing | Duplication existed before your changes | SKIP — tech debt, not blocking |

---

## Step 3 — Triage Table

Present findings to the user in this format:

```
## CI/CD Triage — PR #{PR_NUMBER}

| # | Category | Details | Action | Status |
|---|----------|---------|--------|--------|
| 1 | [MUST FIX] Test failure | OrderService.test.ts — expected call not received | Fix: update mock after API change | Pending |
| 2 | [SHOULD FIX] Coverage drop | OrderForm.ts — 72% to 65% (your file) | Add test for new validation branch | Pending |
| 3 | [SKIP] Coverage drop | LegacyUtils.ts — 80% to 78% (not in diff) | Pre-existing — skip | Skipped |
| 4 | [SKIP] Code smell | OldPage.ts — cognitive complexity (untouched) | Pre-existing tech debt — skip | Skipped |
```

Ask the user:
> "Which items would you like me to fix? (e.g., 'all actionable', '1 and 2', 'just the test failure')"

---

## Step 4 — Fix Failures

### Test failures

1. Read the failing test file
2. Read the source file it tests
3. Understand what changed th