静态分析运行器Skill static-analysis-runner

静态分析运行器是一个自动化代码质量检测工具,支持SonarQube、ESLint、TSLint、Pylint、Rubocop、Checkstyle等多语言代码检查器。该工具能够执行代码质量分析、安全漏洞扫描、代码规范检查,并提供自定义规则配置、报告聚合、质量门评估和趋势分析功能。适用于代码重构、安全审查、性能优化等开发流程,帮助团队提升代码质量和开发效率。关键词:静态代码分析、代码质量检测、SonarQube、ESLint、代码检查器、质量门、代码规范、安全扫描、多语言支持、DevOps工具链。

DevOps 0 次安装 0 次浏览 更新于 2/26/2026

name: static-analysis-runner description: 运行静态分析工具,包括SonarQube、ESLint和多语言代码检查器 allowed-tools:

  • Bash
  • Read
  • Write
  • Glob

静态分析运行器技能

概述

运行静态分析工具,包括SonarQube、ESLint/TSLint和多语言代码检查器,支持自定义规则配置和报告聚合。

能力

  • 运行SonarQube分析
  • 执行ESLint/TSLint
  • 多语言支持
  • 自定义规则配置
  • 报告聚合
  • 质量门评估
  • 趋势分析

目标流程

  • 重构计划
  • 安全架构审查
  • 性能优化

输入模式

{
  "type": "object",
  "required": ["paths"],
  "properties": {
    "paths": {
      "type": "array",
      "items": { "type": "string" },
      "description": "要分析的路径"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["sonarqube", "eslint", "tslint", "pylint", "rubocop", "checkstyle"]
      },
      "default": ["eslint"]
    },
    "config": {
      "type": "object",
      "properties": {
        "configFile": {
          "type": "string",
          "description": "代码检查器配置文件路径"
        },
        "rules": {
          "type": "object",
          "description": "规则覆盖"
        },
        "fix": {
          "type": "boolean",
          "default": false
        }
      }
    },
    "qualityGate": {
      "type": "object",
      "properties": {
        "maxErrors": { "type": "number" },
        "maxWarnings": { "type": "number" }
      }
    }
  }
}

输出模式

{
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tool": { "type": "string" },
          "files": { "type": "array" },
          "errors": { "type": "number" },
          "warnings": { "type": "number" }
        }
      }
    },
    "qualityGatePassed": {
      "type": "boolean"
    },
    "summary": {
      "type": "object",
      "properties": {
        "totalErrors": { "type": "number" },
        "totalWarnings": { "type": "number" },
        "filesAnalyzed": { "type": "number" }
      }
    }
  }
}

使用示例

{
  kind: 'skill',
  skill: {
    name: 'static-analysis-runner',
    context: {
      paths: ['src/**/*.ts'],
      tools: ['eslint'],
      config: {
        configFile: '.eslintrc.js',
        fix: false
      },
      qualityGate: {
        maxErrors: 0,
        maxWarnings: 10
      }
    }
  }
}