monitor-ci

nrwl/nx-ai-agents-config · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/nrwl/nx-ai-agents-config --skill monitor-ci
0 commentsdiscussion
summary

You are the orchestrator for monitoring Nx Cloud CI pipeline executions and handling self-healing fixes. You spawn subagents to interact with Nx Cloud, run deterministic decision scripts, and take action based on the results.

skill.md

Monitor CI Command

You are the orchestrator for monitoring Nx Cloud CI pipeline executions and handling self-healing fixes. You spawn subagents to interact with Nx Cloud, run deterministic decision scripts, and take action based on the results.

Context

  • Current Branch: !git branch --show-current
  • Current Commit: !git rev-parse --short HEAD
  • Remote Status: !git status -sb | head -1

User Instructions

$ARGUMENTS

Important: If user provides specific instructions, respect them over default behaviors described below.

Configuration Defaults

Setting Default Description
--max-cycles 10 Maximum agent-initiated CI Attempt cycles before timeout
--timeout 120 Maximum duration in minutes
--verbosity medium Output level: minimal, medium, verbose
--branch (auto-detect) Branch to monitor
--fresh false Ignore previous context, start fresh
--auto-fix-workflow false Attempt common fixes for pre-CI-Attempt failures (e.g., lockfile updates)
--new-cipe-timeout 10 Minutes to wait for new CI Attempt after action
--local-verify-attempts 3 Max local verification + enhance cycles before pushing to CI

Parse any overrides from $ARGUMENTS and merge with defaults.

Nx Cloud Connection Check

Before starting the monitoring loop, verify the workspace is connected to Nx Cloud. Without this connection, no CI data is available and the entire skill is inoperable.

Step 0: Verify Nx Cloud Connection

  1. Check nx.json at workspace root for nxCloudId or nxCloudAccessToken

  2. If nx.json missing OR neither property exists → exit with:

    Nx Cloud not connected. Unlock 70% faster CI and auto-fix broken PRs with https://nx.dev/nx-cloud
    
  3. If connected → continue to main loop

Architecture Overview

  1. This skill (orchestrator): spawns subagents, runs scripts, prints status, does local coding work
  2. ci-monitor-subagent (haiku): calls one MCP tool (ci_information or update_self_healing_fix), returns structured result, exits
  3. ci-poll-decide.mjs (deterministic script): takes ci_information result + state, returns action + status message
  4. ci-state-update.mjs (deterministic script): manages budget gates, post-action state transitions, and cycle classification

Status Reporting

The decision script handles message formatting based on verbosity. When printing messages to the user:

  • Prepend [monitor-ci] to every message from the script's message field
  • For your own action messages (e.g. "Applying fix via MCP..."), also prepend [monitor-ci]

Anti-Patterns

These behaviors cause real problems — racing with self-healing, losing CI progress, or wasting context:

Anti-Pattern Why It's Bad
Using CI provider CLIs with --watch flags (e.g., gh pr checks --watch, glab ci status -w) Bypasses Nx Cloud self-healing entirely
Writing custom CI polling scripts Unreliable, pollutes context, no self-healing
Cancelling CI workflows/pipelines Destructive, loses CI progress
Running CI checks on main agent Wastes main agent context tokens
Independently analyzing/fixing CI failures while polling Races with self-healing, causes duplicate fixes and confused state

If this skill fails to activate, the fallback is:

  1. Use CI provider CLI for a one-time, read-only status check (single call, no watch/polling flags)
  2. Immediately delegate to this skill with gathered context
  3. Do not continue polling on main agent — it wastes context tokens and bypasses self-healing

Session Context Behavior

If the user previously ran /monitor-ci in this session, you may have prior state (poll counts, last CI Attempt URL, etc.). Resume from that state unless --fresh is set, in which case discard it and start from Step 1.

MCP Tool Reference

The ci_information and update_self_healing_fix tools are called via the ci-monitor-subagent, not directly from the orchestrator. Calling MCP tools directly wastes main agent context with large response payloads. The field sets below are for composing subagent prompts (see Step 2a).

Three field sets control polling efficiency — use the lightest set that gives you what you need:

WAIT_FIELDS: 'cipeUrl,commitSha,cipeStatus'
LIGHT_FIELDS: 'cipeStatus,cipeUrl,branch,commitSha,selfHealingStatus,verificationStatus,userAction,failedTaskIds,verifiedTaskIds,selfHealingEnabled,failureClassification,couldAutoApplyTasks,autoApplySkipped,autoApplySkipReason,shortLink,confidence,confidenceReasoning,hints,selfHealingSkippedReason,selfHealingSkipMessage'
HEAVY_FIELDS: 'taskOutputSummary,suggestedFix,suggestedFixReasoning,suggestedFixDescription'

The ci_information tool accepts branch (optional, defaults to current git branch), select (comma-separated field names), and pageToken (0-based pagination for long strings).

