🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

CI Monitor

by @zhanghengyi1986-afk

Monitor and interact with CI/CD pipelines (Jenkins, GitHub Actions, GitLab CI). Check build status, trigger builds, analyze failed jobs, view logs. Use when:...

⚑ When to Use
TriggerAction
- Checking build/pipeline status
- Analyzing why a CI job failed
- Triggering builds or test runs
- Monitoring deployment progress
- "Jenkins ζž„ε»ΊηŠΆζ€ζ€ŽδΉˆζ ·" / "CI ζŒ‚δΊ†ηœ‹ηœ‹δ»€δΉˆεŽŸε› "
❌ **DON'T use this skill when:**
- Writing/editing Jenkinsfile or CI config β†’ edit files directly
- Managing infrastructure β†’ use DevOps tools
- Code review β†’ use platform web UI or `gh` CLI directly
βš™οΈ Configuration

# Set environment variables
export JENKINS_URL="https://jenkins.example.com"
export JENKINS_USER="admin"
export JENKINS_TOKEN="your-api-token"

Common Operations

# List all jobs
curl -s "$JENKINS_URL/api/json?tree=jobs[name,color]" \
  --user "$JENKINS_USER:$JENKINS_TOKEN" | jq '.jobs[] | "\(.name): \(.color)"'

Get last build status

curl -s "$JENKINS_URL/job/{job-name}/lastBuild/api/json" \ --user "$JENKINS_USER:$JENKINS_TOKEN" | jq '{result,duration,timestamp,builtOn}'

Get console output of last build

curl -s "$JENKINS_URL/job/{job-name}/lastBuild/consoleText" \ --user "$JENKINS_USER:$JENKINS_TOKEN" | tail -50

Trigger a build

curl -s -X POST "$JENKINS_URL/job/{job-name}/build" \ --user "$JENKINS_USER:$JENKINS_TOKEN"

Trigger with parameters

curl -s -X POST "$JENKINS_URL/job/{job-name}/buildWithParameters?BRANCH=develop&ENV=staging" \ --user "$JENKINS_USER:$JENKINS_TOKEN"

Get build queue

curl -s "$JENKINS_URL/queue/api/json" \ --user "$JENKINS_USER:$JENKINS_TOKEN" | jq '.items[] | {task: .task.name, why}'

Failure Analysis

When a build fails:

1. Get build result and duration:

curl -s "$JENKINS_URL/job/{job}/lastBuild/api/json" \
  --user "$JENKINS_USER:$JENKINS_TOKEN" | jq '{result,duration,timestamp}'

2. Get failed test report:

curl -s "$JENKINS_URL/job/{job}/lastBuild/testReport/api/json" \
  --user "$JENKINS_USER:$JENKINS_TOKEN" | jq '{failCount,passCount,skipCount,suites[].cases[] | select(.status=="FAILED") | {name,errorDetails}}'

3. Get console log (last 200 lines):

curl -s "$JENKINS_URL/job/{job}/lastBuild/consoleText" \
  --user "$JENKINS_USER:$JENKINS_TOKEN" | tail -200 | grep -i -E "error|fail|exception" 

4. Summarize findings in this format:

πŸ”΄ Build #{number} FAILED
⏱️ Duration: Xm Ys
πŸ“‹ Tests: X passed, Y failed, Z skipped
❌ Failed tests:
  - TestClass.testMethod: error message
  - TestClass.testMethod2: error message
πŸ” Root cause: [analysis based on logs]
πŸ’‘ Suggestion: [fix suggestion]

View on ClawHub
TERMINAL
clawhub install ci-monitor

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’