Self Healing Ci 标志

Self Healing Ci

社区
pskoett
self-healing-ci

仅限 CI 的自愈工作流,使用 gh-aw(GitHub Agentic Workflows)在拉取请求和定时运行中主动恢复运行环境。当 CI 检查失败(测试、构建、lint、部署、扫描)时,此技能会根据 CI 日志诊断故障,在 PR 评论中提出经过验证的补丁,或通过后续提交修复,并将 HEAL 条目提交到 `.learnings/HEALS.md`。保留先验证再持久化的原则:只有在同一工作流中重新运行检查并通过,HEAL 才会标记为 `verified`;否则会以 `pending-verify` 状态提交,等待人工跟进。PR 中反复出现的修复模式会累积 `Recurrence-Count`,达到 ≥3 时会附加 `Handoff` 区块,以提示通过 self-improvement-ci 提升处理级别。适用场景:您希望在 CI 或定时流水线中无头执行自愈循环,自动捕获反复出现的故障模式,或希望 PR 能呈现不明显的环境或工具修复方案,无需人工分诊。对于交互式或本地会话,请改用 `self-healing`。

Add to TypingMind

概览

发布者pskoett
代码仓库pskoett-ai-skills
技能名称self-healing-ci
星标数
321
复刻数
48
附带文件
1
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 pskoett 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Self Healing Ci AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/pskoett/pskoett-ai-skills/tree/main/agent-plugin/skills/self-healing-ci
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pskoett/pskoett-ai-skills.git /tmp/pskoett-ai-skills
mkdir -p .claude/skills
cp -r /tmp/pskoett-ai-skills/agent-plugin/skills/self-healing-ci .claude/skills/self-healing-ci
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Self Healing Ci,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Self Healing Ci。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Self Healing Ci 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Self-Healing CI

CI-only variant of self-healing. Runs the diagnose → patch → verify → file loop headlessly against pull-request and scheduled workflow events.

Install

bash
gh skill install pskoett/pskoett-skills self-healing-ci

Fallback using the Agent Skills CLI:

bash
npx skills add pskoett/pskoett-skills/skills/self-healing-ci

Purpose

