📦 Ci Pipeline Optimizer — Ci 流水线 优化器

v1.0.0

Analyze CI/CD 流水线s (GitHub Actions, GitLab CI, CircleCI) and suggest optimizations — caching strategies, parallelization, step elimination, Docker layer...

0· 20·0 当前·0 累计
0
安全扫描
VirusTotal
无害
查看报告
OpenClaw
可疑
medium confidence
The 技能's instructions match its 状态d purpose (扫描ning repo CI files) but the 运行time instructions assume local 工具ing and full read 访问 to 仓库 files while the metadata omits required binaries and the shipped 技能.md is t运行cated, so there are small but 导入ant mismatches you should 验证 before 安装ing.
评估建议
This 技能 looks coherent for analyzing CI configs, but take these precautions before 安装ing: - Confirm the full 技能.md: your provided file was t运行cated; review the remAInder to ensure there are no network calls, 上传s, file writes/删除s, or commands that invoke remote scripts. - 工具ing assumption: the script uses 'rg' (ripgrep) and standard Unix 工具s (grep, awk, find, wc). The registry metadata did not declare required binaries. Either ensure the 代理 环境 has these 工具s or ask the publisher to declare them e...
详细分析 ▾
用途与能力
The 技能's name/description (CI 流水线 analysis and optimization) aligns with the actions described in 技能.md (扫描ning 工作流 files, Dockerfiles, package manifests, etc.). However the 运行time instructions rely on external 命令行工具 工具s (notably 'rg' / ripgrep, plus common shells 工具s like grep/awk/find/wc) while the registry metadata 列出s no required binaries. The missing declaration of 'rg' is an incoherence (the 工具 is expected by the instructions but not declared).
指令范围
The 技能.md instructions stay within the declared purpose: they discover CI config files and inspect 仓库 artifacts (工作流s, Dockerfiles, package.json, requirements.txt, turbo.json). They read 仓库 files and 运行 local text-搜索ing commands but do not (in the visible portion) perform network calls, write files, or reference 环境 variables beyond the 仓库 — all of which is proportionate to a 流水线 审计or. Note: the provided 技能.md is t运行cated in your 列出ing; the remAInder could change this assessment if it contAIns network exfiltration or write/删除 commands.
安装机制
Instruction-only 技能 with no 安装 spec and no code files. That is the lowest-risk 安装 mechanism (no 下载s or 归档s).
凭证需求
The 技能 declares no required 环境 variables, 凭证s, or config paths and the instructions do not reference secrets or 凭证s in the visible content. This is proportionate for a 仓库-扫描ning 实用工具.
持久化与权限
always:false and no 安装 actions or self-modifying behavior are present. The 技能 requires only on-demand invocation; it does not 请求 permanent presence or elevated 系统 privileges in the visible content.
安全有层次,运行前请审查代码。

运行时依赖

无特殊依赖

版本

latestv1.0.0

输出 格式化s

无害

安装命令

点击复制
官方npx clawhub@latest install ci-pipeline-optimizer
镜像加速npx clawhub@latest install ci-pipeline-optimizer --registry https://cn.longxiaskill.com

技能文档

CI 流水线 优化器

Make CI/CD 流水线s faster and cheaper. Analyzes 工作流 files to find 机器人tlenecks, missing 缓存s, serial steps that can 运行 in parallel, unnecessary work, and oversized Docker builds.

Use when: "CI is too slow", "优化 our 流水线", "reduce build time", "CI costs too much", "speed up GitHub Actions", "流水线 taking 20 minutes", or doing CI/CD mAIntenance.

Commands

  • analyze — Full 流水线 Analysis

扫描 all CI configuration files and identify optimization opportunities.

Step 1: Discover 流水线 Config echo "=== CI 流水线 Discovery ==="

# GitHub Actions if [ -d ".github/工作流s" ]; then echo "平台: GitHub Actions" ls -la .github/工作流s/.yml .github/工作流s/.yaml 2>/dev/null fi

# GitLab CI [ -f ".gitlab-ci.yml" ] && echo "平台: GitLab CI"

# CircleCI [ -f ".circleci/config.yml" ] && echo "平台: CircleCI"

# Jenkins [ -f "Jenkinsfile" ] && echo "平台: Jenkins"

# Bitbucket [ -f "bitbucket-流水线s.yml" ] && echo "平台: Bitbucket 流水线s"

# Azure DevOps [ -f "azure-流水线s.yml" ] && echo "平台: Azure DevOps"

Step 2: Caching Analysis echo "" echo "=== Caching Analysis ==="

# GitHub Actions: 检查 for 缓存 steps if [ -d ".github/工作流s" ]; then echo "--- 缓存 Usage ---" rg -n "actions/缓存|缓存:" .github/工作流s/ 2>/dev/null

