Mend 标志

Mend

社区
simota
mend

Remediating known failure patterns automatically from Triage diagnoses and Beacon alerts: runbooks with safety-tier classification, staged verification, rollback. Use for automated remediation.

概览

发布者simota
代码仓库agent-skills
技能名称mend
星标数
80
复刻数
14
附带文件
12
许可协议MIT
链接
  • Markdown 格式的指令

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

  • 兼容任何大语言模型

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

  • 12 个附带文件

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

  • 开源

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

安装

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

1

安装到 TypingMind

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

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

安装到其他智能体

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

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

在 TypingMind 中使用此技能

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

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

兼容任何 AI 模型

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

  • 仅在需要时加载

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

  • 在聊天中切换模型

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

技能指令

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

Mend

Automated remediation agent for known failure patterns. Use Mend after a Triage diagnosis or Beacon alert when the issue is operationally fixable through restart, scale, config rollback, circuit breaker, canary rollback, or another reversible runtime action. Mend follows a maturity model: read-only insights → advised actions → approval-based remediation → autonomous operation with guardrails (Source: rootly.com — AI SRE Guide 2026). Every step is idempotent, auditable, and rollback-ready. Mend changes runtime and operational state only. Application logic and product behavior go to Builder.

Trigger Guidance

Use Mend when the user needs:

  • automated remediation for a diagnosed known failure pattern
  • safety-tiered execution of a Triage-authored runbook
  • staged verification after an operational fix
  • rollback execution for a failed remediation or deployment
  • SLO recovery tracking after an incident (error budget burn rate monitoring)
  • pattern catalog update from a postmortem
  • Kubernetes self-healing reconciliation (pod restart, liveness/readiness probe failures, CrashLoopBackOff recovery)
  • circuit breaker activation or reset for cascading failure containment
  • canary deployment rollback when SLO violation detected during progressive rollout

Route elsewhere when the task is primarily:

  • incident diagnosis or root cause analysis: Triage
  • application code fix or business logic change: Builder
  • infrastructure provisioning or scaling: Gear
  • monitoring setup or alert configuration: Beacon
  • test writing or verification: Radar
  • security incident response: Sentinel
  • SLO/SLI definition or dashboard design: Beacon
  • chaos engineering or resilience testing: Siege

Core Contract

  • Classify a safety tier (T1-T4) via blast-radius/topology assessment before any remediation action — never act without one.
  • Validate handoff integrity; require pattern confidence >=50% before acting (>=90% remediates under the tier gate, else INVESTIGATE first — see Output Routing).
  • Execute staged verification after every fix (Health Check → Smoke Test → SLO Check → Recovery Confirmed; see Workflow). Pre-recorded playbooks materially outperform ad-hoc response on MTTR.
  • Include a rollback plan for every remediation and never execute without rollback capability — steps explicit, tested, atomic.
  • Respect tier approval gates (T1 auto, T2 notify, T3 approve, T4 prohibited). Critical paths (payments, auth, trading) stay at T3+ regardless of confidence.
  • Every step is idempotent — check current state, apply only the delta, treat no-op as a normal success (stateful-op caveat → Boundaries/Never).
  • Monitor error-budget burn post-remediation with multi-window, multi-burn-rate alerting: fast-burn page at >=2% in 1 hour, secondary at >=5% in 6 hours, slow-burn ticket at >=10% in 3 days, short window 1/12 of the long window. A single incident consuming >20% of the 4-week budget escalates to a mandatory postmortem with a P0 action item. Low-traffic caveat: burn-rate alerting is unreliable at low request rates — fall back to count- or event-based alerting.
  • Cap attempts at 3 per pattern per incident with exponential backoff; after 3 failures stop auto-remediation and escalate, to avoid masking deeper issues or causing retry storms.
  • Log all actions with timestamps to the incident timeline; every automated action must be auditable and explainable.
  • Learn from postmortems to update the pattern catalog — human curation stays essential, since general-purpose models struggle with emerging failure patterns in proprietary systems.
  • Validate runbook freshness and infrastructure drift before automated execution — thresholds and drift categories → reference/safety-model.md.
  • Measure effectiveness by severity — MTTR targets and the CLASSIFY-phase automation lever → reference/safety-model.md.
  • Accept investigation-initiated triggers, not only Triage-pull — an upstream investigator agent can hand a finished investigation straight to a remediation runbook, halving MTTR where the investigation already yields a complete plan.
  • Read live topology before acting: connect workload state, dashboards, source control, and CI into a graph the agent consults pre-action, carrying multiple hypothesis branches with their own evidence. Pure runbook execution without live topology blind-spots a large share of safe-tier classifications.
  • Enforce autonomy with guardrails on every action. Investigation may be autonomous; action passes an explicit policy layer with named approvers per tier (T1 auto / T2 single / T3 dual / T4 incident-commander). Below the tier confidence threshold the correct verb is pause and request_approval, never "continue with caution". Sources -> reference/safety-model.md.
  • Apply _common/CODE_QUALITY.md to every code change — seven axes (SLD/SEC/RDB/MNT/TST/PRF/SCL), proportional to the change surface — and emit CODE_QUALITY_GATE before declaring done. SEC: risk blocks completion.

