agentleFS
hyperledger-cactihyperledger-cacti/cacti/.github/skills/ci-triage/SKILL.md

ci-triage

Skill412 starsChanged 4 months agoApache-2.0View on GitHub

Triage Cacti CI failures on a PR or main branch, fetch failing job logs via gh CLI, categorize root causes, and produce a structured markdown report at docs/ci-reports/. Use when the user asks why CI is failing, asks for a CI failure report, references a failing PR or run, mentions GitHub Actions failures, or asks to analyze/diagnose pipeline issues in the Hyperledger Cacti monorepo.

17 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer the API (works while runs are in progress and is more reliable than gh run view --log-failed):

    line 48
  2. Distinctive:

    Use templates/report-template.md.

    line 78
  3. Distinctive:

    Run metadata (PR/sha, run id, date)

    line 81

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cacti CI Triage Skill

End-to-end workflow for diagnosing failing GitHub Actions runs on the hyperledger-cacti/cacti monorepo and producing a fixable report.

Quick Start

# Triage a PR end-to-end and write a report
.github/skills/ci-triage/scripts/triage-pr.sh 4152

# Triage main branch HEAD (aggregates all workflows on that commit)
.github/skills/ci-triage/scripts/triage-main.sh

# Triage one specific workflow run (handy for workflow_dispatch URLs)
.github/skills/ci-triage/scripts/triage-run.sh 26411751837

Each script writes a report to docs/ci-reports/ that the agent then refines using the categorization rules below.

Workflow

1. Enumerate failing checks

For a PR:

gh pr checks <PR> --repo hyperledger-cacti/cacti --json name,state,link \
  --jq '.[] | select(.state=="FAILURE" or .state=="CANCELLED")'

For a commit/main:

gh api "repos/hyperledger-cacti/cacti/commits/<sha>/check-runs?per_page=100" \
  --jq '.check_runs[] | select(.conclusion=="failure" or .conclusion=="cancelled")
        | {name, html_url, id:.id}'

2. Fetch failing job logs

Prefer the API (works while runs are in progress and is more reliable than gh run view --log-failed):

gh api repos/hyperledger-cacti/cacti/actions/jobs/<job_id>/logs \
  | grep -iE "FAIL |error|exit code|timeout|no tests found|undefined:|cannot find" \
  | grep -vE "YN0|deprecat|warning|notice|test-reporter|##\[group" \
  | tail -40

3. Categorize each failure

Match each failure to a root-cause bucket (see REFERENCE.md for the full pattern catalog and historical examples). Common buckets:

BucketSignalAction
PR-caused regressionNew error in code/config the PR touchedBlock merge, fix in PR
Self-inflicted by ignore patternNo tests found, exiting with code 1Add --passWithNoTests or remove the job
Jest config regexSyntaxError: Invalid regular expression: Nothing to repeatFix jest.config.js (glob != regex)
Polkadot/ESMdynamic import callback was invoked without --experimental-vm-modulesAdd Jest ESM flag
Go toolchainundefined: min in protobuf packageBump actions/setup-go to 1.23
Long-running integration timeoutExceeded timeout of 3600000 ms for a hookPre-existing flake; document, don't block PR
Removed package jobJob exists for archived packageRemove from *-workflow.yaml
GHA infra flakeCache service responded with 400, Create Artifact Container failed, Bad credentialsRe-run; pin perms/token if recurring
Permissions / OIDCBad credentials on dorny/paths-filterAdd permissions: block + explicit token
Empty github.base_reffatal: Not a valid object name origin/ exit 128 on dispatch/scheduleGuard with if [[ -z "$BASE_REF" ]] fallback

4. Write the report

Use templates/report-template.md. Required sections:

  • Run metadata (PR/sha, run id, date)
  • Summary table (job → bucket → caused-by-PR)
  • Per-failure details with log excerpts (5-10 lines)
  • Recommended fixes ordered by priority
  • Pre-existing vs PR-caused split

5. Verify report before sharing

  • Every failing job has a category and recommendation
  • Log excerpts include the actual error line, not just ##[error]
  • Pre-existing flakes are clearly separated from PR regressions
  • File saved at docs/ci-reports/pr-<N>-ci-failures.md

Cacti-specific Gotchas

  • Cacti CI workflow removed push trigger (commit ce833fd95). On main it only runs via schedule (Mon/Thu 08:00 UTC) or workflow_dispatch. Trigger manually: gh workflow run "Cacti CI" --ref main.
  • gh run view --log-failed often returns empty for long runs. Use gh api .../actions/jobs/<id>/logs instead.
  • testPathIgnorePatterns in jest.config.js are RegExp, not globs.
  • workspace: protocol resolves locally even when the version is unpublished on npm — don't confuse YN0002 workspace warnings with real failures.
  • Per-job JEST_TEST_PATTERN + a matching testPathIgnorePatterns entry results in "No tests found, exiting with code 1". Remove the job, not the ignore.

Files

  • scripts/triage-pr.sh — full PR triage pipeline
  • scripts/triage-main.sh — main branch triage
  • scripts/triage-run.sh — single workflow run triage (good for workflow_dispatch URLs)
  • scripts/fetch-job-log.sh — single-job log fetch + filter (high-signal grep with SARIF/JSON noise stripped)
  • REFERENCE.md — full pattern catalog
  • templates/report-template.md — report skeleton

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.