[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79RVENWSHEDKDP3916FV21H":3,"skill-same:01M79RVENWSHEDKDP3916FV21H":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M79RVENWSHEDKDP3916FV21H","monitor-ci",null,"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.","socialrobot-io\u002Fagent-kit","socialrobot-io","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F310128493?v=4","01M79RV7DY6VNDT9KXPS3HH9ZV","Socialrobot.io","01M79RV7EKQ1E2TAZ9D33BCM87",6,"MIT","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmonitor-ci\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: monitor-ci\ndescription: 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.\n---\n\n# Monitor CI Command\n\nYou 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.\n\n## Context\n\n- **Current Branch:** !`git branch --show-current`\n- **Current Commit:** !`git rev-parse --short HEAD`\n- **Remote Status:** !`git status -sb | head -1`\n\n## User Instructions\n\n$ARGUMENTS\n\n**Important:** If user provides specific instructions, respect them over default behaviors described below.\n\n## Configuration Defaults\n\n| Setting                   | Default       | Description                                                               |\n| ------------------------- | ------------- | ------------------------------------------------------------------------- |\n| `--max-cycles`            | 10            | Maximum **agent-initiated** CI Attempt cycles before timeout              |\n| `--timeout`               | 120           | Maximum duration in minutes                                               |\n| `--verbosity`             | medium        | Output level: minimal, medium, verbose                                    |\n| `--branch`                | (auto-detect) | Branch to monitor                                                         |\n| `--fresh`                 | false         | Ignore previous context, start fresh                                      |\n| `--auto-fix-workflow`     | false         | Attempt common fixes for pre-CI-Attempt failures (e.g., lockfile updates) |\n| `--new-cipe-timeout`      | 10            | Minutes to wait for new CI Attempt after action                           |\n| `--local-verify-attempts` | 3             | Max local verification + enhance cycles before pushing to CI              |\n\nParse any overrides from `$ARGUMENTS` and merge with defaults.\n\n## Nx Cloud Connection Check\n\nBefore 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.\n\n### Step 0: Verify Nx Cloud Connection\n\n1. **Check `nx.json`** at workspace root for `nxCloudId` or `nxCloudAccessToken`\n2. **If `nx.json` missing OR neither property exists** → exit with:\n\n   ```\n   Nx Cloud not connected. Unlock 70% faster CI and auto-fix broken PRs with https:\u002F\u002Fnx.dev\u002Fnx-cloud\n   ```\n\n3. **If connected** → continue to main loop\n\n## Architecture Overview\n\n1. **This skill (orchestrator)**: spawns subagents, runs scripts, prints status, does local coding work\n2. **ci-monitor-subagent (haiku)**: calls one MCP tool (ci_information or update_self_healing_fix), returns structured result, exits\n3. **ci-poll-decide.mjs (deterministic script)**: takes ci_information result + state, returns action + status message\n4. **ci-state-update.mjs (deterministic script)**: manages budget gates, post-action state transitions, and cycle classification\n\n## Status Reporting\n\nThe decision script handles message formatting based on verbosity. When printing messages to the user:\n\n- Prepend `[monitor-ci]` to every message from the script's `message` field\n- For your own action messages (e.g. \"Applying fix via MCP...\"), also prepend `[monitor-ci]`\n\n## Anti-Patterns\n\nThese behaviors cause real problems — racing with self-healing, losing CI progress, or wasting context:\n\n| Anti-Pattern                                                                                    | Why It's Bad                                                       |\n| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |\n| Using CI provider CLIs with `--watch` flags (e.g., `gh pr checks --watch`, `glab ci status -w`) | Bypasses Nx Cloud self-healing entirely                            |\n| Writing custom CI polling scripts                                                               | Unreliable, pollutes context, no self-healing                      |\n| Cancelling CI workflows\u002Fpipelines                                                               | Destructive, loses CI progress                                     |\n| Running CI checks on main agent                                                                 | Wastes main agent context tokens                                   |\n| Independently analyzing\u002Ffixing CI failures while polling                                        | Races with self-healing, causes duplicate fixes and confused state |\n\n**If this skill fails to activate**, the fallback is:\n\n1. Use CI provider CLI for a one-time, read-only status check (single call, no watch\u002Fpolling flags)\n2. Immediately delegate to this skill with gathered context\n3. Do not continue polling on main agent — it wastes context tokens and bypasses self-healing\n\n## Session Context Behavior\n\nIf the user previously ran `\u002Fmonitor-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.\n\n## MCP Tool Reference\n\nThree field sets control polling efficiency — use the lightest set that gives you what you need:\n\n```yaml\nWAIT_FIELDS: 'cipeUrl,commitSha,cipeStatus'\nLIGHT_FIELDS: 'cipeStatus,cipeUrl,branch,commitSha,selfHealingStatus,verificationStatus,userAction,failedTaskIds,verifiedTaskIds,selfHealingEnabled,failureClassification,couldAutoApplyTasks,autoApplySkipped,autoApplySkipReason,shortLink,confidence,confidenceReasoning,hints,selfHealingSkippedReason,selfHealingSkipMessage'\nHEAVY_FIELDS: 'taskOutputSummary,suggestedFix,suggestedFixReasoning,suggestedFixDescription'\n```\n\nThe `ci_information` tool accepts `branch` (optional, defaults to current git branch), `select` (comma-separated field names), and `pageToken` (0-based pagination for long strings).\n\nThe `update_self_healing_fix` tool accepts a `shortLink` and an action: `APPLY`, `REJECT`, or `RERUN_ENVIRONMENT_STATE`.\n\n## Default Behaviors by Status\n\nThe decision script returns one of the following statuses. This table defines the **default behavior** for each. User instructions can override any of these.\n\n**Simple exits** — just report and exit:\n\n| Status                  | Default Behavior                                                                                                 |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------------- |\n| `ci_success`            | Exit with success                                                                                                |\n| `cipe_canceled`         | Exit, CI was canceled                                                                                            |\n| `cipe_timed_out`        | Exit, CI timed out                                                                                               |\n| `polling_timeout`       | Exit, polling timeout reached                                                                                    |\n| `circuit_breaker`       | Exit, no progress after 13 consecutive polls                                                                     |\n| `environment_rerun_cap` | Exit, environment reruns exhausted                                                                               |\n| `fix_auto_applying`     | Self-healing is handling it — just record `last_cipe_url`, enter wait mode. No MCP call or local git ops needed. |\n| `error`                 | Wait 60s and loop                                                                                                |\n\n**Statuses requiring action** — when handling these in Step 3, read `references\u002Ffix-flows.md` for the detailed flow:\n\n| Status                   | Summary                                                                                       |\n| ------------------------ | --------------------------------------------------------------------------------------------- |\n| `fix_auto_apply_skipped` | Fix verified but auto-apply skipped (e.g., loop prevention). Inform user, offer manual apply. |\n| `fix_apply_ready`        | Fix verified (all tasks or e2e-only). Apply via MCP.                                          |\n| `fix_needs_local_verify` | Fix has unverified non-e2e tasks. Run locally, then apply or enhance.                         |\n| `fix_needs_review`       | Fix verification failed\u002Fnot attempted. Analyze and decide.                                    |\n| `fix_failed`             | Self-healing failed. Fetch heavy data, attempt local fix (gate check first).                  |\n| `no_fix`                 | No fix available. Fetch heavy data, attempt local fix (gate check first) or exit.             |\n| `environment_issue`      | Request environment rerun via MCP (gate check first).                                         |\n| `self_healing_throttled` | Reject old fixes, attempt local fix.                                                          |\n| `no_new_cipe`            | CI Attempt never spawned. Auto-fix workflow or exit with guidance.                            |\n| `cipe_no_tasks`          | CI failed with no tasks. Retry once with empty commit.                                        |\n\n**Key rules (always apply):**\n\n- **Git safety**: Stage specific files by name — `git add -A` or `git add .` risks committing the user's unrelated work-in-progress or secrets\n- **Environment failures** (OOM, command not found, permission denied): bail immediately. These aren't code bugs, so spending local-fix budget on them is wasteful\n- **Gate check**: Run `ci-state-update.mjs gate` before local fix attempts — if budget exhausted, print message and exit\n\n## Main Loop\n\n### Step 1: Initialize Tracking\n\n```\ncycle_count = 0            # Only incremented for agent-initiated cycles (counted against --max-cycles)\nstart_time = now()         # Passed to the decision script as --elapsed-seconds on every poll to enforce --timeout across attempts\nno_progress_count = 0\nlocal_verify_count = 0\nenv_rerun_count = 0\nlast_cipe_url = null\nexpected_commit_sha = null\nagent_triggered = false    # Set true after monitor takes an action that triggers new CI Attempt\npoll_count = 0\nwait_mode = false\nprev_status = null\nprev_cipe_status = null\nprev_sh_status = null\nprev_verification_status = null\nprev_failure_classification = null\n```\n\n### Step 2: Polling Loop\n\nRepeat until done:\n\n#### 2a. Spawn subagent (FETCH_STATUS)\n\nDetermine select fields based on mode:\n\n- **Wait mode**: use WAIT_FIELDS (`cipeUrl,commitSha,cipeStatus`)\n- **Normal mode (first poll or after newCipeDetected)**: use LIGHT_FIELDS\n\nCall the `ci_information` tool with the determined `select` fields for the current branch. Wait for the result before proceeding.\n\n#### 2b. Run decision script\n\n```bash\nnode \u003Cskill_dir>\u002Fscripts\u002Fci-poll-decide.mjs '\u003Csubagent_result_json>' \u003Cpoll_count> \u003Cverbosity> \\\n  [--wait-mode] \\\n  [--prev-cipe-url \u003Clast_cipe_url>] \\\n  [--expected-sha \u003Cexpected_commit_sha>] \\\n  [--prev-status \u003Cprev_status>] \\\n  [--timeout \u003Ctimeout_minutes>] \\\n  [--new-cipe-timeout \u003Cnew_cipe_timeout_minutes>] \\\n  [--elapsed-seconds \u003Cseconds_since_start_time>] \\\n  [--env-rerun-count \u003Cenv_rerun_count>] \\\n  [--no-progress-count \u003Cno_progress_count>] \\\n  [--prev-cipe-status \u003Cprev_cipe_status>] \\\n  [--prev-sh-status \u003Cprev_sh_status>] \\\n  [--prev-verification-status \u003Cprev_verification_status>] \\\n  [--prev-failure-classification \u003Cprev_failure_classification>]\n```\n\nPass `--timeout` and `--new-cipe-timeout` in **minutes** (the values from Configuration Defaults) — the script converts to seconds internally. Pass `--elapsed-seconds` as the whole seconds elapsed since `start_time` (`now() - start_time`); this is what enforces `--timeout` as a **total** monitor budget across every poll and attempt, so it must be supplied on every call once monitoring has started.\n\nThe script outputs a single JSON line: `{ action, code, message, delay?, noProgressCount, envRerunCount, fields?, newCipeDetected?, verifiableTaskIds? }`\n\n#### 2c. Process script output\n\nParse the JSON output and update tracking state:\n\n- `no_progress_count = output.noProgressCount`\n- `env_rerun_count = output.envRerunCount`\n- `prev_cipe_status = subagent_result.cipeStatus`\n- `prev_sh_status = subagent_result.selfHealingStatus`\n- `prev_verification_status = subagent_result.verificationStatus`\n- `prev_failure_classification = subagent_result.failureClassification`\n- `prev_status = output.action + \":\" + (output.code || subagent_result.cipeStatus)`\n- `poll_count++`\n\nBased on `action`:\n\n- **`action == \"poll\"`**: Print `output.message`, sleep `output.delay` seconds, go to 2a\n  - If `output.newCipeDetected`: clear wait mode, reset `wait_mode = false`\n- **`action == \"wait\"`**: Print `output.message`, sleep `output.delay` seconds, go to 2a\n- **`action == \"done\"`**: Proceed to Step 3 with `output.code`\n\n### Step 3: Handle Actionable Status\n\nWhen decision script returns `action == \"done\"`:\n\n1. Run cycle-check (Step 4) **before** handling the code\n2. Check the returned `code`\n3. Look up default behavior in the table above\n4. Check if user instructions override the default\n5. Execute the appropriate action\n6. **If action expects new CI Attempt**, update tracking (see Step 3a)\n7. If action results in looping, go to Step 2\n\n#### Tool calls for actions\n\nSeveral statuses require fetching additional data or calling tools:\n\n- **fix_apply_ready**: Call `update_self_healing_fix` with action `APPLY`\n- **fix_needs_local_verify**: Call `ci_information` with HEAVY_FIELDS for fix details before local verification\n- **fix_needs_review**: Call `ci_information` with HEAVY_FIELDS → get `suggestedFixDescription`, `suggestedFixSummary`, `taskFailureSummaries`\n- **fix_failed \u002F no_fix**: Call `ci_information` with HEAVY_FIELDS → get `taskFailureSummaries` for local fix context\n- **environment_issue**: Call `update_self_healing_fix` with action `RERUN_ENVIRONMENT_STATE`\n- **self_healing_throttled**: Call `ci_information` with HEAVY_FIELDS → get `selfHealingSkipMessage`; then call `update_self_healing_fix` for each old fix\n\n### Step 3a: Track State for New-CI-Attempt Detection\n\nAfter actions that should trigger a new CI Attempt, run:\n\n```bash\nnode \u003Cskill_dir>\u002Fscripts\u002Fci-state-update.mjs post-action \\\n  --action \u003Ctype> \\\n  --cipe-url \u003Ccurrent_cipe_url> \\\n  --commit-sha \u003Cgit_rev_parse_HEAD>\n```\n\nAction types: `fix-auto-applying`, `apply-mcp`, `apply-local-push`, `reject-fix-push`, `local-fix-push`, `env-rerun`, `auto-fix-push`, `empty-commit-push`\n\nThe script returns `{ waitMode, pollCount, lastCipeUrl, expectedCommitSha, agentTriggered }`. Update all tracking state from the output, then go to Step 2.\n\n### Step 4: Cycle Classification and Progress Tracking\n\nWhen the decision script returns `action == \"done\"`, run cycle-check **before** handling the code:\n\n```bash\nnode \u003Cskill_dir>\u002Fscripts\u002Fci-state-update.mjs cycle-check \\\n  --code \u003Ccode> \\\n  [--agent-triggered] \\\n  --cycle-count \u003Ccycle_count> --max-cycles \u003Cmax_cycles> \\\n  --env-rerun-count \u003Cenv_rerun_count>\n```\n\nThe script returns `{ cycleCount, agentTriggered, envRerunCount, approachingLimit, limitReached, message }`. Update tracking state from the output.\n\n- If `limitReached` → the `--max-cycles` budget is exhausted. Print `message` and **stop monitoring** (do not handle the code or start another cycle). This is a hard stop, not advisory.\n- Else if `approachingLimit` → ask user whether to continue (with 5 or 10 more cycles) or stop monitoring\n- If previous cycle was NOT agent-triggered (human pushed), log that human-initiated push was detected\n\n#### Progress Tracking\n\n- `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)\n- `env_rerun_count` reset on non-environment status is handled by ci-state-update.mjs cycle-check\n- On new CI Attempt detected (poll script returns `newCipeDetected`) → reset `local_verify_count = 0`, `env_rerun_count = 0`\n\n## Error Handling\n\n| Error                          | Action                                                                                                      |\n| ------------------------------ | ----------------------------------------------------------------------------------------------------------- |\n| Git rebase conflict            | Report to user, exit                                                                                        |\n| `nx-cloud apply-locally` fails | Reject fix via MCP (`action: \"REJECT\"`), then attempt manual patch (Reject + Fix From Scratch Flow) or exit |\n| MCP tool error                 | Retry once, if fails report to user                                                                         |\n| Subagent spawn failure         | Retry once, if fails exit with error                                                                        |\n| Decision script error          | Treat as `error` status, increment `no_progress_count`                                                      |\n| No new CI Attempt detected     | If `--auto-fix-workflow`, try lockfile update; otherwise report to user with guidance                       |\n| Lockfile auto-fix fails        | Report to user, exit with guidance to check CI logs                                                         |\n\n## User Instruction Examples\n\nUsers can override default behaviors:\n\n| Instruction                                      | Effect                                              |\n| ------------------------------------------------ | --------------------------------------------------- |\n| \"never auto-apply\"                               | Always prompt before applying any fix               |\n| \"always ask before git push\"                     | Prompt before each push                             |\n| \"reject any fix for e2e tasks\"                   | Auto-reject if `failedTaskIds` contains e2e         |\n| \"apply all fixes regardless of verification\"     | Skip verification check, apply everything           |\n| \"if confidence \u003C 70, reject\"                     | Check confidence field before applying              |\n| \"run 'nx affected -t typecheck' before applying\" | Add local verification step                         |\n| \"auto-fix workflow failures\"                     | Attempt lockfile updates on pre-CI-Attempt failures |\n| \"wait 45 min for new CI Attempt\"                 | Override new-CI-Attempt timeout (default: 10 min)   |\n","# Monitor CI Command\n\nYou 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.\n\n## Context\n\n- **Current Branch:** !`git branch --show-current`\n- **Current Commit:** !`git rev-parse --short HEAD`\n- **Remote Status:** !`git status -sb | head -1`\n\n## User Instructions\n\n$ARGUMENTS\n\n**Important:** If user provides specific instructions, respect them over default behaviors described below.\n\n## Configuration Defaults\n\n| Setting                   | Default       | Description                                                               |\n| ------------------------- | ------------- | ------------------------------------------------------------------------- |\n| `--max-cycles`            | 10            | Maximum **agent-initiated** CI Attempt cycles before timeout              |\n| `--timeout`               | 120           | Maximum duration in minutes                                               |\n| `--verbosity`             | medium        | Output level: minimal, medium, verbose                                    |\n| `--branch`                | (auto-detect) | Branch to monitor                                                         |\n| `--fresh`                 | false         | Ignore previous context, start fresh                                      |\n| `--auto-fix-workflow`     | false         | Attempt common fixes for pre-CI-Attempt failures (e.g., lockfile updates) |\n| `--new-cipe-timeout`      | 10            | Minutes to wait for new CI Attempt after action                           |\n| `--local-verify-attempts` | 3             | Max local verification + enhance cycles before pushing to CI              |\n\nParse any overrides from `$ARGUMENTS` and merge with defaults.\n\n## Nx Cloud Connection Check\n\nBefore 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.\n\n### Step 0: Verify Nx Cloud Connection\n\n1. **Check `nx.json`** at workspace root for `nxCloudId` or `nxCloudAccessToken`\n2. **If `nx.json` missing OR neither property exists** → exit with:\n\n   ```\n   Nx Cloud not connected. Unlock 70% faster CI and auto-fix broken PRs with https:\u002F\u002Fnx.dev\u002Fnx-cloud\n   ```\n\n3. **If connected** → continue to main loop\n\n## Architecture Overview\n\n1. **This skill (orchestrator)**: spawns subagents, runs scripts, prints status, does local coding work\n2. **ci-monitor-subagent (haiku)**: calls one MCP tool (ci_information or update_self_healing_fix), returns structured result, exits\n3. **ci-poll-decide.mjs (deterministic script)**: takes ci_information result + state, returns action + status message\n4. **ci-state-update.mjs (deterministic script)**: manages budget gates, post-action state transitions, and cycle classification\n\n## Status Reporting\n\nThe decision script handles message formatting based on verbosity. When printing messages to the user:\n\n- Prepend `[monitor-ci]` to every message from the script's `message` field\n- For your own action messages (e.g. \"Applying fix via MCP...\"), also prepend `[monitor-ci]`\n\n## Anti-Patterns\n\nThese behaviors cause real problems — racing with self-healing, losing CI progress, or wasting context:\n\n| Anti-Pattern                                                                                    | Why It's Bad                                                       |\n| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |\n| Using CI provider CLIs with `--watch` flags (e.g., `gh pr checks --watch`, `glab ci status -w`) | Bypasses Nx Cloud self-healing entirely                            |\n| Writing custom CI polling scripts                                                               | Unreliable, pollutes context, no self-healing                      |\n| Cancelling CI workflows\u002Fpipelines                                                               | Destructive, loses CI progress                                     |\n| Running CI checks on main agent                                                                 | Wastes main agent context tokens                                   |\n| Independently analyzing\u002Ffixing CI failures while polling                                        | Races with self-healing, causes duplicate fixes and confused state |\n\n**If this skill fails to activate**, the fallback is:\n\n1. Use CI provider CLI for a one-time, read-only status check (single call, no watch\u002Fpolling flags)\n2. Immediately delegate to this skill with gathered context\n3. Do not continue polling on main agent — it wastes context tokens and bypasses self-healing\n\n## Session Context Behavior\n\nIf the user previously ran `\u002Fmonitor-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.\n\n## MCP Tool Reference\n\nThree field sets control polling efficiency — use the lightest set that gives you what you need:\n\n```yaml\nWAIT_FIELDS: 'cipeUrl,commitSha,cipeStatus'\nLIGHT_FIELDS: 'cipeStatus,cipeUrl,branch,commitSha,selfHealingStatus,verificationStatus,userAction,failedTaskIds,verifiedTaskIds,selfHealingEnabled,failureClassification,couldAutoApplyTasks,autoApplySkipped,autoApplySkipReason,shortLink,confidence,confidenceReasoning,hints,selfHealingSkippedReason,selfHealingSkipMessage'\nHEAVY_FIELDS: 'taskOutputSummary,suggestedFix,suggestedFixReasoning,suggestedFixDescription'\n```\n\nThe `ci_information` tool accepts `branch` (optional, defaults to current git branch), `select` (comma-separated field names), and `pageToken` (0-based pagination for long strings).\n\nThe `update_self_healing_fix` tool accepts a `shortLink` and an action: `APPLY`, `REJECT`, or `RERUN_ENVIRONMENT_STATE`.\n\n## Default Behaviors by Status\n\nThe decision script returns one of the following statuses. This table defines the **default behavior** for each. User instructions can override any of these.\n\n**Simple exits** — just report and exit:\n\n| Status                  | Default Behavior                                                                                                 |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------------- |\n| `ci_success`            | Exit with success                                                                                                |\n| `cipe_canceled`         | Exit, CI was canceled                                                                                            |\n| `cipe_timed_out`        | Exit, CI timed out                                                                                               |\n| `polling_timeout`       | Exit, polling timeout reached                                                                                    |\n| `circuit_breaker`       | Exit, no progress after 13 consecutive polls                                                                     |\n| `environment_rerun_cap` | Exit, environment reruns exhausted                                                                               |\n| `fix_auto_applying`     | Self-healing is handling it — just record `last_cipe_url`, enter wait mode. No MCP call or local git ops needed. |\n| `error`                 | Wait 60s and loop                                                                                                |\n\n**Statuses requiring action** — when handling these in Step 3, read `references\u002Ffix-flows.md` for the detailed flow:\n\n| Status                   | Summary                                                                                       |\n| ------------------------ | --------------------------------------------------------------------------------------------- |\n| `fix_auto_apply_skipped` | Fix verified but auto-apply skipped (e.g., loop prevention). Inform user, offer manual apply. |\n| `fix_apply_ready`        | Fix verified (all tasks or e2e-only). Apply via MCP.                                          |\n| `fix_needs_local_verify` | Fix has unverified non-e2e tasks. Run locally, then apply or enhance.                         |\n| `fix_needs_review`       | Fix verification failed\u002Fnot attempted. Analyze and decide.                                    |\n| `fix_failed`             | Self-healing failed. Fetch heavy data, attempt local fix (gate check first).                  |\n| `no_fix`                 | No fix available. Fetch heavy data, attempt local fix (gate check first) or exit.             |\n| `environment_issue`      | Request environment rerun via MCP (gate check first).                                         |\n| `self_healing_throttled` | Reject old fixes, attempt local fix.                                                          |\n| `no_new_cipe`            | CI Attempt never spawned. Auto-fix workflow or exit with guidance.                            |\n| `cipe_no_tasks`          | CI failed with no tasks. Retry once with empty commit.                                        |\n\n**Key rules (always apply):**\n\n- **Git safety**: Stage specific files by name — `git add -A` or `git add .` risks committing the user's unrelated work-in-progress or secrets\n- **Environment failures** (OOM, command not found, permission denied): bail immediately. These aren't code bugs, so spending local-fix budget on them is wasteful\n- **Gate check**: Run `ci-state-update.mjs gate` before local fix attempts — if budget exhausted, print message and exit\n\n## Main Loop\n\n### Step 1: Initialize Tracking\n\n```\ncycle_count = 0            # Only incremented for agent-initiated cycles (counted against --max-cycles)\nstart_time = now()         # Passed to the decision script as --elapsed-seconds on every poll to enforce --timeout across attempts\nno_progress_count = 0\nlocal_verify_count = 0\nenv_rerun_count = 0\nlast_cipe_url = null\nexpected_commit_sha = null\nagent_triggered = false    # Set true after monitor takes an action that triggers new CI Attempt\npoll_count = 0\nwait_mode = false\nprev_status = null\nprev_cipe_status = null\nprev_sh_status = null\nprev_verification_status = null\nprev_failure_classification = null\n```\n\n### Step 2: Polling Loop\n\nRepeat until done:\n\n#### 2a. Spawn subagent (FETCH_STATUS)\n\nDetermine select fields based on mode:\n\n- **Wait mode**: use WAIT_FIELDS (`cipeUrl,commitSha,cipeStatus`)\n- **Normal mode (first poll or after newCipeDetected)**: use LIGHT_FIELDS\n\nCall the `ci_information` tool with the determined `select` fields for the current branch. Wait for the result before proceeding.\n\n#### 2b. Run decision script\n\n```bash\nnode \u003Cskill_dir>\u002Fscripts\u002Fci-poll-decide.mjs '\u003Csubagent_result_json>' \u003Cpoll_count> \u003Cverbosity> \\\n  [--wait-mode] \\\n  [--prev-cipe-url \u003Clast_cipe_url>] \\\n  [--expected-sha \u003Cexpected_commit_sha>] \\\n  [--prev-status \u003Cprev_status>] \\\n  [--timeout \u003Ctimeout_minutes>] \\\n  [--new-cipe-timeout \u003Cnew_cipe_timeout_minutes>] \\\n  [--elapsed-seconds \u003Cseconds_since_start_time>] \\\n  [--env-rerun-count \u003Cenv_rerun_count>] \\\n  [--no-progress-count \u003Cno_progress_count>] \\\n  [--prev-cipe-status \u003Cprev_cipe_status>] \\\n  [--prev-sh-status \u003Cprev_sh_status>] \\\n  [--prev-verification-status \u003Cprev_verification_status>] \\\n  [--prev-failure-classification \u003Cprev_failure_classification>]\n```\n\nPass `--timeout` and `--new-cipe-timeout` in **minutes** (the values from Configuration Defaults) — the script converts to seconds internally. Pass `--elapsed-seconds` as the whole seconds elapsed since `start_time` (`now() - start_time`); this is what enforces `--timeout` as a **total** monitor budget across every poll and attempt, so it must be supplied on every call once monitoring has started.\n\nThe script outputs a single JSON line: `{ action, code, message, delay?, noProgressCount, envRerunCount, fields?, newCipeDetected?, verifiableTaskIds? }`\n\n#### 2c. Process script output\n\nParse the JSON output and update tracking state:\n\n- `no_progress_count = output.noProgressCount`\n- `env_rerun_count = output.envRerunCount`\n- `prev_cipe_status = subagent_result.cipeStatus`\n- `prev_sh_status = subagent_result.selfHealingStatus`\n- `prev_verification_status = subagent_result.verificationStatus`\n- `prev_failure_classification = subagent_result.failureClassification`\n- `prev_status = output.action + \":\" + (output.code || subagent_result.cipeStatus)`\n- `poll_count++`\n\nBased on `action`:\n\n- **`action == \"poll\"`**: Print `output.message`, sleep `output.delay` seconds, go to 2a\n  - If `output.newCipeDetected`: clear wait mode, reset `wait_mode = false`\n- **`action == \"wait\"`**: Print `output.message`, sleep `output.delay` seconds, go to 2a\n- **`action == \"done\"`**: Proceed to Step 3 with `output.code`\n\n### Step 3: Handle Actionable Status\n\nWhen decision script returns `action == \"done\"`:\n\n1. Run cycle-check (Step 4) **before** handling the code\n2. Check the returned `code`\n3. Look up default behavior in the table above\n4. Check if user instructions override the default\n5. Execute the appropriate action\n6. **If action expects new CI Attempt**, update tracking (see Step 3a)\n7. If action results in looping, go to Step 2\n\n#### Tool calls for actions\n\nSeveral statuses require fetching additional data or calling tools:\n\n- **fix_apply_ready**: Call `update_self_healing_fix` with action `APPLY`\n- **fix_needs_local_verify**: Call `ci_information` with HEAVY_FIELDS for fix details before local verification\n- **fix_needs_review**: Call `ci_information` with HEAVY_FIELDS → get `suggestedFixDescription`, `suggestedFixSummary`, `taskFailureSummaries`\n- **fix_failed \u002F no_fix**: Call `ci_information` with HEAVY_FIELDS → get `taskFailureSummaries` for local fix context\n- **environment_issue**: Call `update_self_healing_fix` with action `RERUN_ENVIRONMENT_STATE`\n- **self_healing_throttled**: Call `ci_information` with HEAVY_FIELDS → get `selfHealingSkipMessage`; then call `update_self_healing_fix` for each old fix\n\n### Step 3a: Track State for New-CI-Attempt Detection\n\nAfter actions that should trigger a new CI Attempt, run:\n\n```bash\nnode \u003Cskill_dir>\u002Fscripts\u002Fci-state-update.mjs post-action \\\n  --action \u003Ctype> \\\n  --cipe-url \u003Ccurrent_cipe_url> \\\n  --commit-sha \u003Cgit_rev_parse_HEAD>\n```\n\nAction types: `fix-auto-applying`, `apply-mcp`, `apply-local-push`, `reject-fix-push`, `local-fix-push`, `env-rerun`, `auto-fix-push`, `empty-commit-push`\n\nThe script returns `{ waitMode, pollCount, lastCipeUrl, expectedCommitSha, agentTriggered }`. Update all tracking state from the output, then go to Step 2.\n\n### Step 4: Cycle Classification and Progress Tracking\n\nWhen the decision script returns `action == \"done\"`, run cycle-check **before** handling the code:\n\n```bash\nnode \u003Cskill_dir>\u002Fscripts\u002Fci-state-update.mjs cycle-check \\\n  --code \u003Ccode> \\\n  [--agent-triggered] \\\n  --cycle-count \u003Ccycle_count> --max-cycles \u003Cmax_cycles> \\\n  --env-rerun-count \u003Cenv_rerun_count>\n```\n\nThe script returns `{ cycleCount, agentTriggered, envRerunCount, approachingLimit, limitReached, message }`. Update tracking state from the output.\n\n- If `limitReached` → the `--max-cycles` budget is exhausted. Print `message` and **stop monitoring** (do not handle the code or start another cycle). This is a hard stop, not advisory.\n- Else if `approachingLimit` → ask user whether to continue (with 5 or 10 more cycles) or stop monitoring\n- If previous cycle was NOT agent-triggered (human pushed), log that human-initiated push was detected\n\n#### Progress Tracking\n\n- `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)\n- `env_rerun_count` reset on non-environment status is handled by ci-state-update.mjs cycle-check\n- On new CI Attempt detected (poll script returns `newCipeDetected`) → reset `local_verify_count = 0`, `env_rerun_count = 0`\n\n## Error Handling\n\n| Error                          | Action                                                                                                      |\n| ------------------------------ | ----------------------------------------------------------------------------------------------------------- |\n| Git rebase conflict            | Report to user, exit                                                                                        |\n| `nx-cloud apply-locally` fails | Reject fix via MCP (`action: \"REJECT\"`), then attempt manual patch (Reject + Fix From Scratch Flow) or exit |\n| MCP tool error                 | Retry once, if fails report to user                                                                         |\n| Subagent spawn failure         | Retry once, if fails exit with error                                                                        |\n| Decision script error          | Treat as `error` status, increment `no_progress_count`                                                      |\n| No new CI Attempt detected     | If `--auto-fix-workflow`, try lockfile update; otherwise report to user with guidance                       |\n| Lockfile auto-fix fails        | Report to user, exit with guidance to check CI logs                                                         |\n\n## User Instruction Examples\n\nUsers can override default behaviors:\n\n| Instruction                                      | Effect                                              |\n| ------------------------------------------------ | --------------------------------------------------- |\n| \"never auto-apply\"                               | Always prompt before applying any fix               |\n| \"always ask before git push\"                     | Prompt before each push                             |\n| \"reject any fix for e2e tasks\"                   | Auto-reject if `failedTaskIds` contains e2e         |\n| \"apply all fixes regardless of verification\"     | Skip verification check, apply everything           |\n| \"if confidence \u003C 70, reject\"                     | Check confidence field before applying              |\n| \"run 'nx affected -t typecheck' before applying\" | Add local verification step                         |\n| \"auto-fix workflow failures\"                     | Attempt lockfile updates on pre-CI-Attempt failures |\n| \"wait 45 min for new CI Attempt\"                 | Override new-CI-Attempt timeout (default: 10 min)   |\n",{"name":5,"description":7},"main","496c56c6fc129d23d8fc35cb9c093ab625240302",".agents\u002Fskills\u002Fmonitor-ci",0,"https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit","https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@socialrobot-io\u002Fagent-kit-core","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io","https:\u002F\u002Fsocialrobot.io","Plan, schedule, and publish content across all your platforms in only a couple of minutes.","2026-11-01 02:16:59",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add socialrobot-io\u002Fagent-kit --skill monitor-ci",{"tool":40,"command":41},"bunx","bunx skills add socialrobot-io\u002Fagent-kit --skill monitor-ci",{"tool":43,"command":44},"pnpm","pnpm dlx skills add socialrobot-io\u002Fagent-kit --skill monitor-ci","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmonitor-ci\u002FSKILL.md",true,[48,54,60],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"references\u002Ffix-flows.md","REFERENCE","参考文档",4935,"https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmonitor-ci\u002Freferences\u002Ffix-flows.md",{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"scripts\u002Fci-poll-decide.mjs","SCRIPT","脚本",15990,"https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmonitor-ci\u002Fscripts\u002Fci-poll-decide.mjs",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fci-state-update.mjs",4644,"https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmonitor-ci\u002Fscripts\u002Fci-state-update.mjs",[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79RW54SNCCBQ3YK964B5PE7","bullet-briefing","Format a short bullet-point briefing from a longer request.","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002Fexamples\u002Fexample-app\u002Fagents\u002Fchat\u002Fskills\u002Fbullet-briefing\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M79RW0YDHBY6TPE35G0JASH8","nx-workspace","Explore and understand Nx workspaces. USE WHEN answering questions about the workspace, projects, or tasks. ALSO USE WHEN an nx command fails or you need to check available targets\u002Fconfiguration before running a task. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What depends on library Y?', 'What targets can I run?', 'Cannot find configuration for task', 'debug nx task failure'.","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnx-workspace\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M79RVYMCHDGTPWEXX3CGH5JS","nx-run-tasks","Helps with running tasks in an Nx workspace. USE WHEN the user wants to execute build, test, lint, serve, or run any other tasks defined in the workspace.","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnx-run-tasks\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M79RVWDJPWRGRN3BKTM9FX98","nx-plugins","Find and add Nx plugins. USE WHEN user wants to discover available plugins, install a new plugin, or add support for a specific framework or technology to the workspace.","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnx-plugins\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M79RVQQQGM10NVCN538VH79C","nx-import","Import, merge, or combine repositories into an Nx workspace using nx import. USE WHEN the user asks to adopt Nx across repos, move projects into a monorepo, or bring code\u002Fhistory from another repository.","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnx-import\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M79RVKK4YCXFE8KEPHGE31Q1","nx-generate","Generate code using nx generators. INVOKE IMMEDIATELY when user mentions scaffolding, setup, structure, creating apps\u002Flibs, or setting up project structure. Trigger words - scaffold, setup, create a new app, create a new lib, project structure, generate, add a new project. ALWAYS use this BEFORE calling nx_docs or exploring - this skill handles discovery internally.","https:\u002F\u002Fgithub.com\u002Fsocialrobot-io\u002Fagent-kit\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fnx-generate\u002FSKILL.md",[],[]]