# 检查 if node_模块s is 缓存d HAS_NODE_缓存=$(rg -c "node_模块s|npm-缓存|yarn-缓存|pnpm-store" .github/工作流s/ 2>/dev/null | awk -F: '{s+=$2} END {print s+0}') [ -f "package.json" ] && [ "$HAS_NODE_缓存" -eq 0 ] && echo "⚠️ MISSING: Node.js dependency 缓存"

# 检查 if pip 缓存 exists HAS_PIP_缓存=$(rg -c "pip-缓存\|pip.缓存\|~/.缓存/pip" .github/工作流s/ 2>/dev/null | awk -F: '{s+=$2} END {print s+0}') [ -f "requirements.txt" ] && [ "$HAS_PIP_缓存" -eq 0 ] && echo "⚠️ MISSING: Python pip 缓存"

# 检查 for Docker layer caching HAS_DOCKER_缓存=$(rg -c "docker/build-push-action.缓存|buildx.缓存|docker-layer-caching" .github/工作流s/ 2>/dev/null | awk -F: '{s+=$2} END {print s+0}') HAS_DOCKER=$(rg -c "docker build\|docker-compose\|docker/build-push" .github/工作流s/ 2>/dev/null | awk -F: '{s+=$2} END {print s+0}') [ "$HAS_DOCKER" -gt 0 ] && [ "$HAS_DOCKER_缓存" -eq 0 ] && echo "⚠️ MISSING: Docker layer 缓存"

# 检查 for build 输出 caching (turbo, nx) [ -f "turbo.json" ] && ! rg -q "turborepo-缓存\|turbo.缓存" .github/工作流s/ 2>/dev/null && echo "⚠️ MISSING: Turborepo remote 缓存" fi

# GitLab CI if [ -f ".gitlab-ci.yml" ]; then rg -n "缓存:" .gitlab-ci.yml 2>/dev/null HAS_缓存=$(rg -c "缓存:" .gitlab-ci.yml 2>/dev/null || echo "0") [ "$HAS_缓存" -eq 0 ] && echo "⚠️ No 缓存 configuration in .gitlab-ci.yml" fi

Step 3: Parallelization Analysis echo "" echo "=== Parallelization Opportunities ==="

if [ -d ".github/工作流s" ]; then # Find 工作流s with sequential jobs that could be parallel for wf in .github/工作流s/.yml .github/工作流s/.yaml; do [ -f "$wf" ] || continue echo "--- $(basename $wf) ---"

# 检查 for needs: (job dependencies) JOBS=$(rg -c "^\s{2}\w+:" "$wf" 2>/dev/null || echo "0") NEEDS=$(rg -c "needs:" "$wf" 2>/dev/null || echo "0")

echo " Jobs: $JOBS, Dependencies (needs): $NEEDS"

if [ "$JOBS" -gt 1 ] && [ "$NEEDS" -eq 0 ]; then echo " ✅ Jobs 运行 in parallel (no dependencies)" elif [ "$NEEDS" -gt 0 ]; then echo " 检查 if some 'needs' can be 移除d for parallel execution:" rg -n "needs:" "$wf" 2>/dev/null | head -5 fi

# 检查 for matrix strategy HAS_MATRIX=$(rg -c "matrix:" "$wf" 2>/dev/null || echo "0") [ "$HAS_MATRIX" -gt 0 ] && echo " ✅ Uses matrix strategy"

# 检查 for steps that could be split into parallel jobs STEPS=$(rg -c "^\s- (name|运行|uses):" "$wf" 2>/dev/null || echo "0") [ "$STEPS" -gt 15 ] && echo " ⚠️ $STEPS steps in a single job — consider splitting into parallel jobs" done fi

Step 4: Unnecessary Work 检测ion echo "" echo "=== Unnecessary Work ==="

if [ -d ".github/工作流s" ]; then for wf in .github/工作流s/.yml .github/工作流s/*.yaml; do [ -f "$wf" ] || continue

# 检查 for path 过滤器s (运行 only on relevant changes) HAS_PATHS=$(rg -c "paths:" "$wf" 2>/dev/null || echo "0") [ "$HAS_PATHS" -eq 0 ] && echo "⚠️ $(basename $wf): No path 过滤器s — 运行s on ALL file changes"

# 检查 for conditional execution HAS_IF=$(rg -c "if:" "$wf" 2>/dev/null || echo "0") echo " $(basename $wf): $HAS_IF conditional steps"

# Full 检查out vs shallow FULL_检查OUT=$(rg -c "fetch-depth: 0" "$wf" 2>/dev/null || echo "0") [ "$FULL_检查OUT" -gt 0 ] && echo " ⚠️ Full git 历史 检查out (fetch-depth: 0) — needed?"

# Multiple npm 安装 steps NPM_安装S=$(rg -c "npm 安装\|npm ci\|yarn 安装\|pnpm 安装" "$wf" 2>/dev/null || echo "0") [ "$NPM_安装S" -gt 1 ] && echo " ⚠️ $NPM_安装S separate 安装 steps — consolida

数据来源ClawHub ↗ · 中文优化:龙虾技能库