ci-failure-diagnosis
Diagnose a CI-specific failure from workflow definitions and logs by locating the failed workflow, job, step, and first trustworthy error, then comparing CI and local environments. Use for CI pipeline
SKILL.mdskills/ci-failure-diagnosis/SKILL.md
GitHubEnglish
Permission Contract
These capability limits come from Skill metadata, not user authorization. Allowed capabilities remain subject to the user's authorized scope and stricter conditions in the instructions.
- Read files: only within authorized scope and this Skill's conditions.
- Write or modify files: prohibited.
- Run shell commands: prohibited.
- Access the network: prohibited.
- Perform destructive actions: prohibited. An explicit exception for isolated temporary artifacts applies only under all of its stated conditions; it does not grant general write or deletion permission.
Execution Contract
Default to fast; bounded natural-language invocation is allowed.
Complete one primary task by default. Continue an authorized end-to-end workflow within each Skill's permissions; Router remains recommendation-only. Pause for new material decisions or scope, not authorization already given.
For authorized multi-stage work, evidence reuse or recovery, read references/workflow-coordination.en.md; optionally use references/workflow-coordination.mjs and references/workflows.yaml. Provide manual handoff when host execution is unavailable.
For a human-only blocker, give location, action, success signal and resume step; never request secret values or assume completion.
Validate according to actual risk; security, production, migrations, releases and other high-risk work use audit. Read references/execution-modes.en.md only when mode selection is unclear.
CI Failure Diagnosis
Diagnose a CI-specific failure using workflow definitions, logs, repository configuration, and environment evidence. Do not implement the fix.
Boundary
- Require a CI run, log excerpt, or identifiable failed workflow context. Route ordinary runtime bugs without CI context to
bug-root-cause-analysis. - Keep all files unchanged. Provide repair direction only.
- Never print credential values, request credential disclosure, or recommend disabling permissions, checks, branch protection, or other security controls.
- Redact credential-like values and distinguish a missing permission or credential reference from its value.
- Do not treat downstream cancellations or cascaded failures as root cause.
Workflow
- Identify the provider, workflow, run, job, matrix entry, step, command, and failure time from available evidence.
- Locate the first trustworthy error before cascaded errors, retries, skipped steps, and cleanup failures.
- Classify the failure as code, test, dependency, cache, permission/credential, runner environment, configuration, infrastructure, or flaky/unknown.
- Compare CI and local runtime versions, operating system, architecture, environment variable presence, dependency lockfile, install mode, shell, working directory, services, caches, and commands.
- Trace the evidence chain from CI input/state to the failing command, failure point, and job result.
- Propose safe local reproduction steps only from repository and workflow evidence. Mark unverified commands as hypotheses.
- Separate confirmed root cause, primary hypothesis, alternatives, and unknowns. Try to falsify flaky and cache explanations.
- Give the minimum repair direction, validation path, confidence, and evidence needed next without editing files.
Read execution boundaries. For code analysis, implementation or verification whose rules depend on the stack, consult language and runtime selection and apply only relevant component profiles. Routing, handoff and ordinary documentation work do not require language profiles.
Before editing user files or running test/build/diagnostic commands, read user workspace safety and apply relevant sections. Read-only analysis/review uses it when assessing authorization/business invariants, existing-data update semantics, validation isolation or edit conflicts; preserve this Skill's own permissions.
Output Contract
- Failure location: provider, workflow, run, job, matrix, step, and command
- First trustworthy error
- Evidence and causal sequence
- Failure classification
- Confirmed root cause or ranked hypotheses
- CI-versus-local differences
- Safe local reproduction
- Minimum repair direction
- Validation recommendations
- Confidence and unknowns
Redact sensitive values. Do not include a patch or claim a cascade error is the root cause.
简体中文
权限契约
以下能力边界来自 Skill 元数据,不构成用户授权;允许的能力仍须遵守用户授权范围和正文中更严格的条件。
- 读取文件:仅限已授权范围及本 Skill 的条件内。
- 写入或修改文件:禁止。
- 执行 Shell 命令:禁止。
- 访问网络:禁止。
- 执行破坏性操作:禁止。 正文明确规定的隔离临时产物例外仅适用于该例外的全部条件,不扩大为一般写入或删除权限。
执行契约
默认使用 fast;允许边界明确的自然语言隐式调用。
默认完成一个主任务。用户已授权完整流程时,在各 Skill 权限内连续完成;Router 仍只推荐。新重大决策或超出授权时暂停,不重复索取已有授权。
仅在已授权多阶段协作、证据复用或恢复时读取 references/workflow-coordination.zh-CN.md;按需使用 references/workflow-coordination.mjs 和 references/workflows.yaml,宿主不支持执行时提供人工交接。
必须由用户完成的阻塞步骤:给出操作位置、具体动作、成功标志、恢复步骤;不要求粘贴秘密值,不代替用户确认完成。
按实际风险选择验证;安全、生产、迁移、发布等高风险工作使用 audit。模式不明确时才读取 references/execution-modes.zh-CN.md。
CI 失败诊断
使用 workflow 定义、日志、仓库配置和环境证据诊断 CI 特定失败。不要实施修复。
职责边界
- 需要 CI run、日志片段或可识别的失败 workflow 上下文;没有 CI 上下文的普通运行时 Bug 交给
bug-root-cause-analysis。 - 保持所有文件不变,只给修复方向。
- 不得输出密钥值、要求用户披露密钥,也不得建议关闭权限、检查、分支保护或其他安全控制。
- 对疑似凭证值脱敏,区分缺少权限或凭证引用与凭证值本身。
- 不把后续取消或级联错误当根因。
工作流程
- 从可用证据识别 provider、workflow、run、job、matrix 项、step、命令和失败时间。
- 在级联错误、重试、跳过步骤和清理失败之前定位第一个可信错误。
- 分类为代码、测试、依赖、缓存、权限/密钥、Runner 环境、配置、基础设施或 flaky/未知。
- 对比 CI 与本地的运行时版本、操作系统、架构、环境变量是否存在、依赖锁文件、安装模式、shell、工作目录、服务、缓存和命令。
- 建立从 CI 输入/状态到失败命令、失效点和 job 结果的证据链。
- 只依据仓库和 workflow 证据提出安全本地复现步骤;未验证命令标记为假设。
- 分离已确认根因、主要假设、替代假设和未知项,并尝试证伪 flaky 与缓存解释。
- 不修改文件,给出最小修复方向、验证路径、置信度和下一步所需证据。
读取执行边界。分析、实施或验证代码且检查规则依赖技术栈时,按需读取语言与运行时选择,仅应用相关组件规则。路由、交接和普通文档任务无需加载语言规则。
修改用户文件或运行测试、构建、诊断命令前,读取用户项目修改与验证安全并应用相关章节。只读分析/审查涉及权限与业务不变量、已有数据更新语义、验证隔离或编辑冲突时按需读取,保持本 Skill 自身权限。
输出契约
- 失败位置:provider、workflow、run、job、matrix、step 和命令
- 第一个可信错误
- 证据与因果顺序
- 失败分类
- 已确认根因或排序假设
- CI 与本地差异
- 安全本地复现
- 最小修复方向
- 验证建议
- 置信度与未知项
敏感值必须脱敏。不得包含补丁,也不得把级联错误声称为根因。