agentleFS
GavinGreenwoodGavinGreenwood/agentic-workflow-template/.agents/skills/fix-cicd/SKILL.md

fix-cicd

Skill5 starsChanged 44 days agoMITView on GitHub

User-invoked only. Read the failing CI logs on this branch, diagnose flake vs real, fix or re-run

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Run git branch --show-current.

    line 13
  2. Very specific:

    If no failed jobs: output "✅ No failing jobs on <branch>." and stop.

    line 31
  3. Distinctive:

    Read every log end-to-end — the root cause is usually in the last error block.

    line 39
  4. Distinctive:

    Before touching code, check whether the failure is a transient flake:

    line 47
  5. Very specific:

    Run the same check locally (e.g.

    line 49
  6. Very specific:

    If the command succeeds: output "Flake detected — triggered rerun of run <run-id>.

    line 58
  7. Distinctive:

    If it fails: output the error and stop — do not attempt a code fix until the rerun issue is resolved.

    line 59
  8. Distinctive:

    Read only the files the logs implicate.

    line 65
  9. Very specific:

    Commit using the ticket ID: fix(<TICKET-ID>): <short description> and push.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Fix failing GitHub Actions jobs on the current branch.

Uses the gh CLI — no extra credentials needed beyond the GitHub auth already configured.

Step 1 — Identify the branch

Run git branch --show-current. Extract the ticket ID from the branch name (e.g. proj-144-... → PROJ-144).

Step 2 — Fetch the latest run for this branch

gh run list --branch <branch> --limit 5 --json databaseId,displayTitle,status,conclusion,createdAt,workflowName

Take the most recent completed run. If none found: output "No CI run found for this branch." and stop.

Step 3 — Fetch failed jobs

gh run view <run-id> --json jobs

Identify all failed jobs. Skip jobs that are still running or were skipped.

If no failed jobs: output "✅ No failing jobs on <branch>." and stop.

Step 4 — Fetch logs (parallel)

gh run view <run-id> --log-failed

Read every log end-to-end — the root cause is usually in the last error block. For targeted job-level logs:

gh run view <run-id> --job <job-id> --log

Step 5 — Diagnose: flake or real failure?

Before touching code, check whether the failure is a transient flake:

  • Run the same check locally (e.g. npm run lint, npm run typecheck, npm run test).
  • Cross-reference the failed job name against the files changed on this branch (git diff main...HEAD --name-only). If the job lints/tests code that this branch does not touch, a flake is likely.

If it looks like a flake — (i) the check passes locally and (ii) the failing job touches files this branch did not change, or (iii) the logs contain a known-transient signature (network timeout, registry 5xx, install blip): do NOT make a code change. Instead, trigger a rerun immediately:

gh run rerun <run-id> --failed

If the command succeeds: output "Flake detected — triggered rerun of run <run-id>. No code changes made." then stop. If it fails: output the error and stop — do not attempt a code fix until the rerun issue is resolved.

If it is a real failure (error implicates files changed on this branch, or reproduces locally): proceed to Step 6.

Step 6 — Fix

Read only the files the logs implicate. Apply the minimal fix. Do not refactor surrounding code.

Commit using the ticket ID: fix(<TICKET-ID>): <short description> and push.

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.