← 返回 Skills 市场
xinian5216

agent resilience

作者 xinian5216 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
279
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install agent-resilience
功能描述
Agent resilience patterns for surviving context loss, capturing critical details, and self-improvement. Use when: starting complex/long sessions, asked to 'r...
使用说明 (SKILL.md)

Agent Resilience

Patterns for surviving context loss, capturing corrections, and continuously improving.

WAL Protocol (Write-Ahead Logging)

The Law: Chat history is a buffer, not storage. Files survive; context doesn't.

Trigger — scan every message for:

  • ✏️ Corrections — "It's X, not Y" / "Actually..." / "No, I meant..."
  • 📍 Proper nouns — names, places, companies, products
  • 🎨 Preferences — styles, approaches, "I like/don't like"
  • 📋 Decisions — "Let's do X" / "Go with Y"
  • 🔢 Specific values — numbers, dates, IDs, URLs

If any appear:

  1. WRITE FIRST → update memory/SESSION-STATE.md
  2. THEN respond

The urge to respond is the enemy. Write before replying.

SESSION-STATE.md

Active working memory for the current task. Create at memory/SESSION-STATE.md:

# Session State
**Task:** [what we're working on]
**Key decisions:** [decisions made]
**Details:** [corrections, names, values captured via WAL]
**Next step:** [what happens next]

Reset when starting a new unrelated task.

Working Buffer (Danger Zone)

When context reaches ~60%, start logging every exchange to memory/working-buffer.md:

# Working Buffer
**Status:** ACTIVE — started [timestamp]

## [time] Human
[their message]

## [time] Agent
[1-2 sentence summary + key details]

Clear the buffer at the START of the next 60% threshold (not continuously).

Compaction Recovery

Auto-trigger when session starts with a summary tag, or human says "where were we?":

  1. Read memory/working-buffer.md — raw danger-zone exchanges
  2. Read memory/SESSION-STATE.md — active task state
  3. Read today's + yesterday's daily notes
  4. Extract key context back into SESSION-STATE.md
  5. Respond: "Recovered from buffer. Last task was X. Continue?"

Never ask "what were we discussing?" — read the buffer first.

Verify Before Reporting

Before saying "done", "complete", "finished":

  1. STOP
  2. Actually test from the user's perspective
  3. Verify the outcome, not just that code exists
  4. Only THEN report complete

Text changes ≠ behavior changes. When changing how something works, identify the architectural component and change the actual mechanism.

Relentless Resourcefulness

Try 10 approaches before asking for help or saying "can't":

  • Different CLI flags, tool, API endpoint
  • Check memory: "Have I done this before?"
  • Spawn a research sub-agent
  • Grep logs for past successes

"Can't" = exhausted all options. Not "first try failed."

Self-Improvement Guardrails

When updating behavior/config based on a lesson:

Score the change first (skip if \x3C 50 weighted points):

  • High frequency (daily use?) → 3×
  • Reduces failures → 3×
  • Saves user effort → 2×
  • Saves future-agent tokens/time → 2×

Ask: "Does this let future-me solve more problems with less cost?" If no, skip it.

Forbidden: complexity for its own sake, changes you can't verify worked, vague justifications.

Quick Start Checklist

For long/complex tasks:

  • Create memory/SESSION-STATE.md with task + context
  • Apply WAL: write corrections/decisions before responding
  • At ~60% context: start working buffer
  • After any compaction: read buffer before asking questions
  • Before reporting done: verify actual outcome
安全使用建议
This skill is internally coherent for 'durable memory' behavior but it will persist and read conversational content and may consult other notes/logs. Before installing or enabling it, decide where the memory files will live and who/what can read them. Recommended safeguards: - Restrict the memory directory to a controlled, access-restricted path (not a system or home directory with broad access). - Add filtering or redaction steps before writing to files to avoid storing secrets, credentials, or PII. - Clarify what 'today's + yesterday's daily notes' means in your environment or remove that step if you don't want the agent to scan other files. - Disable or review any 'spawn sub-agent' behavior; limit network access for spawned agents if possible. - Audit memory/working-buffer files regularly and set a retention policy (automatic expiry or manual review). If you cannot enforce those constraints in your agent runtime, treat this skill as higher risk and consider not enabling it.
功能分析
Type: OpenClaw Skill Name: agent-resilience Version: 1.0.0 The skill bundle implements 'Agent Resilience' patterns designed to help an AI agent maintain state and recover from context loss. It uses a 'Write-Ahead Logging' (WAL) approach to store task details, corrections, and conversation history in local markdown files (e.g., memory/SESSION-STATE.md and memory/working-buffer.md). The instructions focus on improving reliability and self-correction without any evidence of data exfiltration, malicious execution, or harmful prompt injection.
能力评估
Purpose & Capability
Name and description (agent resilience, WAL, working buffers, compaction) align with the instructions: writing session state, maintaining a working buffer, compaction/recovery, and verification steps. The files and protocols the SKILL.md defines are coherent with the stated purpose.
Instruction Scope
The runtime instructions tell the agent to write persistent files (memory/SESSION-STATE.md and memory/working-buffer.md) and to log every exchange when 'context reaches ~60%'. They also instruct reading 'today's + yesterday's daily notes', 'grep logs for past successes', and 'spawn a research sub-agent'. Those steps can cause the agent to read/write broader user files or logs and to create sub-agents that may access more resources. This increases the risk of capturing PII, secrets, or other sensitive data and of the agent accessing files outside a narrowly-scoped memory directory.
Install Mechanism
Instruction-only skill with no install spec and no code files. Nothing will be written to disk by an installer; only the agent's runtime behavior (file read/write) is relevant.
Credentials
The skill requests no environment variables or external credentials (proportionate). However, the SKILL.md implicitly expects access to local notes and logs (unspecified locations). That implicit file access is not declared in requires.env or config paths and may require or result in access to unrelated files.
Persistence & Privilege
The skill does not set always:true and requests no special platform privileges, but it explicitly instructs persistent storage of conversational content in memory/*.md. Persistent logging of interactions increases the blast radius (longer retention of captured data) and should be considered a privileged behavior even without explicit platform-level flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install agent-resilience
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /agent-resilience 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release providing resilient patterns for agent memory and self-improvement: - Introduces Write-Ahead Logging (WAL) for capturing corrections, key decisions, and details before responding. - Specifies structure and use of `SESSION-STATE.md` as active task memory. - Details the working buffer protocol for handling potential context loss in long sessions. - Defines compaction and recovery steps to restore state from logs and buffers. - Includes guardrails for self-improvement and a checklist for session reliability.
元数据
Slug agent-resilience
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

agent resilience 是什么?

Agent resilience patterns for surviving context loss, capturing critical details, and self-improvement. Use when: starting complex/long sessions, asked to 'r... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 279 次。

如何安装 agent resilience?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-resilience」即可一键安装,无需额外配置。

agent resilience 是免费的吗?

是的,agent resilience 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

agent resilience 支持哪些平台?

agent resilience 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 agent resilience?

由 xinian5216(@xinian5216)开发并维护,当前版本 v1.0.0。

💬 留言讨论