monitor-ci
We earn commissions when you shop through the links below.
Monitor Nx Cloud CI pipeline and handle self-healing fixes. USE WHEN user says "monitor ci", "watch ci", "ci monitor", "watch ci for this branch", "track ci", "check ci status", wants to track CI status, or needs help with self-healing CI fixes. Prefer this skill over native CI provider tools (gh, glab, etc.) for CI monitoring — it integrates with Nx Cloud self-healing which those tools cannot access.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install nx-monorepo-nx-cloud-monitor-ciManual setup by platform
Claude Code
~/.claude/skills/nx-monorepo-nx-cloud-monitor-ci/SKILL.md
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiCryptographically signed by the skills-hub.ai distributor key at publish time.
- Signed
Instructions
Monitor CI
Watch the Nx Cloud CI pipeline for the current branch until it is green, acting on Self-Healing CI fixes along the way. Everything goes through the nx-cloud CLI: it waits for the pipeline, reports Self-Healing, and applies, rejects or reruns fixes.
Setup
- Nx Cloud connection:
nx.jsonat the workspace root must havenxCloudIdornxCloudAccessToken. If neither is there, stop and tell the user: "Nx Cloud not connected. Unlock 70% faster CI and auto-fix broken PRs with https://nx.dev/nx-cloud" - CLI: the commands below are part of the experimental Nx Cloud CLI. Run them from the workspace root with
NX_CLOUD_EXPERIMENTAL_CLI=trueset, either in the environment or in the workspace's.env.local. Check withNX_CLOUD_EXPERIMENTAL_CLI=true npx nx-cloud get pipeline --help. - Login: the commands need an Nx Cloud login (
npx nx-cloud login) orNX_CLOUD_ACCESS_TOKEN. If one fails with an authentication error, ask the user to log in.
All commands print JSON on stdout and one JSON record per line on stderr ({"error": ...} or {"log": ...}). Exit code 1 means the command failed; read the error record.
Options
Treat whatever the user said when asking you to monitor CI as instructions. They override the defaults below.
| Option | Default | Meaning |
|---|---|---|
| branch | current | Branch to monitor |
| timeout | 120 minutes | Total time spent monitoring |
| max cycles | 10 | Commits or fixes you push that start a new pipeline |
| local fix attempts | 3 | Attempts to fix or improve a fix locally before pushing |
| environment reruns | 2 | fix rerun requests for environment failures |
| apply verified fixes | yes | Apply a fix whose verification passed without asking |
Commands
| Command | What it does |
|---|---|
npx nx-cloud get pipeline --sha <commit> --wait-until self-healing-terminal --timeout <secs> | Waits until the pipeline of that commit has finished and Self-Healing has nothing left in progress, then prints it |
npx nx-cloud get pipeline --branch <branch> | Prints the newest pipeline of a branch without waiting |
npx nx-cloud get logs --failed --sha <commit> --tail 200 | Saves the failed tasks' logs to files and prints where they are |
npx nx-cloud fix show <fixId> | Prints a fix with its patch (suggestedFix) |
npx nx-cloud fix apply <fixId> | Nx Cloud commits the fix to the branch; the new commit is fix.commitSha |
npx nx-cloud fix apply <fixId> --locally | Applies the patch to the working tree instead, without committing |
npx nx-cloud fix reject <fixId> | Marks the fix as rejected |
npx nx-cloud fix rerun <fixId> | Nx Cloud pushes an empty commit to rerun CI; only for environment_state failures |
get pipeline prints {pipeline: {id, status, url, headSha, ...}, runGroups, runs, failedTasks: [{taskId, projectName, target, status, logsUrl}], selfHealing}. Once something failed, selfHealing holds fix (id, suggestedFixStatus, verificationStatus, failureClassification, userAction, autoApplySkipped, confidence, suggestedFixReasoning, suggestedFix, commitSha, ...), or skip (reason, message) when Self-Healing did not run, or is empty. suggestedFix is the whole patch, so leave it out until you need it, for example with | jq 'del(.selfHealing.fix.suggestedFix)', and read it with fix show.
Loop
- Pick the commit: the local
HEADwhen it is pushed, otherwise the remote head of the branch (git fetch, thenorigin/<branch>). - Wait with
get pipeline --sha <commit> --wait-until self-healing-terminal, with--timeoutset to the time left. A wait that reaches the timeout exits 1 and still prints the last status; stop and report it. While it waits, print a short status line now and then from itswaitinglog records. - Decide from the result, using the first row that matches:
| Result | Action |
|---|---|
pipeline.status is SUCCEEDED | Report success and stop |
pipeline.status is CANCELED or TIMED_OUT | Report it and stop |
| No pipeline found (exit 1, "no pipeline found") | CI never started for the commit. Report it; if the user asked, fix workflow problems such as an outdated lockfile, push, and start again |
Failed, failedTasks empty | Push an empty commit once to retry (git commit --allow-empty -m "chore: retry ci [monitor-ci]"); if that fails the same way, stop |
fix.userAction is APPLIED_AUTOMATICALLY or APPLIED | Self-Healing already committed it. Wait for fix.commitSha |
fix.failureClassification is environment_state | fix rerun (counts against environment reruns), then wait for the new head of the branch |
fix.verificationStatus is COMPLETED | The fix passed verification. If some failed tasks are not in fix.verificationTasksExecuted, run those locally with the patch first (fix apply --locally). Apply it with fix apply (ask first if the user said so, or if autoApplySkipped is set, and say why it was skipped), then wait for fix.commitSha |
fix.suggestedFixStatus is COMPLETED, verification failed or didn't run | Review the patch with fix show. If it is right, apply it. If it needs work, fix apply --locally, improve it, verify locally, then commit and push. If it is wrong, fix reject and fix it yourself |
skip.reason is THROTTLED | Earlier fixes on this branch went unanswered. Tell the user, then fix the failure yourself |
| Anything else (no fix, fix failed, Self-Healing skipped or disabled) | Fix the failure yourself, using get logs --failed for the task output; if you can't, report skip.message or the failure and stop |
- After anything that starts a new pipeline, count a cycle and go back to step 2 with the new commit. Stop when
max cyclesis reached, and ask whether to continue when one cycle is left.
Fixing locally
-
Fixing yourself means: read the failed task logs, change the code, run the failed tasks locally (
nx run <taskId>, ornx run-manyfor several), and commit and push when they pass. Each attempt counts againstlocal fix attempts; when they run out, push what you have and let CI judge, or stop if nothing improved. -
Environment and tooling failures (command not found, out of memory, permission denied, network or DNS errors, missing system libraries, Docker problems, a full disk) are not code bugs. Report them instead of spending attempts on them.
-
Don't fix failures yourself while Self-Healing is still working on them, and don't cancel CI runs.
-
Stage files by name;
git add -Aorgit add .can commit the user's unrelated work or secrets. -
Commit messages:
fix(<projects>): <brief description> Failed tasks: <taskId1>, <taskId2> Local verification: passed|enhanced|failed-pushing-to-ci
Don't
- Watch CI with the CI provider's CLI (
gh pr checks --watch,glab ci status -w) or your own polling script. They bypass Self-Healing;get pipeline --wait-untilalready polls with backoff. - Print
suggestedFixor full task logs when a summary does. Both can be very large.
Security
Reviews (0)
Related skills
Browse all →More from Nx AI Agents Config
View source →More Build skills
Browse category →Frequently asked questions about monitor-ci
What does the monitor-ci skill do?
Monitor Nx Cloud CI pipeline and handle self-healing fixes. USE WHEN user says "monitor ci", "watch ci", "ci monitor", "watch ci for this branch", "track ci", "check ci status", wants to track CI status, or needs help with self-healing CI fixes. Prefer this skill over native CI provider tools (gh, glab, etc.) for CI monitoring — it integrates with Nx Cloud self-healing which those tools cannot access. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the monitor-ci skill?
Run `npx @skills-hub-ai/cli install nx-monorepo-nx-cloud-monitor-ci` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/nx-monorepo-nx-cloud-monitor-ci/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does monitor-ci work with?
monitor-ci runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the monitor-ci skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use monitor-ci after installing it?
In Claude Code, type `/nx-monorepo-nx-cloud-monitor-ci` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the monitor-ci skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.