monitoring-ci
Monitors CI checks on the current branch, diagnoses failures from logs, fixes them (lint, typecheck, test, build), pushes the fix, and re-watches until green. Uses gh run watch for live monitoring and gh run view --log-failed for diagnosis. Use when CI is failing, after pushing to a PR, when the user says "watch CI", "fix CI", "why is CI failing", or proactively after creating a PR or pushing changes.
What this skill does
# Monitoring CI
Watch CI, diagnose failures, fix them, and get the branch to green.
## Current context
- Branch: !`git branch --show-current`
- PR: !`gh pr view --json number,title,url --jq '"\(.url) — \(.title)"' 2>/dev/null || echo "no PR"`
- Latest run: !`gh run list --branch $(git branch --show-current) --limit 1 --json status,conclusion,name,databaseId --jq '.[0] | "\(.name): \(.status) \(.conclusion // "")" + " (ID: \(.databaseId))"' 2>/dev/null || echo "unknown"`
## Decision tree
- What's happening?
- **No runs exist yet** (just pushed, nothing triggered) -> go to "Watch"
- **Run in progress** -> go to "Watch"
- **Run failed** -> go to "Diagnose"
- **Run succeeded** -> tell the user CI is green, done
- **User wants to proactively monitor after a push** -> go to "Watch"
## Watch
Start monitoring CI in the background so the user isn't blocked.
### 1. Find the run to watch
If there's a PR, use PR checks. Otherwise find the latest run for the branch:
```bash
gh run list --branch $(git branch --show-current) --limit 1 --json databaseId,status --jq '.[0]'
```
### 2. Watch it
Run this as a **background Bash task**:
```bash
gh run watch <run-id> --exit-status 2>&1; echo "CI_EXIT=$?"
```
This streams live status and exits when the run completes. `--exit-status` makes it return a non-zero exit code on failure.
### 3. React to the result
When the background task completes:
- **Exit code 0** -> CI passed. Tell the user the PR is green.
- **Non-zero exit code** -> CI failed. Go to "Diagnose".
## Diagnose
### 1. Identify failed checks
```bash
gh run view <run-id> --json jobs --jq '.jobs[] | select(.conclusion == "failure") | {name, conclusion}'
```
If working from a PR instead of a run ID:
```bash
gh pr checks --json name,state,link --jq '.[] | select(.state == "FAILURE")'
```
### 2. Read the failure logs
Start with just the failed step output:
```bash
gh run view <run-id> --log-failed 2>&1 | tail -100
```
Trim to the last 100 lines — the error is almost always at the end. Read the output and classify the failure.
### 3. Escalate if needed
If the failure isn't clear from `--log-failed` (e.g., the error references something earlier in the log, or the failed step is a wrapper that calls something else):
```bash
gh run view <run-id> --log --json jobs --jq '.jobs[] | select(.conclusion == "failure") | .name'
```
Then read the full log for that specific job:
```bash
gh run view <run-id> --log 2>&1 | grep -A 50 "<failed step name>"
```
Focus on the section around the error. Don't dump entire logs into context.
### 4. Classify the failure
- **Lint / format error** -> go to "Fix: lint"
- **Type error** -> go to "Fix: typecheck"
- **Test failure** -> go to "Fix: test"
- **Build error** -> go to "Fix: build"
- **Flaky / infrastructure** (timeout, network error, runner issue, rate limit) -> go to "Rerun"
- **Unknown / can't diagnose** -> show the logs to the user and ask for guidance
## Fix: lint
Run the project's linter/formatter locally to reproduce and fix:
1. Check the project for lint tooling — look for `biome.json`, `.eslintrc`, `prettier` config, `ruff.toml`, `Cargo.toml`, etc.
2. Run the linter with auto-fix: `bunx biome check --write .` / `bun lint --fix` / equivalent
3. If auto-fix doesn't cover it, read the error and fix manually
4. Commit with `fix: resolve lint errors` and push
5. Go to "Watch" to monitor the new run
## Fix: typecheck
1. Run the type checker locally: `bunx tsc --noEmit` / equivalent
2. Read the errors and fix them
3. Commit with `fix: resolve type errors` and push
4. Go to "Watch"
## Fix: test
1. Identify which test(s) failed from the CI logs
2. Run the failing test locally to reproduce: `bun test <specific test file>`
3. Read the test and the code it's testing to understand the failure
4. Fix the code or the test — whichever is wrong
5. Re-run the test locally to verify the fix
6. Commit with `fix: resolve test failure in <area>` and push
7. Go to "Watch"
## Fix: build
1. Read the build error from the logs
2. Run the build locally: `bun run build` / equivalent
3. Fix the error — common causes:
- Missing import/export
- Dependency not installed
- Environment variable not set (warn the user, don't add secrets)
- Incompatible dependency version
4. Commit with `fix: resolve build error` and push
5. Go to "Watch"
## Rerun
For flaky checks or infrastructure failures:
```bash
gh run rerun <run-id> --failed
```
This reruns only the failed jobs, not the entire workflow. Then go to "Watch" to monitor the rerun.
If the same check fails again after a rerun, it's probably not flaky — go to "Diagnose" and treat it as a real failure.
## The fix-watch loop
After pushing a fix, always loop back to "Watch" to monitor the new run. Keep looping until CI is green or you've exhausted what can be fixed automatically.
Track iterations to avoid infinite loops:
- **1st failure** -> diagnose and fix normally
- **2nd failure on the same check** -> the first fix didn't work. Read the new error carefully, it may be a different issue or the fix was incomplete
- **3rd failure on the same check** -> stop and tell the user. Three strikes means this needs human judgment
Different checks failing on different iterations is fine — keep fixing. The 3-strike limit is per check, not total.
## Proactive use
Use this skill proactively:
- After the `creating-prs` skill creates a PR — start watching CI immediately
- After pushing commits to a branch with an open PR
- After pushing a CI fix — watch to confirm it worked
When used proactively, always run the watch in the background so the user can keep working.
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.