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
}
}
}
}