AGENT SKILL

retrospective

任务完成后的反思与经验沉淀。审视本次执行过程,将教训更新到对应 skill 中,驱动所有 skill 持续进化。

License 许可
Apache-2.0
最近更新
2026-08-12
Stars
★ 2
Forks
0

01 前言 Front Matter

name
retrospective
description
任务完成后的反思与经验沉淀。审视本次执行过程,将教训更新到对应 skill 中,驱动所有 skill 持续进化。

03 SKILL.md 正文

任务反思与经验沉淀

触发条件:任何非平凡任务完成后(尤其是经历了 debug 的任务),主动执行此 skill。也可由用户显式触发。

服务对象:所有 skill。本 skill 的产出是对其他 skill 文件的更新,不产生代码。

核心原则

🚨 对结果要有定力,不要自我欺骗

最大的风险是"觉得差不多了"的幻觉——结果不达标时,找外部原因搪塞然后降低要求宣布完成。

常见的自我欺骗模式:

  • 功能任务:输出不正确时归因于"量化精度不够"、"模型太小"、"这是预期的退化",而不是继续排查实现 bug
  • 性能任务:优化没有效果时归因于"编译器已经优化得很好了"、"已经接近理论极限",而不是继续尝试其他方案

正确做法:

  • 测试目标在开始前就定好,不能中途降低标准
  • 通过标准必须具体、可验证("差不多能用"不算通过)
  • 功能任务:人工验证不通过就是没通过,继续排查实现细节
  • 性能任务:没有达到预期提升就继续优化,用数据证明已到极限而不是猜测

TDD 思维:先定测试再写代码

每个子任务开始前明确三件事:

  1. 通过标准是什么? — 具体的预期输出
  2. 怎么测? — 可执行的测试命令
  3. 什么不算通过? — 明确列出容易自我欺骗的边界情况

执行流程

1. 识别教训

  • 走了哪些弯路?错误假设是什么?
  • 根因是什么?为什么没有第一时间找到?
  • 方法论问题?跳步了?过早下结论了?把 bug 归因为外部原因了?

2. 判断归属

教训类型 更新位置
某个 skill 流程中的陷阱 该 skill 的 common-pitfalls 或步骤文件
通用工作方法论 该 skill 的 SKILL.md 顶层注意事项
跨 skill 通用经验 memory 系统

3. 写入原则

  • 只写方法论,不写单次任务的具体细节。 可以附最小测试示例说明如何验证。
  • 放在最显眼的位置。 关键教训放 SKILL.md 顶部,不要埋在子文档末尾。
  • 增加的同时审视现有内容。 显而易见的、能从代码直接推出的指导删掉或精简。单个步骤文件不超过 500 行。

04 同仓库更多 Skills

zhangmask
zhangmask/C_AnimeCompanion

mem0

Mem0 Platform SDK for adding persistent memory to AI applications. TRIGGER when: user mentions "mem0", "MemoryClient", "memory layer", "remember user preferences", "persistent context", "personalization", or needs to add long-term memory to chatbots, agents, or AI apps. Covers Python SDK (mem0ai), TypeScript SDK (mem0ai), and framework integrations (LangChain, CrewAI, OpenAI Agents SDK, Pipecat, LlamaIndex, AutoGen, LangGraph). Also covers the open-source self-hosted Memory class. This is the DEFAULT mem0 skill for ambiguous queries. DO NOT TRIGGER when: user asks about CLI commands, terminal usage, or shell scripts (use mem0-cli), or Vercel AI SDK / @mem0/vercel-ai-provider / createMem0 (use mem0-vercel-ai-sdk).

★ 2
zhangmask
zhangmask/C_AnimeCompanion

mem0-vercel-ai-sdk

Mem0 provider for Vercel AI SDK (@mem0/vercel-ai-provider). TRIGGER when: user mentions "vercel ai sdk", "@mem0/vercel-ai-provider", "createMem0", "retrieveMemories", "addMemories", "getMemories", "searchMemories", "mem0 vercel", "AI SDK provider", "AI SDK memory", or is using generateText/streamText with mem0. Also triggers for Next.js apps needing memory-augmented AI. DO NOT TRIGGER when: user asks about direct Python/TS SDK calls without Vercel (use mem0 skill), or CLI terminal commands (use mem0-cli skill).

★ 2
zhangmask
zhangmask/C_AnimeCompanion

mem0-test-integration

Verify a Mem0 integration produced by /mem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run /mem0-integrate and says "verify", "test the integration", "run /mem0-test-integration", or when a .mem0-integration/ directory exists and tests have not been run yet on the current branch. DO NOT TRIGGER when: the user wants to run general project tests (defer to the repo's native test command), or when no prior /mem0-integrate run exists in the current branch (ask them to run /mem0-integrate first). This skill ONLY catches compile and runtime bugs by design. Logical integration errors — wrong data stored, wrong time retrieved, wrong user scoping — are on the human reviewer.

★ 2
zhangmask
zhangmask/C_AnimeCompanion

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local `Memory` class) to the mem0 Platform / hosted / managed SDK (the `MemoryClient` class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g. "migrate my mem0 setup to the platform", "switch from self-hosted mem0 to MemoryClient", "use my mem0 API key instead of a local Qdrant", "move mem0 to the cloud/hosted/managed service", or "replace my local mem0 vector store + embedder config with the platform". Applies to Python (`from mem0 import Memory` → `from mem0 import MemoryClient`) and TypeScript/JavaScript (`import { Memory } from "mem0ai/oss"` → `import MemoryClient from "mem0ai"`). Trigger even when the user doesn't say the word "migrate" but clearly wants their existing mem0 integration to run against the hosted platform. It first produces a reviewable migration plan, then executes it after the developer approves. Strictly scoped to the mem0 integration — it does not refactor, restructure, or "improve" any unrelated code.

★ 2
zhangmask
zhangmask/C_AnimeCompanion

mem0-integrate

Integrate Mem0 into an existing repository using a goal-driven, TDD pipeline. Detects the repo's language automatically and asks the user to pick between Mem0 Platform (managed) and Mem0 Open Source (self-hosted). Writes failing tests before any implementation. Produces a local feature branch plus `.mem0-integration/` artifacts consumed by the paired verification skill. TRIGGER when: user says "integrate mem0", "add mem0 to this repo", "wire mem0 into <repo>", or asks how to add memory to an existing project. DO NOT TRIGGER when: the user wants general SDK usage (use skill:mem0), CLI usage (use skill:mem0-cli), or Vercel AI SDK (use skill:mem0-vercel-ai-sdk). After success, invoke skill:mem0-test-integration to verify in the same workspace (loose coupling).

★ 2
zhangmask
zhangmask/C_AnimeCompanion

mem0-cli

Mem0 CLI -- the command-line interface for mem0 memory operations. TRIGGER when: user mentions "mem0 cli", "mem0 command line", "@mem0/cli", "mem0-cli", "pip install mem0-cli", "npm install -g @mem0/cli", or is running mem0 commands in a terminal/shell (mem0 add, mem0 search, mem0 list, mem0 get, mem0 init, mem0 config, mem0 import). Also triggers when query includes CLI flags like --user-id, --output, --json, --agent, or describes bash/zsh/terminal/shell usage. DO NOT TRIGGER when: user asks about programmatic SDK integration in Python/TS code (use mem0 skill), or Vercel AI SDK provider (use mem0-vercel-ai-sdk skill).

★ 2