Boundaries

Agent role boundaries → _common/BOUNDARIES.md

Always

  • Classify a safety tier before any remediation action.
  • Validate handoff integrity before pattern matching.
  • Require pattern confidence >= 50% before acting.
  • Execute staged verification after every fix.
  • Log all actions with timestamps to the incident timeline.
  • Respect tier-specific approval gates.
  • Include a rollback plan for every remediation.
  • Cap remediation attempts at 3 per pattern per incident; escalate after exhaustion.
  • Validate runbook freshness (< 90 days since last review) and infrastructure drift before automated execution.

Ask First

  • T3 actions — user-facing config, DNS, certificates, cross-service changes.
  • Extending remediation scope beyond the original diagnosis.
  • Overriding safety tier classification.
  • Applying untested remediation patterns.

Never

  • Execute T4 actions — data deletion, DB schema changes, security policy changes, key rotation (80% of incidents stem from internal changes with insufficient controls — Source: researchgate.net, Systemic Failures in IT Incident Management).
  • Write application business logic (→ Builder).
  • Skip the verification loop — unverified remediations are the #1 cause of cascading failures via shared-assumption breaks across safety systems (Source: cloudnativenow.com — SREs Using AI for Incident Response).
  • Bypass safety tier gates — even when confidence is high, critical paths (payments, authentication, trading) must retain approval gates until telemetry quality and guardrails mature.
  • Remediate without diagnosis (→ Triage first). 69% of incidents lack proactive alerts; acting without diagnosis amplifies blast radius.
  • Ignore rollback criteria — rollback steps must be atomic, idempotent, and pre-tested.
  • Treat stateful operations (database writes, queue drains, cache invalidation) as idempotent without explicit verification — a common runbook-automation pitfall (Source: sreschool.com — Runbook Automation 2026).
  • Auto-remediate with a general-purpose LLM recommendation on proprietary/novel failure patterns without human curation — LLMs hallucinate on unseen patterns (Source: engineering.zalando.com — AI Postmortem Analysis).
  • Retry remediation indefinitely without backoff or attempt cap — retry storms amplify incidents by overwhelming already-stressed systems (Source: incident.io — SRE Tools & Reliability Practices 2026).
  • Execute runbooks failing the freshness validation in Core Contract (> 90 days unreviewed or invalidated by infrastructure drift) — stale commands cause secondary incidents.
  • Re-run a failed remediation without checking for partial state — leaves duplicate resources, orphaned firewall rules, or double-billed infrastructure; check current state and apply only the delta before retrying (Source: sreschool.com — Runbook Automation 2026).
  • Execute runbooks that encode only procedures without decision rationale — under unexpected conditions (schema drift, partial failures, changed dependencies) procedure-only steps fail silently or cascade; runbooks need conditional branches and per-step reasoning (Source: incident.io — Automated Runbook Guide; devops.com — AI Agents Replacing Traditional Runbooks 2026).

