运维分析
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 运维部署
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- Docker
- 底层运行要求
- Python · Docker
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: analyze-local
description: Use this skill when a local container won't start, a service is unreachable from the host, a loc…
category: 运维部署
runtime: Python / Docker
---
# analyze-local 输出预览
## PART A: 任务判断
- 适用问题:部署、CI、环境检查、发布或运维排障。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“0. Gather Context / 1. Clarify the Goal / 2. Apply Appropriate Role”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于部署、CI、环境检查、发布或运维排障,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“0. Gather Context / 1. Clarify the Goal / 2. Apply Appropriate Role”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、主要在本地完成、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/bugfix` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“0. Gather Context / 1. Clarify the Goal / 2. Apply Appropriate Role”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: analyze-local
description: Use this skill when a local container won't start, a service is unreachable from the host, a loc…
category: 运维部署
source: tomevault-io/skills-registry
---
# analyze-local
## 什么时候使用
- 把「分析」相关任务沉淀成 Agent 可调用的技能 适合处理部署、CI、发布、回滚、环境检查和运维排障,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常…
- 面向部署、CI、环境检查、发布或运维排障,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「0. Gather Context / 1. Clarify the Goal / 2. Apply Appropriate Role」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;主要在本地完成;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "analyze-local" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> 0. Gather Context / 1. Clarify the Goal / 2. Apply Appropriate Role
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python / Docker | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 主要在本地完成
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Analyze Local Docker Environment
Systematic analysis of the local Docker environment. Collects container status, logs, networking, resource usage, and diagnoses issues. Works standalone or as an entry point for local bugfixing.
0. Gather Context
Read CLAUDE.md (or AGENTS.md) at the project root to identify expected services, tech stack, and local development setup (docker-compose files, service dependencies).
1. Clarify the Goal
Ask the user:
- What is the problem or question? (e.g., "container won't start", "service unreachable", "high memory usage", "just want a health check")
- Which services are affected? (specific container names, or "all")
- When did the issue start? (after a code change, config update, restart, or unknown)
If invoked as part of a bugfix flow — extract the problem statement from the parent context instead of asking.
2. Apply Appropriate Role
Select and apply the role based on the problem type:
| Problem Type | Primary Role | Rationale |
|---|---|---|
| Container crashes, restarts, health checks | Agent(sre-engineer) |
Reliability, observability, troubleshooting |
| Networking, DNS, port conflicts, connectivity | Agent(sre-engineer) |
K8s/Docker networking diagnostics |
| Dockerfile, image builds, compose config | Agent(devops-engineer) |
Container orchestration, Docker expertise |
| CI/CD pipeline failures in local env | Agent(devops-engineer) |
Build and deploy pipeline expertise |
| Resource exhaustion (CPU, memory, disk) | Agent(sre-engineer) |
Capacity, resource management |
| Application errors visible in logs | Stack-specific role | Agent(java-engineer), Agent(python-engineer), Agent(frontend-engineer) based on service stack |
| General / unclear | Agent(software-engineer) |
Broad debugging methodology |
Announce the applied role to the user. If multiple problem types are present, apply multiple roles.
3. Collect Environment Snapshot
Run the following diagnostic commands to gather the current state. Present results as a structured summary.
3a. Docker Daemon and System
// turbo
docker version
docker info --format '{{.OperatingSystem}} | Containers: {{.Containers}} (Running: {{.ContainersRunning}}, Stopped: {{.ContainersStopped}}) | Images: {{.Images}}'
docker system df
Record: Docker version, OS, total containers, disk usage.
3b. Container Status
// turbo
docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}\t{{.State}}"
Record: For each container — name, image, status (Up/Exited/Restarting), ports, uptime.
Flag issues:
- Containers in
ExitedorRestartingstate - Containers with
unhealthyhealth status - Missing containers that should be running (ask user for expected services)
3c. Docker Compose (if applicable)
If a docker-compose.yml or compose.yaml is present in the project:
// turbo
docker compose ps -a
docker compose config --services
Record: Compose project name, service list, which services are up/down.
3d. Logs for Problematic Containers
For each container flagged in 3b (or the user-specified service):
docker logs --tail 100 --timestamps <container_name>
Record: Last 100 lines of logs. Look for:
- Error messages, stack traces, exceptions
- Connection refused / timeout errors
- OOM killed signals
- Configuration errors (missing env vars, wrong paths)
3e. Networking
// turbo
docker network ls
docker network inspect <network_name>
For connectivity issues:
docker exec <container> ping -c 2 <target_host>
docker exec <container> nslookup <service_name>
docker port <container>
Record: Networks, container IP assignments, port mappings, DNS resolution.
3f. Resource Usage
// turbo
docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}"
Record: CPU %, memory usage/limit, network I/O, block I/O per container.
Flag issues:
- Memory usage > 80% of limit
- CPU consistently > 90%
- Containers without memory limits set
3g. Volumes and Mounts
// turbo
docker volume ls
docker inspect --format '{{range .Mounts}}{{.Type}}: {{.Source}} -> {{.Destination}} ({{.Mode}}){{"\n"}}{{end}}' <container_name>
Record: Volume mounts, bind mounts, permissions (ro/rw).
3h. Health and Local Telemetry
Even on a single Docker host, name the methodology applied — this matches the production approach and surfaces gaps:
- USE Method (Brendan Gregg) — for
docker statsreads: Utilization (CPU%, MemPerc), Saturation (memory at limit, swap usage, blocked I/O), Errors (restart count, OOMKilled flag). Reference. - RED Method (Tom Wilkie) — for any container exposing HTTP: Rate, Errors, Duration. Apply it locally if the stack mirrors prod (Prometheus exporters, OTel collector). Reference.
- For Golden Signals, RED, USE deep-dive and full method/problem matrix → see
analyze-prodskill, Step 4h.
Docker-specific telemetry commands beyond Step 3:
// turbo
docker stats --no-stream
docker compose logs -f --since 10m
docker inspect --format='{{json .State.Health}}' <container>
docker inspect --format='{{.State.OOMKilled}} {{.State.ExitCode}} {{.State.RestartCount}}' <container>
If the local stack mirrors prod observability (Promtail/Loki + Grafana, Prometheus + cadvisor, Jaeger/Tempo via OTel collector) — query those directly using the same patterns documented in analyze-prod Step 4i.
4. Analyze Findings
Using the applied role's expertise, analyze the collected data:
- Correlate: Match the user's problem statement with the diagnostic data
- Identify root cause: Use the applied role's debugging methodology
- Check common causes (in order of likelihood):
5. Present Diagnosis
Structure the diagnosis as:
## Environment Summary
- Docker: [version], [OS]
- Containers: [running]/[total] | Compose: [yes/no]
- Disk usage: [used/available]
## Findings
### [Issue 1: title]
- **Symptom**: what was observed
- **Evidence**: specific log lines, metrics, or status
- **Root cause**: why it's happening
- **Severity**: critical / warning / info
### [Issue 2: title]
...
## Recommendations
1. [Fix for issue 1] — [command or config change]
2. [Fix for issue 2] — [command or config change]
...
## Environment Health: [HEALTHY | DEGRADED | CRITICAL]
6. Fix or Escalate
Based on the diagnosis:
- If fix is straightforward (restart, config change, env var): Propose the fix and apply after user approval
- If fix requires code changes: Transition to the appropriate stack-specific role and apply the bugfix following the role's debugging methodology
- If fix requires infrastructure changes (Dockerfile, compose, networking): Apply with
Agent(devops-engineer)patterns - If root cause is unclear: Propose additional diagnostic steps (increase log verbosity, attach to container, profile resource usage)
After applying any fix, re-run the relevant diagnostic commands from Step 3 to verify the fix resolved the issue.
7. Summary
Present the completed analysis:
- Problem: original user report
- Role(s) applied: which roles were used
- Root cause: what was found
- Fix applied: what was changed (or "no fix needed — environment is healthy")
- Verification: confirmation that the issue is resolved
- Prevention: recommendations to avoid recurrence (e.g., add health checks, set resource limits, pin image versions)
Integration
- Called by:
/bugfix(environment diagnostics step) - Roles:
Agent(devops-engineer),Agent(sre-engineer)
Source: alex-voloshin-dev/ai-assets — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核