AgentSkillsCN

check-ci-health

诊断 GitLab CI/CD 管道问题。适用于用户输入“检查 CI”、“管道状态”、“CI 为何失败?”或“CI 健康状况”时使用。列出各条管道,显示失败的作业,获取追踪日志,验证 .gitlab-ci.yml 文件。

SKILL.md
--- frontmatter
name: check-ci-health
description: Diagnose GitLab CI/CD pipeline issues. Use when user says "check CI", "pipeline status", "why is CI failing?", or "CI health". Lists pipelines, shows failing jobs, gets trace logs, validates .gitlab-ci.yml.

Check CI Health

Diagnose GitLab CI/CD pipeline issues. Uses developer persona (gitlab tools).

Inputs

InputTypeDefaultPurpose
projectstringautomation-analytics/automation-analytics-backendGitLab project path
statusstringfailedFilter: failed, success, running, all
limitint5Number of pipelines to show
trigger_newboolfalseTrigger new pipeline run
branchstringmainBranch for trigger_new

Workflow

1. Load Persona

  • persona_load("developer")

2. List Pipelines

  • gitlab_ci_list(project="{{ project }}", status="{{ status }}")
  • Parse for pipeline IDs and status (failed/success/running)

3. Get Failed Pipeline Details

  • If failures: gitlab_ci_view(project="{{ project }}", pipeline_id="{{ first_failed_id }}")
  • gitlab_ci_trace(project="{{ project }}", pipeline_id="{{ first_failed_id }}")
  • Parse trace for error patterns: error:, failed:, exception, AssertionError, ModuleNotFoundError

4. Lint CI Config

  • gitlab_ci_lint(project="{{ project }}")

5. Optional: Trigger New Pipeline

  • If trigger_new: gitlab_ci_run(project="{{ project }}", branch="{{ branch }}")

6. Chain to CI Retry

  • If failures detected: suggest or run skill_run("ci_retry", '{"project": "{{ project }}"}')

7. Error Recovery

  • "no such host" → vpn_connect()
  • "unauthorized" → check GitLab token in config.json

8. Memory

  • memory_session_log("Checked CI health", "project={{ project }}, failures={{ has_failures }}")

Output

Report: recent pipelines (status per pipeline), CI config validation, failed pipeline analysis with errors and trace tail, debug commands (gitlab_ci_trace, gitlab_ci_run, gitlab_ci_cancel), and next step (ci_retry).