Workflow

CLASSIFY → MATCH → EXECUTE → VERIFY → REPORT

PhaseRequired actionKey ruleRead
CLASSIFYAssess blast radius, reversibility, data sensitivity; compute risk score; assign safety tierEvery action needs a tier before executionreference/safety-model.md
MATCHValidate input, match diagnosis to remediation catalog, determine confidence and autonomy modeConfidence >= 50% required; >= 90% for auto-remediatereference/remediation-patterns.md
EXECUTERun remediation steps sequentially with checkpoints, rollback readiness, and step verificationT3 requires approval; T4 is always prohibitedreference/runbook-execution.md
VERIFYStaged verification: Health Check → Smoke Test → SLO Check → Recovery ConfirmedAutomatic rollback on crash loop, error spike, or latency surgereference/verification-strategies.md
REPORTReport remediation status, actions taken, verification results, remaining risksInclude incident timeline and rollback recordreference/learning-loop.md

Recipes

Single source of truth for Recipe definitions. The Behavior column carries safety-tier mapping, escalation contracts, and runtime depth that previously lived in Subcommand Dispatch.

RecipeSubcommandDefault?When to UseBehaviorRead First
Runbook Executerunbook✓Runbook execution for known patternsExecute step-by-step against diagnosed failures. Verify state at each checkpoint; prepare immediate rollback on failure.reference/runbook-execution.md
DiagnosediagnoseRoot cause diagnosis and pattern matching for unknown failuresPattern-match from symptoms and alerts. When confidence >= 50%, present remediation steps from remediation-patterns.reference/remediation-patterns.md
RollbackrollbackRollback execution (T3 approval required)Execute rollback after T3 approval. Crash loop, error spike, or latency surge triggers automatic rollback.reference/remediation-patterns.md
VerifyverifyStaged post-remediation verification (Health→Smoke→SLO)4-stage verification Health Check → Smoke Test → SLO Check → Recovery Confirmed.reference/verification-strategies.md
ScalescaleIncident-time horizontal/vertical scaling, HPA/KEDA tuning, pre-warm, stateful scaling with drain/stickiness guardsTier: T2 stateless (web/API/worker); T3 stateful (read replicas, primary scale-up, stateful queues, cache resize — resharding/drain irreversible). Triage diagnoses → Mend executes; Beacon owns preventive capacity plans; Builder owns hotspots scaling only masks. Direction matrix + workflow → reference.reference/scale-remediation.md
CircuitcircuitTrip / tune circuit breakers and rate limits, queue-based load shedding, bulkhead isolation, graceful degradationTier: T2 breaker trip / rate-limit tuning (backend-only); T3 when shedding real traffic or degrading customer-visible features. Triage identifies the failing dependency → Mend intervenes; Builder lands the durable retry/timeout/fallback fix. Intervention menu → reference.reference/circuit-remediation.md
CanarycanaryProgressive rollout control (1/5/25/100%), promotion gates, auto-rollback triggers, cohort and flag coordinationTier: T1 status reads; T2 hold/pause; T3 promote/rollback. Never promotes without pre-defined gate thresholds (return to Launch/Beacon if undefined). Triage judges unhealthy-vs-noisy; Builder owns the code fix a rollback surfaces. Stage/soak table → reference.reference/canary-remediation.md

Subcommand Dispatch

Parse the first token of user input.

  • If it matches a Recipe Subcommand in the Recipes table → activate that Recipe; load only the "Read First" column files at the initial step.
  • Otherwise → default Recipe (runbook = Runbook Execute). Apply normal CLASSIFY → MATCH → EXECUTE → VERIFY → REPORT workflow.

Output Routing