Run self-healing in CI without interactive chat loops:

  • Inspect failed PR checks (test/build/lint/scan/deploy) and parse logs for root cause
  • Propose a minimal verified patch as a PR comment or follow-up commit
  • Commit a HEAL- entry to .learnings/HEALS.md with verification proof (or pending-verify if the workflow can't re-run the check)
  • Search prior HEAL entries by Pattern-Key before filing new ones — deduplicate recurrences
  • Append a Handoff block at Recurrence-Count >= 3 for promotion via self-improvement-ci

Use self-healing for interactive/local sessions.

Context Limitation (Important)

CI agents do not have peak task context from the original implementation session. The agent is reading CI logs and code, not riding peak context after a focused implementation. Implications:

  • Favor conservative diagnoses — when uncertain, file pending-verify and surface to the PR author
  • Require mandatory verify before claiming verified — re-run the failing check in the same workflow run
  • Never modify project code without an explicit verify pass; propose changes as PR comments unless the workflow is configured for auto-commit
  • Route uncertain or high-impact recommendations to interactive review

Prerequisites

  1. GitHub Actions enabled for the repository
  2. GitHub CLI authenticated in the workflow (gh auth status)
  3. gh-aw installed for authoring/validation:
bash
gh extension install github/gh-aw
  1. .learnings/HEALS.md committed to the repo (or created on first run; see references/workflow-example.md for the bootstrap pattern)

CI Contract

The CI skill must:

  1. Read CI logs, PR diff, and existing .learnings/HEALS.md — nothing else from the PR author's machine
  2. Avoid direct code modifications by default — propose via PR comment or label-gated commit
  3. Re-run the failing check after applying the proposed patch (when feasible) — verified requires this; pending-verify is honest if it cannot
  4. Emit a machine-readable YAML output (see Output Schema)
  5. Commit the verified HEAL- entry only on a successful re-run — abandoned heals are still filed, but in a separate commit clearly labeled

Output Schema

yaml
self_healing_ci:
  source:
    pr_number: 123
    commit_sha: "abc123def"
    failed_check: "test (node 20)"
    workflow_run_id: 4567891234
  heal:
    heal_id: "HEAL-20260524-001"
    status: "verified"            # verified | pending-verify | abandoned
    trigger: "tool-failure"       # free-form
    active_context: "ci"          # optional
    area: "tests"                 # free-form
    pattern_key: "env.lockfile_mismatch"
    diagnosis: "Project uses pnpm; CI workflow ran `npm ci`."
    fix:
      summary: "Switch the CI install step from `npm ci` to `pnpm install --frozen-lockfile`."
      diff_path: ".learnings/heals/HEAL-20260524-001/patch.diff"   # only if files generated
    verification:
      command: "pnpm install --frozen-lockfile"
      exit_code: 0
      output_excerpt: "Lockfile is up to date, resolution step is skipped"
    recurrence_count: 1
    promotion_ready: false        # true at recurrence_count >= 3
  summary:
    heals_filed: 1
    verified: 1
    pending_verify: 0
    abandoned: 0
    promotion_candidates: 0

Verify-Before-Persist in CI

In CI the verify step is operationalized as re-running the failed check inside the same workflow run after applying the proposed patch:

Original failureVerify step in CI
pnpm test failedRe-run pnpm test after the patch
Build (tsc, cargo build) failedRe-run the build step
Lint (eslint, ruff) failedRe-run the lint step
Deploy preview failedRe-run the deploy step (if the workflow allows)
Snapshot diffRe-run with deterministic stubs if applicable

If the re-run isn't feasible (the check requires secrets only available in production workflows; the failure is transient; the patch needs human review before commit), the HEAL ships as pending-verify with explicit notes on what would prove it.

Never fake verified. Faking is the exact failure mode this skill exists to prevent — and in CI, the consequences propagate further than in interactive sessions because future PRs may apply the unverified "fix" automatically.

Recurrence and Promotion Rules

  • Search .learnings/HEALS.md by Pattern-Key before filing new heals
  • On match: increment Recurrence-Count, update Last-Seen, append the new occurrence to See Also
  • Promotion threshold (same as interactive):
    • Recurrence-Count >= 3
    • Seen across at least 2 distinct PRs/tasks
    • Within a 30-day window
    • The fix is generalizable (not project-specific)
  • On promotion: append a Handoff block to the existing HEAL with a Promotion Target (CLAUDE.md / AGENTS.md / .github/copilot-instructions.md / new-skill) and a one-line Distilled Rule
  • self-improvement-ci consumes the Handoff blocks and proposes the promotion as a PR

Suggested Workflow Triggers

TriggerUse case
workflow_run (completed, conclusion: failure)Most common — react to other workflows failing
pull_request (with if: guard on check status)Run on every PR but skip if all checks passed
schedule (nightly)Look for stale flakes, surface patterns the per-PR runs missed
workflow_dispatchManual replay against a specific PR or commit

Authoring patterns and example .github/workflows/*.lock.yml files live in references/workflow-example.md. Keep example workflows out of .github/workflows until you've explicitly decided to enable CI automation.

Anti-Patterns in CI

The interactive skill's anti-patterns all apply. CI-specific ones to watch:

  1. Auto-commit unverified fixes. A patch that hasn't passed the re-run check should never land on the branch automatically. Propose via PR comment instead.
  2. Re-trigger loops. If the heal triggers its own workflow, gate with if: github.actor != 'github-actions[bot]' to prevent infinite loops.
  3. Silent retry of flaky tests. A flaky test is not a heal candidate unless the patch actually addresses the non-determinism. Re-running the same flaky test until green is hiding, not healing.
  4. Cross-PR Pattern-Key collisions. If two PRs hit the same Pattern-Key with different root causes, the keys are too coarse — refine them rather than letting them merge.
  5. Heals on infra you don't own. Don't patch a third-party action's source from inside CI — propose a version pin or a configuration change instead.

Cross-references

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Self Healing Ci AI 技能有什么作用?

仅限 CI 的自愈工作流,使用 gh-aw(GitHub Agentic Workflows)在拉取请求和定时运行中主动恢复运行环境。当 CI 检查失败(测试、构建、lint、部署、扫描)时,此技能会根据 CI 日志诊断故障,在 PR 评论中提出经过验证的补丁,或通过后续提交修复,并将 HEAL 条目提交到 `.learnings/HEALS.md`。保留先验证再持久化的原则:只有在同一工作流中重新运行检查并通过,HEAL 才会标记为 `verified`;否则会以 `pending-verify` 状态提交,等待人工跟进。PR 中反复出现的修复模式会累积 `Recurrence-Count`,达到 ≥3 时会附加 `Handoff` 区块,以提示通过 self-improvement-ci 提升处理级别。适用场景:您希望在 CI 或定时流水线中无头执行自愈循环,自动捕获反复出现的故障模式,或希望 PR 能呈现不明显的环境或工具修复方案,无需人工分诊。对于交互式或本地会话,请改用 `self-healing`。

为什么在 TypingMind 中使用 Self Healing Ci?

因为您只需安装一次,就能搭配任何模型使用。Self Healing Ci 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Self Healing Ci?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/pskoett/pskoett-ai-skills/tree/main/agent-plugin/skills/self-healing-ci。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Self Healing Ci?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Self Healing Ci 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Self Healing Ci 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Self Healing Ci AI 技能免费吗?

pskoett 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