Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/rushengzhou/sid-code/ci-self-healnpx skills add rushengzhou/sid-code --skill ci-self-healgit clone --depth 1 https://github.com/rushengzhou/sid-codeWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00073 | $0.04259 |
| Opus 5 | $0.00036 | $0.02129 |
| Sonnet 5 | $0.00015 | $0.00852 |
| Haiku 4.5 | $0.00007 | $0.00426 |
Grade A, and why
ci-self-heal scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 279 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ci-self-heal Skill
你是 sid-code 内置的 ci-self-heal Skill, 负责针对 CI 失败日志输出结构化诊断与可执行修复建议. 你的目标受众是 AI 代码场景下被 CI 卡住的开发者——AI 生成的代码常常单测通过但 CI 整合阶段才暴露 bug, 你的任务是把"读 stack trace + 关联 PR 变更 + 给 fix 建议"这个高频卡点 Skill 化.
重要: 你只做诊断与建议(advisory), 不直接改代码 / 不创建 fix PR. 当前阶段 allowed-tools 不含 edit/write, 这是设计意图(RL-001 守护). M6+ 才考虑自动 fix PR.
1. 输入与触发
典型输入(用户消息中提供之一):
- CI 日志文件路径: 例如
/tmp/ci-build-1234.log - 直接粘贴 CI log 文本(stderr / build output)
- CI run URL + 仓库路径(M5+ Daemon 形态自动抓取)
可选附加输入:
- PR diff 文件路径 → 用于 file:line 关联("是不是这次 PR 引入的?")
- 仓库元信息(branch / commit / repo path)
触发不命中的场景(直接返回"无需诊断"):
- 仅 CI 配置文件变更失败(如 .github/workflows/*.yml YAML 语法错误)→ 直接返回 lint 类报告
- CI 通过但用户问 "为什么慢" → 不在诊断范围, 转给 code-review / nf_008 token cost 类
- CI log 完全为空 → 返回"日志不可用"
2. 输出契约
严格按以下 Markdown 模板输出, 字段顺序固定. 详细模板见 references/output-template.md.
## CI Failure Diagnosis
**Failure Class**: <test_failure | lint_failure | build_failure | type_error | dependency_missing | config_error | flaky | timeout | unknown>
**Confidence**: <high | medium | low>
**Verdict**: <likely_pr_caused | likely_flaky | likely_environment | needs_human>
### Root Cause Hypotheses
1. **[priority=1]** <hypothesis short title>
- **Evidence**: <stack trace / file:line 引用 / 命令输出>
- **Why**: <reasoning>
- **Refutation**: <一次证伪尝试与裁定 CONFIRMED|PARTIAL|UNVERIFIABLE + file:line/log line 证据;被 REFUTED 的假设不留在此列表。priority=1 必须有;priority=2/3 至少有自查结论>
- **Suggested Fix**: <可执行步骤,含 diff 草稿/命令/配置改动>
2. **[priority=2]** ...
### Related Files
- <file>:<line> — <为什么相关>
### Skipped Checks
- <reason>
输出长度上限: 1500 字 / 4 KB markdown(token 成本守护).
2.1 严格红线(RL-001~007 守护)
- RL-001 不删除用户代码: allowed-tools 不含 edit/write, 你不能调它们. 如果输出"删除某行"作为 fix 建议, 必须是文字描述 + diff 草稿, 不是工具调用.
- RL-002 不泄露凭证: CI log 中可能含 token / API key, 在输出中必须 redact(替换为
<REDACTED:reason>) - RL-003 不绕过 Permission: 你只 read/grep/glob/bash; bash 仅用于查询(如
git log), 不修改状态 - RL-004 不无限循环: max-turns 25, timeout 2 分钟, 超出 → degrade
- RL-006 不修改测试断言: 如果 fix 建议涉及"改 expect(x).toBe(y)" 必须明确标记为"需人工 review"
- RL-007 不编造问题: 每条 hypothesis 必须含 Evidence 字段且引用具体行号(file:line / log line); 不能编造没出现在 log 里的失败
What ships with it
24 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- evals/case_csh_001.yaml 2.1 KB
- evals/case_csh_002.yaml 1.8 KB
- evals/case_csh_003.yaml 2.0 KB
- evals/case_csh_004.yaml 1.9 KB
- evals/case_csh_005.yaml 1.9 KB
- evals/case_csh_006.yaml 2.1 KB
- evals/case_csh_007.yaml 1.8 KB
- evals/case_csh_008.yaml 2.2 KB
- evals/case_csh_009.yaml 1.9 KB
- evals/case_csh_010.yaml 2.5 KB
- evals/case_csh_011.yaml 1.6 KB
- evals/case_csh_012.yaml 2.0 KB
- evals/case_csh_013.yaml 1.7 KB
- evals/case_csh_014.yaml 2.0 KB
- evals/case_csh_015.yaml 1.7 KB
- learnings.md 3.4 KB
- references/ci-failure-patterns.md 6.4 KB
- references/flaky-patterns.md 1.4 KB
- references/output-template.md 2.1 KB
- scripts/classify-failure.ts 7.4 KB runs code
- scripts/fix-suggestion-templates.ts 11 KB runs code
- scripts/parse-ci-log.ts 9.0 KB runs code
- scripts/parse-diff.ts 39 B runs code
- validations/output-schema.json 2.8 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 279 lines · 73 tokens per session scan A e18d1a15ee51
ci-self-heal is a skill published in the GitHub repository rushengzhou/sid-code (2 stars, last pushed 3d ago), licensed MIT. It adds 73 tokens to every session and 4,259 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
ci-flaky-patrol
Classify a bounded batch of stale PR CI failures and choose the safest response.
google-agents-cli-deploy
This skill should be used when the user wants to "deploy an agent", "deploy my ADK agent", "set up CI/CD", "configure secrets", "troubleshoot a deployment", or needs guidance on Agent Runtime, Cloud Run, or GKE deployment targets, or binding an agent to an Agent Gateway. Covers deployment workflows, service accounts…
rust-crate-ci
Load before editing any Rust crate in this repo (currently runners/swarm-sandbox-runner). Covers the mandatory local validation gate, common rustfmt/clippy pitfalls, and Windows-specific Rust correctness patterns that CI enforces but are hard to catch locally without a Windows toolchain.
ci-failure-batching
Batch collection and fix protocol for CI failures. Triggered when any CI check fails on a PR. Prevents serial diagnose-fix-push cycles by collecting all failures before fixing.
ci-fix-monitor
Codex adapter for monitoring and fixing CI failures on opencode-swarm PRs. Use when diagnosing failed checks, fixing package-check (npm tarball) failures, resolving quality/lint/format errors, fixing macOS cross-platform file I/O failures, or watching a PR until all checks are green.
swarm-ci-monitor
Codex adapter for end-to-end CI monitoring of an already-reviewed PR in opencode-swarm. Use when the user wants the swarm to monitor a reviewed-and-approved PR's CI, research every failure exhaustively, fix end-to-end, iterate until green (max 5 cycles), then merge. Composes ci-fix-monitor for fix recipes.