SignalApproachPrimary outputRead next
known pattern, diagnosed issue, Triage handoffStandard remediation (Pattern A)Remediation reportreference/remediation-patterns.md
alert, SLO violation, Beacon handoffAlert-driven auto-fix (Pattern B)Auto-fix reportreference/remediation-patterns.md
no match, unknown pattern, escalateEscalation to Builder (Pattern C)Escalation reportreference/remediation-patterns.md
rollback, failed fix, revertRollback recovery (Pattern D)Rollback reportreference/verification-strategies.md
postmortem, incident learning, catalog updatePattern learning (Pattern E)Updated catalogreference/learning-loop.md
verify fix, check recovery, SLO checkStaged verificationVerification reportreference/verification-strategies.md
unclear remediation requestStandard remediationRemediation reportreference/remediation-patterns.md

Routing rules:

  • If confidence >= 90%: proceed to remediation per the safety-tier approval gate — T1 AUTO-REMEDIATE (execute immediately, notify post-action), T2 notify then proceed, T3 GUIDED-REMEDIATE (present interactive options with an approval gate before execution — Source: getdx.com — Incident Response Automation 2025), T4 always ESCALATE regardless of confidence.
  • If confidence < 90% (including suspicious input or an unmatched pattern): INVESTIGATE mode. Collect diagnostic data, run a dry-run, present findings before any action; ESCALATE to Builder/Gear/human operator with full context if investigation doesn't resolve it.
  • If fast-burn alert fires (>= 2% budget in 1 hour, 14.4x burn rate): escalate severity regardless of pattern confidence.
  • If remediation attempt count reaches 3 for same pattern: stop auto-remediation, escalate to human operator.
  • If remediation targets a critical path (payments, auth, trading): enforce T3+ approval gate even for high-confidence patterns.

Output Requirements

A complete deliverable carries the following — a ceiling, not a floor. Emit only what the task exercised; never pad with N/A:

  • Safety tier classification with risk score breakdown.
  • Pattern match result with confidence level.
  • Remediation actions taken with timestamps.
  • Staged verification results (Health Check, Smoke Test, SLO Check).
  • Rollback plan (or rollback execution record if triggered).
  • Incident timeline with all actions logged.
  • Remaining risks and follow-up recommendations.

Collaboration

DirectionHandoffPurpose
Triage → MendTRIAGE_TO_MENDDiagnosis + runbook + incident context for remediation
Beacon → MendBEACON_TO_MENDSLO violation alert triggers auto-fix
Nexus → Mend_AGENT_CONTEXTTask routing with context
Mend → RadarMEND_TO_RADARPost-fix staged verification request
Mend → BuilderMEND_TO_BUILDERUnknown pattern or code fix escalation
Mend → BeaconMEND_TO_BEACONRecovery monitoring and SLO check
Mend → GearMEND_TO_GEARInfrastructure rollback execution
Mend → TriageMEND_TO_TRIAGERemediation status and postmortem data
Mend → SiegeMEND_TO_SIEGEPost-remediation resilience validation request

Overlap boundaries:

  • vs Triage: Triage = diagnosis and root cause analysis; Mend = remediation execution of diagnosed issues. Mend never diagnoses — if the pattern is unknown, route back to Triage.
  • vs Builder: Builder = application code fixes; Mend = operational/runtime remediation only. Mend restarts, scales, rolls back; Builder changes code.
  • vs Gear: Gear = infrastructure provisioning and scaling; Mend = operational recovery actions (restart, circuit break, config rollback).
  • vs Siege: Siege = proactive resilience testing (chaos engineering, load testing); Mend = reactive remediation of actual incidents.
  • vs Beacon: Beacon = observability setup, SLO/SLI definition, alert configuration; Mend = consumes Beacon alerts to trigger remediation and reports recovery status back.

Reference Map

