[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75MNTP7056JZHTKFH8FKHGT":3,"skill-same:01M75MNTP7056JZHTKFH8FKHGT":63},{"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":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M75MNTP7056JZHTKFH8FKHGT","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.","whimzyLive\u002Fnightshift-ai","whimzyLive","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F22066605?v=4","01M75MMH22XX6R3NTAFHD7HEN7","Rushi Patel","01M75MMH32DHVVC61XRSHWVEV2",3,"MIT","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmonitor-ci\u002FSKILL.md",[],[],"2026-11-12 13:55:43",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()\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_seconds>] \\\n  [--new-cipe-timeout \u003Cnew_cipe_timeout_seconds>] \\\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\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, message }`. Update tracking state from the output.\n\n- 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()\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_seconds>] \\\n  [--new-cipe-timeout \u003Cnew_cipe_timeout_seconds>] \\\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\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, message }`. Update tracking state from the output.\n\n- 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","7d4ebd573a4218d5e92eced411b259f34e9203fe",".github\u002Fskills\u002Fmonitor-ci",0,"https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai","https:\u002F\u002Fwithnightshift.com\u002F","https:\u002F\u002Fgithub.com\u002FwhimzyLive","Creator of @typedorm","2026-11-14 22:45:42",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add whimzyLive\u002Fnightshift-ai --skill monitor-ci",{"tool":39,"command":40},"bunx","bunx skills add whimzyLive\u002Fnightshift-ai --skill monitor-ci",{"tool":42,"command":43},"pnpm","pnpm dlx skills add whimzyLive\u002Fnightshift-ai --skill monitor-ci","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmonitor-ci\u002FSKILL.md",true,[47,53,59],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Ffix-flows.md","REFERENCE","参考文档",4935,"https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmonitor-ci\u002Freferences\u002Ffix-flows.md",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"scripts\u002Fci-poll-decide.mjs","SCRIPT","脚本",14647,"https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmonitor-ci\u002Fscripts\u002Fci-poll-decide.mjs",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"scripts\u002Fci-state-update.mjs",4367,"https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmonitor-ci\u002Fscripts\u002Fci-state-update.mjs",[64,72,79,86,93,100],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":71},"01M7BCEWYHDS1FWAJ6G4CD9P54","designing-in-patterns","Use when designing, planning or auditing UI against a component library — naming surfaces with the repo's pattern vocabulary, deciding reuse versus extend versus new, exploring compositions, or writing the reuse table (component-plan.md, a spec's `## Reuse`, a UI audit). Carries the design method; the repo's own vocabulary, bundle and board rules come from project-context and the designer override.","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fdesigning-in-patterns\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"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},"01M75MVN6GACAC87SV9RBPBMKH","typeorm","Use when defining TypeORM entities, writing migrations, or building repository\u002Fquery-builder code in TypeScript. Covers entity and relation decorators, the Data Mapper pattern, migrations, the query builder, transactions, and multi-database configuration.","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002Fskills\u002Ftypeorm\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},"01M75MTEZV8SAZNS20YDSB7KG2","hono-api","Use when building or extending REST APIs with Hono + @hono\u002Fzod-openapi. Covers schema-first route declaration with createRoute, feature-grouped composable routers, a class-based service layer behind interfaces, the strategy pattern for multi-event webhooks, typed request validation, and auto-generated OpenAPI docs.","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002Fskills\u002Fhono-api\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},"01M75MTB91SB6HPB3ZRT20F950","electrodb","Use when defining DynamoDB entities, modeling indexes, or writing queries\u002Fmutations with the ElectroDB ORM. Covers entity schema, access patterns, CRUD operations, update expressions, and single-table design patterns.","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002Fskills\u002Felectrodb\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},"01M75MT7KT9A3XYX38TX5MY6MA","atomic-design","Use when structuring or decomposing any frontend UI into reusable components, regardless of framework. Applies Brad Frost's atomic design methodology — atoms, molecules, organisms, templates, and pages — to guide consistent component hierarchy, naming, and composition decisions.","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002Fskills\u002Fatomic-design\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},"01M75MSTQ54EY0K29PKBF212K1","writing-docs","Use when writing, restructuring, or reviewing any prose documentation — a tutorial, how-to guide, reference page, or explanation\u002Fconceptual doc — for a public docs site (e.g. Mintlify MDX, docs\u002F, README material), a getting-started guide, an API\u002FCLI reference page, or a \"why we built it this way\" conceptual page. Applies the Diátaxis framework (see https:\u002F\u002Fdiataxis.fr\u002F) — every document belongs to exactly one of the four quadrants (tutorial \u002F how-to guide \u002F reference \u002F explanation), and mixing quadrants inside one document is the single most common documentation failure. Covers the four-quadrant compass for picking the right form, per-quadrant structure templates, an anti-pattern list for quadrant drift, and generic voice\u002Fcraft rules — repo-specific voice and target output format (e.g. Mintlify MDX) are resolved from the repo's docs-manifest (falling back to project-context), never hardcoded here.","https:\u002F\u002Fgithub.com\u002FwhimzyLive\u002Fnightshift-ai\u002Fblob\u002Fmain\u002Fplugins\u002Fsdlc\u002Fskills\u002Fwriting-docs\u002FSKILL.md",[],[]]