The update_self_healing_fix tool accepts a shortLink and an action: APPLY, REJECT, or RERUN_ENVIRONMENT_STATE.

Default Behaviors by Status

The decision script returns one of the following statuses. This table defines the default behavior for each. User instructions can override any of these.

Simple exits — just report and exit:

Status Default Behavior
ci_success Exit with success
cipe_canceled Exit, CI was canceled
cipe_timed_out Exit, CI timed out
polling_timeout Exit, polling timeout reached
circuit_breaker Exit, no progress after 13 consecutive polls
environment_rerun_cap Exit, environment reruns exhausted
fix_auto_applying Self-healing is handling it — just record last_cipe_url, enter wait mode. No MCP call or local git ops needed.
error Wait 60s and loop

Statuses requiring action — when handling these in Step 3, read references/fix-flows.md for the detailed flow:

Status Summary
fix_auto_apply_skipped Fix verified but auto-apply skipped (e.g., loop prevention). Inform user, offer manual apply.
fix_apply_ready Fix verified (all tasks or e2e-only). Apply via MCP.
fix_needs_local_verify Fix has unverified non-e2e tasks. Run locally, then apply or enhance.
fix_needs_review Fix verification failed/not attempted. Analyze and decide.
fix_failed Self-healing failed. Fetch heavy data, attempt local fix (gate check first).
no_fix No fix available. Fetch heavy data, attempt local fix (gate check first) or exit.
environment_issue Request environment rerun via MCP (gate check first).
self_healing_throttled Reject old fixes, attempt local fix.
no_new_cipe CI Attempt never spawned. Auto-fix workflow or exit with guidance.
cipe_no_tasks CI failed with no tasks. Retry once with empty commit.

Key rules (always apply):

  • Git safety: Stage specific files by name — git add -A or git add . risks committing the user's unrelated work-in-progress or secrets
  • Environment failures (OOM, command not found, permission denied): bail immediately. These aren't code bugs, so spending local-fix budget on them is wasteful
  • Gate check: Run ci-state-update.mjs gate before local fix attempts — if budget exhausted, print message and exit

Main Loop

Step 1: Initialize Tracking

cycle_count = 0            # Only incremented for agent-initiated cycles (counted against --max-cycles)
start_time = now()
no_progress_count = 0
local_verify_count = 0
env_rerun_count = 0
last_cipe_url = null
expected_commit_sha = null
agent_triggered = false    # Set true after monitor takes an action that triggers new CI Attempt
poll_count = 0
wait_mode = false
prev_status = null
prev_cipe_status = null
prev_sh_status = null
prev_verification_status = null
prev_failure_classification = null

Step 2: Polling Loop

Repeat until done:

2a. Spawn subagent (FETCH_STATUS)

Determine select fields based on mode:

  • Wait mode: use WAIT_FIELDS (cipeUrl,commitSha,cipeStatus)
  • Normal mode (first poll or after newCipeDetected): use LIGHT_FIELDS
Task(
  agent: "ci-monitor-subagent",
  model: haiku,
  prompt: "FETCH_STATUS for branch '<branch>'.
           select: '<fields>'"
)

The subagent calls ci_information and returns a JSON object with the requested fields. This is a foreground call — wait for the result.

2b. Run decision script

node <skill_dir>/scripts/ci-poll-decide.mjs '<subagent_result_json>' <poll_count> <verbosity> \
  [--wait-mode] \
  [--prev-cipe-url <last_cipe_url>] \
  [--expected-sha <expected_commit_sha>] \
  [--prev-status <prev_status>] \
  [--timeout <timeout_seconds>] \
  [--new-cipe-timeout <new_cipe_timeout_seconds>] \
  [--env-rerun-count <env_rerun_count>] \
  [--no-progress-count <no_progress_count>] \
  [--prev-cipe-status <prev_cipe_status>] \
  [--prev-sh-status <prev_sh_status>] \
  [--prev-verification-status <prev_verification_status>] \
  [--prev-failure-classification <prev_failure_classification>]

The script outputs a single JSON line: { action, code, message, delay?, noProgressCount, envRerunCount, fields?, newCipeDetected?, verifiableTaskIds? }

2c. Process script output

Parse the JSON output and update tracking state:

  • no_progress_count = output.noProgressCount
  • env_rerun_count = output.envRerunCount
  • prev_cipe_status = subagent_result.cipeStatus
  • prev_sh_status = subagent_result.selfHealingStatus
  • prev_verification_status = subagent_result.verificationStatus
  • prev_failure_classification = subagent_result.failureClassification
  • prev_status = output.action + ":" + (output.code || subagent_result.cipeStatus)
  • poll_count++

Based on action:

  • action == "poll": Print output.message, sleep output.delay seconds, go to 2a
    • If output.newCipeDetected: clear wait mode, reset wait_mode = false
  • action == "wait": Print output.message, sleep output.delay seconds, go to 2a
  • action == "done": Proceed to Step 3 with output.code

Step 3: Handle Actionable Status

When decision script returns action == "done":

  1. Run cycle-check (Step 4) before handling the code
  2. Check the returned code
  3. Look up default behavior in the table above
  4. Check if user instructions override the default
  5. Execute the appropriate action
  6. If action expects new CI Attempt, update tracking (see Step 3a)
  7. If action results in looping, go to Step 2

Spawning subagents for actions

Several statuses require fetching heavy data or calling MCP:

  • fix_apply_ready: Spawn UPDATE_FIX subagent with APPLY
  • fix_needs_local_verify: Spawn FETCH_HEAVY subagent for fix details before local verification
  • fix_needs_review: Spawn FETCH_HEAVY subagent → get suggestedFixDescription, suggestedFixSummary, taskFailureSummaries
  • fix_failed / no_fix: Spawn FETCH_HEAVY subagent → get taskFailureSummaries for local fix context
  • environment_issue: Spawn UPDATE_FIX subagent with RERUN_ENVIRONMENT_STATE
  • self_healing_throttled: Spawn FETCH_HEAVY subagent → get selfHealingSkipMessage; then FETCH_THROTTLE_INFO + UPDATE_FIX for each old fix

Step 3a: Track State for New-CI-Attempt Detection

After actions that should trigger a new CI Attempt, run:

node <skill_dir>/scripts/ci-state-update.mjs post-action \
  --action <type> \
  --cipe-url <current_cipe_url> \
  --commit-sha <git_rev_parse_HEAD>

Action types: fix-auto-applying, apply-mcp, apply-local-push, reject-fix-push, local-fix-push, env-rerun, auto-fix-push, empty-commit-push

The script returns { waitMode, pollCount, lastCipeUrl, expectedCommitSha, agentTriggered }. Update all tracking state from the output, then go to Step 2.

Step 4: Cycle Classification and Progress Tracking

When the decision script returns action == "done", run cycle-check before handling the code:

node <skill_dir>/scripts/ci-state-update.mjs cycle-check \
  --code <code> \
  [--agent-triggered] \
  --cycle-count <cycle_count> --max-cycles <max_cycles> \
  --env-rerun-count <env_rerun_count>

The script returns { cycleCount, agentTriggered, envRerunCount, approachingLimit, message }. Update tracking state from the output.

  • If approachingLimit → ask user whether to continue (with 5 or 10 more cycles) or stop monitoring
  • If previous cycle was NOT agent-triggered (human pushed), log that human-initiated push was detected

Progress Tracking

  • no_progress_count, circuit breaker (5 polls), and backoff reset are handled by ci-poll-decide.mjs (progress = any change in cipeStatus, selfHealingStatus, verificationStatus, or failureClassification)
  • env_rerun_count reset on non-environment status is handled by ci-state-update.mjs cycle-check
  • On new CI Attempt detected (poll script returns newCipeDetected) → reset local_verify_count = 0, env_rerun_count = 0

Error Handling

Error Action
Git rebase conflict Report to user, exit
nx-cloud apply-locally fails Reject fix via MCP (action: "REJECT"), then attempt manual patch (Reject + Fix From Scratch Flow) or exit
MCP tool error Retry once, if fails report to user
Subagent spawn failure Retry once, if fails exit with error
Decision script error Treat as error status, increment no_progress_count
No new CI Attempt detected If --auto-fix-workflow, try lockfile update; otherwise report to user with guidance
Lockfile auto-fix fails Report to user, exit with guidance to check CI logs

User Instruction Examples

Users can override default behaviors:

how to use monitor-ci

How to use monitor-ci on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add monitor-ci
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/nrwl/nx-ai-agents-config --skill monitor-ci

The skills CLI fetches monitor-ci from GitHub repository nrwl/nx-ai-agents-config and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/monitor-ci

Reload or restart Cursor to activate monitor-ci. Access the skill through slash commands (e.g., /monitor-ci) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.659 reviews
  • Luis Chawla· Dec 28, 2024

    I recommend monitor-ci for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Diya Li· Dec 24, 2024

    monitor-ci fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Noor Liu· Dec 24, 2024

    Useful defaults in monitor-ci — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Shikha Mishra· Dec 20, 2024

    I recommend monitor-ci for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Zaid Reddy· Dec 16, 2024

    Keeps context tight: monitor-ci is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Aisha Sharma· Dec 12, 2024

    Registry listing for monitor-ci matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Aisha Kapoor· Nov 27, 2024

    monitor-ci reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Diya Thomas· Nov 15, 2024

    We added monitor-ci from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Isabella Menon· Nov 15, 2024

    monitor-ci has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Aditi Okafor· Nov 7, 2024

    monitor-ci is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

showing 1-10 of 59

1 / 6
Instruction Effect
"never auto-apply" Always prompt before applying any fix
"always ask before git push" Prompt before each push
"reject any fix for e2e tasks" Auto-reject if failedTaskIds contains e2e
"apply all fixes regardless of verification" Skip verification check, apply everything