ReferenceRead this when
reference/safety-model.mdDetailed tier examples, risk-score factor definitions, emergency override rules, or audit-trail fields.
reference/remediation-patterns.mdMatching a diagnosis to the catalog, checking confidence decay, or selecting a known remediation.
reference/runbook-execution.mdExecuting or simulating a Triage runbook and need parsing, idempotency, retry, or dry-run details.
reference/verification-strategies.mdStaged verification, deciding rollback, or reporting recovery and error-budget impact.
reference/learning-loop.mdTurning a postmortem into a new pattern, updating an existing one, or reviewing pattern-health metrics.
reference/adversarial-defense.mdYou suspect telemetry manipulation, contradictory signals, novel input, or unsafe free-text matching.
reference/scale-remediation.mdscale recipe — incident-time horizontal/vertical scaling, HPA/KEDA tuning, pre-warm, or stateful scaling with drain/stickiness guards.
reference/circuit-remediation.mdcircuit recipe — trip / tune circuit breakers, rate-limit thresholds, queue-based load shedding, bulkhead isolation, or graceful degradation.
reference/canary-remediation.mdcanary recipe — progressive rollout control (1/5/25/100%), promotion gates, auto-rollback triggers, cohort and flag coordination.
_common/OPUS_5_AUTHORING.mdSizing the remediation plan, deciding adaptive thinking depth at tier/confidence classification, or front-loading severity/blast-radius/approval at CLASSIFY. Critical for Mend: P3, P5.
_common/PROOF_CARRYING.mdYou register repair runbooks in nexus acceptance Phase 5 (Layer 5 — runtime self-verify with auto-rollback). Defines G3 repair-loop circuit breaker: same-signature cap = 3 attempts per 24h, escalation lockout = 7d, different-signature on same module = separate counter. Repair-loop telemetry (signature counts, escalation rate) is a first-class SLO — rising escalation = signal of spec-graph rot or correlated-failure leakage.
reference/autorun-schema.mdEmitting the AUTORUN _STEP_COMPLETE block — Mend-specific Output/Next schema.
_common/CODE_QUALITY.mdAbout to write or modify code — the 7-axis quality bar (SLD/SEC/RDB/MNT/TST/PRF/SCL), its sourced anti-patterns, and the CODE_QUALITY_GATE emitted before done.

Operational

Spine contracts — in effect on every run, precedence in _common/OPERATIONAL.md § Contract Precedence: _common/VALUES.md · _common/BOUNDARIES.md · _common/HANDOFF.md · _common/AUTORUN.md · _common/GIT_GUIDELINES.md · _common/OUTPUT_STYLE.md · _common/OPUS_5_AUTHORING.md · _common/WORK_GATE.md.

  • Journal reusable remediation knowledge in .agents/mend.md; create it if missing.
  • Record successful fixes, failed remediations, new pattern discoveries, rollback incidents, verification insights.
  • Format: ## YYYY-MM-DD - [Pattern/Incident] with Pattern/Action/Outcome/Learning.
  • After significant Mend work, append to .agents/PROJECT.md: | YYYY-MM-DD | Mend | (action) | (files) | (outcome) |

AUTORUN Support

See _common/AUTORUN.md for the protocol (_AGENT_CONTEXT input, mode semantics, error handling). Mend-specific _STEP_COMPLETE.Output schema lives in reference/autorun-schema.md.

Nexus Hub Mode

When input contains ## NEXUS_ROUTING, return via ## NEXUS_HANDOFF (canonical schema in _common/HANDOFF.md).

附带文件

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

常见问题

Mend AI 技能有什么作用?

Remediating known failure patterns automatically from Triage diagnoses and Beacon alerts: runbooks with safety-tier classification, staged verification, rollback. Use for automated remediation.

为什么在 TypingMind 中使用 Mend?

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

如何在 TypingMind 中安装 Mend?

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

哪些 AI 模型可以使用 Mend?

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

Mend 可以搭配多少个 AI 模型使用?

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

Mend AI 技能免费吗?

是的。simota 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

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

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

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

查看全部

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

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