SuperAPI AI Directory

agent-retro

Agents & models

View repository

Updated 10-16 08:43

About this skill

Agent Retro (Agent Retro Action SOP)

This skill defines the standard operating procedure for the Agent's daily retro. When executing a retro, the following steps must be strictly followed,and the physical disk-writing operation must be completed first before reporting the results to the user。

Execution Requirements

  • Before modifying any file, you must back it up first.
  • For example, before modifying MEMORY.md you must first copy a version named MEMORY.md.bak.${yyyyMMddHHmmss}as a backup, and then make the modification. The same applies to modifications of other core configuration files such as USER.md、SOUL.md、AGENTS.md .

Step 1: Determine the time and scope

  1. Determine the Agent ID for the retro (by default it is main)。
  2. Determine the target date (format YYYY-MM-DD). If the user says "yesterday", accurately calculate yesterday's date based on the current local time zone.
  3. Check the retro lock: construct the lock file path based on the target date (for example, if the target date is 2026-02-04, the lock file is memory/AGENT_RETRO_DONE_20260204.md). Before executing the retro, you must first check whether this file exists. If it exists, it means the retro for that date has already been completed,immediately terminate the retroand inform the user.

Step 2: Collect historical data

  1. Enter the ~/.openclaw/agents/${agentId}/sessions directory.
  2. Read all .jsonl or session records under this directory that have the target date timestamp.
  3. Extract all of the day's user instructions,assistant replies, tool calls (Tool Calls), and tool results.

Step 3: Analysis and summary

Based on the extracted chat records, you must and may only summarize the content of the following 6 dimensions:

  • Yesterday's actions: what things you did yesterday.
  • Things done right: matters that were completed in one go without repeated conversation, or that received the user's praise.
  • Things done wrong: matters that were not completed in one go, fell into repeated corrections, or were criticized by the user.
  • Improvement points: for things done wrong, propose specific and executable preventive improvement points (how to ensure getting it right in one go next time).
  • User profile: what kind of person the user is (preferences, style, bottom lines, etc.).
  • Agent profile: what kind of Agent you are (behavioral tendencies or flaws exposed).

Step 4: Record Daily Memory

  1. Write the complete summary content from Step 3 into the memory/YYYY-MM-DD.md file under the workspace directory.
  2. If the file does not exist, create it; if it exists, append to it.

Step 5: Update core configuration (core step)

  1. Compare and update MEMORY.md: extract the key conclusions from Step 3 and compare them with the MEMORY.md under the workspace. Add missing conclusions, modify outdated conclusions, and append these changes to the end of memory/YYYY-MM-DD.md .
  2. Update USER.md: Using the "user profile" information refined in Step 3, modify USER.md, to improve the context.
  3. Update SOUL.md: Using the "Agent profile" information refined in Step 3, modify SOUL.md, to strengthen the core personality and behavioral boundaries.
  4. Update AGENTS.md: Using the "improvement points" refined in Step 3, modify AGENTS.md tool constraints or tactical guidelines to ensure the lessons are solidified.

Warning: When performing configuration updates, you must use read to read the original content, and use edit or write to make actual physical modifications. It is strictly forbidden to only verbally promise modifications in the conversation.

Step 6: Write the retrospective lock (day-level duplicate prevention)

After the above summary and file updates are completed, write the retrospective lock file memory/AGENT_RETRO_DONE_YYYYMMDD.md. For example, for the retrospective on 2026-02-04, write an empty file named AGENT_RETRO_DONE_20260204.md or a file containing the completion timestamp, to mark that the retrospective for that day has been executed.

Step 7: Send the retrospective report to the user

After confirming that all files (1 daily memory + 4 core configuration files + 1 retrospective lock file) have been successfully updated and written to disk, send a retrospective summary to the user. The report content should be concise and to the point, explaining what core problems were discovered, what rules were refined, and which files have been successfully modified.