agentsclimarketplace

Jenkins pipeline diagnosis

Skill daleiawei/jenkins-pipeline-diagnosis

用于根据用户提供的Jenkins Job构建链接进行失败问题诊断的技能。当用户需要分析Jenkins流水线构建失败原因时使用,通过调用Jenkins API获取构建结果、分析失败阶段、检查构建日志和测试报告,提供详细的失败诊断报告。From its SKILL.md

Install
npx -y skills add daleiawei/jenkins-pipeline-diagnosis

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.5 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

Jenkins Pipeline Diagnosis

Overview

此技能用于诊断Jenkins流水线构建失败的原因,通过分析构建日志和测试报告,提供详细的失败诊断报告,帮助用户快速定位和解决构建问题。

Workflow

1. 调用工具脚本diagnose_jenkins_build.py生成诊断报告

  • 脚本路径:scripts/diagnose_jenkins_build.py
  • 功能:主诊断脚本,协调整个诊断流程,包括获取构建信息、定位失败阶段、分析失败原因并生成报告
  • 参数:

Resources

scripts/

包含用于与Jenkins API交互和分析日志的脚本:

  • diagnose_jenkins_build.py: 主诊断脚本,协调整个诊断流程,包括获取构建信息、定位失败阶段、分析失败原因并生成报告
  • jenkins_api.py: 封装Jenkins API工具调用,获取构建结果、阶段信息和日志信息
  • log_analyzer.py: 分析构建日志,识别失败关键字和上下文
  • report_generator.py: 生成诊断报告的工具

references/

包含Jenkins API文档和失败模式参考:

  • jenkins_api_reference.md: Jenkins API使用参考
  • failure_patterns.md: 常见失败模式和解决方案

assets/

包含诊断报告模板和示例:

  • report_template.md: 诊断报告模板

Usage

Input

Output

  • 详细的构建失败诊断报告,包括:
    • 构建基本信息(Job名称、构建编号、构建状态)
    • 失败阶段信息
    • 失败关键字和上下文
    • 测试失败详情(如果适用)
    • 失败原因分析
    • 解决方案建议

Example

User Input:

帮我诊断这个Jenkins构建失败的原因:https://jenkins.example.com/job/my-project/456/

Expected Output:

# Jenkins构建失败诊断报告

## 基本信息
- Job名称: my-project
- 构建编号: 456
- 构建状态: FAILED
- 构建时间: 2024-01-20 10:30:45

## 失败阶段
- 阶段名称: test
- 开始时间: 2024-01-20 10:25:30
- 结束时间: 2024-01-20 10:30:45
- 持续时间: 5分15秒

## 失败节点
- 阶段名称: test
- 开始时间: 2024-01-20 10:25:30
- 结束时间: 2024-01-20 10:30:45
- 持续时间: 5分15秒


## 失败原因
- 关键字: ERROR
- 上下文: 

[ERROR] Tests run: 10, Failures: 2, Errors: 0, Skipped: 1 [ERROR] Failed tests: [ERROR] com.example.TestClass.testMethod1 [ERROR] com.example.TestClass.testMethod2


## 测试失败详情
- 测试类: com.example.TestClass
- 失败方法: testMethod1, testMethod2
- 失败原因: 断言失败 - 预期值与实际值不匹配

## 诊断分析
构建失败是由于测试阶段的单元测试失败导致的。具体是TestClass中的两个测试方法断言失败,可能是由于代码变更导致的行为变化。

## 解决方案建议
1. 检查com.example.TestClass中的testMethod1和testMethod2方法
2. 确认最近的代码变更是否影响了这些测试
3. 更新测试用例以匹配新的预期行为,或修复代码以符合测试预期
4. 重新运行构建验证修复结果

What ships with it: 7 files

55.8 KB alongside SKILL.md, 4 of them executable

assets/

scripts/

Gives 0 of the 12 instructions most ci cd skills give in ~1.1k tokens

Counted across 392 of the 394 authors here whose files we hold, read 2026-08-07

  • Pin third-party actions to full commit SHAsin 34 of 392
  • Cache dependencies appropriatelyin 24 of 392, across 12 files
  • Optimize pipelines exceeding ten minutesin 21 of 392, across 7 files
  • Configure branch protection rulesin 19 of 392, across 5 files
  • Use environments for deployment trackingin 19 of 392, across 7 files
  • Implement manual gates for productionin 19 of 392, across 7 files
  • Implement security scanningin 18 of 392, across 5 files
  • Enforce all quality gates before mergein 18 of 392, across 5 files
  • Fix failing code instead of disabling checksin 18 of 392, across 4 files
  • Use CI/CD variables for secretsin 18 of 392, across 6 files
  • Move checks upstream in the pipelinein 17 of 392, across 3 files
  • Use specific image tagsin 17 of 392, across 5 files

Said here and by no other author read

  • accept a jenkins build link
  • run the main diagnosis script
  • fetch build information via jenkins api
  • identify the failed build stage
  • analyze logs for failure keywords
  • generate a detailed diagnosis report

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,861. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.