failure-handling

failure-handling is a skill for Claude Code from Lee-W/maigo. It costs 107 tokens per session (4,200 once invoked), scanned A, original, MIT.

A set of procedures for handling failures in Maigo command workflows, including blocked reviews, failed tests, unavailable helper agents, and repeated loops.

In plain words
What is it for?
It helps manage review-fix cycles, rerun failed tests, retry unavailable agents a limited number of times, and present recovery choices when an agent cannot continue.
Why use it?
It ensures failures are passed back with enough evidence, fixes are checked again, and temporary infrastructure problems do not cause endless retries or silent decisions.

Skill for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions subagents.

Part of the maigo plugin — 24 skills, 15 commands, 5 agents, 5 hooks shipped together

Good fit It helps manage review-fix cycles, rerun failed tests, retry unavailable agents a limited number of times, and present recovery choices when an agent cannot continue.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lee-w/maigo/failure-handling
Install

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.

Any agent
npx skills add Lee-W/maigo --skill failure-handling
Clone the repo
git clone --depth 1 https://github.com/Lee-W/maigo

Made for: Claude Code.

Or install maigo, the plugin that ships this one along with the rest of its 24 skills, 15 commands, 5 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for failure-handling

README.md
[![agentmods](https://agentmods.dev/badge/skills/lee-w/maigo/failure-handling.svg)](https://agentmods.dev/skills/lee-w/maigo/failure-handling)
Your own site
<a href="https://agentmods.dev/skills/lee-w/maigo/failure-handling"><img src="https://agentmods.dev/badge/skills/lee-w/maigo/failure-handling.svg" alt="Measured on agentmods" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,200 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.04200
Opus 5 $0.00053 $0.02100
Sonnet 5 $0.00021 $0.00840
Haiku 4.5 $0.00011 $0.00420

Measured 4d ago against content hash d8bf4abad82a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

failure-handling 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 4d 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.

skills/failure-handling/SKILL.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Failure Handling

Consumers: /maigo:go 失敗處理段、/maigo:quick 同段、/maigo:team 同段、/maigo:address-comments step 5 都引用本 skill。

爽世擋下(NEEDS_CHANGES / BLOCKED)

  1. 完整把爽世 (Soyo) 的輸出傳給愛音 (Anon)——must-fix 清單 + evidence 待補 + 具體改法
  2. 愛音修完後,必須附上每條 must-fix 的對應 diff 與 evidence(不接受「都改好了」這種模糊回報)
  3. 重新請爽世 review。爽世會逐條對照——任何一條沒清就維持 BLOCKED

修正輪閉環

套用任何 review 修正後,一律送回同一位 reviewer 複驗——同一個 context 才抓得到這輪 修正本身引入的新矛盾;換一個沒看過前情的 reviewer,等於失去對照歷史的能力。

  1. 修到 PASS 為止——每一輪修正都可能引入新缺陷,改完就收工等於沒驗;verdict 未達 對應 command 的通過門檻前,流程不算完成。
  2. reviewer 無法續用(原 agent session 已結束、必須開新 agent)時,視同重新審查: 附上完整前情——原始 diff、前幾輪 must-fix 清單、目前已套用的修正——不能只給「這是修正 後的版本」讓新 reviewer 從零判斷。

立希驗證紅

  1. 把 failure 完整貼給愛音 (Anon)(command + exit code + output)
  2. 愛音修完後立希 (Taki) 重跑——不接受愛音口頭說「修好了」
  3. 修到全綠才算過

環境造成的假紅

測試紅燈被診斷為環境造成的假紅(Node/OS/工具版本行為差異,不是程式碼缺陷)時, 判準:乾淨環境會綠、紅的成因指向 Node/OS/工具版本而非被測程式碼本身。

優先順序:

  1. 改環境設定讓它真的綠(例如 .claude/settings.local.jsonenv、正確的 flag、 對版本的工具)
  2. 治本的 repo 改動(測試 setup 層的隔離),範圍合理時另開 PR
  3. 最後才是遮蔽(本 repo 的 known-test-failures 機制)

Why:遮蔽名單是全檔粒度,遮掉噪音的同時把該檔案未來的真回歸一起遮掉;環境修法 沒有這個代價,還會讓別的 session 也直接受益。

不要把「加進 known-test-failures」當預設收尾動作——寫之前先問使用者,並在選項裡說明 代價;修完環境要回報「修掉幾個 / 還剩幾個」,剩下的說清楚為什麼修不掉。

Subagent 過載 / 不可用(如 529 Overloaded)

某個 agent 的 Task 因基礎設施問題(伺服器 529 Overloaded、逾時、暫時不可用)反覆啟動失敗,與該 agent 的工作品質無關時:

  1. 有限次重試——重試 2-3 次。每次重試成本不低(subagent 啟動到報錯可能耗數分鐘),不要無聲地一直重撞。
  2. 仍失敗 → 把選項攤給使用者,不自行決定:
    • 等久一點再試(短間隔重試只是重複燒時間;建議擱 20-30 分鐘讓尖峰過)
    • orchestrator 主線代打該 stage——繞過過載點立即解卡
    • 暫停,等基礎設施恢復後再接續
  3. 使用者授權主線代打時:
    • 明示這違反該 command 的分工守則(orchestrator 本不該自己 review / 實作),且獨立性較弱(等於審 / 改自己流程的產出)
    • 嚴格度不打折——照對應 skill(如 strict-review 9 項)硬走,以 git diff / 實測為憑,不因「我自己跑」放水
    • review 類代打要實際構造場景驗證(不只讀 code 說 OK);驗證類代打要貼真實 exit code
  4. infra 恢復後,讓真人 agent 補跑一次複核——代打有真實盲點(代打者對該 repo 的慣例未必熟,且審/驗自己的產出獨立性弱)。基礎設施恢復可 spawn 時,對代打過的 stage 補跑真正的 agent 一輪;真人 agent 揪出代打漏掉的問題是常態,不是例外。

Read the full file on GitHub · 177 lines

Changes

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.

  1. 4d ago Changed · +40 lines d8bf4abad82a
  2. 8d ago First seen · 137 lines · 107 tokens per session scan A cac3dab54807

Subscribe to this mod's changes

failure-handling is a skill published in the GitHub repository Lee-W/maigo (14 stars, last pushed yesterday), licensed MIT. It adds 107 tokens to every session and 4,200 once invoked, about $0.0005 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-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens